|
|
@@ -7622,9 +7622,323 @@
|
|
|
return [RAUtils dict2data:dic];
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+#pragma mark save order
|
|
|
+
|
|
|
++ (NSString *)valueInParams:(NSDictionary *)params key:(NSString *)key translateSingleQuote:(BOOL)translate {
|
|
|
+ NSString *ret = [self valueInParams:params key:key];
|
|
|
+ if (translate) {
|
|
|
+ ret = [self translateSingleQuote:ret];
|
|
|
+ }
|
|
|
+
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+
|
|
|
+(NSData*) offline_saveorder :(NSMutableDictionary *) param
|
|
|
{
|
|
|
- return nil;
|
|
|
+
|
|
|
+ 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] ;
|
|
|
+
|
|
|
+ NSString *internal_notes = [self valueInParams:param key:@"internal_notes" translateSingleQuote:YES];
|
|
|
+ internal_notes = [internal_notes isEqualToString:@""] ? @"" :[NSString stringWithFormat:@"internal_notes = '%@',",internal_notes];
|
|
|
+
|
|
|
+ NSString *poNumber = [self valueInParams:param key:@"poNumber" translateSingleQuote:YES];
|
|
|
+ poNumber = [poNumber isEqualToString:@""] ? @"" :[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];
|
|
|
+
|
|
|
+ NSString *sign_picpath = [self valueInParams:param key:@"sign_picpath" translateSingleQuote:YES];
|
|
|
+ sign_picpath = [sign_picpath isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"sign_picpath = '%@',",sign_picpath];
|
|
|
+
|
|
|
+ NSString *total_price = [self valueInParams:param key:@"totalPrice"];
|
|
|
+ if (![total_price isEqualToString:@""]) {
|
|
|
+ total_price = [NSString stringWithFormat:@"total_price = %@,",total_price];
|
|
|
+ } else {
|
|
|
+ total_price = @"";
|
|
|
+ }
|
|
|
+
|
|
|
+ NSString *paymentsAndCredits = [self valueInParams:param key:@"paymentsAndCredits"];
|
|
|
+ if ([paymentsAndCredits isEqualToString:@""]) {
|
|
|
+ paymentsAndCredits = @"";
|
|
|
+ } else {
|
|
|
+ paymentsAndCredits = [NSString stringWithFormat:@"paymentsAndCredits = %@,",paymentsAndCredits];
|
|
|
+ }
|
|
|
+
|
|
|
+ NSString *handling_fee_value = [self valueInParams:param key:@"handling_fee_value"];
|
|
|
+ if ([handling_fee_value isEqualToString:@""]) {
|
|
|
+ handling_fee_value = @"";
|
|
|
+ } else if ([handling_fee_value isEqualToString:@"Shipping To Be Quoted"]) {
|
|
|
+ handling_fee_value = @"";
|
|
|
+ } else {
|
|
|
+ handling_fee_value = [NSString stringWithFormat:@"handling_fee_value = %@,",handling_fee_value];
|
|
|
+ }
|
|
|
+ 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] : @"";
|
|
|
+
|
|
|
+ NSString *lift_gate_value = [self valueInParams:param key:@"lift_gate_value"]; // Shipping To Be Quoted
|
|
|
+ NSString *lift_gate_placeholder = @"";
|
|
|
+ if ([handling_fee_value isEqualToString:@""]) {
|
|
|
+
|
|
|
+ lift_gate_placeholder = @"";
|
|
|
+
|
|
|
+ } else if ([handling_fee_value isEqualToString:@""]) {
|
|
|
+
|
|
|
+ lift_gate_placeholder = @"";
|
|
|
+
|
|
|
+ } else {
|
|
|
+ lift_gate_placeholder = [NSString stringWithFormat:@"lift_gate_value = %@,",lift_gate_value];
|
|
|
+ }
|
|
|
+
|
|
|
+ NSString *logist = [self valueInParams:param key:@"logist" translateSingleQuote:YES];
|
|
|
+ logist = [logist isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"logist = '%@',",logist];
|
|
|
+
|
|
|
+// NSString *erpOrderStatus = [self valueInParams:param key:@"erpOrderStatus"];
|
|
|
+ NSNumber *erpOrderStatus_number = [param objectForKey:@"erpOrderStatus"];
|
|
|
+ NSString *erpOrderStatus = erpOrderStatus_number ? @"" : [NSString stringWithFormat:@"erpOrderStatus = %@,",erpOrderStatus_number];
|
|
|
+
|
|
|
+
|
|
|
+ NSString *paymentType = [self valueInParams:param key:@"paymentType" translateSingleQuote:YES];
|
|
|
+ paymentsAndCredits = [paymentsAndCredits isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"paymentType = '%@',",paymentsAndCredits];
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ NSString *credit_card_type = [self valueInParams:param key:@"credit_card_type" translateSingleQuote:YES];
|
|
|
+ credit_card_type = [credit_card_type isEqualToString:@""] ? @"" : [NSString stringWithFormat:@"credit_card_type = '%@',",credit_card_type];
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ 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 *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 *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 *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 *customer_name = [self valueInParams:param key:@"customer_name" translateSingleQuote:YES];
|
|
|
+ customer_name = [customer_name isEqualToString:@""] ? @"" : [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]];
|
|
|
+
|
|
|
+ NSString *customer_address2 = [self valueInParams:param key:@"customer_address2" translateSingleQuote:YES];
|
|
|
+ customer_address2 = [customer_address2 isEqualToString:@""] ? @"" : [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];
|
|
|
+
|
|
|
+ NSString *customer_address4 = [self valueInParams:param key:@"customer_address4" translateSingleQuote:YES];
|
|
|
+ customer_address4 = [customer_address4 isEqualToString:@""] ? @"" : [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];
|
|
|
+
|
|
|
+ NSString *customer_state = [self valueInParams:param key:@"customer_state" translateSingleQuote:YES];
|
|
|
+ customer_state = [customer_state isEqualToString:@""] ? @"" : [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];
|
|
|
+
|
|
|
+ NSString *customer_zipcode = [self valueInParams:param key:@"customer_zipcode" translateSingleQuote:YES];
|
|
|
+ customer_zipcode = [customer_zipcode isEqualToString:@""] ? @"" : [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];
|
|
|
+
|
|
|
+ NSString *receive_name = [self valueInParams:param key:@"receive_name" translateSingleQuote:YES];
|
|
|
+ receive_name = [receive_name isEqualToString:@""] ? @"" : [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];
|
|
|
+
|
|
|
+
|
|
|
+ NSString *receive_contact = [self valueInParams:param key:@"receive_contact" translateSingleQuote:YES];
|
|
|
+ receive_contact = [receive_contact isEqualToString:@""] ? @"" : [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];
|
|
|
+
|
|
|
+
|
|
|
+ NSString *receive_email = [self valueInParams:param key:@"receive_email" translateSingleQuote:YES];
|
|
|
+ receive_email = [receive_email isEqualToString:@""] ? @"" : [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];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ NSString *sender_cid = [self valueInParams:param key:@"sender_cid" translateSingleQuote:YES];
|
|
|
+ sender_cid = [sender_cid isEqualToString:@""] ? @"" : [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];
|
|
|
+
|
|
|
+ NSString *sender_ext = [self valueInParams:param key:@"sender_ext" translateSingleQuote:YES];
|
|
|
+ sender_ext = [sender_ext isEqualToString:@""] ? @"" : [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];
|
|
|
+
|
|
|
+ NSString *sender_phone = [self valueInParams:param key:@"sender_phone" translateSingleQuote:YES];
|
|
|
+ sender_phone = [sender_phone isEqualToString:@""] ? @"" : [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];
|
|
|
+
|
|
|
+ NSString *sender_email = [self valueInParams:param key:@"sender_email" translateSingleQuote:YES];
|
|
|
+ sender_email = [sender_email isEqualToString:@""] ? @"" : [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];
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
+
|
|
|
+ NSString *billing_cid = [self valueInParams:param key:@"billing_cid" translateSingleQuote:YES];
|
|
|
+ billing_cid = [billing_cid isEqualToString:@""] ? @"" : [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];
|
|
|
+
|
|
|
+ NSString *billing_ext = [self valueInParams:param key:@"billing_ext" translateSingleQuote:YES];
|
|
|
+ billing_ext = [billing_ext isEqualToString:@""] ? @"" : [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];
|
|
|
+
|
|
|
+ NSString *billing_phone = [self valueInParams:param key:@"billing_phone" translateSingleQuote:YES];
|
|
|
+ billing_phone = [billing_phone isEqualToString:@""] ? @"" : [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];
|
|
|
+
|
|
|
+ NSString *billing_email = [self valueInParams:param key:@"billing_email" translateSingleQuote:YES];
|
|
|
+ billing_email = [billing_email isEqualToString:@""] ? @"" : [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];
|
|
|
+
|
|
|
+ NSString *returnto_name = [self valueInParams:param key:@"returnto_name" translateSingleQuote:YES];
|
|
|
+ returnto_name = [returnto_name isEqualToString:@""] ? @"" : [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];
|
|
|
+
|
|
|
+ NSString *returnto_contact = [self valueInParams:param key:@"returnto_contact" translateSingleQuote:YES];
|
|
|
+ returnto_contact = [returnto_contact isEqualToString:@""] ? @"" : [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];
|
|
|
+
|
|
|
+ NSString *returnto_fax = [self valueInParams:param key:@"returnto_fax" translateSingleQuote:YES];
|
|
|
+ returnto_fax = [returnto_fax isEqualToString:@""] ? @"" : [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];
|
|
|
+
|
|
|
+
|
|
|
+ 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,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];
|
|
|
+
|
|
|
+ int contact_ret = [iSalesDB execSql:contactSql];
|
|
|
+
|
|
|
+ int order_ret = [iSalesDB execSql:orderSql];
|
|
|
+
|
|
|
+ int ret = contact_ret == 2 && order_ret == 2 ? 2 : -1;
|
|
|
+
|
|
|
+
|
|
|
+ NSMutableDictionary *dic = [NSMutableDictionary dictionary];
|
|
|
+ [dic setValue:[NSNumber numberWithInteger:ret] forKey:@"result"];
|
|
|
+ [dic setValue:@"Regular Mode" forKey:@"mode"];
|
|
|
+ [dic setValue:@"160409" forKey:@"min_ver"];
|
|
|
+
|
|
|
+ return [RAUtils dict2data:dic];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@end
|