Browse Source

save order 去除对参数为空时,不做保存的操作(也就是参数为空时也写进数据库)。

Pen Li 9 years ago
parent
commit
83dad3deea

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 86 - 79
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -8047,20 +8047,20 @@
     // "logistic_note" = "USE MY CARRIER";
     NSString *so_id = [self valueInParams:param key:@"orderCode" translateSingleQuote:YES];
     NSString *general_notes = [self valueInParams:param key:@"comments" translateSingleQuote:YES];
-    general_notes = [general_notes isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"general_notes = '%@',",general_notes] ;
+    general_notes = [NSString stringWithFormat:@"general_notes = '%@',",general_notes] ;
     
     NSString *internal_notes = [self valueInParams:param key:@"internal_notes" translateSingleQuote:YES];
-    internal_notes = [internal_notes isEqualToString:@""] ? @"" :[NSString stringWithFormat:@"internal_notes = '%@',",internal_notes];
+    internal_notes = [NSString stringWithFormat:@"internal_notes = '%@',",internal_notes];
     
     NSString *poNumber = [self valueInParams:param key:@"poNumber" translateSingleQuote:YES];
-    poNumber = [poNumber isEqualToString:@""] ? @"" :[NSString stringWithFormat:@"poNumber = '%@',",poNumber];
+    poNumber = [NSString stringWithFormat:@"poNumber = '%@',",poNumber];
     
     NSString *must_call = [self valueInParams:param key:@"must_call"]; // false
-    int must_call_integer = [must_call isEqualToString:@"false"] ? 0 : 1;
-    must_call = [must_call isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"must_call = %d,",must_call_integer];
+    int must_call_integer = [must_call isEqualToString:@"true"] ? 1 : 0;
+    must_call = [NSString stringWithFormat:@"must_call = %d,",must_call_integer];
     
     NSString *sign_picpath = [self valueInParams:param key:@"sign_picpath" translateSingleQuote:YES];
-    sign_picpath = [sign_picpath isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"sign_picpath = '%@',",sign_picpath];
+    sign_picpath = [NSString stringWithFormat:@"sign_picpath = '%@',",sign_picpath];
     
     NSString *total_price = [self valueInParams:param key:@"totalPrice"];
     if (![total_price isEqualToString:@""]) {
@@ -8087,8 +8087,8 @@
     NSString *handling_fee_placeholder = handling_fee_value;
     
     NSString *lift_gate = [self valueInParams:param key:@"lift_gate"]; // false
-    int lift_gate_integer = [lift_gate isEqualToString:@"false"] ? 0 : 1;
-    lift_gate = ![lift_gate isEqualToString:@""] ? [NSString stringWithFormat:@"lift_gate = %d,",lift_gate_integer] : @"";
+    int lift_gate_integer = [lift_gate isEqualToString:@"true"] ? 1 : 0;
+    lift_gate = [NSString stringWithFormat:@"lift_gate = %d,",lift_gate_integer];
     
     NSString *lift_gate_value = [self valueInParams:param key:@"lift_gate_value"]; // Shipping To Be Quoted
     NSString *lift_gate_placeholder = @"";
@@ -8096,7 +8096,7 @@
         
         lift_gate_placeholder = @"";
         
-    } else if ([handling_fee_value isEqualToString:@""]) {
+    } else if ([handling_fee_value isEqualToString:@"Shipping To Be Quoted"]) {
         
         lift_gate_placeholder = @"";
         
@@ -8105,7 +8105,7 @@
     }
     
     NSString *logist = [self valueInParams:param key:@"logist" translateSingleQuote:YES];
-    logist = [logist isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"logist = '%@',",logist];
+    logist = [NSString stringWithFormat:@"logist = '%@',",logist];
     
     NSString *logistic_note_text = [self valueInParams:param key:@"logist_note_text" translateSingleQuote:YES];
     NSString *logistic_note = [self valueInParams:param key:@"logistic_note" translateSingleQuote:YES];
@@ -8113,231 +8113,238 @@
     
 //    NSString *erpOrderStatus = [self valueInParams:param key:@"erpOrderStatus"];
     NSNumber *erpOrderStatus_number = [param objectForKey:@"erpOrderStatus"];
-    NSString *erpOrderStatus = erpOrderStatus_number ? @"" : [NSString stringWithFormat:@"erpOrderStatus = %@,",erpOrderStatus_number];
+    NSString *erpOrderStatus = !erpOrderStatus_number ? @"" : [NSString stringWithFormat:@"submit_as = %@,",erpOrderStatus_number];
 
     
     NSString *paymentType = [self valueInParams:param key:@"paymentType" translateSingleQuote:YES];
-    paymentType = [paymentType isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"paymentType = '%@',",paymentType];
+    paymentType = [NSString stringWithFormat:@"paymentType = '%@',",paymentType];
     
     NSString *credit_card_address1 = [self valueInParams:param key:@"credit_card_address1" translateSingleQuote:YES];
-    credit_card_address1 = [credit_card_address1 isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"credit_card_address1 = '%@',",credit_card_address1];
+    credit_card_address1 = [NSString stringWithFormat:@"credit_card_address1 = '%@',",credit_card_address1];
     
     NSString *credit_card_address2 = [self valueInParams:param key:@"credit_card_address2" translateSingleQuote:YES];
-    credit_card_address2 = [credit_card_address2 isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"credit_card_address2 = '%@',",credit_card_address2];
+    credit_card_address2 = [NSString stringWithFormat:@"credit_card_address2 = '%@',",credit_card_address2];
     
     NSString *credit_card_city = [self valueInParams:param key:@"credit_card_city" translateSingleQuote:YES];
-    credit_card_city = [credit_card_city isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"credit_card_city = '%@',",credit_card_city];
+    credit_card_city = [NSString stringWithFormat:@"credit_card_city = '%@',",credit_card_city];
     
     NSString *credit_card_expiration = [self valueInParams:param key:@"credit_card_expiration" translateSingleQuote:YES];
     
     NSString *credit_card_first_name = [self valueInParams:param key:@"credit_card_first_name" translateSingleQuote:YES];
-    credit_card_first_name = [credit_card_first_name isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"credit_card_first_name = '%@',",credit_card_first_name];
+    credit_card_first_name = [NSString stringWithFormat:@"credit_card_first_name = '%@',",credit_card_first_name];
     
     NSString *credit_card_last_name = [self valueInParams:param key:@"credit_card_last_name" translateSingleQuote:YES];
-    credit_card_last_name = [credit_card_last_name isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"credit_card_last_name = '%@',",credit_card_last_name];
+    credit_card_last_name = [NSString stringWithFormat:@"credit_card_last_name = '%@',",credit_card_last_name];
     
     NSString *credit_card_number = [self valueInParams:param key:@"credit_card_number" translateSingleQuote:YES];
     BOOL number_nil = [credit_card_number isEqualToString:@""];
-    credit_card_number = [AESCrypt fastencrypt:credit_card_number];
-    credit_card_number = number_nil ? @"" : [NSString stringWithFormat:@"credit_card_number = '%@',",credit_card_number];
+    if (!number_nil) {
+        credit_card_number = [AESCrypt fastencrypt:credit_card_number];
+    }
+    credit_card_number = [NSString stringWithFormat:@"credit_card_number = '%@',",credit_card_number];
     
     NSString *credit_card_security_code = [self valueInParams:param key:@"credit_card_security_code" translateSingleQuote:YES];
     BOOL security_code_nil = [credit_card_security_code isEqualToString:@""];
-    credit_card_security_code = [AESCrypt fastencrypt:credit_card_security_code];
-    credit_card_security_code = security_code_nil ? @"" : [NSString stringWithFormat:@"credit_card_security_code = '%@',",credit_card_security_code];
+    if (!security_code_nil) {
+        credit_card_security_code = [AESCrypt fastencrypt:credit_card_security_code];
+    }
+    credit_card_security_code = [NSString stringWithFormat:@"credit_card_security_code = '%@',",credit_card_security_code];
     
     NSString *credit_card_state = [self valueInParams:param key:@"credit_card_state" translateSingleQuote:YES];
-    credit_card_state = [credit_card_state isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"credit_card_state = '%@',",credit_card_state];
+    credit_card_state = [NSString stringWithFormat:@"credit_card_state = '%@',",credit_card_state];
     
     NSNumber *card_type_number = [param objectForKey:@"credit_card_type"];
-    NSString *credit_card_type = card_type_number ? [NSString stringWithFormat:@"credit_card_type = '%@',",[card_type_number integerValue] == 0 ? @"VISA" : @"MASTER CARD"] : @"";
+    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 = [credit_card_zipcode isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"credit_card_zipcode = '%@',",credit_card_zipcode];
+    credit_card_zipcode = [NSString stringWithFormat:@"credit_card_zipcode = '%@',",credit_card_zipcode];
     
     NSString *credit_card_expiration_year = [[credit_card_expiration componentsSeparatedByString:@"/"] lastObject];
     credit_card_expiration_year = [AESCrypt fastencrypt:credit_card_expiration_year];
-    credit_card_expiration_year = [credit_card_expiration_year isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"credit_card_expiration_year = '%@',",credit_card_expiration_year];
+    credit_card_expiration_year = [NSString stringWithFormat:@"credit_card_expiration_year = '%@',",credit_card_expiration_year];
     
     NSString *credit_card_expiration_month = [[credit_card_expiration componentsSeparatedByString:@"/"] firstObject];
     credit_card_expiration_month = [AESCrypt fastencrypt:credit_card_expiration_month];
-    credit_card_expiration_month = [credit_card_expiration_month isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"credit_card_expiration_month = '%@',",credit_card_expiration_month];
+    credit_card_expiration_month = [NSString stringWithFormat:@"credit_card_expiration_month = '%@',",credit_card_expiration_month];
     
     
     NSString *customer_cid = [self valueInParams:param key:@"customer_cid" translateSingleQuote:YES];
     NSString *contact_id = customer_cid;
-    customer_cid = [customer_cid isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"customer_cid = '%@',",customer_cid];
+    customer_cid = [NSString stringWithFormat:@"customer_cid = '%@',",customer_cid];
     
     NSString *customer_contact = [self valueInParams:param key:@"customer_contact" translateSingleQuote:YES];
-    NSString *contact_contact = [customer_contact isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"contact_name = '%@',",customer_contact];
-    customer_contact = [customer_contact isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"customer_contact = '%@',",customer_contact];
+    NSString *contact_contact = [NSString stringWithFormat:@"contact_name = '%@',",customer_contact];
+    customer_contact = [NSString stringWithFormat:@"customer_contact = '%@',",customer_contact];
     
     NSString *customer_email = [self valueInParams:param key:@"customer_email" translateSingleQuote:YES];
-    NSString *contact_email = [customer_email isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"email = '%@',",customer_email];
-    customer_email = [customer_email isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"customer_email = '%@',",customer_email];
+    NSString *contact_email = [NSString stringWithFormat:@"email = '%@',",customer_email];
+    customer_email = [NSString stringWithFormat:@"customer_email = '%@',",customer_email];
     
     NSString *customer_phone = [self valueInParams:param key:@"customer_phone" translateSingleQuote:YES];
-    NSString *contact_phone = [customer_phone isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"phone = '%@',",[AESCrypt fastencrypt:customer_phone]];
-    customer_phone = [customer_phone isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"customer_phone = '%@',",customer_phone];
+    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 = [customer_fax isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"fax = '%@',",customer_fax];
-    customer_fax = [customer_fax isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"customer_fax = '%@',",customer_fax];
+    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];
-    customer_name = [customer_name isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"company_name = '%@',",[AESCrypt fastencrypt:customer_name]];
+    customer_name = [NSString stringWithFormat:@"company_name = '%@',",[AESCrypt fastencrypt:customer_name]];
     
     NSString *customer_address1 = [self valueInParams:param key:@"customer_address1" translateSingleQuote:YES];
