|
|
@@ -568,9 +568,9 @@
|
|
|
//select url,type from model_image where product_id=%d and type=1 order by default_img desc , _id asc limit 1;",product_id
|
|
|
|
|
|
if(product_id==nil)
|
|
|
- sqlQuery = [NSString stringWithFormat:@"select i.url from model m LEFT join model_image i on m.product_id = i.product_id where m.name=%@ order by i.default_img desc, i._id asc limit 1;",model_name];
|
|
|
+ sqlQuery = [NSString stringWithFormat:@"select i.url from product m LEFT join model_image i on m.product_id = i.product_id where m.name=%@ order by i.default_img desc, i._id asc limit 1;",model_name];// select i.url from model m LEFT join model_image i on m.product_id = i.product_id where m.name=%@ order by i.default_img desc, i._id asc limit 1;
|
|
|
else
|
|
|
- sqlQuery = [NSString stringWithFormat:@"select i.url from model m LEFT join model_image i on m.product_id = i.product_id where m.product_id=%@ order by i.default_img desc, i._id asc limit 1;",product_id];
|
|
|
+ sqlQuery = [NSString stringWithFormat:@"select i.url from product m LEFT join model_image i on m.product_id = i.product_id where m.product_id=%@ order by i.default_img desc, i._id asc limit 1;",product_id];// select i.url from model m LEFT join model_image i on m.product_id = i.product_id where m.product_id=%@ order by i.default_img desc, i._id asc limit 1;
|
|
|
|
|
|
sqlite3_stmt * statement;
|
|
|
|
|
|
@@ -622,9 +622,9 @@
|
|
|
NSString *sqlQuery = nil;
|
|
|
|
|
|
if(product_id==nil)
|
|
|
- sqlQuery = [NSString stringWithFormat:@"select default_category from model where name='%@';",model_name];
|
|
|
+ sqlQuery = [NSString stringWithFormat:@"select default_category from product where name='%@';",model_name];// select default_category from model where name='%@';
|
|
|
else
|
|
|
- sqlQuery = [NSString stringWithFormat:@"select default_category from model where product_id=%@;",product_id];
|
|
|
+ sqlQuery = [NSString stringWithFormat:@"select default_category from product where product_id=%@;",product_id]; // select default_category from model where product_id=%@;
|
|
|
|
|
|
sqlite3_stmt * statement;
|
|
|
|
|
|
@@ -697,9 +697,9 @@
|
|
|
NSString *sqlQuery = nil;
|
|
|
|
|
|
if(product_id==nil)
|
|
|
- sqlQuery = [NSString stringWithFormat:@"select name,description,product_id,color,legcolor,availability,incoming_stock,demension,seat_height,material,box_dim,volume,weight,model_set,load_ability,default_category,fabric_content,assembling,made_in,special_remarks,stockUom,product_group,selector_field,property_field,packaging from model where name='%@';",model_name];
|
|
|
+ sqlQuery = [NSString stringWithFormat:@"select name,description,product_id,color,legcolor,availability,incoming_stock,demension,seat_height,material,box_dim,volume,weight,model_set,load_ability,default_category,fabric_content,assembling,made_in,special_remarks,stockUom,product_group,selector_field,property_field,packaging from product where name='%@';",model_name]; // select name,description,product_id,color,legcolor,availability,incoming_stock,demension,seat_height,material,box_dim,volume,weight,model_set,load_ability,default_category,fabric_content,assembling,made_in,special_remarks,stockUom,product_group,selector_field,property_field,packaging from model where name='%@';
|
|
|
else
|
|
|
- sqlQuery = [NSString stringWithFormat:@"select name,description,product_id,color,legcolor,availability,incoming_stock,demension,seat_height,material,box_dim,volume,weight,model_set,load_ability,default_category,fabric_content,assembling,made_in,special_remarks,stockUom,product_group,selector_field,property_field,packaging from model where product_id=%@;",product_id];
|
|
|
+ sqlQuery = [NSString stringWithFormat:@"select name,description,product_id,color,legcolor,availability,incoming_stock,demension,seat_height,material,box_dim,volume,weight,model_set,load_ability,default_category,fabric_content,assembling,made_in,special_remarks,stockUom,product_group,selector_field,property_field,packaging from product where product_id=%@;",product_id]; // select name,description,product_id,color,legcolor,availability,incoming_stock,demension,seat_height,material,box_dim,volume,weight,model_set,load_ability,default_category,fabric_content,assembling,made_in,special_remarks,stockUom,product_group,selector_field,property_field,packaging from model where product_id=%@;
|
|
|
|
|
|
sqlite3_stmt * statement;
|
|
|
[ret setValue:@"2" forKey:@"result"];
|
|
|
@@ -998,9 +998,9 @@
|
|
|
|
|
|
NSString *sqlQuery = nil;
|
|
|
if(exactMatch )
|
|
|
- sqlQuery=[NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout from model m left join wishlist w on m.product_id=w.product_id where lower(name) like'%@%%' order by m.name limit %d offset %d ;",keyword,limit, offset];
|
|
|
+ sqlQuery=[NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout from product m left join wishlist w on m.product_id=w.product_id where lower(name) like'%@%%' order by m.name limit %d offset %d ;",keyword,limit, offset]; // select m.name,m.description,m.product_id,w._id,m.closeout from model m left join wishlist w on m.product_id=w.product_id where lower(name) like'%@%%' order by m.name limit %d offset %d ;
|
|
|
else
|
|
|
- sqlQuery=[NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout from model m left join wishlist w on m.product_id=w.product_id where lower(name) like'%%%@%%' or lower(description) like'%%%@%%' order by m.name limit %d offset %d ;",keyword,keyword,limit, offset];
|
|
|
+ sqlQuery=[NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout from product m left join wishlist w on m.product_id=w.product_id where lower(name) like'%%%@%%' or lower(description) like'%%%@%%' order by m.name limit %d offset %d ;",keyword,keyword,limit, offset];// select m.name,m.description,m.product_id,w._id,m.closeout from model m left join wishlist w on m.product_id=w.product_id where lower(name) like'%%%@%%' or lower(description) like'%%%@%%' order by m.name limit %d offset %d ;
|
|
|
|
|
|
DebugLog(@"offline_search sql:%@",sqlQuery);
|
|
|
sqlite3_stmt * statement;
|
|
|
@@ -2094,7 +2094,7 @@
|
|
|
// int count = [iSalesDB get_recordcount:db table:@"model" where:[NSString stringWithFormat:@"category like'#%%%@%%#'",category]];
|
|
|
|
|
|
|
|
|
- NSString *sqlQuery = [NSString stringWithFormat:@"select m.name,m.product_id,i.url,random() as aa from model m LEFT join model_image i on m.product_id = i.product_id where m.category like'%%#%@#%%' and m.category like'%%#005#%%' and i.default_img = %d order by aa limit 10 ;",category,OFFLINE_IMG_TYPE_CATEGORY];
|
|
|
+ NSString *sqlQuery = [NSString stringWithFormat:@"select m.name,m.product_id,i.url,random() as aa from product m LEFT join model_image i on m.product_id = i.product_id where m.category like'%%#%@#%%' and m.category like'%%#005#%%' and i.default_img = %d order by aa limit 10 ;",category,OFFLINE_IMG_TYPE_CATEGORY]; // select m.name,m.product_id,i.url,random() as aa from model m LEFT join model_image i on m.product_id = i.product_id where m.category like'%%#%@#%%' and m.category like'%%#005#%%' and i.default_img = %d order by aa limit 10 ;
|
|
|
sqlite3_stmt * statement;
|
|
|
int count = 0;
|
|
|
[ret setValue:[NSString stringWithFormat:@"%d",count] forKey:@"count"];
|
|
|
@@ -2167,7 +2167,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
- NSString *sqlQuery = [NSString stringWithFormat:@"select %@,property_display from model where product_id=%d ;",field,product_id];
|
|
|
+ NSString *sqlQuery = [NSString stringWithFormat:@"select %@,property_display from product where product_id=%d ;",field,product_id]; // select %@,property_display from model where product_id=%d ;
|
|
|
sqlite3_stmt * statement;
|
|
|
|
|
|
|
|
|
@@ -2224,7 +2224,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
- NSString *sqlQuery = [NSString stringWithFormat:@"select %@,selector_display,product_id,category from model where product_group='%@' order by name;",field,product_group];
|
|
|
+ NSString *sqlQuery = [NSString stringWithFormat:@"select %@,selector_display,product_id,category from product where product_group='%@' order by name;",field,product_group]; // select %@,selector_display,product_id,category from model where product_group='%@' order by name;
|
|
|
sqlite3_stmt * statement;
|
|
|
|
|
|
|
|
|
@@ -2378,7 +2378,7 @@
|
|
|
{
|
|
|
// get default sold qty, return -1 if model not found;
|
|
|
int ret = -1;
|
|
|
- NSString *sqlQuery = [NSString stringWithFormat:@"select stockUom from model where product_id=%d;",product_id];
|
|
|
+ NSString *sqlQuery = [NSString stringWithFormat:@"select stockUom from product where product_id=%d;",product_id];// select stockUom from model where product_id=%d;
|
|
|
sqlite3_stmt * statement;
|
|
|
|
|
|
|
|
|
@@ -3880,7 +3880,7 @@
|
|
|
NSString *where = [NSString stringWithFormat:@"category like'%%#%@#%%'",category];
|
|
|
|
|
|
|
|
|
- NSString *sqlQuery = [NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout from model m left join wishlist w on m.product_id=w.product_id where m.category like'%%#%@#%%' order by m.name limit %d offset %d ;",category,limit, offset];
|
|
|
+ NSString *sqlQuery = [NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout from product m left join wishlist w on m.product_id=w.product_id where m.category like'%%#%@#%%' order by m.name limit %d offset %d ;",category,limit, offset];
|
|
|
|
|
|
// {
|
|
|
// alert = SP;
|
|
|
@@ -3981,7 +3981,7 @@
|
|
|
|
|
|
// where bestseller > 0 order by bestseller desc
|
|
|
// sql query: alert availability(int) best_seller(int) price qty
|
|
|
- sqlQuery = [NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout from (select name,description,product_id,closeout,best_seller from model where %@ %@ %@ %@ %@ %@) m left join wishlist w on m.product_id=w.product_id order by %@ limit %d offset %d;",cateWhere,best_seller,alert,available_condition,qty,price,order_best_seller,limit,offset];
|
|
|
+ sqlQuery = [NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout from (select name,description,product_id,closeout,best_seller from product where %@ %@ %@ %@ %@ %@) m left join wishlist w on m.product_id=w.product_id order by %@ limit %d offset %d;",cateWhere,best_seller,alert,available_condition,qty,price,order_best_seller,limit,offset];
|
|
|
|
|
|
where =[NSString stringWithFormat:@"%@ %@ %@ %@ %@ %@",cateWhere,best_seller,alert,available_condition,qty,price];
|
|
|
|
|
|
@@ -4128,7 +4128,7 @@
|
|
|
int count;
|
|
|
|
|
|
NSString *sqlQuery = nil;
|
|
|
- sqlQuery=[NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout from model m left join wishlist w on m.product_id=w.product_id where %@ order by %@ limit %d offset %d ;",where,orderby,limit, offset];
|
|
|
+ sqlQuery=[NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout from product m left join wishlist w on m.product_id=w.product_id where %@ order by %@ limit %d offset %d ;",where,orderby,limit, offset];
|
|
|
|
|
|
double price_min = 0;
|
|
|
double price_max = 0;
|
|
|
@@ -4268,7 +4268,7 @@
|
|
|
|
|
|
// where bestseller > 0 order by bestseller desc
|
|
|
// sql query: alert availability(int) best_seller(int) price qty
|
|
|
- sqlQuery = [NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout from (select name,description,product_id,closeout,best_seller from model where %@ %@ %@ %@ %@ %@) m left join wishlist w on m.product_id=w.product_id order by %@ limit %d offset %d;",cateWhere,best_seller,alert,available_condition,qty,price,order_best_seller,limit,offset];
|
|
|
+ sqlQuery = [NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout from (select name,description,product_id,closeout,best_seller from product where %@ %@ %@ %@ %@ %@) m left join wishlist w on m.product_id=w.product_id order by %@ limit %d offset %d;",cateWhere,best_seller,alert,available_condition,qty,price,order_best_seller,limit,offset];
|
|
|
|
|
|
// count
|
|
|
where =[NSString stringWithFormat:@"%@ %@ %@ %@ %@ %@",cateWhere,best_seller,alert,available_condition,qty,price];
|
|
|
@@ -4412,7 +4412,9 @@
|
|
|
NSMutableDictionary* ret = [self dictionaryFileName:@"orderDetail.json"];
|
|
|
|
|
|
// decrypt card number and card security code
|
|
|
- NSString* sql=[NSString stringWithFormat:@"select o._id,o.so_id,o.poNumber,o.create_time,o.status,o.TotalCuft,o.TotalWeight,o.TotalCarton,decrypt(c.company_name),o.customer_contact,decrypt(c.addr_1),c.addr_2,c.addr_3,c.addr_4,o.logist,o.shipping,o.lift_gate_value,o.general_notes,o.internal_notes,o.paymentType,o.lift_gate,o.receive_name,o.receive_contact,o.receive_ext,o.sender_name,o.sender_contact,o.sender_ext,o.shipping_billto_name,o.shipping_billto_contact,o.shipping_billto_ext,o.billing_name,o.billing_contact,o.billing_ext,o.returnto_name,o.returnto_contact,o.returnto_ext,o.handling_fee_value,o.paymentsAndCredits,o.total_price,o.customer_cid,o.credit_card_first_name,o.credit_card_last_name,o.credit_card_address1,o.credit_card_address2,o.credit_card_zipcode,o.credit_card_type,decrypt(o.credit_card_number),decrypt(o.credit_card_security_code),o.credit_card_expiration,o.credit_card_city,o.credit_card_state,o.shipNull,o.erpOrderStatus from (select _id,so_id,poNumber,create_time,status,TotalCuft,TotalWeight,TotalCarton,customer_cid,customer_contact,logist,shipping,lift_gate_value,general_notes,internal_notes,paymentType,lift_gate,receive_name,receive_contact,receive_ext,sender_name,sender_contact,sender_ext,shipping_billto_name,shipping_billto_contact,shipping_billto_ext,billing_name,billing_contact,billing_ext,returnto_name,returnto_contact,returnto_ext,handling_fee_value,paymentsAndCredits,total_price,customer_cid,credit_card_first_name,credit_card_last_name,credit_card_address1,credit_card_address2,credit_card_zipcode,credit_card_type,credit_card_number,credit_card_security_code,credit_card_expiration,credit_card_city,credit_card_state,ifnull(shipping,'ship_null') as shipNull,erpOrderStatus from offline_order where _id=%d) o left join offline_contact c on o.customer_cid=c.contact_id",orderId ];
|
|
|
+// NSString* sql=[NSString stringWithFormat:@"select o._id,o.so_id,o.poNumber,o.create_time,o.status,o.TotalCuft,o.TotalWeight,o.TotalCarton,decrypt(c.company_name),o.customer_contact,decrypt(c.addr_1),c.addr_2,c.addr_3,c.addr_4,o.logist,o.shipping,o.lift_gate_value,o.general_notes,o.internal_notes,o.paymentType,o.lift_gate,o.receive_name,o.receive_contact,o.receive_ext,o.sender_name,o.sender_contact,o.sender_ext,o.shipping_billto_name,o.shipping_billto_contact,o.shipping_billto_ext,o.billing_name,o.billing_contact,o.billing_ext,o.returnto_name,o.returnto_contact,o.returnto_ext,o.handling_fee_value,o.paymentsAndCredits,o.total_price,o.customer_cid,o.credit_card_first_name,o.credit_card_last_name,o.credit_card_address1,o.credit_card_address2,o.credit_card_zipcode,o.credit_card_type,decrypt(o.credit_card_number),decrypt(o.credit_card_security_code),o.credit_card_expiration,o.credit_card_city,o.credit_card_state,o.shipNull,o.erpOrderStatus from (select _id,so_id,poNumber,create_time,status,TotalCuft,TotalWeight,TotalCarton,customer_cid,customer_contact,logist,shipping,lift_gate_value,general_notes,internal_notes,paymentType,lift_gate,receive_name,receive_contact,receive_ext,sender_name,sender_contact,sender_ext,shipping_billto_name,shipping_billto_contact,shipping_billto_ext,billing_name,billing_contact,billing_ext,returnto_name,returnto_contact,returnto_ext,handling_fee_value,paymentsAndCredits,total_price,customer_cid,credit_card_first_name,credit_card_last_name,credit_card_address1,credit_card_address2,credit_card_zipcode,credit_card_type,credit_card_number,credit_card_security_code,credit_card_expiration,credit_card_city,credit_card_state,ifnull(shipping,'ship_null') as shipNull,erpOrderStatus from offline_order where _id=%d) o left join offline_contact c on o.customer_cid=c.contact_id",orderId ];
|
|
|
+
|
|
|
+ NSString *sql = [NSString stringWithFormat:@"select o._id,o.so_id,o.poNumber,o.create_time,o.status,decrypt(c.company_name),o.customer_contact,decrypt(c.addr_1),c.addr_2,c.addr_3,c.addr_4,o.logist,o.shipping,o.lift_gate_value,o.general_notes,o.internal_notes,o.paymentType,o.lift_gate,o.receive_name,o.receive_contact,o.receive_ext,o.sender_name,o.sender_contact,o.sender_ext,o.shipping_billto_name,o.shipping_billto_contact,o.shipping_billto_ext,o.billing_name,o.billing_contact,o.billing_ext,o.returnto_name,o.returnto_contact,o.returnto_ext,o.handling_fee_value,o.paymentsAndCredits,o.total_price,o.customer_cid,o.credit_card_first_name,o.credit_card_last_name,o.credit_card_address1,o.credit_card_address2,o.credit_card_zipcode,o.credit_card_type,decrypt(o.credit_card_number),decrypt(o.credit_card_security_code),decrypt(o.credit_card_expiration_month),o.credit_card_city,o.credit_card_state,o.shipNull,o.erpOrderStatus,decrypt(o.credit_card_expiration_year) from (select _id,so_id,poNumber,create_time,status,customer_cid,customer_contact,logist,shipping,lift_gate_value,general_notes,internal_notes,paymentType,lift_gate,receive_name,receive_contact,receive_ext,sender_name,sender_contact,sender_ext,shipping_billto_name,shipping_billto_contact,shipping_billto_ext,billing_name,billing_contact,billing_ext,returnto_name,returnto_contact,returnto_ext,handling_fee_value,paymentsAndCredits,total_price,customer_cid,credit_card_first_name,credit_card_last_name,credit_card_address1,credit_card_address2,credit_card_zipcode,credit_card_type,credit_card_number,credit_card_security_code,credit_card_expiration_month,credit_card_city,credit_card_state,ifnull(shipping,'ship_null') as shipNull,erpOrderStatus,credit_card_expiration_year from offline_order where _id=%d) o left join offline_contact c on o.customer_cid=c.contact_id",orderId];
|
|
|
|
|
|
sqlite3 *db = [iSalesDB get_db];
|
|
|
sqlite3_stmt * statement;
|
|
|
@@ -4456,7 +4458,7 @@
|
|
|
nscreate_time = [[self changeDateTimeFormate:nscreate_time] stringByAppendingString:@" PST"];// 与在线统一
|
|
|
|
|
|
int status = sqlite3_column_int(statement, 4);
|
|
|
- int erpStatus = sqlite3_column_int(statement, 52);;
|
|
|
+ int erpStatus = sqlite3_column_int(statement, 49);
|
|
|
NSString* nsstatus = [self orderStatus:status erpStatus:erpStatus];
|
|
|
|
|
|
// status
|
|
|
@@ -4468,42 +4470,44 @@
|
|
|
ret[@"orderStatus"] = [NSNumber numberWithInteger:status];
|
|
|
ret[@"order_status"] = nsstatus;
|
|
|
|
|
|
- double TotalCuft = sqlite3_column_double(statement, 5);
|
|
|
- double TotalWeight = sqlite3_column_double(statement, 6);
|
|
|
- double TotalCarton = sqlite3_column_double(statement, 7);
|
|
|
-
|
|
|
+// double TotalCuft = sqlite3_column_double(statement, 5);
|
|
|
+// double TotalWeight = sqlite3_column_double(statement, 6);
|
|
|
+// double TotalCarton = sqlite3_column_double(statement, 7);
|
|
|
+ double TotalCuft;
|
|
|
+ double TotalWeight;
|
|
|
+ double TotalCarton;
|
|
|
|
|
|
- char *company_name = (char*)sqlite3_column_text(statement, 8);
|
|
|
+ char *company_name = (char*)sqlite3_column_text(statement, 5);
|
|
|
if(company_name==nil)
|
|
|
company_name= "";
|
|
|
NSString *nscompany_name= [[NSString alloc]initWithUTF8String:company_name];
|
|
|
// company name
|
|
|
ret[@"company_name"] = nscompany_name;
|
|
|
|
|
|
- char *customer_contact = (char*)sqlite3_column_text(statement, 9);
|
|
|
+ char *customer_contact = (char*)sqlite3_column_text(statement, 6);
|
|
|
if(customer_contact==nil)
|
|
|
customer_contact= "";
|
|
|
NSString *nscustomer_contact= [[NSString alloc]initWithUTF8String:customer_contact];
|
|
|
|
|
|
|
|
|
- char *addr_1 = (char*)sqlite3_column_text(statement, 10);
|
|
|
+ char *addr_1 = (char*)sqlite3_column_text(statement, 7);
|
|
|
if(addr_1==nil)
|
|
|
addr_1="";
|
|
|
NSString *nsaddr_1= [[NSString alloc]initWithUTF8String:addr_1];
|
|
|
|
|
|
- char *addr_2 = (char*)sqlite3_column_text(statement, 11);
|
|
|
+ char *addr_2 = (char*)sqlite3_column_text(statement, 8);
|
|
|
if(addr_2==nil)
|
|
|
addr_2="";
|
|
|
NSString *nsaddr_2= [[NSString alloc]initWithUTF8String:addr_2];
|
|
|
|
|
|
|
|
|
- char *addr_3 = (char*)sqlite3_column_text(statement, 12);
|
|
|
+ char *addr_3 = (char*)sqlite3_column_text(statement, 9);
|
|
|
if(addr_3==nil)
|
|
|
addr_3="";
|
|
|
NSString *nsaddr_3= [[NSString alloc]initWithUTF8String:addr_3];
|
|
|
|
|
|
|
|
|
- char *addr_4 = (char*)sqlite3_column_text(statement, 13);
|
|
|
+ char *addr_4 = (char*)sqlite3_column_text(statement, 10);
|
|
|
if(addr_4==nil)
|
|
|
addr_4="";
|
|
|
NSString *nsaddr_4= [[NSString alloc]initWithUTF8String:addr_4];
|
|
|
@@ -4516,39 +4520,39 @@
|
|
|
NSString * customer_address = [RAUtils arr2string:arr_addr separator:@"<br>" trim:true];
|
|
|
|
|
|
|
|
|
- char *logist = (char*)sqlite3_column_text(statement, 14);
|
|
|
+ char *logist = (char*)sqlite3_column_text(statement, 11);
|
|
|
if(logist==nil)
|
|
|
logist= "";
|
|
|
NSString *nslogist=[[NSString alloc]initWithUTF8String:logist];
|
|
|
|
|
|
- NSString *shipping = [NSString stringWithFormat:@"$%.2f",sqlite3_column_double(statement, 15)];
|
|
|
- if ([[self textAtColumn:51 statement:statement] isEqualToString:@"ship_null"]) {
|
|
|
+ NSString *shipping = [NSString stringWithFormat:@"$%.2f",sqlite3_column_double(statement, 12)];
|
|
|
+ if ([[self textAtColumn:48 statement:statement] isEqualToString:@"ship_null"]) {
|
|
|
shipping = @"Shipping To Be Quoted";
|
|
|
}
|
|
|
|
|
|
// Shipping
|
|
|
ret[@"Shipping"] = shipping;
|
|
|
|
|
|
- double lift_gate = sqlite3_column_double(statement, 16);
|
|
|
+ double lift_gate = sqlite3_column_double(statement, 13);
|
|
|
// Liftgate Fee(No loading dock)
|
|
|
ret[@"Liftgate Fee(No loading dock)"] = [NSString stringWithFormat:@"$%.2f",lift_gate];
|
|
|
|
|
|
- char *general_notes = (char*)sqlite3_column_text(statement, 17);
|
|
|
+ char *general_notes = (char*)sqlite3_column_text(statement, 14);
|
|
|
if(general_notes==nil)
|
|
|
general_notes= "";
|
|
|
NSString *nsgeneral_notes=[[NSString alloc]initWithUTF8String:general_notes];
|
|
|
|
|
|
- char *internal_notes = (char*)sqlite3_column_text(statement, 18);
|
|
|
+ char *internal_notes = (char*)sqlite3_column_text(statement, 15);
|
|
|
if(internal_notes==nil)
|
|
|
internal_notes= "";
|
|
|
NSString *nsinternal_notes=[[NSString alloc]initWithUTF8String:internal_notes];
|
|
|
|
|
|
- char *payment_type = (char*)sqlite3_column_text(statement, 19);
|
|
|
+ char *payment_type = (char*)sqlite3_column_text(statement, 16);
|
|
|
if(payment_type==nil)
|
|
|
payment_type= "";
|
|
|
NSString *nspayment_type=[[NSString alloc]initWithUTF8String:payment_type];
|
|
|
|
|
|
- int have_lift_gate = sqlite3_column_int(statement, 20);
|
|
|
+ int have_lift_gate = sqlite3_column_int(statement, 17);
|
|
|
|
|
|
// order info
|
|
|
NSString* orderinfo = [self textFileName:@"order_info.html"];
|
|
|
@@ -4575,16 +4579,16 @@
|
|
|
{
|
|
|
payment = [self textFileName:@"creditcardpayment.html"];
|
|
|
|
|
|
- NSString *card_first_name = [self textAtColumn:40 statement:statement];
|
|
|
- NSString *card_last_name = [self textAtColumn:41 statement:statement];
|
|
|
- NSString *card_addr1 = [self textAtColumn:42 statement:statement];
|
|
|
- NSString *card_addr2 = [self textAtColumn:43 statement:statement];
|
|
|
- NSString *card_zipcode = [self textAtColumn:44 statement:statement];
|
|
|
- NSString *card_type = [self textAtColumn:45 statement:statement];
|
|
|
+ NSString *card_first_name = [self textAtColumn:37 statement:statement];
|
|
|
+ NSString *card_last_name = [self textAtColumn:38 statement:statement];
|
|
|
+ NSString *card_addr1 = [self textAtColumn:39 statement:statement];
|
|
|
+ NSString *card_addr2 = [self textAtColumn:40 statement:statement];
|
|
|
+ NSString *card_zipcode = [self textAtColumn:41 statement:statement];
|
|
|
+ NSString *card_type = [self textAtColumn:42 statement:statement];
|
|
|
if (card_type.length > 0) { // 显示星号
|
|
|
card_type = @"****";
|
|
|
}
|
|
|
- NSString *card_number = [self textAtColumn:46 statement:statement]; // 只显示最后四位
|
|
|
+ NSString *card_number = [self textAtColumn:43 statement:statement]; // 只显示最后四位
|
|
|
if (card_number.length > 0 && card_number.length > 4) {
|
|
|
for (int i = 0; i < card_number.length - 4; i++) {
|
|
|
card_number = [card_number stringByReplacingCharactersInRange:NSMakeRange(i, 1) withString:@"*"];
|
|
|
@@ -4592,13 +4596,17 @@
|
|
|
} else {
|
|
|
card_number = @"";
|
|
|
}
|
|
|
- NSString *card_security_code = [self textAtColumn:47 statement:statement];
|
|
|
- NSString *card_expiration = [self textAtColumn:48 statement:statement];
|
|
|
- if (card_expiration.length > 0) { // 显示星号
|
|
|
+ NSString *card_security_code = [self textAtColumn:44 statement:statement];
|
|
|
+ NSString *card_expiration_month = [self textAtColumn:45 statement:statement];
|
|
|
+ NSString *card_expiration_year = [self textAtColumn:50 statement:statement];
|
|
|
+ NSString *card_expiration = [NSString stringWithFormat:@"%@/%@",card_expiration_month,card_expiration_year];
|
|
|
+ if (card_expiration_month.length && card_expiration_year.length) { // 显示星号
|
|
|
card_expiration = @"****";
|
|
|
}
|
|
|
- NSString *card_city = [self textAtColumn:49 statement:statement];
|
|
|
- NSString *card_state = [self textAtColumn:50 statement:statement];
|
|
|
+
|
|
|
+
|
|
|
+ NSString *card_city = [self textAtColumn:46 statement:statement];
|
|
|
+ NSString *card_state = [self textAtColumn:47 statement:statement];
|
|
|
|
|
|
payment = [self replaceHtml:payment String:@"CardNumber_or_nbsp" withString:card_number];
|
|
|
payment = [self replaceHtml:payment String:@"CardType_or_nbsp" withString:card_type];
|
|
|
@@ -4627,66 +4635,66 @@
|
|
|
|
|
|
/*****ship to******/
|
|
|
// ShipToCompany_or_ 
|
|
|
- NSString *shipToCompany = [self textAtColumn:21 statement:statement];
|
|
|
+ NSString *shipToCompany = [self textAtColumn:18 statement:statement];
|
|
|
moreInfo = [self replaceHtml:moreInfo String:@"ShipToCompany_or_" withString:shipToCompany];
|
|
|
- NSString *shipToName = [self textAtColumn:22 statement:statement];
|
|
|
+ NSString *shipToName = [self textAtColumn:19 statement:statement];
|
|
|
moreInfo = [self replaceHtml:moreInfo String:@"ShipToName_or_" withString:shipToName];
|
|
|
- NSString *shipToAddr = [self textAtColumn:23 statement:statement];
|
|
|
+ NSString *shipToAddr = [self textAtColumn:20 statement:statement];
|
|
|
moreInfo = [self replaceHtml:moreInfo String:@"ShipToAddress_or_" withString:shipToAddr];
|
|
|
|
|
|
/*****ship from******/
|
|
|
// ShipFromCompany_or_ 
|
|
|
- NSString *shipFromCompany = [self textAtColumn:24 statement:statement];
|
|
|
+ NSString *shipFromCompany = [self textAtColumn:21 statement:statement];
|
|
|
moreInfo = [self replaceHtml:moreInfo String:@"ShipFromCompany_or_" withString:shipFromCompany];
|
|
|
- NSString *shipFromName = [self textAtColumn:25 statement:statement];
|
|
|
+ NSString *shipFromName = [self textAtColumn:22 statement:statement];
|
|
|
moreInfo = [self replaceHtml:moreInfo String:@"ShipFromName_or_" withString:shipFromName];
|
|
|
- NSString *shipFromAddr = [self textAtColumn:26 statement:statement];
|
|
|
+ NSString *shipFromAddr = [self textAtColumn:23 statement:statement];
|
|
|
moreInfo = [self replaceHtml:moreInfo String:@"ShipFromAddress_or_" withString:shipFromAddr];
|
|
|
|
|
|
/*****freight to******/
|
|
|
// FreightBillToCompany_or_ 
|
|
|
- NSString *freightBillToCompany = [self textAtColumn:27 statement:statement];
|
|
|
+ NSString *freightBillToCompany = [self textAtColumn:24 statement:statement];
|
|
|
moreInfo = [self replaceHtml:moreInfo String:@"FreightBillToCompany_or_" withString:freightBillToCompany];
|
|
|
- NSString *freightBillToName = [self textAtColumn:28 statement:statement];
|
|
|
+ NSString *freightBillToName = [self textAtColumn:25 statement:statement];
|
|
|
moreInfo = [self replaceHtml:moreInfo String:@"FreightBillToName_or_" withString:freightBillToName];
|
|
|
- NSString *freightBillToAddr = [self textAtColumn:29 statement:statement];
|
|
|
+ NSString *freightBillToAddr = [self textAtColumn:26 statement:statement];
|
|
|
moreInfo = [self replaceHtml:moreInfo String:@"FreightBillToAddress_or_" withString:freightBillToAddr];
|
|
|
|
|
|
/*****merchandise to******/
|
|
|
// MerchandiseBillToCompany_or_ 
|
|
|
- NSString *merchandiseBillToCompany = [self textAtColumn:30 statement:statement];
|
|
|
+ NSString *merchandiseBillToCompany = [self textAtColumn:27 statement:statement];
|
|
|
moreInfo = [self replaceHtml:moreInfo String:@"MerchandiseBillToCompany_or_" withString:merchandiseBillToCompany];
|
|
|
- NSString *merchandiseBillToName = [self textAtColumn:31 statement:statement];
|
|
|
+ NSString *merchandiseBillToName = [self textAtColumn:28 statement:statement];
|
|
|
moreInfo = [self replaceHtml:moreInfo String:@"MerchandiseBillToName_or_" withString:merchandiseBillToName];
|
|
|
- NSString *merchandiseBillToAddr = [self textAtColumn:32 statement:statement];
|
|
|
+ NSString *merchandiseBillToAddr = [self textAtColumn:29 statement:statement];
|
|
|
moreInfo = [self replaceHtml:moreInfo String:@"MerchandiseBillToAddress_or_" withString:merchandiseBillToAddr];
|
|
|
|
|
|
/*****return to******/
|
|
|
// ReturnToCompany_or_ 
|
|
|
- NSString *returnToCompany = [self textAtColumn:33 statement:statement];
|
|
|
+ NSString *returnToCompany = [self textAtColumn:30 statement:statement];
|
|
|
moreInfo = [self replaceHtml:moreInfo String:@"ReturnToCompany_or_" withString:returnToCompany];
|
|
|
- NSString *returnToName = [self textAtColumn:34 statement:statement];
|
|
|
+ NSString *returnToName = [self textAtColumn:31 statement:statement];
|
|
|
moreInfo = [self replaceHtml:moreInfo String:@"ReturnToName_or_" withString:returnToName];
|
|
|
- NSString *returnToAddr = [self textAtColumn:35 statement:statement];
|
|
|
+ NSString *returnToAddr = [self textAtColumn:32 statement:statement];
|
|
|
moreInfo = [self replaceHtml:moreInfo String:@"ReturnToAddress_or_" withString:returnToAddr];
|
|
|
//
|
|
|
ret[@"more_order_info"] = moreInfo;
|
|
|
DebugLog(@"more info : %@",moreInfo);
|
|
|
|
|
|
// handling fee
|
|
|
- double handlingFee = sqlite3_column_double(statement, 36);
|
|
|
+ double handlingFee = sqlite3_column_double(statement, 33);
|
|
|
ret[@"Handling Fee"] = [NSString stringWithFormat:@"$%.2f",handlingFee];
|
|
|
|
|
|
// payments/Credits
|
|
|
- double payments_and_credist = sqlite3_column_double(statement, 37);
|
|
|
+ double payments_and_credist = sqlite3_column_double(statement, 34);
|
|
|
ret[@"Payments/Credits"] = [NSString stringWithFormat:@"$%.2f",payments_and_credist];
|
|
|
|
|
|
// total
|
|
|
- double totalPrice = sqlite3_column_double(statement, 38);
|
|
|
+ double totalPrice = sqlite3_column_double(statement, 35);
|
|
|
ret[@"Total"] = [NSString stringWithFormat:@"$%.2f",totalPrice];
|
|
|
|
|
|
// customer info
|
|
|
- customerID = [self textAtColumn:39 statement:statement];
|
|
|
+ customerID = [self textAtColumn:36 statement:statement];
|
|
|
|
|
|
|
|
|
// mode
|