ORKESTRA

ORKESTRA

  orkestra orkestra.com.tr
  Sohbet   İndirme Merkezi

Örnek Betik Kodları

Betik Sekmesi

Betik sekmesinde ilgili Fiyat kartını istediğiniz gibi özelleştirebilirsiniz. Bu sayede çok sayıda Fiyat Kartı oluşturmak yerine az sayıda fiyat kartıyla çok sayıda senaryo yönetmeniz mümkündür.

 


 

ÖRNEK BETİK KODLARI

 

// Yapılan işe ait detayları daha iyi görmek için debugEnabled parametresini true yapın
// Standart işleyişte debugEnabled parametresi false olmalıdır
// Buradaki log sunucu tarafında pidofbizserver logudur.
boolean debugEnabled = true;
// "A"=>48.4,"B"=>"47.2","C"=>46,"D"=>44.2,"E"=>43,"F"=>40,"P"=>37
// card.setValue(0) ile varsayılan indirim değerini sıfırlıyoruz.
card.setValue(0);
String cariTicariIslemGrubu = context.party.partyGroup.code;
String odemePlaniKodu = context.paymentPlan.code;
long odemePlaniRef = context.paymentPlan.reference;
// TICARI ISLEM GRUBUNA GORE INDIRIM 1 ALANI GUNCELLENIR
if(cariTicariIslemGrubu=="A"){
card.setValue(48.4);
}else if(cariTicariIslemGrubu=="B"){
card.setValue(47.2);
}else if(cariTicariIslemGrubu=="C"){
card.setValue(46);
}else if(cariTicariIslemGrubu=="D"){
card.setValue(44.2);
}else if(cariTicariIslemGrubu=="E"){
card.setValue(43);
}else if(cariTicariIslemGrubu=="F"){
card.setValue(40);
}else if(cariTicariIslemGrubu=="P"){
card.setValue(37);
}
// TICARI ISLEM GRUBUNA GORE COZUMLENDI
// ***********************************
// ODEME PLANINA GORE INDIRIM2 VE INDIRIM3 ALANI GUNCELLENIR
//odemePlanlari = array(""=>array(),"120 Gün"=>array(2.5) ,"90 Gün"=>array(5),"Peşin"=>array(5,7),"Kredi Kartı"=>array(5,3),"Ay Sonu"=>array(5,5) );
if(odemePlaniRef==5 || odemePlaniKodu=="120 Gün"){
card.setDiscount1(2.5);
}else if(odemePlaniRef==4 || odemePlaniKodu=="90 Gün"){
card.setDiscount1(5);
}else if(odemePlaniRef==7 || odemePlaniKodu=="Peşin"){
card.setDiscount1(5);
card.setDiscount2(7);
}else if(odemePlaniRef==1 || odemePlaniKodu=="Kredi Kartı"){
card.setDiscount1(5);
card.setDiscount2(3);
}else if(odemePlaniRef==2 || odemePlaniKodu=="Ay Sonu"){
card.setDiscount1(5);
card.setDiscount2(5);
}
// ************************************
// CORTEGA
// ************************************
if(context.party.reference>0 && context.item.group.reference==1){
if(context.hasCategoryByCode("CK-68")){
card.setValue(68);
}else if(context.hasCategoryByCode("CK-66")){
card.setValue(66);
}else if(context.hasCategoryByCode("CK-65")){
card.setValue(65);
}else if(context.hasCategoryByCode("CK-64")){
card.setValue(64);
}else if(context.hasCategoryByCode("CK-63")){
card.setValue(63);
}else if(context.hasCategoryByCode("CK-62")){
card.setValue(62);
}else if(context.hasCategoryByCode("CK-60")){
card.setValue(60);
}else if(context.hasCategoryByCode("CK-58")){
card.setValue(58);
}else if(context.hasCategoryByCode("CK-56")){
card.setValue(56);
}else if(context.hasCategoryByCode("CK-50")){
card.setValue(50);
}
}
if(debugEnabled){
Console.warn("Party " + context.party.code+" => "+context.party.description);
Console.warn("Party Group " + context.party.group);
Console.warn("Party Categories " + StringUtil.toString(context.party.partyCats));
Console.warn("Party HasCategory " + context.hasCategoryByCode("CK-68"));
Console.warn("PayPlan " + context.paymentPlan);
Console.warn("Item " + context.item);
Console.warn("Item Group " + context.item.group);
Console.warn("Item Brand " + context.item.brand);
}

 

 

 

// Yapılan işe ait detayları daha iyi görmek için debugEnabled parametresini true yapın
// Standart işleyişte debugEnabled parametresi false olmalıdır
boolean debugEnabled = true;
card.setValue(0); // bu satır ile varsayılan kart değerini sıfırlıyoruz.
String urun = context.item.code;
String analizgrup = context.item.analysisGroup5.code;
String odemePlaniKodu = context.paymentPlan.code;
long odemePlaniRef = context.paymentPlan.reference;
long ambar = context.facilityReference;
/*
Ref Kod
497 AKOVA YEM
484 ANKARA TARIM YEM
438 EGELİM YEM DEPO
505 HASEL YEM
498 KOÇLAR YEM
508 ÖZLÜ YEM
422 ÜSTÜN KARDEŞLER YEM
202 YÖREM SANAYİ YEM DEPO
*/
if(urun == "151.Y02.YEM.001"){
if(ambar == 497){
if(odemePlaniKodu == "30 GÜN"){
card.setValue(2.77);
}else if(odemePlaniKodu == "45 GÜN"){
card.setValue(2.81);
}else if(odemePlaniKodu == "60 GÜN"){
card.setValue(2.84);
}else{
card.setValue(2.72);
}
}else if(ambar == 484){
if(odemePlaniKodu == "30 GÜN"){
card.setValue(2.77);
}else if(odemePlaniKodu == "45 GÜN"){
card.setValue(2.81);
}else if(odemePlaniKodu == "60 GÜN"){
card.setValue(2.84);
}else{
card.setValue(2.72);
}
}
}
if(debugEnabled){
Console.warn("PayPlan : " + context.paymentPlan);
Console.warn("Item : " + context.item);
Console.warn("Analiz Grup 5 : " + context.item.analysisGroup5);
Console.warn("Ambar Ref : " + context.facilityReference);
}

 

boolean debugEnabled = true;
card.setOperatorType(0);
card.setValue(0);
BigDecimal fiyat = context.item.priceDefault;
String urun = context.item.group.code;
if(debugEnabled){
    Console.warn("FIYAT KARTI OZELLIKLERI");
    Console.warn("urunCode : " + urun);
    Console.warn("VarsayılanSatışFiyatı : " + fiyat);
}
if(StringUtil.startsWith(urun,"Mobilya")){
    card.setOperatorType(6);
    BigDecimal discAmount = 1;
    context.setDiscount(1, (discAmount * 100) / context.calculatedPrice);
}

 

//  Bu Kod Satırda #### Kayıt Numaralı İndirim Kartının Uygulanmasını sağlar.
if(ambar == 283){
    card.setDiscCard1(context.loadDiscountCardByReference(####));
}