-    customer_address1 = [customer_address1 isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"addr_1 = '%@',",[AESCrypt fastencrypt:customer_address1]];
+    customer_address1 = [NSString stringWithFormat:@"addr_1 = '%@',",[AESCrypt fastencrypt:customer_address1]];
     
     NSString *customer_address2 = [self valueInParams:param key:@"customer_address2" translateSingleQuote:YES];
-    customer_address2 = [customer_address2 isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"addr_2 = '%@',",customer_address2];
+    customer_address2 = [NSString stringWithFormat:@"addr_2 = '%@',",customer_address2];
     
     NSString *customer_address3 = [self valueInParams:param key:@"customer_address3" translateSingleQuote:YES];
-    customer_address3 = [customer_address3 isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"addr_3 = '%@',",customer_address3];
+    customer_address3 = [NSString stringWithFormat:@"addr_3 = '%@',",customer_address3];
     
     NSString *customer_address4 = [self valueInParams:param key:@"customer_address4" translateSingleQuote:YES];
-    customer_address4 = [customer_address4 isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"addr_4 = '%@',",customer_address4];
+    customer_address4 = [NSString stringWithFormat:@"addr_4 = '%@',",customer_address4];
     
     NSString *customer_country = [self valueInParams:param key:@"customer_country" translateSingleQuote:YES];
-    customer_country = [customer_country isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"country = '%@',",customer_country];
+    customer_country = [NSString stringWithFormat:@"country = '%@',",customer_country];
     
     NSString *customer_state = [self valueInParams:param key:@"customer_state" translateSingleQuote:YES];
-    customer_state = [customer_state isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"state = '%@',",customer_state];
+    customer_state = [NSString stringWithFormat:@"state = '%@',",customer_state];
     
     NSString *customer_city = [self valueInParams:param key:@"customer_city" translateSingleQuote:YES];
-    customer_city = [customer_city isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"city = '%@',",customer_city];
+    customer_city = [NSString stringWithFormat:@"city = '%@',",customer_city];
     
     NSString *customer_zipcode = [self valueInParams:param key:@"customer_zipcode" translateSingleQuote:YES];
-    customer_zipcode = [customer_zipcode isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"zipcode = '%@'",customer_zipcode];
+    customer_zipcode = [NSString stringWithFormat:@"zipcode = '%@'",customer_zipcode];
     
     NSString *contactSql = [NSString stringWithFormat:@"update offline_contact set %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ where contact_id = '%@'",contact_contact,contact_email,contact_phone,contact_fax,customer_name,customer_address1,customer_address2,customer_address3,customer_address4,customer_country,customer_state,customer_city,customer_zipcode,contact_id];
     
     
     NSString *receive_cid = [self valueInParams:param key:@"receive_cid" translateSingleQuote:YES];
-    receive_cid = [receive_cid isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"receive_cid = '%@',",receive_cid];
+    receive_cid = [NSString stringWithFormat:@"receive_cid = '%@',",receive_cid];
     
     NSString *receive_name = [self valueInParams:param key:@"receive_name" translateSingleQuote:YES];
-    receive_name = [receive_name isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"receive_name = '%@',",receive_name];
+    receive_name = [NSString stringWithFormat:@"receive_name = '%@',",receive_name];
     
 
     NSString *receive_ext = [self valueInParams:param key:@"receive_ext" translateSingleQuote:YES];
-    receive_ext = [receive_ext isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"receive_ext = '%@',",receive_ext];
+    receive_ext = [NSString stringWithFormat:@"receive_ext = '%@',",receive_ext];
     
 
     NSString *receive_contact = [self valueInParams:param key:@"receive_contact" translateSingleQuote:YES];
-    receive_contact = [receive_contact isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"receive_contact = '%@',",receive_contact];
+    receive_contact = [NSString stringWithFormat:@"receive_contact = '%@',",receive_contact];
     
 
     NSString *receive_phone = [self valueInParams:param key:@"receive_phone" translateSingleQuote:YES];
