THAI: Add Lipit promotion
This commit is contained in:
parent
96d8d558ac
commit
6596d83310
140 changed files with 94033 additions and 203 deletions
|
|
@ -1,3 +1,45 @@
|
|||
def GetPrice_Old(price_list, product_code_1, product_code_2, product_code_3):
|
||||
if product_code_1 in price_list:
|
||||
return price_list[product_code_1]
|
||||
elif product_code_2 in price_list:
|
||||
return price_list[product_code_2]
|
||||
elif product_code_3 in price_list:
|
||||
return price_list[product_code_3]
|
||||
else:
|
||||
return ""
|
||||
|
||||
def GetPrice(price_list, product_code):
|
||||
if product_code in price_list:
|
||||
return price_list[product_code]
|
||||
else:
|
||||
return ""
|
||||
|
||||
def GetOriginalPrice_Old(original_price_list, product_code_1, product_code_2, product_code_3):
|
||||
if product_code_1 in original_price_list:
|
||||
return original_price_list[product_code_1]
|
||||
elif product_code_2 in original_price_list:
|
||||
return original_price_list[product_code_2]
|
||||
elif product_code_3 in original_price_list:
|
||||
return original_price_list[product_code_3]
|
||||
else:
|
||||
return ""
|
||||
|
||||
def GetOriginalPrice(original_price_list, product_code):
|
||||
if product_code in original_price_list:
|
||||
return original_price_list[product_code]
|
||||
else:
|
||||
return ""
|
||||
|
||||
def GetTricker(tricker_list, product_code_1, product_code_2, product_code_3):
|
||||
if product_code_1 in tricker_list:
|
||||
return tricker_list[product_code_1]
|
||||
elif product_code_2 in tricker_list:
|
||||
return tricker_list[product_code_2]
|
||||
elif product_code_3 in tricker_list:
|
||||
return tricker_list[product_code_3]
|
||||
else:
|
||||
return ""
|
||||
|
||||
if "v2" in param:
|
||||
print("Version 1 ignore ")
|
||||
else:
|
||||
|
|
@ -7,6 +49,16 @@
|
|||
touch_less_gen = True
|
||||
else:
|
||||
touch_less_gen = False
|
||||
|
||||
if current_file_name == "page_catalog_group_recommend_double_pro.skt":
|
||||
double_pro_gen = True
|
||||
else:
|
||||
double_pro_gen = False
|
||||
|
||||
if current_file_name == "page_catalog_group_recommend_triple_pro.skt":
|
||||
triple_pro_gen = True
|
||||
else:
|
||||
triple_pro_gen = False
|
||||
|
||||
if current_file_name == "page_catalog_group_pro_15THB.skt":
|
||||
fixed_price = 15
|
||||
|
|
@ -14,92 +66,57 @@
|
|||
fixed_price = 0
|
||||
|
||||
if current_file_name == "page_catalog_group_pro_rerun.skt":
|
||||
def GetPrice(product_code_1, product_code_2, product_code_3):
|
||||
prices = {
|
||||
"12-02-02-0043": 15,
|
||||
"12-99-05-0057": 15,
|
||||
"12-99-05-0059": 15,
|
||||
"12-02-02-0044": 20,
|
||||
"12-99-03-0046": 20,
|
||||
"12-99-02-0050": 20,
|
||||
"12-99-02-0011": 25,
|
||||
"12-99-02-0015": 25,
|
||||
"12-99-02-0003": 30,
|
||||
"12-99-02-0001": 30,
|
||||
"12-03-02-0036": 30,
|
||||
"12-03-03-0035": 35,
|
||||
"12-99-03-0066": 30
|
||||
rerun_prices = {
|
||||
"12-02-02-0043": 15,
|
||||
"12-99-05-0057": 15,
|
||||
"12-99-05-0059": 15,
|
||||
"12-02-02-0044": 20,
|
||||
"12-99-03-0046": 20,
|
||||
"12-99-02-0050": 20,
|
||||
"12-99-02-0011": 25,
|
||||
"12-99-02-0015": 25,
|
||||
"12-99-02-0003": 30,
|
||||
"12-99-02-0001": 30,
|
||||
"12-03-02-0036": 30,
|
||||
"12-03-03-0035": 35,
|
||||
"12-99-03-0066": 30
|
||||
}
|
||||
|
||||
rerun_original_prices = {
|
||||
"12-02-02-0043": 35,
|
||||
"12-99-05-0057": 20,
|
||||
"12-99-05-0059": 20,
|
||||
"12-02-02-0044": 25,
|
||||
"12-99-03-0046": 25,
|
||||
"12-99-02-0050": 25,
|
||||
"12-99-02-0011": 30,
|
||||
"12-99-02-0015": 30,
|
||||
"12-99-02-0003": 35,
|
||||
"12-99-02-0001": 35,
|
||||
"12-03-02-0036": 40,
|
||||
"12-03-03-0035": 45,
|
||||
"12-99-03-0066": 60
|
||||
}
|
||||
|
||||
rerun_trickers = {
|
||||
"12-02-02-0043": "PMD20",
|
||||
"12-99-05-0057": "PMD05",
|
||||
"12-99-05-0059": "PMD05",
|
||||
"12-02-02-0044": "PMD05",
|
||||
"12-99-03-0046": "PMD05",
|
||||
"12-99-02-0011": "PMD05",
|
||||
"12-99-02-0015": "PMD05",
|
||||
"12-99-02-0003": "PMD05",
|
||||
"12-99-02-0001": "PMD05",
|
||||
"12-03-02-0036": "PMD10",
|
||||
"12-03-03-0035": "PMD10",
|
||||
"12-99-03-0066": "PMD30"
|
||||
}
|
||||
|
||||
|
||||
|
||||
if product_code_1 in prices:
|
||||
return prices[product_code_1]
|
||||
elif product_code_2 in prices:
|
||||
return prices[product_code_2]
|
||||
elif product_code_3 in prices:
|
||||
return prices[product_code_3]
|
||||
else:
|
||||
return ""
|
||||
|
||||
def GetOriginalPrice(product_code_1, product_code_2, product_code_3):
|
||||
original_prices = {
|
||||
"12-02-02-0043": 35,
|
||||
"12-99-05-0057": 20,
|
||||
"12-99-05-0059": 20,
|
||||
"12-02-02-0044": 25,
|
||||
"12-99-03-0046": 25,
|
||||
"12-99-02-0050": 25,
|
||||
"12-99-02-0011": 30,
|
||||
"12-99-02-0015": 30,
|
||||
"12-99-02-0003": 35,
|
||||
"12-99-02-0001": 35,
|
||||
"12-03-02-0036": 40,
|
||||
"12-03-03-0035": 45,
|
||||
"12-99-03-0066": 60
|
||||
}
|
||||
|
||||
if product_code_1 in original_prices:
|
||||
return original_prices[product_code_1]
|
||||
elif product_code_2 in original_prices:
|
||||
return original_prices[product_code_2]
|
||||
elif product_code_3 in original_prices:
|
||||
return original_prices[product_code_3]
|
||||
else:
|
||||
return ""
|
||||
|
||||
def GetTricker(product_code_1, product_code_2, product_code_3):
|
||||
trickers = {
|
||||
"12-02-02-0043": "PMD20",
|
||||
"12-99-05-0057": "PMD05",
|
||||
"12-99-05-0059": "PMD05",
|
||||
"12-02-02-0044": "PMD05",
|
||||
"12-99-03-0046": "PMD05",
|
||||
"12-99-02-0011": "PMD05",
|
||||
"12-99-02-0015": "PMD05",
|
||||
"12-99-02-0003": "PMD05",
|
||||
"12-99-02-0001": "PMD05",
|
||||
"12-03-02-0036": "PMD10",
|
||||
"12-03-03-0035": "PMD10",
|
||||
"12-99-03-0066": "PMD30"
|
||||
}
|
||||
|
||||
if product_code_1 in trickers:
|
||||
return trickers[product_code_1]
|
||||
elif product_code_2 in trickers:
|
||||
return trickers[product_code_2]
|
||||
elif product_code_3 in trickers:
|
||||
return trickers[product_code_3]
|
||||
else:
|
||||
return ""
|
||||
get_price = GetPrice
|
||||
get_original_price = GetOriginalPrice
|
||||
get_tricker = GetTricker
|
||||
rerun_fix_price = True
|
||||
else:
|
||||
get_price = None
|
||||
get_original_price = None
|
||||
get_tricker = None
|
||||
rerun_prices = {}
|
||||
rerun_original_prices = {}
|
||||
rerun_trickers = {}
|
||||
rerun_fix_price = False
|
||||
|
||||
if current_file_name == "page_catalog_group_pro_mymint.skt":
|
||||
|
|
@ -119,10 +136,38 @@
|
|||
else:
|
||||
from_pepsi_second_cup_30 = False
|
||||
|
||||
if current_file_name == "page_catalog_group_pro_lipit.skt":
|
||||
from_lipit_pro = True
|
||||
else:
|
||||
from_lipit_pro = False
|
||||
|
||||
if current_file_name == "page_catalog_group_pro_monday_banana.skt":
|
||||
monday_banana_prices = {
|
||||
"12-03-02-0024": 30,
|
||||
"12-03-03-0024": 35,
|
||||
"12-03-03-0029": 40,
|
||||
"12-03-02-0023": 25,
|
||||
"12-03-03-0023": 30
|
||||
}
|
||||
|
||||
monday_banana_original_prices = {
|
||||
"12-03-02-0024": 40,
|
||||
"12-03-03-0024": 45,
|
||||
"12-03-03-0029": 50,
|
||||
"12-03-02-0023": 35,
|
||||
"12-03-03-0023": 40
|
||||
}
|
||||
|
||||
monday_banana_fix_price = True
|
||||
else:
|
||||
monday_banana_prices = {}
|
||||
monday_banana_original_prices = {}
|
||||
monday_banana_fix_price = False
|
||||
|
||||
#print ("######################################################################################################")
|
||||
idx_of_eng = 2
|
||||
out_xml('<FrameScroll> \r\n')
|
||||
if touch_less_gen == True:
|
||||
if touch_less_gen == True or double_pro_gen or triple_pro_gen:
|
||||
out_xml('<Max> 16 </Max>\r\n')
|
||||
out_xml('<X> 10 </X>\r\n')
|
||||
out_xml('<Y> 497 </Y>\r\n')
|
||||
|
|
@ -135,8 +180,13 @@
|
|||
if "all" in verbose:
|
||||
print("current_file_name " + current_file_name)
|
||||
|
||||
|
||||
if touch_less_gen == False:
|
||||
if triple_pro_gen == True:
|
||||
out_xml('\t Var block_index_override = 0\r\n')
|
||||
out_xml('\t Var block_index_move = 0\r\n')
|
||||
elif double_pro_gen == True:
|
||||
out_xml('\t Var block_index_override = 0\r\n')
|
||||
out_xml('\t Var block_index_move = 0\r\n')
|
||||
elif touch_less_gen == False:
|
||||
|
||||
out_xml('\t Var block_index_override = 0\r\n')
|
||||
out_xml('\t Var block_index_move = 0\r\n')
|
||||
|
|
@ -195,6 +245,9 @@
|
|||
out_xml('\t</QRCode>\r\n')
|
||||
out_xml('</Block>\r\n')
|
||||
out_xml(';dummy_layout.inc\r\n')
|
||||
|
||||
if double_pro_gen == True or triple_pro_gen:
|
||||
out_xml(';dummy_layout.inc\r\n')
|
||||
|
||||
|
||||
out_xml('; menu_new_list '+ str(len(menu_new_list))+'\r\n')
|
||||
|
|
@ -233,7 +286,7 @@
|
|||
str_con_var += spl[6] + '-'
|
||||
|
||||
str_con_var = str_con_var.replace("-", "")
|
||||
if touch_less_gen == True:
|
||||
if touch_less_gen == True or double_pro_gen == True or triple_pro_gen == True:
|
||||
str_con += "Disable=Invisible,"
|
||||
|
||||
str_con += "$Sum" + str_con_var
|
||||
|
|
@ -302,10 +355,18 @@
|
|||
out_xml( '\t\tVar OpenFromXML = CurrentXMLFileName2\r\n')
|
||||
|
||||
if rerun_fix_price:
|
||||
out_xml( '\t\tVar PriceD1 = ' + str(get_price(pd_code_1, pd_code_2, pd_code_3)) + '\r\n')
|
||||
out_xml( '\t\tVar PriceD2 = ' + str(get_price(pd_code_1, pd_code_2, pd_code_3)) + '\r\n')
|
||||
out_xml( '\t\tVar PriceD3 = ' + str(get_price(pd_code_1, pd_code_2, pd_code_3)) + '\r\n')
|
||||
out_xml( '\t\tVar OldPrice = ' + str(get_original_price(pd_code_1, pd_code_2, pd_code_3)) + '\r\n')
|
||||
out_xml( '\t\tVar PriceD1 = ' + str(GetPrice_Old(rerun_prices, pd_code_1, pd_code_2, pd_code_3)) + '\r\n')
|
||||
out_xml( '\t\tVar PriceD2 = ' + str(GetPrice_Old(rerun_prices, pd_code_1, pd_code_2, pd_code_3)) + '\r\n')
|
||||
out_xml( '\t\tVar PriceD3 = ' + str(GetPrice_Old(rerun_prices, pd_code_1, pd_code_2, pd_code_3)) + '\r\n')
|
||||
out_xml( '\t\tVar OldPrice = ' + str(GetOriginalPrice_Old(rerun_original_prices, pd_code_1, pd_code_2, pd_code_3)) + '\r\n')
|
||||
elif monday_banana_fix_price:
|
||||
out_xml( '\t\tVar PriceD1 = ' + str(GetPrice(monday_banana_prices, pd_code_1)) + '\r\n')
|
||||
out_xml( '\t\tVar PriceD2 = ' + str(GetPrice(monday_banana_prices, pd_code_2)) + '\r\n')
|
||||
out_xml( '\t\tVar PriceD3 = ' + str(GetPrice(monday_banana_prices, pd_code_3)) + '\r\n')
|
||||
out_xml( '\t\tVar OriginalPriceD1 = ' + str(GetOriginalPrice(monday_banana_original_prices, pd_code_1)) + '\r\n')
|
||||
out_xml( '\t\tVar OriginalPriceD2 = ' + str(GetOriginalPrice(monday_banana_original_prices, pd_code_2)) + '\r\n')
|
||||
out_xml( '\t\tVar OriginalPriceD3 = ' + str(GetOriginalPrice(monday_banana_original_prices, pd_code_3)) + '\r\n')
|
||||
|
||||
else:
|
||||
out_xml( '\t\tVar PriceD1 = $' + spl[4] + '.Price\r\n')
|
||||
out_xml( '\t\tVar PriceD2 = $' + spl[5] + '.Price\r\n')
|
||||
|
|
@ -392,7 +453,10 @@
|
|||
|
||||
if rerun_fix_price:
|
||||
out_xml( '\t\tVar FromRerunPro = 1 \r\n')
|
||||
out_xml( '\t\tVar RerunProCode = "' + get_tricker(pd_code_1, pd_code_2, pd_code_3) + '"\r\n')
|
||||
out_xml( '\t\tVar RerunProCode = "' + GetTricker(rerun_trickers, pd_code_1, pd_code_2, pd_code_3) + '"\r\n')
|
||||
|
||||
if monday_banana_fix_price:
|
||||
out_xml( '\t\tVar FromMondayBananaPro = 1 \r\n')
|
||||
|
||||
if from_my_mint_promotion:
|
||||
out_xml( '\t\tVar FromMyMintPro = 1 \r\n')
|
||||
|
|
@ -403,6 +467,9 @@
|
|||
if from_pepsi_second_cup_30:
|
||||
out_xml( '\t\tVar FromPepsiSecondCup30 = 1 \r\n')
|
||||
|
||||
if from_lipit_pro:
|
||||
out_xml( '\t\tVar FromLipitPro = 1 \r\n')
|
||||
|
||||
|
||||
out_xml( '\t\t\r\n')
|
||||
out_xml( '\t\t\r\n')
|
||||
|
|
@ -529,14 +596,18 @@
|
|||
if fixed_price > 0:
|
||||
out_xml( '\t<Value> StringFmt( 15 , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
|
||||
elif rerun_fix_price:
|
||||
out_xml( '\t<Value> StringFmt( ' + str(get_price(pd_code_1, pd_code_2, pd_code_3)) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
|
||||
out_xml( '\t<Value> StringFmt( ' + str(GetPrice_Old(rerun_prices, pd_code_1, pd_code_2, pd_code_3)) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
|
||||
elif monday_banana_fix_price:
|
||||
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(monday_banana_prices, spl[4])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
|
||||
else:
|
||||
out_xml( '\t<Value> StringFmt( $' + spl[4] + '.Price , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
|
||||
else:
|
||||
if fixed_price > 0:
|
||||
out_xml( '\t<Value> "฿15" </Value>\r\n')
|
||||
elif rerun_fix_price:
|
||||
out_xml( '\t<Value> "฿' + str(get_price(pd_code_1, pd_code_2, pd_code_3)) + '" </Value>\r\n')
|
||||
out_xml( '\t<Value> "฿' + str(GetPrice_Old(rerun_prices, pd_code_1, pd_code_2, pd_code_3)) + '" </Value>\r\n')
|
||||
elif monday_banana_fix_price:
|
||||
out_xml( '\t<Value> "฿' + str(GetPrice(monday_banana_prices, spl[4])) + '" </Value>\r\n')
|
||||
else:
|
||||
out_xml( '\t<Value> Var( "฿" + $' + spl[4] + '.Price ) </Value>\r\n')
|
||||
out_xml( '\t</Text>\r\n')
|
||||
|
|
@ -584,14 +655,18 @@
|
|||
if fixed_price > 0:
|
||||
out_xml( '\t<Value> StringFmt( 15 , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
|
||||
elif rerun_fix_price:
|
||||
out_xml( '\t<Value> StringFmt( ' + str(get_price(pd_code_1, pd_code_2, pd_code_3)) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
|
||||
out_xml( '\t<Value> StringFmt( ' + str(GetPrice_Old(rerun_prices, pd_code_1, pd_code_2, pd_code_3)) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
|
||||
elif monday_banana_fix_price:
|
||||
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(monday_banana_prices, spl[5])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
|
||||
else:
|
||||
out_xml( '\t<Value> StringFmt( $' + spl[5] + '.Price , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
|
||||
else:
|
||||
if fixed_price > 0:
|
||||
out_xml( '\t<Value> "฿15" </Value>\r\n')
|
||||
elif rerun_fix_price:
|
||||
out_xml( '\t<Value> "฿' + str(get_price(pd_code_1, pd_code_2, pd_code_3)) + '" </Value>\r\n')
|
||||
out_xml( '\t<Value> "฿' + str(GetPrice_Old(rerun_prices, pd_code_1, pd_code_2, pd_code_3)) + '" </Value>\r\n')
|
||||
elif monday_banana_fix_price:
|
||||
out_xml( '\t<Value> "฿' + str(GetPrice(monday_banana_prices, spl[5])) + '" </Value>\r\n')
|
||||
else:
|
||||
out_xml( '\t<Value> Var( "฿" + $' + spl[5] + '.Price ) </Value>\r\n')
|
||||
out_xml( '\t</Text>\r\n')
|
||||
|
|
@ -641,14 +716,18 @@
|
|||
if fixed_price > 0:
|
||||
out_xml( '\t<Value> StringFmt( 15 , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
|
||||
elif rerun_fix_price:
|
||||
out_xml( '\t<Value> StringFmt( ' + str(get_price(pd_code_1, pd_code_2, pd_code_3)) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
|
||||
out_xml( '\t<Value> StringFmt( ' + str(GetPrice_Old(rerun_prices, pd_code_1, pd_code_2, pd_code_3)) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
|
||||
elif monday_banana_fix_price:
|
||||
out_xml( '\t<Value> StringFmt( ' + str(GetPrice(monday_banana_prices, spl[6])) + ' , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
|
||||
else:
|
||||
out_xml( '\t<Value> StringFmt( $' + spl[6] + '.Price , DisplayFormat, PreScaleConvertShow) </Value>; test\r\n')
|
||||
else:
|
||||
if fixed_price > 0:
|
||||
out_xml( '\t<Value> "฿15" </Value>\r\n')
|
||||
elif rerun_fix_price:
|
||||
out_xml( '\t<Value> "฿' + str(get_price(pd_code_1, pd_code_2, pd_code_3)) + '" </Value>\r\n')
|
||||
out_xml( '\t<Value> "฿' + str(GetPrice_Old(rerun_prices, pd_code_1, pd_code_2, pd_code_3)) + '" </Value>\r\n')
|
||||
elif monday_banana_fix_price:
|
||||
out_xml( '\t<Value> "฿' + str(GetPrice(monday_banana_prices, spl[6])) + '" </Value>\r\n')
|
||||
else:
|
||||
out_xml( '\t<Value> Var( "฿" + $' + spl[6] + '.Price ) </Value>\r\n')
|
||||
out_xml( '\t</Text>\r\n')
|
||||
|
|
@ -780,7 +859,7 @@
|
|||
str_con_var += spl[10] + '-'
|
||||
|
||||
str_con_var = str_con_var.replace("-", "")
|
||||
if touch_less_gen == True:
|
||||
if touch_less_gen == True or double_pro_gen == True or triple_pro_gen == True:
|
||||
str_con += "Disable=Invisible,"
|
||||
|
||||
str_con += "$Sum" + str_con_var
|
||||
|
|
@ -927,6 +1006,9 @@
|
|||
if from_pepsi_second_cup_30:
|
||||
out_xml( '\t\tVar FromPepsiSecondCup30 = 1 \r\n')
|
||||
|
||||
if from_lipit_pro:
|
||||
out_xml( '\t\tVar FromLipitPro = 1 \r\n')
|
||||
|
||||
out_xml( '\t\t\r\n')
|
||||
out_xml( '\t\t\r\n')
|
||||
if "inter" in param:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue