|
|
@@ -20,6 +20,7 @@
|
|
|
#import "QRCodeGenerator.h"
|
|
|
#import "config.h"
|
|
|
#import "ImageUtils.h"
|
|
|
+#import "RAConvertor.h"
|
|
|
|
|
|
@interface OLDataProvider ()
|
|
|
|
|
|
@@ -390,7 +391,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
|
|
|
// NSString* detail =[NSString stringWithFormat:@"<font size=0.2>%@</font>",[RAUtils arr2string:arr_detail separator:@" " trim:true]];
|
|
|
- NSString* detail =[RAUtils arr2string:arr_detail separator:@" " trim:true];
|
|
|
+ NSString* detail =[RAConvertor arr2string:arr_detail separator:@" " trim:true];
|
|
|
|
|
|
|
|
|
//model image;
|
|
|
@@ -632,7 +633,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
|
|
|
|
|
|
- DebugLog(@"data string: %@",[RAUtils dict2string:ret] );
|
|
|
+ DebugLog(@"data string: %@",[RAConvertor dict2string:ret] );
|
|
|
|
|
|
return ret;
|
|
|
}
|
|
|
@@ -773,7 +774,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
NSMutableArray* billto_arr0 = [[NSMutableArray alloc]init];
|
|
|
[billto_arr0 addObject:billing_phone];
|
|
|
[billto_arr0 addObject:billing_fax];
|
|
|
- NSString* billing_pf=[RAUtils arr2string:billto_arr0 separator:@" " trim:true];
|
|
|
+ NSString* billing_pf=[RAConvertor arr2string:billto_arr0 separator:@" " trim:true];
|
|
|
NSString* billing_email = [self textAtColumn:11 statement:statement];
|
|
|
if(billing_email.length>0)
|
|
|
billing_email= [@"EMAIL: " stringByAppendingString:billing_email];
|
|
|
@@ -793,7 +794,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
[receive_arr0 addObject:receive_phone];
|
|
|
[receive_arr0 addObject:receive_fax];
|
|
|
NSString* receive_email = [self textAtColumn:16 statement:statement];
|
|
|
- NSString* receive_pf=[RAUtils arr2string:billto_arr0 separator:@" " trim:true];
|
|
|
+ NSString* receive_pf=[RAConvertor arr2string:billto_arr0 separator:@" " trim:true];
|
|
|
|
|
|
if(receive_email.length>0)
|
|
|
receive_email= [@"EMAIL: " stringByAppendingString:receive_email];
|
|
|
@@ -840,7 +841,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
[billto_arr addObject:billing_pf];
|
|
|
[billto_arr addObject:billing_contact];
|
|
|
[billto_arr addObject:billing_email];
|
|
|
- NSString* billto=[RAUtils arr2string:billto_arr separator:@"\r\n" trim:true];
|
|
|
+ NSString* billto=[RAConvertor arr2string:billto_arr separator:@"\r\n" trim:true];
|
|
|
|
|
|
|
|
|
NSMutableArray* receive_arr = [[NSMutableArray alloc]init];
|
|
|
@@ -848,7 +849,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
[receive_arr addObject:receive_pf];
|
|
|
[receive_arr addObject:receive_contact];
|
|
|
[receive_arr addObject:receive_email];
|
|
|
- NSString* receive=[RAUtils arr2string:receive_arr separator:@"\r\n" trim:true];
|
|
|
+ NSString* receive=[RAConvertor arr2string:receive_arr separator:@"\r\n" trim:true];
|
|
|
|
|
|
float shipping = sqlite3_column_double(statement, 28);
|
|
|
float lift_gate_value = sqlite3_column_double(statement, 29);
|
|
|
@@ -1555,7 +1556,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
return [RAUtils dict2data:ret];
|
|
|
*/
|
|
|
- DebugLog(@"debug sales order data:%@", [RAUtils dict2string:data]);
|
|
|
+ DebugLog(@"debug sales order data:%@", [RAConvertor dict2string:data]);
|
|
|
return data;
|
|
|
}
|
|
|
+(NSData*) offline_request_salesorder :(NSMutableDictionary *) params
|
|
|
@@ -1816,7 +1817,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
ret[@"portfolio"] = [self preparePortfolio:serial];
|
|
|
ret[@"view_portfolio"] = [self preparePDF:serial];
|
|
|
|
|
|
- NSString* str= [RAUtils dict2string:ret];
|
|
|
+ NSString* str= [RAConvertor dict2string:ret];
|
|
|
|
|
|
|
|
|
|
|
|
@@ -2589,7 +2590,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
// NSArray *retarr = [set2 allObjects];
|
|
|
|
|
|
- NSString* whereprice=[RAUtils arr2string:arr2 separator:@"," trim:true brackets:@"'"];
|
|
|
+ NSString* whereprice=[RAConvertor arr2string:arr2 separator:@"," trim:true brackets:@"'"];
|
|
|
|
|
|
|
|
|
// sqlite3 *db = [iSalesDB get_db];
|
|
|
@@ -2751,9 +2752,9 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
NSString* whereprice=nil;
|
|
|
if(contact_id==nil)
|
|
|
- whereprice=[RAUtils arr2string:arr1 separator:@"," trim:true brackets:@"'"];
|
|
|
+ whereprice=[RAConvertor arr2string:arr1 separator:@"," trim:true brackets:@"'"];
|
|
|
else
|
|
|
- whereprice=[RAUtils arr2string:arr2 separator:@"," trim:true brackets:@"'"];
|
|
|
+ whereprice=[RAConvertor arr2string:arr2 separator:@"," trim:true brackets:@"'"];
|
|
|
|
|
|
|
|
|
// sqlite3 *db = [iSalesDB get_db];
|
|
|
@@ -3401,7 +3402,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
|
|
|
[iSalesDB close_db:db];
|
|
|
- DebugLog(@"data string: %@",[RAUtils dict2string:ret] );
|
|
|
+ DebugLog(@"data string: %@",[RAConvertor dict2string:ret] );
|
|
|
|
|
|
return ret;
|
|
|
}
|
|
|
@@ -3527,7 +3528,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
|
|
|
|
|
|
- DebugLog(@"data string: %@",[RAUtils dict2string:ret] );
|
|
|
+ DebugLog(@"data string: %@",[RAConvertor dict2string:ret] );
|
|
|
|
|
|
return ret;
|
|
|
}
|
|
|
@@ -3727,7 +3728,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
[arr_name addObject:customer_first_name];
|
|
|
[arr_name addObject:customer_last_name];
|
|
|
|
|
|
- NSString *contact_name=[RAUtils arr2string:arr_name separator:@" " trim:true];
|
|
|
+ NSString *contact_name=[RAConvertor arr2string:arr_name separator:@" " trim:true];
|
|
|
|
|
|
// default ship from
|
|
|
NSString *ship_from_default_sql = @"select contact_id,decrypt(company_name),decrypt(addr_1),first_name || ' ' || last_name,email,fax,decrypt(phone) from offline_contact where contact_id = 'NPD';";
|
|
|
@@ -4568,7 +4569,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
[iSalesDB close_db:db];
|
|
|
|
|
|
|
|
|
- DebugLog(@"data string: %@",[RAUtils dict2string:ret] );
|
|
|
+ DebugLog(@"data string: %@",[RAConvertor dict2string:ret] );
|
|
|
|
|
|
return [RAUtils dict2data:ret];
|
|
|
}
|
|
|
@@ -4797,7 +4798,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
[arr_name addObject:nsfirst_name];
|
|
|
[arr_name addObject:nslast_name];
|
|
|
|
|
|
- NSString *nscontact_name=[RAUtils arr2string:arr_name separator:@" " trim:true];
|
|
|
+ NSString *nscontact_name=[RAConvertor arr2string:arr_name separator:@" " trim:true];
|
|
|
|
|
|
|
|
|
NSMutableArray* arr_ext= [[NSMutableArray alloc] init];
|
|
|
@@ -4813,7 +4814,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
[arr_ext addObject:nszipcode];
|
|
|
[arr_ext addObject:nscountry];
|
|
|
|
|
|
- NSString *nsext=[RAUtils arr2string:arr_ext separator:@", " trim:true];
|
|
|
+ NSString *nsext=[RAConvertor arr2string:arr_ext separator:@", " trim:true];
|
|
|
|
|
|
|
|
|
nsext=[nsext stringByReplacingOccurrencesOfString:@", \r\n," withString:@"\r\n"];
|
|
|
@@ -4868,7 +4869,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
|
|
|
|
|
|
- DebugLog(@"data string: %@",[RAUtils dict2string:ret] );
|
|
|
+ DebugLog(@"data string: %@",[RAConvertor dict2string:ret] );
|
|
|
|
|
|
return ret;
|
|
|
}
|
|
|
@@ -6541,7 +6542,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
[arr_name addObject:nsfirst_name];
|
|
|
[arr_name addObject:nslast_name];
|
|
|
|
|
|
- NSString *nscontact_name=[RAUtils arr2string:arr_name separator:@" " trim:true];
|
|
|
+ NSString *nscontact_name=[RAConvertor arr2string:arr_name separator:@" " trim:true];
|
|
|
|
|
|
NSMutableArray* arr_addr = [[NSMutableArray alloc] init];
|
|
|
|
|
|
@@ -6579,7 +6580,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
[arr_addr addObject:nsfax];
|
|
|
[arr_addr addObject:nsemail];
|
|
|
|
|
|
- NSString * name = [RAUtils arr2string:arr_addr separator:@", " trim:true];
|
|
|
+ NSString * name = [RAConvertor arr2string:arr_addr separator:@", " trim:true];
|
|
|
|
|
|
name=[name stringByReplacingOccurrencesOfString:@", <br>," withString:@"<br>"];
|
|
|
|
|
|
@@ -6610,7 +6611,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
|
|
|
|
|
|
- DebugLog(@"data string: %@",[RAUtils dict2string:ret] );
|
|
|
+ DebugLog(@"data string: %@",[RAConvertor dict2string:ret] );
|
|
|
|
|
|
return ret;
|
|
|
}
|
|
|
@@ -6783,7 +6784,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
addr1 = @"";
|
|
|
}
|
|
|
DebugLog(@"addr");
|
|
|
- addr = [RAUtils arr2string:@[addr1,addr2,addr3,addr4] separator:@" " trim:true];
|
|
|
+ addr = [RAConvertor arr2string:@[addr1,addr2,addr3,addr4] separator:@" " trim:true];
|
|
|
addr = [AESCrypt fastencrypt:addr];
|
|
|
addr = [self translateSingleQuote:addr];
|
|
|
|
|
|
@@ -6836,7 +6837,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
lastName = @"";
|
|
|
}
|
|
|
|
|
|
- contact_name = [RAUtils arr2string:@[fistName,lastName] separator:@" " trim:true];
|
|
|
+ contact_name = [RAConvertor arr2string:@[fistName,lastName] separator:@" " trim:true];
|
|
|
DebugLog(@"contact_name");
|
|
|
contact_name = [self translateSingleQuote:contact_name];
|
|
|
|
|
|
@@ -6954,7 +6955,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
[sync_dic setValue:contact_id forKey:@"contact_id"];
|
|
|
// sync_data = [AESCrypt fastencrypt:[RAUtils dict2string:sync_dic]];
|
|
|
- sync_data = [RAUtils dict2string:sync_dic];
|
|
|
+ sync_data = [RAConvertor dict2string:sync_dic];
|
|
|
sync_data = [self translateSingleQuote:sync_data];
|
|
|
|
|
|
sql = [NSString stringWithFormat:@"update offline_contact set company_name = '%@',addr_1 = '%@',addr_2 = '%@',addr_3 = '%@',addr_4 = '%@',country = '%@',state = '%@',city = '%@',zipcode = '%@',first_name = '%@',last_name = '%@',phone = '%@',fax = '%@',email = '%@',notes = '%@',price_type = '%@',sales_rep = '%@',img_0 = '%@',img_1 = '%@',img_2 = '%@',sync_data = '%@',contact_name = '%@',addr = '%@',type = '%@' where contact_id = '%@';",companyName,addr1,addr2,addr3,addr4,country,state,city,zipcode,fistName,lastName,phone,fax,email,notes,price,salesRep,img_0,img_1,img_2,sync_data,contact_name,addr,contact_type,contact_id];
|
|
|
@@ -6964,7 +6965,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
[sync_dic setValue:contact_id forKey:@"contact_id"];
|
|
|
// sync_data = [AESCrypt fastencrypt:[RAUtils dict2string:sync_dic]];
|
|
|
- sync_data = [RAUtils dict2string:sync_dic];
|
|
|
+ sync_data = [RAConvertor dict2string:sync_dic];
|
|
|
sync_data = [self translateSingleQuote:sync_data];
|
|
|
|
|
|
sql = [NSString stringWithFormat:@"insert into offline_contact (is_active,company_name,addr_1,addr_2,addr_3,addr_4,country,state,city,zipcode,first_name,last_name,phone,fax,email,notes,price_type,sales_rep,img_0,img_1,img_2,editable,contact_id,Sales_Order_Customer,Sales_Order_Freight_Bill_To,Sales_Order_Ship_From,Sales_Order_Merchandise_Bill_To,Contact_Return_To,Sales_Order_Ship_To,sync_data,contact_name,addr,type) values (1,'%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@','%@',1,'%@',%d,%d,0,%d,0,1,'%@','%@','%@','%@')",companyName,addr1,addr2,addr3,addr4,country,state,city,zipcode,fistName,lastName,phone,fax,email,notes,price,salesRep,img_0,img_1,img_2,contact_id,isCustomer ? 1 : 0,isCustomer ? 1 : 0,isCustomer ? 1 : 0,sync_data,contact_name,addr,contact_type];
|
|
|
@@ -7557,7 +7558,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
[iSalesDB close_db:db];
|
|
|
|
|
|
- DebugLog(@"data string: %@",[RAUtils dict2string:ret] );
|
|
|
+ DebugLog(@"data string: %@",[RAConvertor dict2string:ret] );
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
@@ -7888,7 +7889,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
[iSalesDB close_db:db];
|
|
|
|
|
|
- DebugLog(@"data string: %@",[RAUtils dict2string:ret] );
|
|
|
+ DebugLog(@"data string: %@",[RAConvertor dict2string:ret] );
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
@@ -8104,7 +8105,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
[arr_addr addObject:customer_zipcode];
|
|
|
[arr_addr addObject:customer_country];
|
|
|
|
|
|
- NSString * customer_address = [RAUtils arr2string:arr_addr separator:@" " trim:true];
|
|
|
+ NSString * customer_address = [RAConvertor arr2string:arr_addr separator:@" " trim:true];
|
|
|
|
|
|
|
|
|
char *logist = (char*)sqlite3_column_text(statement, 11);
|
|
|
@@ -11854,7 +11855,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
if (submit) {
|
|
|
NSString *sales_rep = [iSalesDB jk_queryText:[NSString stringWithFormat:@"select sales_rep from offline_order where so_id = '%@';",so_id]];
|
|
|
[param setValue:sales_rep forKey:@"sales_rep"];
|
|
|
- NSString *sync_data = [self translateSingleQuote:[RAUtils dict2string:param]];
|
|
|
+ NSString *sync_data = [self translateSingleQuote:[RAConvertor dict2string:param]];
|
|
|
sync_sql = [NSString stringWithFormat:@",sync_data = '%@' ",sync_data];
|
|
|
}
|
|
|
|
|
|
@@ -12380,7 +12381,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
return [RAUtils dict2data:resultDictionary];
|
|
|
}
|
|
|
|
|
|
- NSString *model_info = [RAUtils dict2string:dic];
|
|
|
+ NSString *model_info = [RAConvertor dict2string:dic];
|
|
|
|
|
|
|
|
|
|
|
|
@@ -12427,7 +12428,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
|
|
|
// 保存信息
|
|
|
// [params setObject:[params objectForKey:@"product_ids"] forKey:@"productIds"];
|
|
|
- NSString *off_params = [RAUtils dict2string:params];
|
|
|
+ NSString *off_params = [RAConvertor dict2string:params];
|
|
|
|
|
|
|
|
|
// configureParams = [configureParams stringByAppendingFormat:@"productIds=%@",product_ids_string];
|
|
|
@@ -12993,7 +12994,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
|
|
|
[item setObject:uuid forKey:@"pdf_token"];
|
|
|
[item setObject:[NSNumber numberWithInt:is_delete] forKey:@"is_delete"];
|
|
|
|
|
|
- NSDictionary *off_Params_dic = [RAUtils string2dict:off_params];
|
|
|
+ NSDictionary *off_Params_dic = [RAConvertor string2dict:off_params];
|
|
|
[item setObject:[off_Params_dic objectForKey:@"product_ids"] forKey:@"product_ids"];
|
|
|
|
|
|
if (!is_local && !is_delete) { // 已经同步过的,并且没被删除,就不需要上传。
|