|
@@ -7201,6 +7201,11 @@
|
|
|
[customer_dic setValue:[NSNumber numberWithInteger:15] forKey:@"count"];
|
|
[customer_dic setValue:[NSNumber numberWithInteger:15] forKey:@"count"];
|
|
|
|
|
|
|
|
}];
|
|
}];
|
|
|
|
|
+
|
|
|
|
|
+ // setting
|
|
|
|
|
+ NSDictionary *setting = params[@"setting"];
|
|
|
|
|
+ NSNumber *hide = setting[@"CustomerHide"];
|
|
|
|
|
+ [customer_dic setValue:hide forKey:@"hide"];
|
|
|
|
|
|
|
|
return customer_dic;
|
|
return customer_dic;
|
|
|
}
|
|
}
|
|
@@ -7209,6 +7214,13 @@
|
|
|
|
|
|
|
|
__block NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
__block NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
|
|
|
|
|
|
|
|
+ // setting
|
|
|
|
|
+ NSDictionary *setting = params[@"setting"];
|
|
|
|
|
+ NSNumber *hide = setting[@"ShipToHide"];
|
|
|
|
|
+ [dic setValue:hide forKey:@"hide"];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
NSString *orderCode = [self valueInParams:params key:@"orderCode"];
|
|
NSString *orderCode = [self valueInParams:params key:@"orderCode"];
|
|
|
orderCode = [self translateSingleQuote:orderCode];
|
|
orderCode = [self translateSingleQuote:orderCode];
|
|
|
|
|
|
|
@@ -7271,7 +7283,7 @@
|
|
|
[dic setValue:choose_dic forKey:@"item_0"];
|
|
[dic setValue:choose_dic forKey:@"item_0"];
|
|
|
|
|
|
|
|
// contact id
|
|
// contact id
|
|
|
- NSDictionary *contact_id_dic = [[self infoName:@"receive_cid" aname:@"Contact ID" control:@"edit" keyboard:@"text" value:cid] mutableCopy];
|
|
|
|
|
|
|
+ NSMutableDictionary *contact_id_dic = [[self infoName:@"receive_cid" aname:@"Contact ID" control:@"edit" keyboard:@"text" value:cid] mutableCopy];
|
|
|
[contact_id_dic setValue:@"1" forKey:@"disable"];
|
|
[contact_id_dic setValue:@"1" forKey:@"disable"];
|
|
|
[contact_id_dic setValue:@"true" forKey:@"required"];
|
|
[contact_id_dic setValue:@"true" forKey:@"required"];
|
|
|
|
|
|
|
@@ -7283,7 +7295,11 @@
|
|
|
[dic setValue:company_name_dic forKey:@"item_2"];
|
|
[dic setValue:company_name_dic forKey:@"item_2"];
|
|
|
|
|
|
|
|
// address
|
|
// address
|
|
|
- NSDictionary *ext_dic = [self infoName:@"receive_ext" aname:@"Address" control:@"text_view" keyboard:@"text" value:ext];
|
|
|
|
|
|
|
+ NSMutableDictionary *ext_dic = [self infoName:@"receive_ext" aname:@"Address" control:@"text_view" keyboard:@"text" value:ext].mutableCopy;
|
|
|
|
|
+ NSNumber *required = setting[@"ShippingToAddressRequire"];
|
|
|
|
|
+ if ([required integerValue]) {
|
|
|
|
|
+ [ext_dic setValue:@"true" forKey:@"required"];
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
[dic setValue:ext_dic forKey:@"item_3"];
|
|
[dic setValue:ext_dic forKey:@"item_3"];
|
|
|
|
|
|
|
@@ -7314,6 +7330,11 @@
|
|
|
+ (NSDictionary *)shipFromDic:(NSDictionary *)params db:(sqlite3 *)db {
|
|
+ (NSDictionary *)shipFromDic:(NSDictionary *)params db:(sqlite3 *)db {
|
|
|
__block NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
__block NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
|
|
|
|
|
|
|
|
+ // setting
|
|
|
|
|
+ NSDictionary *setting = params[@"setting"];
|
|
|
|
|
+ NSNumber *hide = setting[@"ShipFromHide"];
|
|
|
|
|
+ [dic setValue:hide forKey:@"hide"];
|
|
|
|
|
+
|
|
|
NSString *orderCode = [self valueInParams:params key:@"orderCode"];
|
|
NSString *orderCode = [self valueInParams:params key:@"orderCode"];
|
|
|
orderCode = [self translateSingleQuote:orderCode];
|
|
orderCode = [self translateSingleQuote:orderCode];
|
|
|
|
|
|
|
@@ -7420,6 +7441,11 @@
|
|
|
+ (NSDictionary *)freightBillToDic:(NSDictionary *) params db:(sqlite3 *)db {
|
|
+ (NSDictionary *)freightBillToDic:(NSDictionary *) params db:(sqlite3 *)db {
|
|
|
__block NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
__block NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
|
|
|
|
|
|
|
|
+ // setting
|
|
|
|
|
+ NSDictionary *setting = params[@"setting"];
|
|
|
|
|
+ NSNumber *hide = setting[@"FreightBillToHide"];
|
|
|
|
|
+ [dic setValue:hide forKey:@"hide"];
|
|
|
|
|
+
|
|
|
NSString *orderCode = [self valueInParams:params key:@"orderCode"];
|
|
NSString *orderCode = [self valueInParams:params key:@"orderCode"];
|
|
|
orderCode = [self translateSingleQuote:orderCode];
|
|
orderCode = [self translateSingleQuote:orderCode];
|
|
|
|
|
|
|
@@ -7518,7 +7544,11 @@
|
|
|
[dic setValue:company_name_dic forKey:@"item_2"];
|
|
[dic setValue:company_name_dic forKey:@"item_2"];
|
|
|
|
|
|
|
|
// address
|
|
// address
|
|
|
- NSDictionary *ext_dic = [self infoName:@"shipping_billto_ext" aname:@"Address" control:@"text_view" keyboard:@"text" value:ext];
|
|
|
|
|
|
|
+ NSMutableDictionary *ext_dic = [self infoName:@"shipping_billto_ext" aname:@"Address" control:@"text_view" keyboard:@"text" value:ext].mutableCopy;
|
|
|
|
|
+ NSNumber *ext_required = setting[@"FreightBillToAddressRequire"];
|
|
|
|
|
+ if ([ext_required integerValue]) {
|
|
|
|
|
+ [ext_dic setValue:@"true" forKey:@"required"];
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
[dic setValue:ext_dic forKey:@"item_3"];
|
|
[dic setValue:ext_dic forKey:@"item_3"];
|
|
|
|
|
|
|
@@ -7549,6 +7579,11 @@
|
|
|
+ (NSDictionary *)merchandiseBillToDic:(NSDictionary *)params db:(sqlite3 *)db {
|
|
+ (NSDictionary *)merchandiseBillToDic:(NSDictionary *)params db:(sqlite3 *)db {
|
|
|
__block NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
__block NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
|
|
|
|
|
|
|
|
+ // setting
|
|
|
|
|
+ NSDictionary *setting = params[@"setting"];
|
|
|
|
|
+ NSNumber *hide = setting[@"MerchandiseBillToHide"];
|
|
|
|
|
+ [dic setValue:hide forKey:@"hide"];
|
|
|
|
|
+
|
|
|
NSString *orderCode = [self valueInParams:params key:@"orderCode"];
|
|
NSString *orderCode = [self valueInParams:params key:@"orderCode"];
|
|
|
orderCode = [self translateSingleQuote:orderCode];
|
|
orderCode = [self translateSingleQuote:orderCode];
|
|
|
|
|
|
|
@@ -7636,7 +7671,11 @@
|
|
|
[dic setValue:company_name_dic forKey:@"item_2"];
|
|
[dic setValue:company_name_dic forKey:@"item_2"];
|
|
|
|
|
|
|
|
// address
|
|
// address
|
|
|
- NSDictionary *ext_dic = [self infoName:@"billing_ext" aname:@"Address" control:@"text_view" keyboard:@"text" value:ext];
|
|
|
|
|
|
|
+ NSMutableDictionary *ext_dic = [self infoName:@"billing_ext" aname:@"Address" control:@"text_view" keyboard:@"text" value:ext].mutableCopy;
|
|
|
|
|
+ NSNumber *ext_required = setting[@"MerchandiseBillToAddressRequire"];
|
|
|
|
|
+ if ([ext_required integerValue]) {
|
|
|
|
|
+ [ext_dic setValue:@"true" forKey:@"required"];
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
[dic setValue:ext_dic forKey:@"item_3"];
|
|
[dic setValue:ext_dic forKey:@"item_3"];
|
|
|
|
|
|
|
@@ -7667,6 +7706,11 @@
|
|
|
+ (NSDictionary *)returnToDic:(NSDictionary *)params db:(sqlite3 *)db {
|
|
+ (NSDictionary *)returnToDic:(NSDictionary *)params db:(sqlite3 *)db {
|
|
|
__block NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
__block NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
|
|
|
|
|
|
|
|
+ // setting
|
|
|
|
|
+ NSDictionary *setting = params[@"setting"];
|
|
|
|
|
+ NSNumber *hide = setting[@"ReturnToHide"];
|
|
|
|
|
+ [dic setValue:hide forKey:@"hide"];
|
|
|
|
|
+
|
|
|
NSString *orderCode = [self valueInParams:params key:@"orderCode"];
|
|
NSString *orderCode = [self valueInParams:params key:@"orderCode"];
|
|
|
orderCode = [self translateSingleQuote:orderCode];
|
|
orderCode = [self translateSingleQuote:orderCode];
|
|
|
|
|
|
|
@@ -7781,6 +7825,12 @@
|
|
|
__block int TotalCarton = 0;
|
|
__block int TotalCarton = 0;
|
|
|
__block double payments = 0;
|
|
__block double payments = 0;
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // setting
|
|
|
|
|
+ NSDictionary *setting = params[@"setting"];
|
|
|
|
|
+ NSNumber *hide = setting[@"ModelInformationHide"];
|
|
|
|
|
+ [dic setValue:hide forKey:@"hide"];
|
|
|
|
|
+
|
|
|
NSString *sql = [NSString stringWithFormat:@"select c.item_id,c.item_count,m.stockUom,c.price,c.discount,m.name,m.description,c.line_note,m.availability from (select _id,product_id,decrypt(str_price) as price,discount,item_count,line_note,item_id from offline_cart where so_no='%@') c left join product m on c.product_id=m.product_id;",orderCode];
|
|
NSString *sql = [NSString stringWithFormat:@"select c.item_id,c.item_count,m.stockUom,c.price,c.discount,m.name,m.description,c.line_note,m.availability from (select _id,product_id,decrypt(str_price) as price,discount,item_count,line_note,item_id from offline_cart where so_no='%@') c left join product m on c.product_id=m.product_id;",orderCode];
|
|
|
|
|
|
|
|
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
@@ -7896,6 +7946,11 @@
|
|
|
[dic setValue:@"Remarks Content" forKey:@"title"];
|
|
[dic setValue:@"Remarks Content" forKey:@"title"];
|
|
|
[dic setValue:[NSNumber numberWithInteger:4] forKey:@"count"];
|
|
[dic setValue:[NSNumber numberWithInteger:4] forKey:@"count"];
|
|
|
|
|
|
|
|
|
|
+ // setting
|
|
|
|
|
+ NSDictionary *setting = params[@"setting"];
|
|
|
|
|
+ NSNumber *hide = setting[@"RemarksContentHide"];
|
|
|
|
|
+ [dic setValue:hide forKey:@"hide"];
|
|
|
|
|
+
|
|
|
NSString *orderCode = [self valueInParams:params key:@"orderCode"];
|
|
NSString *orderCode = [self valueInParams:params key:@"orderCode"];
|
|
|
orderCode = [self translateSingleQuote:orderCode];
|
|
orderCode = [self translateSingleQuote:orderCode];
|
|
|
|
|
|
|
@@ -7955,6 +8010,11 @@
|
|
|
|
|
|
|
|
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
|
|
|
|
|
|
|
|
+ // setting
|
|
|
|
|
+ NSDictionary *setting = params[@"setting"];
|
|
|
|
|
+ NSNumber *hide = setting[@"OrderTotalHide"];
|
|
|
|
|
+ [dic setValue:hide forKey:@"hide"];
|
|
|
|
|
+
|
|
|
NSString *sql = [NSString stringWithFormat:@"select lift_gate,lift_gate_value,shipping,handling_fee_value from offline_order where so_id = '%@';",orderCode];
|
|
NSString *sql = [NSString stringWithFormat:@"select lift_gate,lift_gate_value,shipping,handling_fee_value from offline_order where so_id = '%@';",orderCode];
|
|
|
|
|
|
|
|
__block double lift_gate_value = 0;
|
|
__block double lift_gate_value = 0;
|
|
@@ -8095,6 +8155,11 @@
|
|
|
|
|
|
|
|
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
|
|
|
|
|
|
|
|
+ // setting
|
|
|
|
|
+ NSDictionary *setting = params[@"setting"];
|
|
|
|
|
+ NSNumber *hide = setting[@"SignatureHide"];
|
|
|
|
|
+ [dic setValue:hide forKey:@"hide"];
|
|
|
|
|
+
|
|
|
[dic setValue:@"Signature" forKey:@"title"];
|
|
[dic setValue:@"Signature" forKey:@"title"];
|
|
|
|
|
|
|
|
__block NSString *pic_path = @"";
|
|
__block NSString *pic_path = @"";
|
|
@@ -8123,6 +8188,13 @@
|
|
|
+ (NSDictionary *)shippingMethodDic:(NSMutableDictionary *)params db:(sqlite3 *)db {
|
|
+ (NSDictionary *)shippingMethodDic:(NSMutableDictionary *)params db:(sqlite3 *)db {
|
|
|
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
|
|
|
|
|
|
|
|
+ // setting
|
|
|
|
|
+ NSDictionary *setting = params[@"setting"];
|
|
|
|
|
+ NSNumber *hide = setting[@"ShippingMethodHide"];
|
|
|
|
|
+ [dic setValue:hide forKey:@"hide"];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
NSString *orderCode = [self valueInParams:params key:@"orderCode"];
|
|
NSString *orderCode = [self valueInParams:params key:@"orderCode"];
|
|
|
orderCode = [self translateSingleQuote:orderCode];
|
|
orderCode = [self translateSingleQuote:orderCode];
|
|
|
|
|
|
|
@@ -8266,14 +8338,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
// item_0
|
|
// item_0
|
|
|
- NSDictionary *item_0 = @{
|
|
|
|
|
|
|
+ NSMutableDictionary *item_0 = @{
|
|
|
@"aname" : @"Shipping",
|
|
@"aname" : @"Shipping",
|
|
|
@"cadedate" : cadedate,
|
|
@"cadedate" : cadedate,
|
|
|
@"control" : @"enum",
|
|
@"control" : @"enum",
|
|
|
@"name" : @"logist",
|
|
@"name" : @"logist",
|
|
|
@"refresh" : [NSNumber numberWithInteger:1],
|
|
@"refresh" : [NSNumber numberWithInteger:1],
|
|
|
@"single_select" : @"true",
|
|
@"single_select" : @"true",
|
|
|
- };
|
|
|
|
|
|
|
+ }.mutableCopy;
|
|
|
|
|
+ NSNumber *required = setting[@"ShippingMethodRequired"];
|
|
|
|
|
+ if ([required integerValue]) {
|
|
|
|
|
+ [item_0 setValue:@"true" forKey:@"required"];
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
[dic setValue:item_0 forKey:@"item_0"];
|
|
[dic setValue:item_0 forKey:@"item_0"];
|
|
|
|
|
|
|
@@ -8304,7 +8380,7 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// section_0
|
|
// section_0
|
|
|
- NSDictionary *dic = @{
|
|
|
|
|
|
|
+ NSMutableDictionary *dic = @{
|
|
|
@"count" : @(1),
|
|
@"count" : @(1),
|
|
|
@"item_0" : @{
|
|
@"item_0" : @{
|
|
|
@"aname" : @"Submit Order As",
|
|
@"aname" : @"Submit Order As",
|
|
@@ -8327,9 +8403,14 @@
|
|
|
@"single_select" : @"true"
|
|
@"single_select" : @"true"
|
|
|
},
|
|
},
|
|
|
@"title" : @"Order Type"
|
|
@"title" : @"Order Type"
|
|
|
- };
|
|
|
|
|
|
|
+ }.mutableCopy;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ // setting
|
|
|
|
|
+ NSDictionary *setting = params[@"setting"];
|
|
|
|
|
+ NSNumber *hide = setting[@"OrderTypeHide"];
|
|
|
|
|
+ [dic setValue:hide forKey:@"hide"];
|
|
|
|
|
+
|
|
|
return dic;
|
|
return dic;
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -8425,21 +8506,23 @@
|
|
|
state = [self textAtColumn:12 statement:stmt];
|
|
state = [self textAtColumn:12 statement:stmt];
|
|
|
}];
|
|
}];
|
|
|
|
|
|
|
|
-// if ([year isEqualToString:@""]) {
|
|
|
|
|
-// NSDate *date = [NSDate date];
|
|
|
|
|
-// NSCalendar *calendar = [NSCalendar currentCalendar];
|
|
|
|
|
-// int year_integer = [calendar component:NSCalendarUnitYear fromDate:date];
|
|
|
|
|
-// year = [NSString stringWithFormat:@"%d",year_integer];
|
|
|
|
|
-// }
|
|
|
|
|
-// if ([month isEqualToString:@""]) {
|
|
|
|
|
-// month = @"01";
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ NSString *required = @"true";
|
|
|
|
|
+ // setting
|
|
|
|
|
+ NSDictionary *setting = params[@"setting"];
|
|
|
|
|
+
|
|
|
|
|
+ NSNumber *requiredNumber = setting[@"PaymentRequire"];
|
|
|
|
|
+ if ([requiredNumber integerValue]) {
|
|
|
|
|
+ required = @"true";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ required = @"false";
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// "section_2"
|
|
// "section_2"
|
|
|
- NSDictionary *dic = @{
|
|
|
|
|
|
|
+ NSMutableDictionary *dic = @{
|
|
|
@"count" : @(1),
|
|
@"count" : @(1),
|
|
|
@"item_0" : @{
|
|
@"item_0" : @{
|
|
|
@"aname" : @"Payment",
|
|
@"aname" : @"Payment",
|
|
|
|
|
+ @"required" : required,
|
|
|
@"cadedate" : @{
|
|
@"cadedate" : @{
|
|
|
@"count" : @(6),
|
|
@"count" : @(6),
|
|
|
@"val_0" : @{
|
|
@"val_0" : @{
|
|
@@ -8630,9 +8713,14 @@
|
|
|
@"single_select" : @"true"
|
|
@"single_select" : @"true"
|
|
|
},
|
|
},
|
|
|
@"title" : @"Payment Information"
|
|
@"title" : @"Payment Information"
|
|
|
- };
|
|
|
|
|
|
|
+ }.mutableCopy;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ NSNumber *hide = setting[@"PaymentInformationHide"];
|
|
|
|
|
+ [dic setValue:hide forKey:@"hide"];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
return dic;
|
|
return dic;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -8641,6 +8729,22 @@
|
|
|
|
|
|
|
|
sqlite3 *db = [iSalesDB get_db];
|
|
sqlite3 *db = [iSalesDB get_db];
|
|
|
|
|
|
|
|
|
|
+ // UISetting
|
|
|
|
|
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
|
|
|
|
|
+ NSString *cachefolder = [paths objectAtIndex:0];
|
|
|
|
|
+ NSString *img_cache = [cachefolder stringByAppendingPathComponent:@"offline_data/UISetting.json"];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ NSData* json =nil;
|
|
|
|
|
+ json=[NSData dataWithContentsOfFile:img_cache];
|
|
|
|
|
+ NSError *error=nil;
|
|
|
|
|
+ NSMutableDictionary* menu = [[NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error] mutableCopy];
|
|
|
|
|
+ NSDictionary *setting = [menu objectForKey:@"placeOrder"];
|
|
|
|
|
+
|
|
|
|
|
+ [params setObject:setting forKey:@"setting"];
|
|
|
|
|
+
|
|
|
|
|
+ int section_count = 0;
|
|
|
|
|
+
|
|
|
// params
|
|
// params
|
|
|
NSString *orderCode = [self valueInParams:params key:@"orderCode"];
|
|
NSString *orderCode = [self valueInParams:params key:@"orderCode"];
|
|
|
orderCode = [self translateSingleQuote:orderCode];
|
|
orderCode = [self translateSingleQuote:orderCode];
|
|
@@ -8649,66 +8753,94 @@
|
|
|
__block NSMutableDictionary *ret = [self dictionaryFileName:@"placeOrderTemplate.json"];
|
|
__block NSMutableDictionary *ret = [self dictionaryFileName:@"placeOrderTemplate.json"];
|
|
|
|
|
|
|
|
// 0 Order Type
|
|
// 0 Order Type
|
|
|
|
|
+ NSString *key0 = [NSString stringWithFormat:@"section_%d",section_count++];
|
|
|
NSDictionary *order_type_dic = [self submitAsDic:params db:db];
|
|
NSDictionary *order_type_dic = [self submitAsDic:params db:db];
|
|
|
- [ret setValue:order_type_dic forKey:@"section_0"];
|
|
|
|
|
|
|
+ [ret setValue:order_type_dic forKey:key0];
|
|
|
|
|
|
|
|
// 1 Shipping Method
|
|
// 1 Shipping Method
|
|
|
|
|
+ NSString *key1 = [NSString stringWithFormat:@"section_%d",section_count++];
|
|
|
NSMutableDictionary *shipping_method_dic = [[self shippingMethodDic:params db:db] mutableCopy];
|
|
NSMutableDictionary *shipping_method_dic = [[self shippingMethodDic:params db:db] mutableCopy];
|
|
|
-// [params setValue:[shipping_method_dic objectForKey:@"lift_gate"] forKey:@"lift_gate"];
|
|
|
|
|
-// [shipping_method_dic removeObjectForKey:@"lift_gate"];
|
|
|
|
|
- [ret setValue:shipping_method_dic forKey:@"section_1"];
|
|
|
|
|
|
|
+ [ret setValue:shipping_method_dic forKey:key1];
|
|
|
|
|
|
|
|
|
|
|
|
|
// 2 Payment Information
|
|
// 2 Payment Information
|
|
|
|
|
+ NSString *key2 = [NSString stringWithFormat:@"section_%d",section_count++];
|
|
|
NSDictionary *payment_info_dic = [self paymentInfoDic:params db:db];
|
|
NSDictionary *payment_info_dic = [self paymentInfoDic:params db:db];
|
|
|
- [ret setValue:payment_info_dic forKey:@"section_2"];
|
|
|
|
|
|
|
+ [ret setValue:payment_info_dic forKey:key2];
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// 3 Customer
|
|
// 3 Customer
|
|
|
|
|
+ NSString *key3 = [NSString stringWithFormat:@"section_%d",section_count++];
|
|
|
NSDictionary *customer_dic = [self customerDic:params db:db];
|
|
NSDictionary *customer_dic = [self customerDic:params db:db];
|
|
|
- [ret setValue:customer_dic forKey:@"section_3"];
|
|
|
|
|
|
|
+ [ret setValue:customer_dic forKey:key3];
|
|
|
|
|
|
|
|
// 4 Ship To
|
|
// 4 Ship To
|
|
|
|
|
+ NSString *key4 = [NSString stringWithFormat:@"section_%d",section_count++];
|
|
|
NSDictionary *ship_to_dic = [self shipToDic:params db:db];
|
|
NSDictionary *ship_to_dic = [self shipToDic:params db:db];
|
|
|
- [ret setValue:ship_to_dic forKey:@"section_4"];
|
|
|
|
|
|
|
+ [ret setValue:ship_to_dic forKey:key4];
|
|
|
|
|
|
|
|
// 5 Ship From
|
|
// 5 Ship From
|
|
|
- NSDictionary *ship_from_dic = [self shipFromDic:params db:db];
|
|
|
|
|
- [ret setValue:ship_from_dic forKey:@"section_5"];
|
|
|
|
|
-
|
|
|
|
|
|
|
+ NSNumber *shipFromDisable = setting[@"ShipFromDisabled"];
|
|
|
|
|
+ if (![shipFromDisable integerValue]) {
|
|
|
|
|
+ NSString *key5 = [NSString stringWithFormat:@"section_%d",section_count++];
|
|
|
|
|
+ NSDictionary *ship_from_dic = [self shipFromDic:params db:db];
|
|
|
|
|
+ [ret setValue:ship_from_dic forKey:key5];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 6 Freight Bill To
|
|
// 6 Freight Bill To
|
|
|
- NSDictionary *freight_bill_to = [self freightBillToDic:params db:db];
|
|
|
|
|
- [ret setValue:freight_bill_to forKey:@"section_6"];
|
|
|
|
|
-
|
|
|
|
|
|
|
+ NSNumber *freightBillToDisable = setting[@"FreightBillToDisabled"];
|
|
|
|
|
+ if (![freightBillToDisable integerValue]) {
|
|
|
|
|
+ NSString *key6 = [NSString stringWithFormat:@"section_%d",section_count++];
|
|
|
|
|
+ NSDictionary *freight_bill_to = [self freightBillToDic:params db:db];
|
|
|
|
|
+ [ret setValue:freight_bill_to forKey:key6];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 7 Merchandise Bill To
|
|
// 7 Merchandise Bill To
|
|
|
- NSDictionary *merchandise_bill_to_dic = [self merchandiseBillToDic:params db:db];
|
|
|
|
|
- [ret setValue:merchandise_bill_to_dic forKey:@"section_7"];
|
|
|
|
|
|
|
+ NSNumber *merchandiseBillToDisable = setting[@"MerchandisebillToDisabled"];
|
|
|
|
|
+ if (![merchandiseBillToDisable integerValue]) {
|
|
|
|
|
+ NSString *key7 = [NSString stringWithFormat:@"section_%d",section_count++];
|
|
|
|
|
+ NSDictionary *merchandise_bill_to_dic = [self merchandiseBillToDic:params db:db];
|
|
|
|
|
+ [ret setValue:merchandise_bill_to_dic forKey:key7];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// 8 Return To
|
|
// 8 Return To
|
|
|
- NSDictionary *return_to_dic = [self returnToDic:params db:db];
|
|
|
|
|
- [ret setValue:return_to_dic forKey:@"section_8"];
|
|
|
|
|
|
|
+ NSNumber *returnToDisable = setting[@"ReturnToDisabled"];
|
|
|
|
|
+ if (![returnToDisable integerValue]) {
|
|
|
|
|
+ NSString *key8 = [NSString stringWithFormat:@"section_%d",section_count++];
|
|
|
|
|
+ NSDictionary *return_to_dic = [self returnToDic:params db:db];
|
|
|
|
|
+ [ret setValue:return_to_dic forKey:key8];
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// 9 Model Information
|
|
// 9 Model Information
|
|
|
|
|
+ NSString *key9 = [NSString stringWithFormat:@"section_%d",section_count++];
|
|
|
NSMutableDictionary *model_info_dic = [[self modelInfoDic:params db:db] mutableCopy];
|
|
NSMutableDictionary *model_info_dic = [[self modelInfoDic:params db:db] mutableCopy];
|
|
|
|
|
|
|
|
NSDictionary *toOrderTotal = [model_info_dic valueForKey:@"toOrderTotal"];
|
|
NSDictionary *toOrderTotal = [model_info_dic valueForKey:@"toOrderTotal"];
|
|
|
[model_info_dic removeObjectForKey:@"toOrderTotal"];
|
|
[model_info_dic removeObjectForKey:@"toOrderTotal"];
|
|
|
|
|
|
|
|
- [ret setValue:model_info_dic forKey:@"section_9"];
|
|
|
|
|
|
|
+ [ret setValue:model_info_dic forKey:key9];
|
|
|
|
|
|
|
|
// 10 Remarks Content
|
|
// 10 Remarks Content
|
|
|
|
|
+ NSString *key10 = [NSString stringWithFormat:@"section_%d",section_count++];
|
|
|
NSDictionary *remarks_content_dic = [self remarksContentDic:params db:db];
|
|
NSDictionary *remarks_content_dic = [self remarksContentDic:params db:db];
|
|
|
|
|
|
|
|
- [ret setValue:remarks_content_dic forKey:@"section_10"];
|
|
|
|
|
|
|
+ [ret setValue:remarks_content_dic forKey:key10];
|
|
|
|
|
|
|
|
// 11 Order Total
|
|
// 11 Order Total
|
|
|
|
|
+ NSString *key11 = [NSString stringWithFormat:@"section_%d",section_count++];
|
|
|
NSDictionary *order_total_dic = [self orderTotalDic:params otherTotal:toOrderTotal db:db];
|
|
NSDictionary *order_total_dic = [self orderTotalDic:params otherTotal:toOrderTotal db:db];
|
|
|
|
|
|
|
|
- [ret setValue:order_total_dic forKey:@"section_11"];
|
|
|
|
|
|
|
+ [ret setValue:order_total_dic forKey:key11];
|
|
|
|
|
|
|
|
// 12 Signature
|
|
// 12 Signature
|
|
|
|
|
+ NSString *key12 = [NSString stringWithFormat:@"section_%d",section_count++];
|
|
|
NSDictionary *sign_dic = [self signatureDic:params db:db];
|
|
NSDictionary *sign_dic = [self signatureDic:params db:db];
|
|
|
|
|
|
|
|
- [ret setValue:sign_dic forKey:@"section_12"];
|
|
|
|
|
|
|
+ [ret setValue:sign_dic forKey:key12];
|
|
|
|
|
+
|
|
|
|
|
+ [ret setValue:@(section_count) forKey:@"section_count"];
|
|
|
|
|
|
|
|
[iSalesDB close_db:db];
|
|
[iSalesDB close_db:db];
|
|
|
|
|
|