-    receive_phone = [receive_phone isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"receive_phone = '%@',",receive_phone];
+    receive_phone = [NSString stringWithFormat:@"receive_phone = '%@',",receive_phone];
     
 
     NSString *receive_email = [self valueInParams:param key:@"receive_email" translateSingleQuote:YES];
-    receive_email = [receive_email isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"receive_email = '%@',",receive_email];
+    receive_email = [NSString stringWithFormat:@"receive_email = '%@',",receive_email];
     
 
     NSString *receive_fax = [self valueInParams:param key:@"receive_fax" translateSingleQuote:YES];
-    receive_fax = [receive_fax isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"receive_fax = '%@',",receive_fax];
+    receive_fax = [NSString stringWithFormat:@"receive_fax = '%@',",receive_fax];
     
 
     
     NSString *sender_cid = [self valueInParams:param key:@"sender_cid" translateSingleQuote:YES];
-    sender_cid = [sender_cid isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"sender_cid = '%@',",sender_cid];
+    sender_cid = [NSString stringWithFormat:@"sender_cid = '%@',",sender_cid];
     
     NSString *sender_name = [self valueInParams:param key:@"sender_name" translateSingleQuote:YES];
-    sender_name = [sender_name isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"sender_name = '%@',",sender_name];
+    sender_name = [NSString stringWithFormat:@"sender_name = '%@',",sender_name];
     
     NSString *sender_ext = [self valueInParams:param key:@"sender_ext" translateSingleQuote:YES];
-    sender_ext = [sender_ext isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"sender_ext = '%@',",sender_ext];
+    sender_ext = [NSString stringWithFormat:@"sender_ext = '%@',",sender_ext];
     
     NSString *sender_contact = [self valueInParams:param key:@"sender_contact" translateSingleQuote:YES];
-    sender_contact = [sender_contact isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"sender_contact = '%@',",sender_contact];
+    sender_contact = [NSString stringWithFormat:@"sender_contact = '%@',",sender_contact];
     
     NSString *sender_phone = [self valueInParams:param key:@"sender_phone" translateSingleQuote:YES];
-    sender_phone = [sender_phone isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"sender_phone = '%@',",sender_phone];
+    sender_phone = [NSString stringWithFormat:@"sender_phone = '%@',",sender_phone];
     
     NSString *sender_fax = [self valueInParams:param key:@"sender_fax" translateSingleQuote:YES];
-    sender_fax = [sender_fax isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"sender_fax = '%@',",sender_fax];
+    sender_fax = [NSString stringWithFormat:@"sender_fax = '%@',",sender_fax];
     
     NSString *sender_email = [self valueInParams:param key:@"sender_email" translateSingleQuote:YES];
-    sender_email = [sender_email isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"sender_email = '%@',",sender_email];
+    sender_email = [NSString stringWithFormat:@"sender_email = '%@',",sender_email];
     
     
     
     
     NSString *shipping_billto_cid = [self valueInParams:param key:@"shipping_billto_cid" translateSingleQuote:YES];
