|
|
@@ -6341,6 +6341,11 @@
|
|
|
nsstatus=@"Closed";
|
|
|
break;
|
|
|
}
|
|
|
+ case -11:
|
|
|
+ {
|
|
|
+ nsstatus = @"Ready For Submit";
|
|
|
+ break;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
@@ -8666,11 +8671,7 @@
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-+(NSData*) offline_saveorder :(NSMutableDictionary *) param
|
|
|
-{
|
|
|
-// "logistic_note" = "PERSONAL PICK UP";
|
|
|
- // logist_note_text
|
|
|
- // "logistic_note" = "USE MY CARRIER";
|
|
|
++ (NSData *)saveorder:(NSMutableDictionary *)param submit:(BOOL)submit {
|
|
|
NSString *so_id = [self valueInParams:param key:@"orderCode" translateSingleQuote:YES];
|
|
|
NSString *general_notes = [self valueInParams:param key:@"comments" translateSingleQuote:YES];
|
|
|
general_notes = [NSString stringWithFormat:@"general_notes = '%@',",general_notes] ;
|
|
|
@@ -8737,11 +8738,12 @@
|
|
|
NSString *logistic_note = [self valueInParams:param key:@"logistic_note" translateSingleQuote:YES];
|
|
|
logistic_note = [logistic_note isEqualToString:@"USE MY CARRIER"] ? [NSString stringWithFormat:@"logistic_note = '%@\n\t%@',",logistic_note,logistic_note_text] : [NSString stringWithFormat:@"logistic_note = '%@',",logistic_note];
|
|
|
|
|
|
-// NSString *erpOrderStatus = [self valueInParams:param key:@"erpOrderStatus"];
|
|
|
+ // NSString *erpOrderStatus = [self valueInParams:param key:@"erpOrderStatus"];
|
|
|
NSNumber *erpOrderStatus_number = [param objectForKey:@"erpOrderStatus"];
|
|
|
- NSString *erpOrderStatus = !erpOrderStatus_number ? @"" : [NSString stringWithFormat:@"submit_as = %@,",erpOrderStatus_number];
|
|
|
+ NSString *erpOrderStatus = !erpOrderStatus_number ? @"" : [NSString stringWithFormat:@"submit_as = %@,",erpOrderStatus_number]; // submit as
|
|
|
|
|
|
|
|
|
+
|
|
|
NSString *paymentType = [self valueInParams:param key:@"paymentType" translateSingleQuote:YES];
|
|
|
paymentType = [NSString stringWithFormat:@"paymentType = '%@',",paymentType];
|
|
|
|
|
|
@@ -8781,7 +8783,7 @@
|
|
|
|
|
|
NSNumber *card_type_number = [param objectForKey:@"credit_card_type"];
|
|
|
NSString *credit_card_type = [NSString stringWithFormat:@"credit_card_type = '%@',",[card_type_number integerValue] == 0 ? @"VISA" : @"MASTER CARD"];
|
|
|
-
|
|
|
+
|
|
|
|
|
|
NSString *credit_card_zipcode = [self valueInParams:param key:@"credit_card_zipcode" translateSingleQuote:YES];
|
|
|
credit_card_zipcode = [NSString stringWithFormat:@"credit_card_zipcode = '%@',",credit_card_zipcode];
|
|
|
@@ -8810,12 +8812,12 @@
|
|
|
NSString *customer_phone = [self valueInParams:param key:@"customer_phone" translateSingleQuote:YES];
|
|
|
NSString *contact_phone = [NSString stringWithFormat:@"phone = '%@',",[AESCrypt fastencrypt:customer_phone]];
|
|
|
customer_phone = [NSString stringWithFormat:@"customer_phone = '%@',",customer_phone];
|
|
|
-
|
|
|
+
|
|
|
|
|
|
NSString *customer_fax = [self valueInParams:param key:@"customer_fax" translateSingleQuote:YES];
|
|
|
NSString *contact_fax = [NSString stringWithFormat:@"fax = '%@',",customer_fax];
|
|
|
customer_fax = [NSString stringWithFormat:@"customer_fax = '%@',",customer_fax];
|
|
|
-
|
|
|
+
|
|
|
|
|
|
//
|
|
|
NSString *customer_name = [self valueInParams:param key:@"customer_name" translateSingleQuote:YES];
|
|
|
@@ -8854,27 +8856,27 @@
|
|
|
NSString *receive_name = [self valueInParams:param key:@"receive_name" translateSingleQuote:YES];
|
|
|
receive_name = [NSString stringWithFormat:@"receive_name = '%@',",receive_name];
|
|
|
|
|
|
-
|
|
|
+
|
|
|
NSString *receive_ext = [self valueInParams:param key:@"receive_ext" translateSingleQuote:YES];
|
|
|
receive_ext = [NSString stringWithFormat:@"receive_ext = '%@',",receive_ext];
|
|
|
|
|
|
-
|
|
|
+
|
|
|
NSString *receive_contact = [self valueInParams:param key:@"receive_contact" translateSingleQuote:YES];
|
|
|
receive_contact = [NSString stringWithFormat:@"receive_contact = '%@',",receive_contact];
|
|
|
|
|
|
-
|
|
|
+
|
|
|
NSString *receive_phone = [self valueInParams:param key:@"receive_phone" translateSingleQuote:YES];
|
|
|
receive_phone = [NSString stringWithFormat:@"receive_phone = '%@',",receive_phone];
|
|
|
|
|
|
-
|
|
|
+
|
|
|
NSString *receive_email = [self valueInParams:param key:@"receive_email" translateSingleQuote:YES];
|
|
|
receive_email = [NSString stringWithFormat:@"receive_email = '%@',",receive_email];
|
|
|
|
|
|
-
|
|
|
+
|
|
|
NSString *receive_fax = [self valueInParams:param key:@"receive_fax" translateSingleQuote:YES];
|
|
|
receive_fax = [NSString stringWithFormat:@"receive_fax = '%@',",receive_fax];
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
NSString *sender_cid = [self valueInParams:param key:@"sender_cid" translateSingleQuote:YES];
|
|
|
sender_cid = [NSString stringWithFormat:@"sender_cid = '%@',",sender_cid];
|
|
|
@@ -8904,22 +8906,22 @@
|
|
|
shipping_billto_cid = [NSString stringWithFormat:@"shipping_billto_cid = '%@',",shipping_billto_cid];
|
|
|
|
|
|
NSString *shipping_billto_name = [self valueInParams:param key:@"shipping_billto_name" translateSingleQuote:YES];
|
|
|
- shipping_billto_name = [NSString stringWithFormat:@"shipping_billto_name = '%@',",shipping_billto_name];
|
|
|
+ shipping_billto_name = [NSString stringWithFormat:@"shipping_billto_name = '%@',",shipping_billto_name];
|
|
|
|
|
|
NSString *shipping_billto_ext = [self valueInParams:param key:@"shipping_billto_ext" translateSingleQuote:YES];
|
|
|
- shipping_billto_ext = [NSString stringWithFormat:@"shipping_billto_ext = '%@',",shipping_billto_ext];
|
|
|
+ shipping_billto_ext = [NSString stringWithFormat:@"shipping_billto_ext = '%@',",shipping_billto_ext];
|
|
|
|
|
|
NSString *shipping_billto_contact = [self valueInParams:param key:@"shipping_billto_contact" translateSingleQuote:YES];
|
|
|
- shipping_billto_contact = [NSString stringWithFormat:@"shipping_billto_contact = '%@',",shipping_billto_contact];
|
|
|
+ shipping_billto_contact = [NSString stringWithFormat:@"shipping_billto_contact = '%@',",shipping_billto_contact];
|
|
|
|
|
|
NSString *shipping_billto_phone = [self valueInParams:param key:@"shipping_billto_phone" translateSingleQuote:YES];
|
|
|
- shipping_billto_phone = [NSString stringWithFormat:@"shipping_billto_phone = '%@',",shipping_billto_phone];
|
|
|
+ shipping_billto_phone = [NSString stringWithFormat:@"shipping_billto_phone = '%@',",shipping_billto_phone];
|
|
|
|
|
|
NSString *shipping_billto_fax = [self valueInParams:param key:@"shipping_billto_fax" translateSingleQuote:YES];
|
|
|
- shipping_billto_fax = [NSString stringWithFormat:@"shipping_billto_fax = '%@',",shipping_billto_fax];
|
|
|
+ shipping_billto_fax = [NSString stringWithFormat:@"shipping_billto_fax = '%@',",shipping_billto_fax];
|
|
|
|
|
|
NSString *shipping_billto_email = [self valueInParams:param key:@"shipping_billto_email" translateSingleQuote:YES];
|
|
|
- shipping_billto_email = [NSString stringWithFormat:@"shipping_billto_email = '%@',",shipping_billto_email];
|
|
|
+ shipping_billto_email = [NSString stringWithFormat:@"shipping_billto_email = '%@',",shipping_billto_email];
|
|
|
|
|
|
|
|
|
NSString *billing_cid = [self valueInParams:param key:@"billing_cid" translateSingleQuote:YES];
|
|
|
@@ -8966,16 +8968,23 @@
|
|
|
returnto_email = [NSString stringWithFormat:@"returnto_email = '%@',",returnto_email];
|
|
|
|
|
|
NSString *order_status = @"status = 1,";
|
|
|
+ if (submit) {
|
|
|
+ order_status = @"status = -11,";
|
|
|
+ }
|
|
|
|
|
|
-// NSString *sync_data = [AESCrypt fastencrypt:[RAUtils dict2string:param]];
|
|
|
+ // NSString *sync_data = [AESCrypt fastencrypt:[RAUtils dict2string:param]];
|
|
|
NSString *sync_data = [self translateSingleQuote:[RAUtils dict2string:param]];
|
|
|
+ NSString *sync_sql = @"";
|
|
|
+ if (submit) {
|
|
|
+ sync_sql = [NSString stringWithFormat:@",sync_data = '%@' ",sync_data];
|
|
|
+ }
|
|
|
|
|
|
- NSString *orderSql = [NSString stringWithFormat:@"update offline_order set %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ so_id = '%@',sync_data = '%@' where so_id = '%@';",order_status,general_notes,internal_notes,poNumber,must_call,sign_picpath,total_price,paymentsAndCredits,handling_fee_placeholder,lift_gate,lift_gate_placeholder,logist,logistic_note,erpOrderStatus,paymentType,credit_card_address1,credit_card_address2,credit_card_city,credit_card_first_name,credit_card_last_name,credit_card_number,credit_card_security_code,credit_card_state,credit_card_type,credit_card_zipcode,credit_card_expiration_year,credit_card_expiration_month,customer_cid,customer_contact,customer_email,customer_phone,customer_fax,receive_cid,receive_name,receive_ext,receive_contact,receive_phone,receive_email,receive_fax,sender_cid,sender_name,sender_ext,sender_contact,sender_phone,sender_fax,sender_email,shipping_billto_cid,shipping_billto_name,shipping_billto_ext,shipping_billto_contact,shipping_billto_phone,shipping_billto_fax,shipping_billto_email,billing_cid,billing_name,billing_ext,billing_contact,billing_phone,billing_fax,billing_email,returnto_cid,returnto_name,returnto_ext,returnto_contact,returnto_phone,returnto_fax,returnto_email,so_id,sync_data,so_id];
|
|
|
+ NSString *orderSql = [NSString stringWithFormat:@"update offline_order set %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ so_id = '%@' %@ where so_id = '%@';",order_status,general_notes,internal_notes,poNumber,must_call,sign_picpath,total_price,paymentsAndCredits,handling_fee_placeholder,lift_gate,lift_gate_placeholder,logist,logistic_note,erpOrderStatus,paymentType,credit_card_address1,credit_card_address2,credit_card_city,credit_card_first_name,credit_card_last_name,credit_card_number,credit_card_security_code,credit_card_state,credit_card_type,credit_card_zipcode,credit_card_expiration_year,credit_card_expiration_month,customer_cid,customer_contact,customer_email,customer_phone,customer_fax,receive_cid,receive_name,receive_ext,receive_contact,receive_phone,receive_email,receive_fax,sender_cid,sender_name,sender_ext,sender_contact,sender_phone,sender_fax,sender_email,shipping_billto_cid,shipping_billto_name,shipping_billto_ext,shipping_billto_contact,shipping_billto_phone,shipping_billto_fax,shipping_billto_email,billing_cid,billing_name,billing_ext,billing_contact,billing_phone,billing_fax,billing_email,returnto_cid,returnto_name,returnto_ext,returnto_contact,returnto_phone,returnto_fax,returnto_email,so_id,sync_sql,so_id];
|
|
|
|
|
|
DebugLog(@"save order contactSql: %@",contactSql);
|
|
|
DebugLog(@"save order orderSql: %@",orderSql);
|
|
|
|
|
|
-// int contact_ret = [iSalesDB execSql:contactSql];
|
|
|
+ // int contact_ret = [iSalesDB execSql:contactSql];
|
|
|
|
|
|
int order_ret = [iSalesDB execSql:orderSql];
|
|
|
|
|
|
@@ -8985,12 +8994,20 @@
|
|
|
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
|
[dic setValue:[NSNumber numberWithInteger:ret] forKey:@"result"];
|
|
|
[dic setValue:@"Regular Mode" forKey:@"mode"];
|
|
|
-// [dic setValue:@"160409" forKey:@"min_ver"];
|
|
|
+ // [dic setValue:@"160409" forKey:@"min_ver"];
|
|
|
[dic setObject:so_id forKey:@"so#"];
|
|
|
return [RAUtils dict2data:dic];
|
|
|
|
|
|
}
|
|
|
|
|
|
++(NSData*) offline_saveorder :(NSMutableDictionary *) param
|
|
|
+{
|
|
|
+// "logistic_note" = "PERSONAL PICK UP";
|
|
|
+ // logist_note_text
|
|
|
+ // "logistic_note" = "USE MY CARRIER";
|
|
|
+ return [self saveorder:param submit:NO];
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark add to cart by name
|
|
|
|
|
|
+(NSData*) offline_add2cartbyname :(NSMutableDictionary *) params
|
|
|
@@ -9080,7 +9097,7 @@
|
|
|
#pragma mark submit order
|
|
|
+(NSData*) offline_submitorder :(NSMutableDictionary *) params;
|
|
|
{
|
|
|
- return [RAUtils dict2data:[self offline_notimpl]];
|
|
|
+ return [self saveorder:params submit:YES];
|
|
|
}
|
|
|
#pragma mark copy order
|
|
|
|