-    shipping_billto_cid = [shipping_billto_cid isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"shipping_billto_cid = '%@',",shipping_billto_cid];
+    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 = [shipping_billto_name isEqualToString:@""] ? @"" : [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 = [shipping_billto_ext isEqualToString:@""] ? @"" : [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 = [shipping_billto_contact isEqualToString:@""] ? @"" : [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 = [shipping_billto_phone isEqualToString:@""] ? @"" : [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 = [shipping_billto_fax isEqualToString:@""] ? @"" : [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 = [shipping_billto_email isEqualToString:@""] ? @"" : [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];
-    billing_cid = [billing_cid isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"billing_cid = '%@',",billing_cid];
+    billing_cid = [NSString stringWithFormat:@"billing_cid = '%@',",billing_cid];
     
     NSString *billing_name = [self valueInParams:param key:@"billing_name" translateSingleQuote:YES];
-    billing_name = [billing_name isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"billing_name = '%@',",billing_name];
+    billing_name = [NSString stringWithFormat:@"billing_name = '%@',",billing_name];
     
     NSString *billing_ext = [self valueInParams:param key:@"billing_ext" translateSingleQuote:YES];
-    billing_ext = [billing_ext isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"billing_ext = '%@',",billing_ext];
+    billing_ext = [NSString stringWithFormat:@"billing_ext = '%@',",billing_ext];
     
     NSString *billing_contact = [self valueInParams:param key:@"billing_contact" translateSingleQuote:YES];
-    billing_contact = [billing_contact isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"billing_contact = '%@',",billing_contact];
+    billing_contact = [NSString stringWithFormat:@"billing_contact = '%@',",billing_contact];
     
     NSString *billing_phone = [self valueInParams:param key:@"billing_phone" translateSingleQuote:YES];
-    billing_phone = [billing_phone isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"billing_phone = '%@',",billing_phone];
+    billing_phone = [NSString stringWithFormat:@"billing_phone = '%@',",billing_phone];
     
     NSString *billing_fax = [self valueInParams:param key:@"billing_fax" translateSingleQuote:YES];
-    billing_fax = [billing_fax isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"billing_fax = '%@',",billing_fax];
+    billing_fax = [NSString stringWithFormat:@"billing_fax = '%@',",billing_fax];
     
     NSString *billing_email = [self valueInParams:param key:@"billing_email" translateSingleQuote:YES];
-    billing_email = [billing_email isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"billing_email = '%@',",billing_email];
+    billing_email = [NSString stringWithFormat:@"billing_email = '%@',",billing_email];
     
     
     NSString *returnto_cid = [self valueInParams:param key:@"returnto_cid" translateSingleQuote:YES];
-    returnto_cid = [returnto_cid isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"returnto_cid = '%@',",returnto_cid];
+    returnto_cid = [NSString stringWithFormat:@"returnto_cid = '%@',",returnto_cid];
     
     NSString *returnto_name = [self valueInParams:param key:@"returnto_name" translateSingleQuote:YES];
-    returnto_name = [returnto_name isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"returnto_name = '%@',",returnto_name];
+    returnto_name = [NSString stringWithFormat:@"returnto_name = '%@',",returnto_name];
     
     NSString *returnto_ext = [self valueInParams:param key:@"returnto_ext" translateSingleQuote:YES];
-    returnto_ext = [returnto_ext isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"returnto_ext = '%@',",returnto_ext];
+    returnto_ext = [NSString stringWithFormat:@"returnto_ext = '%@',",returnto_ext];
     
     NSString *returnto_contact = [self valueInParams:param key:@"returnto_contact" translateSingleQuote:YES];
-    returnto_contact = [returnto_contact isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"returnto_contact = '%@',",returnto_contact];
+    returnto_contact = [NSString stringWithFormat:@"returnto_contact = '%@',",returnto_contact];
     
     NSString *returnto_phone = [self valueInParams:param key:@"returnto_phone" translateSingleQuote:YES];
-    returnto_phone = [returnto_phone isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"returnto_phone = '%@',",returnto_phone];
+    returnto_phone = [NSString stringWithFormat:@"returnto_phone = '%@',",returnto_phone];
     
     NSString *returnto_fax = [self valueInParams:param key:@"returnto_fax" translateSingleQuote:YES];
-    returnto_fax = [returnto_fax isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"returnto_fax = '%@',",returnto_fax];
+    returnto_fax = [NSString stringWithFormat:@"returnto_fax = '%@',",returnto_fax];
     
     NSString *returnto_email = [self valueInParams:param key:@"returnto_email" translateSingleQuote:YES];
-    returnto_email = [returnto_email isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"returnto_email = '%@',",returnto_email];
+    returnto_email = [NSString stringWithFormat:@"returnto_email = '%@',",returnto_email];
     
     
     NSString *orderSql = [NSString stringWithFormat:@"update offline_order set %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ so_id = '%@' where so_id = '%@';",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,so_id];
     
+    DebugLog(@"save order contactSql: %@",contactSql);
+    DebugLog(@"save order orderSql: %@",orderSql);
+    
     int contact_ret = [iSalesDB execSql:contactSql];
     
     int order_ret = [iSalesDB execSql:orderSql];