Просмотр исходного кода

增加order_info.html文件,基本完成offline_oderDetail以及offline_orderlist

Pen Li 9 лет назад
Родитель
Сommit
cbd140fff1

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


+ 320 - 214
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -1268,152 +1268,6 @@
     return [RAUtils dict2data:ret];
     return [RAUtils dict2data:ret];
     
     
 }
 }
-+(NSData*) offline_orderlist :(NSMutableDictionary *) params
-{
-    NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
-    
-    
-    int limit = [[params valueForKey:@"limit"] intValue];
-    int offset = [[params valueForKey:@"offset"] intValue];
-    NSString* keyword = [params valueForKey:@"keyWord"];
-    
-    NSString* where=@"1=1";
-    if(keyword.length>0)
-        where=[NSString stringWithFormat:@"lower(o.order_id) like '%%%@%%' or lower(c.company_name) like '%%%@%%' or lower(c.company_name) like '%%%@%%' or lower(o.create_by) like '%%%@%%'",keyword.lowercaseString,keyword.lowercaseString,keyword.lowercaseString,keyword.lowercaseString];
-    NSString*     sqlQuery=[NSString stringWithFormat:@"SELECT o._id,o.so_id,o.status,o.sales_rep,o.create_by,decrypt(c.company_name),o.create_time,o.total_price from offline_order o left join offline_contact c on o.customer_cid=c.contact_id where %@ order by o.create_time limit %d offset %d" ,where, limit, offset];
-    
-    sqlite3 *db = [iSalesDB get_db];
-    sqlite3_stmt * statement;
-    
-    
-    if (sqlite3_prepare_v2(db, [sqlQuery UTF8String], -1, &statement, nil) == SQLITE_OK)
-    {
-        
-        int count=0;
-        while (sqlite3_step(statement) == SQLITE_ROW)
-        {
-            
-            
-            
-            NSMutableDictionary* item=[[NSMutableDictionary alloc]init];
-            
-            int order_id = sqlite3_column_double(statement, 0);
-            
-            
-            
-            
-            
-            char *soid = (char*)sqlite3_column_text(statement, 1);
-            if(soid==nil)
-                soid= "";
-            NSString *nssoid= [[NSString alloc]initWithUTF8String:soid];
-            
-            
-            int status = sqlite3_column_double(statement, 2);
-            
-            
-            char *sales_rep = (char*)sqlite3_column_text(statement, 3);
-            if(sales_rep==nil)
-                sales_rep= "";
-            NSString *nssales_rep= [[NSString alloc]initWithUTF8String:sales_rep];
-            
-            char *create_by = (char*)sqlite3_column_text(statement, 4);
-            if(create_by==nil)
-                create_by= "";
-            NSString *nscreate_by= [[NSString alloc]initWithUTF8String:create_by];
-            
-            char *company_name = (char*)sqlite3_column_text(statement, 5);
-            if(company_name==nil)
-                company_name= "";
-            NSString *nscompany_name= [[NSString alloc]initWithUTF8String:company_name];
-            
-            char *create_time = (char*)sqlite3_column_text(statement, 6);
-            if(create_time==nil)
-                create_time= "";
-            NSString *nscreate_time= [[NSString alloc]initWithUTF8String:create_time];
-            
-            double total_price = sqlite3_column_double(statement, 7);
-            
-            
-            NSString* nsstatus=@"";
-            switch (status) {
-                case 0:
-                {
-                    nsstatus=@"Temp Order";
-                    break;
-                }
-                case 1:
-                {
-                    nsstatus=@"Saved Order";
-                    break;
-                }
-                case 10:
-                {
-                    nsstatus=@"Quote Submitted";
-                    break;
-                }
-                case 11:
-                {
-                    nsstatus=@"Sales Order Submitted";
-                    break;
-                }
-                case 12:
-                {
-                    nsstatus=@"Processing";
-                    break;
-                }
-                case 13:
-                {
-                    nsstatus=@"Shipped";
-                    break;
-                }
-                case 14:
-                {
-                    nsstatus=@"Closed";
-                    break;
-                }
-                case 15:
-                {
-                    nsstatus=@"Cancelled";
-                    break;
-                }
-                    
-                    
-                default:
-                    break;
-            }
-            
-            item[@"sales_rep"]= nssales_rep;
-            item[@"orderStatus"]= [NSString stringWithFormat:@"%d",status];
-            item[@"order_status"]= nsstatus;
-            item[@"so#"]= nssoid;
-            item[@"price"]= [NSString stringWithFormat:@"$%.2f",total_price];
-            item[@"create_by"]= nscreate_by;
-            item[@"customer_name"]= nscompany_name;
-            item[@"order_id"]= [NSString stringWithFormat:@"%d",order_id];
-            item[@"order_code"]= nssoid;//[NSString stringWithFormat:@"%d",order_id];
-            item[@"purchase_time"]= nscreate_time;
-            
-            
-            ret[[NSString stringWithFormat:@"item_%d",count]]= item;
-            count++;
-            
-        }
-        
-        ret[@"count"]= [NSNumber numberWithInt:count];
-        //ret[@"total_count"]= [NSNumber numberWithInt:count];
-        // ret[@"wish_count"]= [NSNumber numberWithInt:count];
-        ret[@"result"]= [NSNumber numberWithInt:2];
-        
-        
-        sqlite3_finalize(statement);
-
-    }
-    
-    [iSalesDB close_db:db];
-    
-    return [RAUtils dict2data:ret];
-}
 
 
 +(NSData*) offline_editorder :(NSMutableDictionary *) params
 +(NSData*) offline_editorder :(NSMutableDictionary *) params
 {
 {
@@ -2342,6 +2196,7 @@
 }
 }
 
 
 #pragma mark - Jack
 #pragma mark - Jack
+#warning 做SQL操作时转义!!
 
 
 + (NSDictionary *)offline_getAllCountryDefault:(NSString *)countryCode {
 + (NSDictionary *)offline_getAllCountryDefault:(NSString *)countryCode {
     //    "val_227" : {
     //    "val_227" : {
@@ -2715,6 +2570,7 @@
     if (!text) {
     if (!text) {
         text = @"";
         text = @"";
     }
     }
+    
     return text;
     return text;
 }
 }
 
 
@@ -4233,21 +4089,33 @@
 
 
 #pragma mark order detail
 #pragma mark order detail
 
 
++ (NSString *)replaceHtml:(NSString *)html String:(NSString *)str0 withString:(NSString *)str1 {
+    if (str1.length == 0) {
+        str1 = @"&nbsp";
+    }
+    NSString *str = [html stringByReplacingOccurrencesOfString:str0 withString:str1];
+    return str;
+}
+
 +(NSData*) offline_orderdetail :(NSMutableDictionary *) params
 +(NSData*) offline_orderdetail :(NSMutableDictionary *) params
 {
 {
     
     
     DebugLog(@"offline oderdetail params: %@",params);
     DebugLog(@"offline oderdetail params: %@",params);
 
 
+    AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     
     
     int orderId = [params[@"orderId"] intValue];
     int orderId = [params[@"orderId"] intValue];
     NSMutableDictionary* ret = [self dictionaryFileName:@"orderDetail.json"];
     NSMutableDictionary* ret = [self dictionaryFileName:@"orderDetail.json"];
     
     
-    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.totalPrice,o.customer_cid 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,totalPrice,customer_cid 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.totalPrice,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,o.credit_card_number,o.credit_card_security_code,o.credit_card_expiration,o.credit_card_city,o.credit_card_state 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,totalPrice,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 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 *db = [iSalesDB get_db];
     sqlite3_stmt * statement;
     sqlite3_stmt * statement;
     
     
     
     
+    
+    NSString *customerID = nil; // 在查询结果中还需要调用offline_contactinfo,需要使用,其中要打开db 就会lock,故而将其置于外面,在close db后在调用
+    
     if (sqlite3_prepare_v2(db, [sql UTF8String], -1, &statement, nil) == SQLITE_OK)
     if (sqlite3_prepare_v2(db, [sql UTF8String], -1, &statement, nil) == SQLITE_OK)
     {
     {
         
         
@@ -4412,88 +4280,128 @@
             
             
             // order info
             // order info
             NSError *error = nil;
             NSError *error = nil;
-            NSString* orderinfo = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"orderinfo" ofType:@"template"] encoding:NSUTF8StringEncoding error:&error];
-            orderinfo=[orderinfo stringByReplacingOccurrencesOfString:@"SO_PLACEHOLDER" withString:nssoid];
-            orderinfo=[orderinfo stringByReplacingOccurrencesOfString:@"PO_PLACEHOLDER" withString:nspoNumber];
-            orderinfo=[orderinfo stringByReplacingOccurrencesOfString:@"ORDERDATE_PLACEHOLDER" withString:nscreate_time];
-            orderinfo=[orderinfo stringByReplacingOccurrencesOfString:@"ORDERSTATUS_PLACEHOLDER" withString:nsstatus];
-            orderinfo=[orderinfo stringByReplacingOccurrencesOfString:@"CUFT_PLACEHOLDER" withString:[NSString stringWithFormat:@"%.2f",TotalCuft]];
-            orderinfo=[orderinfo stringByReplacingOccurrencesOfString:@"WEIGHT_PLACEHOLDER" withString:[NSString stringWithFormat:@"%.2f",TotalWeight]];
-            orderinfo=[orderinfo stringByReplacingOccurrencesOfString:@"CARTON_PLACEHOLDER" withString:[NSString stringWithFormat:@"%.2f",TotalCarton]];
-            orderinfo=[orderinfo stringByReplacingOccurrencesOfString:@"COMPANY_PLACEHOLDER" withString:nscompany_name];
-            orderinfo=[orderinfo stringByReplacingOccurrencesOfString:@"CONTACT_PLACEHOLDER" withString:nscustomer_contact];
-            orderinfo=[orderinfo stringByReplacingOccurrencesOfString:@"ADDRESS_PLACEHOLDER" withString:customer_address];
-            orderinfo=[orderinfo stringByReplacingOccurrencesOfString:@"SHIPPINGMETHOD_PLACEHOLDER" withString:nslogist];
-            orderinfo=[orderinfo stringByReplacingOccurrencesOfString:@"SHIPPING_PLACEHOLDER" withString:[NSString stringWithFormat:@"%.2f",shipping]];
-            orderinfo=[orderinfo stringByReplacingOccurrencesOfString:@"LIFTGATE_PLACEHOLDER" withString:[NSString stringWithFormat:@"%.2f",lift_gate]];
-            orderinfo=[orderinfo stringByReplacingOccurrencesOfString:@"GENERALNOTES_PLACEHOLDER" withString:nsgeneral_notes];
-            orderinfo=[orderinfo stringByReplacingOccurrencesOfString:@"INTERNALNOTES_PLACEHOLDER" withString:nsinternal_notes];
+//            NSString* orderinfo = [NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"orderinfo" ofType:@"template"] encoding:NSUTF8StringEncoding error:&error];
+            NSString* orderinfo = [self textFileName:@"order_info.html"];
+            
+            
+            orderinfo = [self replaceHtml:orderinfo String:@"SO_or_nbsp" withString:nssoid];
+            orderinfo = [self replaceHtml:orderinfo String:@"PO_or_nbsp" withString:nspoNumber];
+            orderinfo = [self replaceHtml:orderinfo String:@"OrderDate_or_nbsp" withString:nscreate_time];
+            orderinfo=[self replaceHtml:orderinfo String:@"OrderStatus_or_nbsp" withString:nsstatus];
+            orderinfo=[self replaceHtml:orderinfo String:@"TotalCuft_or_nbsp" withString:[NSString stringWithFormat:@"%.2f",TotalCuft]];
+            orderinfo=[self replaceHtml:orderinfo String:@"TotalWeight_or_nbsp" withString:[NSString stringWithFormat:@"%.2f",TotalWeight]];
+            orderinfo = [self replaceHtml:orderinfo String:@"TotalCarton_or_nbsp" withString:[NSString stringWithFormat:@"%.2f",TotalCarton]];
+            orderinfo =[self replaceHtml:orderinfo String:@"CustomerInfo_or_nbsp" withString:nscompany_name];
+            orderinfo =[self replaceHtml:orderinfo String:@"CustomerName_or_nbsp" withString:nscustomer_contact];
+            orderinfo =[self replaceHtml:orderinfo String:@"CustomerAddress_or_nbsp" withString:customer_address];
+            orderinfo =[self replaceHtml:orderinfo String:@"ShippingMethod_or_nbsp" withString:nslogist];
+            orderinfo=[self replaceHtml:orderinfo String:@"Shipping_or_nbsp" withString:[NSString stringWithFormat:@"%.2f",shipping]];
+            orderinfo=[self replaceHtml:orderinfo String:@"LiftgateFee_or_nbsp" withString:[NSString stringWithFormat:@"%.2f",lift_gate]];
+            orderinfo=[self replaceHtml:orderinfo String:@"GeneralNotes_or_nbsp" withString:nsgeneral_notes];
+            orderinfo=[self replaceHtml:orderinfo String:@"InternalNotes_or_nbsp" withString:nsinternal_notes];
             
             
             NSString *payment = nil;
             NSString *payment = nil;
             if([nspayment_type isEqualToString:@"Credit Card"])
             if([nspayment_type isEqualToString:@"Credit Card"])
             {
             {
-                payment=[NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"creditcardpayment" ofType:@"template"] encoding:NSUTF8StringEncoding error:&error];
-                //payment=[payment stringByReplacingOccurrencesOfString:@"PAYMENTTYPE_PLACEHOLDER" withString:nspayment_type];
+                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];
+                if (card_type.length > 0) { // 显示星号
+                    card_type = @"****";
+                }
+                NSString *card_number = [self textAtColumn:46 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:@"*"];
+                    }
+                } 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) { // 显示星号
+                    card_expiration = @"****";
+                }
+                NSString *card_city = [self textAtColumn:49 statement:statement];
+                NSString *card_state = [self textAtColumn:50 statement:statement];
+                
+                payment = [self replaceHtml:payment String:@"CardNumber_or_nbsp" withString:card_number];
+                payment = [self replaceHtml:payment String:@"CardType_or_nbsp" withString:card_type];
+                payment = [self replaceHtml:payment String:@"CardExpireDate_or_nbsp" withString:card_expiration];
+                payment = [self replaceHtml:payment String:@"BillingFirstName_or_nbsp" withString:card_first_name];
+                payment = [self replaceHtml:payment String:@"BillingLastName_or_nbsp" withString:card_last_name];
+                payment = [self replaceHtml:payment String:@"BillingAddr1_or_nbsp" withString:card_addr1];
+                payment = [self replaceHtml:payment String:@"BillingAddr2_or_nbsp" withString:card_addr2];
+                payment = [self replaceHtml:payment String:@"BillingCity_or_nbsp" withString:card_city];
+                payment = [self replaceHtml:payment String:@"BillingState_or_nbsp" withString:card_state];
+                payment = [self replaceHtml:payment String:@"BillingZipCode_or_nbsp" withString:card_zipcode];
+                
+                
             }
             }
             else
             else
             {
             {
-                payment=[NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"normalpayment" ofType:@"template"] encoding:NSUTF8StringEncoding error:&error];
-                payment=[payment stringByReplacingOccurrencesOfString:@"PAYMENTTYPE_PLACEHOLDER" withString:nspayment_type];
+                payment=[self textFileName:@"normalpayment.html"];
+                payment = [self replaceHtml:payment String:@"PAYMENTTYPE_PLACEHOLDER" withString:nspayment_type];
             }
             }
-            orderinfo=[orderinfo stringByReplacingOccurrencesOfString:@"PAYMENT_PLACEHOLDER" withString:payment];
+            orderinfo=[self replaceHtml:orderinfo String:@"Payment_info_or_nbsp" withString:payment];
             ret[@"order_info"]= orderinfo;
             ret[@"order_info"]= orderinfo;
             ret[@"result"]= [NSNumber numberWithInt:2];
             ret[@"result"]= [NSNumber numberWithInt:2];
             
             
-            
             // more info
             // more info
             NSString *moreInfo = [self textFileName:@"more_info.html"];
             NSString *moreInfo = [self textFileName:@"more_info.html"];
-            
+
             /*****ship to******/
             /*****ship to******/
             // ShipToCompany_or_&nbsp
             // ShipToCompany_or_&nbsp
             NSString *shipToCompany = [self textAtColumn:21 statement:statement];
             NSString *shipToCompany = [self textAtColumn:21 statement:statement];
-            moreInfo = [moreInfo stringByReplacingOccurrencesOfString:@"ShipToCompany_or_&nbsp" withString:shipToCompany];
+            moreInfo = [self replaceHtml:moreInfo String:@"ShipToCompany_or_" withString:shipToCompany];
             NSString *shipToName = [self textAtColumn:22 statement:statement];
             NSString *shipToName = [self textAtColumn:22 statement:statement];
-            moreInfo = [moreInfo stringByReplacingOccurrencesOfString:@"ShipToName_or_&nbsp" withString:shipToName];
+            moreInfo = [self replaceHtml:moreInfo String:@"ShipToName_or_" withString:shipToName];
             NSString *shipToAddr = [self textAtColumn:23 statement:statement];
             NSString *shipToAddr = [self textAtColumn:23 statement:statement];
-            moreInfo = [moreInfo stringByReplacingOccurrencesOfString:@"ShipToAddress_or_&nbsp" withString:shipToAddr];
+            moreInfo = [self replaceHtml:moreInfo String:@"ShipToAddress_or_" withString:shipToAddr];
             
             
             /*****ship from******/
             /*****ship from******/
             // ShipFromCompany_or_&nbsp
             // ShipFromCompany_or_&nbsp
             NSString *shipFromCompany = [self textAtColumn:24 statement:statement];
             NSString *shipFromCompany = [self textAtColumn:24 statement:statement];
-            moreInfo = [moreInfo stringByReplacingOccurrencesOfString:@"ShipFromCompany_or_&nbsp" withString:shipFromCompany];
+            moreInfo = [self replaceHtml:moreInfo String:@"ShipFromCompany_or_" withString:shipFromCompany];
             NSString *shipFromName = [self textAtColumn:25 statement:statement];
             NSString *shipFromName = [self textAtColumn:25 statement:statement];
-            moreInfo = [moreInfo stringByReplacingOccurrencesOfString:@"ShipFromName_or_&nbsp" withString:shipFromName];
+            moreInfo = [self replaceHtml:moreInfo String:@"ShipFromName_or_" withString:shipFromName];
             NSString *shipFromAddr = [self textAtColumn:26 statement:statement];
             NSString *shipFromAddr = [self textAtColumn:26 statement:statement];
-            moreInfo = [moreInfo stringByReplacingOccurrencesOfString:@"ShipFromAddress_or_&nbsp" withString:shipFromAddr];
+            moreInfo = [self replaceHtml:moreInfo String:@"ShipFromAddress_or_" withString:shipFromAddr];
             
             
             /*****freight to******/
             /*****freight to******/
             // FreightBillToCompany_or_&nbsp
             // FreightBillToCompany_or_&nbsp
             NSString *freightBillToCompany = [self textAtColumn:27 statement:statement];
             NSString *freightBillToCompany = [self textAtColumn:27 statement:statement];
-            moreInfo = [moreInfo stringByReplacingOccurrencesOfString:@"FreightBillToCompany_or_&nbsp" withString:freightBillToCompany];
+            moreInfo = [self replaceHtml:moreInfo String:@"FreightBillToCompany_or_" withString:freightBillToCompany];
             NSString *freightBillToName = [self textAtColumn:28 statement:statement];
             NSString *freightBillToName = [self textAtColumn:28 statement:statement];
-            moreInfo = [moreInfo stringByReplacingOccurrencesOfString:@"FreightBillToName_or_&nbsp" withString:freightBillToName];
+            moreInfo = [self replaceHtml:moreInfo String:@"FreightBillToName_or_" withString:freightBillToName];
             NSString *freightBillToAddr = [self textAtColumn:29 statement:statement];
             NSString *freightBillToAddr = [self textAtColumn:29 statement:statement];
-            moreInfo = [moreInfo stringByReplacingOccurrencesOfString:@"FreightBillToAddress_or_&nbsp" withString:freightBillToAddr];
+            moreInfo = [self replaceHtml:moreInfo String:@"FreightBillToAddress_or_" withString:freightBillToAddr];
             
             
             /*****merchandise to******/
             /*****merchandise to******/
             // MerchandiseBillToCompany_or_&nbsp
             // MerchandiseBillToCompany_or_&nbsp
             NSString *merchandiseBillToCompany = [self textAtColumn:30 statement:statement];
             NSString *merchandiseBillToCompany = [self textAtColumn:30 statement:statement];
-            moreInfo = [moreInfo stringByReplacingOccurrencesOfString:@"MerchandiseBillToCompany_or_&nbsp" withString:merchandiseBillToCompany];
+            moreInfo = [self replaceHtml:moreInfo String:@"MerchandiseBillToCompany_or_" withString:merchandiseBillToCompany];
             NSString *merchandiseBillToName = [self textAtColumn:31 statement:statement];
             NSString *merchandiseBillToName = [self textAtColumn:31 statement:statement];
-            moreInfo = [moreInfo stringByReplacingOccurrencesOfString:@"MerchandiseBillToName_or_&nbsp" withString:merchandiseBillToName];
+            moreInfo = [self replaceHtml:moreInfo String:@"MerchandiseBillToName_or_" withString:merchandiseBillToName];
             NSString *merchandiseBillToAddr = [self textAtColumn:32 statement:statement];
             NSString *merchandiseBillToAddr = [self textAtColumn:32 statement:statement];
-            moreInfo = [moreInfo stringByReplacingOccurrencesOfString:@"MerchandiseBillToAddress_or_&nbsp" withString:merchandiseBillToAddr];
+            moreInfo = [self replaceHtml:moreInfo String:@"MerchandiseBillToAddress_or_" withString:merchandiseBillToAddr];
             
             
             /*****return to******/
             /*****return to******/
             // ReturnToCompany_or_&nbsp
             // ReturnToCompany_or_&nbsp
             NSString *returnToCompany = [self textAtColumn:33 statement:statement];
             NSString *returnToCompany = [self textAtColumn:33 statement:statement];
-            moreInfo = [moreInfo stringByReplacingOccurrencesOfString:@"ReturnToCompany_or_&nbsp" withString:returnToCompany];
+            moreInfo = [self replaceHtml:moreInfo String:@"ReturnToCompany_or_" withString:returnToCompany];
             NSString *returnToName = [self textAtColumn:34 statement:statement];
             NSString *returnToName = [self textAtColumn:34 statement:statement];
-            moreInfo = [moreInfo stringByReplacingOccurrencesOfString:@"ReturnToName_or_&nbsp" withString:returnToName];
+            moreInfo = [self replaceHtml:moreInfo String:@"ReturnToName_or_" withString:returnToName];
             NSString *returnToAddr = [self textAtColumn:35 statement:statement];
             NSString *returnToAddr = [self textAtColumn:35 statement:statement];
-            moreInfo = [moreInfo stringByReplacingOccurrencesOfString:@"ReturnToAddress_or_&nbsp" withString:returnToAddr];
-            
+            moreInfo = [self replaceHtml:moreInfo String:@"ReturnToAddress_or_" withString:returnToAddr];
+//
             ret[@"more_order_info"] = moreInfo;
             ret[@"more_order_info"] = moreInfo;
+            DebugLog(@"more info : %@",moreInfo);
             
             
             // handling fee
             // handling fee
             double handlingFee = sqlite3_column_double(statement, 36);
             double handlingFee = sqlite3_column_double(statement, 36);
@@ -4508,34 +4416,14 @@
             ret[@"Total"] = [NSString stringWithFormat:@"$%.2f",totalPrice];
             ret[@"Total"] = [NSString stringWithFormat:@"$%.2f",totalPrice];
             
             
             // customer info
             // customer info
-            NSString *customerID = [self textAtColumn:39 statement:statement];
-            NSDictionary *contactInfo = [self offline_contactinfo:[@{@"contactId":customerID} mutableCopy]];
-//            NSMutableDictionary *customerInfo = [NSMutableDictionary dictionary];
-            
-//            customerInfo[@"business_card_0"] = contactInfo[@"business_card_0"];
-//            customerInfo[@"business_card_1"] = contactInfo[@"business_card_1"];
-//            customerInfo[@"business_card_2"] = contactInfo[@"business_card_2"];
-//            customerInfo[@"customer_address1"] = contactInfo[@"customer_address1"];
-//            customerInfo[@"customer_address2"] = contactInfo[@"customer_address2"];
-//            customerInfo[@"customer_address3"] = contactInfo[@"customer_address3"];
-//            customerInfo[@"customer_address4"] = contactInfo[@"customer_address4"];
-//            customerInfo[@"customer_cid"] = contactInfo[@"customer_cid"];
-//            customerInfo[@"customer_city"] = contactInfo[@"customer_city"];
-//            customerInfo[@"customer_contact"] = contactInfo[@"customer_contact"];
-//            customerInfo[@"customer_contact_notes"] = contactInfo[@"customer_contact_notes"];
-//            customerInfo[@"customer_country"] = contactInfo[@"customer_country"];
-//            customerInfo[@"customer_email"] = contactInfo[@"customer_email"];
-//            customerInfo[@"customer_fax"] = contactInfo[@"customer_fax"];
-//            customerInfo[@"customer_first_name"] = contactInfo[@"customer_first_name"];
-//            customerInfo[@"customer_last_name"] = contactInfo[@"customer_last_name"];
-//            customerInfo[@"customer_name"] = contactInfo[@"customer_name"];
-//            customerInfo[@"customer_phone"] = contactInfo[@"customer_phone"];
-//            customerInfo[@"customer_price_type"] = contactInfo[@"customer_price_type"];
-//            customerInfo[@"customer_sales_rep"] = contactInfo[@"customer_sales_rep"];
-//            customerInfo[@"customer_state"] = contactInfo[@"customer_state"];
-//            customerInfo[@"customer_zipcode"] = contactInfo[@"customer_zipcode"];
-            
-            ret[@"customerInfo"] = contactInfo;
+            customerID = [self textAtColumn:39 statement:statement];
+            
+            
+            // mode
+            ret[@"mode"] = appDelegate.mode;
+            
+            // model_count
+            ret[@"model_count"] = @(0);
             
             
         }
         }
         
         
@@ -4552,11 +4440,229 @@
     
     
     [iSalesDB close_db:db];
     [iSalesDB close_db:db];
     
     
+    NSDictionary *contactInfo = [self offline_contactinfo:[@{@"contactId":customerID} mutableCopy]];
+    //            NSMutableDictionary *customerInfo = [NSMutableDictionary dictionary];
+    
+    //            customerInfo[@"business_card_0"] = contactInfo[@"business_card_0"];
+    //            customerInfo[@"business_card_1"] = contactInfo[@"business_card_1"];
+    //            customerInfo[@"business_card_2"] = contactInfo[@"business_card_2"];
+    //            customerInfo[@"customer_address1"] = contactInfo[@"customer_address1"];
+    //            customerInfo[@"customer_address2"] = contactInfo[@"customer_address2"];
+    //            customerInfo[@"customer_address3"] = contactInfo[@"customer_address3"];
+    //            customerInfo[@"customer_address4"] = contactInfo[@"customer_address4"];
+    //            customerInfo[@"customer_cid"] = contactInfo[@"customer_cid"];
+    //            customerInfo[@"customer_city"] = contactInfo[@"customer_city"];
+    //            customerInfo[@"customer_contact"] = contactInfo[@"customer_contact"];
+    //            customerInfo[@"customer_contact_notes"] = contactInfo[@"customer_contact_notes"];
+    //            customerInfo[@"customer_country"] = contactInfo[@"customer_country"];
+    //            customerInfo[@"customer_email"] = contactInfo[@"customer_email"];
+    //            customerInfo[@"customer_fax"] = contactInfo[@"customer_fax"];
+    //            customerInfo[@"customer_first_name"] = contactInfo[@"customer_first_name"];
+    //            customerInfo[@"customer_last_name"] = contactInfo[@"customer_last_name"];
+    //            customerInfo[@"customer_name"] = contactInfo[@"customer_name"];
+    //            customerInfo[@"customer_phone"] = contactInfo[@"customer_phone"];
+    //            customerInfo[@"customer_price_type"] = contactInfo[@"customer_price_type"];
+    //            customerInfo[@"customer_sales_rep"] = contactInfo[@"customer_sales_rep"];
+    //            customerInfo[@"customer_state"] = contactInfo[@"customer_state"];
+    //            customerInfo[@"customer_zipcode"] = contactInfo[@"customer_zipcode"];
+    
+    ret[@"customerInfo"] = contactInfo;
+    
     
     
     return [RAUtils dict2data:ret];
     return [RAUtils dict2data:ret];
     
     
 }
 }
 
 
+#pragma mark order list
+
++(NSData*) offline_orderlist :(NSMutableDictionary *) params
+{
+    NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
+    
+    
+    int limit = [[params valueForKey:@"limit"] intValue];
+    int offset = [[params valueForKey:@"offset"] intValue];
+    NSString* keyword = [params valueForKey:@"keyWord"];
+    keyword = [self translateSingleQuote:keyword]; // 转义单引号
+    NSString *orderStatus = [params valueForKey:@"orderStatus"];
+    
+    NSString* where=@"1 = 1";
+    if(keyword.length>0)
+        where=[where stringByAppendingString:[NSString stringWithFormat:@" and (lower(o.order_id) like '%%%@%%' or lower(c.company_name) like '%%%@%%' or lower(c.company_name) like '%%%@%%' or lower(o.create_by) like '%%%@%%')",keyword.lowercaseString,keyword.lowercaseString,keyword.lowercaseString,keyword.lowercaseString]];
+    
+    if (orderStatus.length > 0) {
+        NSArray *order_status_array = [orderStatus componentsSeparatedByString:@","];
+        if (order_status_array.count == 1) {
+            where = [where stringByAppendingString:[NSString stringWithFormat:@" and o.status = %@",[order_status_array firstObject]]];
+        } else if (order_status_array.count > 1) {
+            
+            for (int i = 0; i < order_status_array.count;i++) {
+                NSString *status = order_status_array[i];
+                NSString *condition = @" or";
+                if (i == 0) {
+                    condition = @" and (";
+                }
+                where = [where stringByAppendingString:[NSString stringWithFormat:@"%@ o.status = %@",condition,status]];
+            }
+            where = [where stringByAppendingString:@" )"];
+        }
+    }
+    
+    NSString*     sqlQuery=[NSString stringWithFormat:@"SELECT o._id,o.so_id,o.status,o.sales_rep,o.create_by,decrypt(c.company_name),o.create_time,o.total_price,o.customer_contact from offline_order o left join offline_contact c on o.customer_cid=c.contact_id where %@ order by o.create_time limit %d offset %d" ,where, limit, offset];
+    
+    DebugLog(@"order list sql: %@",sqlQuery);
+    
+    sqlite3 *db = [iSalesDB get_db];
+    sqlite3_stmt * statement;
+    
+    
+    if (sqlite3_prepare_v2(db, [sqlQuery UTF8String], -1, &statement, nil) == SQLITE_OK)
+    {
+        
+        int count=0;
+        while (sqlite3_step(statement) == SQLITE_ROW)
+        {
+            
+            
+            
+            NSMutableDictionary* item=[[NSMutableDictionary alloc]init];
+            
+            int order_id = sqlite3_column_double(statement, 0);
+            
+            char *soid = (char*)sqlite3_column_text(statement, 1);
+            if(soid==nil)
+                soid= "";
+            NSString *nssoid= [[NSString alloc]initWithUTF8String:soid];
+            
+            
+            int status = sqlite3_column_double(statement, 2);
+            
+            
+            char *sales_rep = (char*)sqlite3_column_text(statement, 3);
+            if(sales_rep==nil)
+                sales_rep= "";
+            NSString *nssales_rep= [[NSString alloc]initWithUTF8String:sales_rep];
+            
+            char *create_by = (char*)sqlite3_column_text(statement, 4);
+            if(create_by==nil)
+                create_by= "";
+            NSString *nscreate_by= [[NSString alloc]initWithUTF8String:create_by];
+            
+            char *company_name = (char*)sqlite3_column_text(statement, 5);
+            if(company_name==nil)
+                company_name= "";
+            NSString *nscompany_name= [[NSString alloc]initWithUTF8String:company_name];
+            
+            char *create_time = (char*)sqlite3_column_text(statement, 6);
+            if(create_time==nil)
+                create_time= "";
+            NSString *nscreate_time= [[NSString alloc]initWithUTF8String:create_time];
+            
+            double total_price = sqlite3_column_double(statement, 7);
+            
+            NSString *customer_contact = [self textAtColumn:8 statement:statement];
+            
+            NSString* nsstatus=@"";
+            switch (status) {
+                case 0:
+                {
+                    nsstatus=@"Temp Order";
+                    break;
+                }
+                case 1:
+                {
+                    nsstatus=@"Saved Order";
+                    break;
+                }
+                case 10:
+                {
+                    nsstatus=@"Quote Submitted";
+                    break;
+                }
+                case 11:
+                {
+                    nsstatus=@"Sales Order Submitted";
+                    break;
+                }
+                case 12:
+                {
+                    nsstatus=@"Processing";
+                    break;
+                }
+                case 13:
+                {
+                    nsstatus=@"Shipped";
+                    break;
+                }
+                case 14:
+                {
+                    nsstatus=@"Closed";
+                    break;
+                }
+                case 15:
+                {
+                    nsstatus=@"Cancelled";
+                    break;
+                }
+                    
+                    
+                default:
+                    break;
+            }
+            //            ": "JH",
+            //            "": "$8307.00",
+            //            "": "MOB1608050001",
+            //            "": "ArpithaT",
+            //            "": "1st Stage Property Transformations",
+            //            "": "JANICE SUTTON",
+            //            "": 2255,
+            //            "": "08/02/2016 09:49:18",
+            //            "": 1,
+            //            "": "Saved Order"
+            //            "": "1470384050483",
+            //            "model_count": "6 / 28"
+            
+            item[@"sales_rep"]= nssales_rep;
+            item[@"price"]= [NSString stringWithFormat:@"$%.2f",total_price];
+            item[@"so#"]= nssoid;
+            item[@"create_by"]= nscreate_by;
+            item[@"customer_name"]= nscompany_name;
+            item[@"customer_contact"] = customer_contact;
+            item[@"order_id"]= [NSString stringWithFormat:@"%d",order_id];
+            item[@"purchase_time"]= nscreate_time;
+            item[@"orderStatus"]= [NSString stringWithFormat:@"%d",status];
+            item[@"order_status"]= nsstatus;
+            item[@"order_code"]= nssoid;//[NSString stringWithFormat:@"%d",order_id];
+            // item[@"model_count"]
+            
+            
+            ret[[NSString stringWithFormat:@"item_%d",count]]= item;
+            count++;
+            
+        }
+        
+        ret[@"count"]= [NSNumber numberWithInt:count];
+        //ret[@"total_count"]= [NSNumber numberWithInt:count];
+        // ret[@"wish_count"]= [NSNumber numberWithInt:count];
+        ret[@"result"]= [NSNumber numberWithInt:2];
+        ret[@"can_see_price"] = [NSNumber numberWithBool:YES];
+        ret[@"time_zone"] = @"PST";
+        
+        
+        sqlite3_finalize(statement);
+        
+    }
+    
+    int total_count = [iSalesDB get_recordcount:db table:@"offline_order o left join offline_contact c on o.customer_cid=c.contact_id" where:where];
+    
+    ret[@"total_count"] = [NSNumber numberWithInteger:total_count];
+    
+    [iSalesDB close_db:db];
+    
+    return [RAUtils dict2data:ret];
+}
+
+
 
 
 
 
 
 

+ 23 - 1
RedAnt ERP Mobile/common/Functions/offline/creditcardpayment.html

@@ -1 +1,23 @@
-<div style="margin-left:15px;word-wrap:break-word;word-break:break-all;">Payment: Credit Card<br><p><b style="font-size:16px;">Card information</b></p><div style="width:50%;float:left;">Card number:</div><div style="width:50%;float:left;"> </div><div style="width:50%;float:left;">Card type:</div><div style="width:50%;float:left;"> </div><div style="width:50%;float:left;">Card expire date:</div><div style="width:50%;float:left;"> </div><p style="font-size:16px;"><b>Billing address</b></p><div style="width:50%;float:left;">First Name:</div><div style="width:50%;float:left;"> </div><div style="width:50%;float:left;">Last Name:</div><div style="width:50%;float:left;"> </div><div style="width:50%;float:left;">Address1:</div><div style="width:50%;float:left;"> </div><div style="width:50%;float:left;">Address2:</div><div style="width:50%;float:left;"> </div><div style="width:50%;float:left;">City:</div><div style="width:50%;float:left;"> </div><div style="width:50%;float:left;">State:</div><div style="width:50%;float:left;"> </div><div style="width:50%;float:left;">Zip code:</div><div style="width:50%;float:left;"> </div></div>
+<div style='margin-left:15px;word-wrap:break-word;word-break:break-all;'>Payment: Credit Card<br><p><b style='font-size:16px;'>Card information</b></p>
+    <div style='width:50%;float:left;'>Card number:</div>
+    <div style='width:50%;float:left;'>CardNumber_or_nbsp</div>
+    <div style='width:50%;float:left;'>Card type:</div>
+    <div style='width:50%;float:left;'>CardType_or_nbsp</div>
+    <div style='width:50%;float:left;'>Card expire date:</div>
+    <div style='width:50%;float:left;'>CardExpireDate_or_nbsp</div>
+    <p style='font-size:16px;'><b >Billing address</b></p>
+    <div style='width:50%;float:left;'>First Name:</div>
+    <div style='width:50%;float:left;'>BillingFirstName_or_nbsp</div>
+    <div style='width:50%;float:left;'>Last Name:</div>
+    <div style='width:50%;float:left;'>BillingLastName_or_nbsp</div>
+    <div style='width:50%;float:left;'>Address1:</div>
+    <div style='width:50%;float:left;'>BillingAddr1_or_nbsp</div>
+    <div style='width:50%;float:left;'>Address2:</div>
+    <div style='width:50%;float:left;'>BillingAddr2_or_nbsp</div>
+    <div style='width:50%;float:left;'>City:</div>
+    <div style='width:50%;float:left;'>BillingCity_or_nbsp</div>
+    <div style='width:50%;float:left;'>State:</div>
+    <div style='width:50%;float:left;'>BillingState_or_nbsp</div>
+    <div style='width:50%;float:left;'>Zip code:</div>
+    <div style='width:50%;float:left;'>BillingZipCode_or_nbsp</div>
+</div>

+ 4 - 0
RedAnt ERP Mobile/iSales-NPD.xcodeproj/project.pbxproj

@@ -11,6 +11,7 @@
 		42969C021D52F31C00FF190A /* editContact.json in Resources */ = {isa = PBXBuildFile; fileRef = 42969C011D52F31C00FF190A /* editContact.json */; };
 		42969C021D52F31C00FF190A /* editContact.json in Resources */ = {isa = PBXBuildFile; fileRef = 42969C011D52F31C00FF190A /* editContact.json */; };
 		42A51BF41D62F60300F13667 /* more_info.html in Resources */ = {isa = PBXBuildFile; fileRef = 42A51BF31D62F60300F13667 /* more_info.html */; };
 		42A51BF41D62F60300F13667 /* more_info.html in Resources */ = {isa = PBXBuildFile; fileRef = 42A51BF31D62F60300F13667 /* more_info.html */; };
 		42A51BF61D62F9AB00F13667 /* orderDetail.json in Resources */ = {isa = PBXBuildFile; fileRef = 42A51BF51D62F9AB00F13667 /* orderDetail.json */; };
 		42A51BF61D62F9AB00F13667 /* orderDetail.json in Resources */ = {isa = PBXBuildFile; fileRef = 42A51BF51D62F9AB00F13667 /* orderDetail.json */; };
+		42B3C9BB1D642C880053985C /* order_info.html in Resources */ = {isa = PBXBuildFile; fileRef = 42B3C9BA1D642C880053985C /* order_info.html */; };
 		42C9FB151D5B28FA001DCA8B /* contactAdvanceSearch.json in Resources */ = {isa = PBXBuildFile; fileRef = 42C9FB141D5B28FA001DCA8B /* contactAdvanceSearch.json */; };
 		42C9FB151D5B28FA001DCA8B /* contactAdvanceSearch.json in Resources */ = {isa = PBXBuildFile; fileRef = 42C9FB141D5B28FA001DCA8B /* contactAdvanceSearch.json */; };
 		42DC31131D546FBE00BCD1C6 /* category.json in Resources */ = {isa = PBXBuildFile; fileRef = 42DC31121D546FBE00BCD1C6 /* category.json */; };
 		42DC31131D546FBE00BCD1C6 /* category.json in Resources */ = {isa = PBXBuildFile; fileRef = 42DC31121D546FBE00BCD1C6 /* category.json */; };
 		710274251CC606C4009FD219 /* UserListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 710274241CC606C4009FD219 /* UserListViewController.m */; };
 		710274251CC606C4009FD219 /* UserListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 710274241CC606C4009FD219 /* UserListViewController.m */; };
@@ -200,6 +201,7 @@
 		42969C011D52F31C00FF190A /* editContact.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = editContact.json; sourceTree = "<group>"; };
 		42969C011D52F31C00FF190A /* editContact.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = editContact.json; sourceTree = "<group>"; };
 		42A51BF31D62F60300F13667 /* more_info.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = more_info.html; sourceTree = "<group>"; };
 		42A51BF31D62F60300F13667 /* more_info.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = more_info.html; sourceTree = "<group>"; };
 		42A51BF51D62F9AB00F13667 /* orderDetail.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = orderDetail.json; sourceTree = "<group>"; };
 		42A51BF51D62F9AB00F13667 /* orderDetail.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = orderDetail.json; sourceTree = "<group>"; };
+		42B3C9BA1D642C880053985C /* order_info.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = order_info.html; sourceTree = "<group>"; };
 		42C9FB141D5B28FA001DCA8B /* contactAdvanceSearch.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = contactAdvanceSearch.json; sourceTree = "<group>"; };
 		42C9FB141D5B28FA001DCA8B /* contactAdvanceSearch.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = contactAdvanceSearch.json; sourceTree = "<group>"; };
 		42DC31121D546FBE00BCD1C6 /* category.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = category.json; sourceTree = "<group>"; };
 		42DC31121D546FBE00BCD1C6 /* category.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = category.json; sourceTree = "<group>"; };
 		56528CA8B8A71F67C2EE5366 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
 		56528CA8B8A71F67C2EE5366 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
@@ -818,6 +820,7 @@
 				42DC31121D546FBE00BCD1C6 /* category.json */,
 				42DC31121D546FBE00BCD1C6 /* category.json */,
 				42A51BF51D62F9AB00F13667 /* orderDetail.json */,
 				42A51BF51D62F9AB00F13667 /* orderDetail.json */,
 				42A51BF31D62F60300F13667 /* more_info.html */,
 				42A51BF31D62F60300F13667 /* more_info.html */,
+				42B3C9BA1D642C880053985C /* order_info.html */,
 			);
 			);
 			name = utils;
 			name = utils;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
@@ -1281,6 +1284,7 @@
 				71DF74951C57614C00F2789C /* PhotoBorder.png in Resources */,
 				71DF74951C57614C00F2789C /* PhotoBorder.png in Resources */,
 				7162A55F1C58724700AB630E /* customer_info_template.json in Resources */,
 				7162A55F1C58724700AB630E /* customer_info_template.json in Resources */,
 				71D46D111CE1D9EF00A081AC /* OLM.storyboard in Resources */,
 				71D46D111CE1D9EF00A081AC /* OLM.storyboard in Resources */,
+				42B3C9BB1D642C880053985C /* order_info.html in Resources */,
 				7141DD3D1C5726B700F7DF59 /* softScanBeep.wav in Resources */,
 				7141DD3D1C5726B700F7DF59 /* softScanBeep.wav in Resources */,
 				7141DD341C57269B00F7DF59 /* include in Resources */,
 				7141DD341C57269B00F7DF59 /* include in Resources */,
 				7141DD601C5747CE00F7DF59 /* LICENSE in Resources */,
 				7141DD601C5747CE00F7DF59 /* LICENSE in Resources */,

+ 15 - 15
RedAnt ERP Mobile/iSales-NPD/more_info.html

@@ -3,48 +3,48 @@
 <div><p><b style='font-size:20px;'>Ship to information</b></p>
 <div><p><b style='font-size:20px;'>Ship to information</b></p>
 <div style='margin-left:15px;word-wrap:break-word;word-break:break-all;'>
 <div style='margin-left:15px;word-wrap:break-word;word-break:break-all;'>
 <div style='width:25%;float:left;'>Company:</div>
 <div style='width:25%;float:left;'>Company:</div>
-<div style='width:75%;float:left;'>ShipToCompany_or_&nbsp</div>
+<div style='width:75%;float:left;'>ShipToCompany_or_</div>
 <div style='width:25%;float:left;'>Name:</div>
 <div style='width:25%;float:left;'>Name:</div>
-<div style='width:75%;float:left;'>ShipToName_or_&nbsp</div>
+<div style='width:75%;float:left;'>ShipToName_or_</div>
 <div style='width:25%;float:left;'>Address:</div>
 <div style='width:25%;float:left;'>Address:</div>
-<div style='width:75%;float:left;'>ShipToAddress_or_&nbsp</div>
+<div style='width:75%;float:left;'>ShipToAddress_or_</div>
 </div>
 </div>
 </div>
 </div>
 <div><p><b style='font-size:20px;'>Ship from information</b></p>
 <div><p><b style='font-size:20px;'>Ship from information</b></p>
 <div style='margin-left:15px;word-wrap:break-word;word-break:break-all;'>
 <div style='margin-left:15px;word-wrap:break-word;word-break:break-all;'>
 <div style='width:25%;float:left;'>Company:</div>
 <div style='width:25%;float:left;'>Company:</div>
-<div style='width:75%;float:left;'>ShipFromCompany_or_&nbsp</div>
+<div style='width:75%;float:left;'>ShipFromCompany_or_</div>
 <div style='width:25%;float:left;'>Name:</div>
 <div style='width:25%;float:left;'>Name:</div>
-<div style='width:75%;float:left;'>ShipFromName_or_&nbsp</div>
+<div style='width:75%;float:left;'>ShipFromName_or_</div>
 <div style='width:25%;float:left;'>Address:</div>
 <div style='width:25%;float:left;'>Address:</div>
-<div style='width:75%;float:left;'>ShipFromAddress_or_&nbsp</div>
+<div style='width:75%;float:left;'>ShipFromAddress_or_</div>
 </div></div>
 </div></div>
 <div><p><b style='font-size:20px;'>Freight bill to information</b></p>
 <div><p><b style='font-size:20px;'>Freight bill to information</b></p>
 <div style='margin-left:15px;word-wrap:break-word;word-break:break-all;'>
 <div style='margin-left:15px;word-wrap:break-word;word-break:break-all;'>
 <div style='width:25%;float:left;'>Company:</div>
 <div style='width:25%;float:left;'>Company:</div>
-<div style='width:75%;float:left;'>FreightBillToCompany_or_&nbsp</div>
+<div style='width:75%;float:left;'>FreightBillToCompany_or_</div>
 <div style='width:25%;float:left;'>Name:</div>
 <div style='width:25%;float:left;'>Name:</div>
-<div style='width:75%;float:left;'>FreightBillToName_or_&nbsp</div>
+<div style='width:75%;float:left;'>FreightBillToName_or_</div>
 <div style='width:25%;float:left;'>Address:</div>
 <div style='width:25%;float:left;'>Address:</div>
-<div style='width:75%;float:left;'>FreightBillToAddress_or_&nbsp</div>
+<div style='width:75%;float:left;'>FreightBillToAddress_or_</div>
 </div></div></div> 
 </div></div></div> 
 <div id='right-div' style='width:45%;float:left;margin-left:55px;margin-bottom:55px;'>
 <div id='right-div' style='width:45%;float:left;margin-left:55px;margin-bottom:55px;'>
 <div><p><b style='font-size:20px;'>Merchandise bill to information</b></p>
 <div><p><b style='font-size:20px;'>Merchandise bill to information</b></p>
 <div style='margin-left:15px;word-wrap:break-word;word-break:break-all;'>
 <div style='margin-left:15px;word-wrap:break-word;word-break:break-all;'>
 <div style='width:25%;float:left;'>Company:</div>
 <div style='width:25%;float:left;'>Company:</div>
-<div style='width:75%;float:left;'>MerchandiseBillToCompany_or_&nbsp</div>
+<div style='width:75%;float:left;'>MerchandiseBillToCompany_or_</div>
 <div style='width:25%;float:left;'>Name:</div>
 <div style='width:25%;float:left;'>Name:</div>
-<div style='width:75%;float:left;'>MerchandiseBillToName_or_&nbsp</div>
+<div style='width:75%;float:left;'>MerchandiseBillToName_or_</div>
 <div style='width:25%;float:left;'>Address:</div>
 <div style='width:25%;float:left;'>Address:</div>
-<div style='width:75%;float:left;'>MerchandiseBillToAddress_or_&nbsp</div>
+<div style='width:75%;float:left;'>MerchandiseBillToAddress_or_</div>
 </div></div>
 </div></div>
 <div><p><b style='font-size:20px;'>Return to information</b></p>
 <div><p><b style='font-size:20px;'>Return to information</b></p>
 <div style='margin-left:15px;word-wrap:break-word;word-break:break-all;'>
 <div style='margin-left:15px;word-wrap:break-word;word-break:break-all;'>
 <div style='width:25%;float:left;'>Company:</div>
 <div style='width:25%;float:left;'>Company:</div>
-<div style='width:75%;float:left;'>ReturnToCompany_or_&nbsp</div>
+<div style='width:75%;float:left;'>ReturnToCompany_or_</div>
 <div style='width:25%;float:left;'>Name:</div>
 <div style='width:25%;float:left;'>Name:</div>
-<div style='width:75%;float:left;'>ReturnToName_or_&nbsp</div>
+<div style='width:75%;float:left;'>ReturnToName_or_</div>
 <div style='width:25%;float:left;'>Address:</div>
 <div style='width:25%;float:left;'>Address:</div>
-<div style='width:75%;float:left;'>ReturnToAddress_or_&nbsp</div>
+<div style='width:75%;float:left;'>ReturnToAddress_or_</div>
 </div></div></div>
 </div></div></div>
 </body>
 </body>

+ 39 - 0
RedAnt ERP Mobile/iSales-NPD/order_info.html

@@ -0,0 +1,39 @@
+<body style='background-color:#FFFFFF;'>
+<div>
+<br>
+<div>SO#: <font color=#fe0000>SO_or_nbsp</font></div>
+<div>PO#: <font color=#fe0000>PO_or_nbsp</font></div>
+<div>Order date: <font color=#fe0000>OrderDate_or_nbsp</font></div>
+<div>Order status: <font color=#fe0000>OrderStatus_or_nbsp</font></div>
+<div>Total Cuft: <font color=#fe0000>TotalCuft_or_nbsp</font></div>
+<div>Total Weight: <font color=#fe0000>TotalWeight_or_nbsp</font></div>
+<div>Total Carton: <font color=#fe0000>TotalCarton_or_nbsp</font></div>
+</div>
+<div>
+<div id='left_div' style='width:50%;float:left;margin-bottom:55px;'>
+<div><p><b style='font-size:20px;'>Customer information</b></p>
+<div style='margin-left:15px;word-wrap:break-word;word-break:break-all;'>
+<div style='width:20%;float:left;'>Company:</div>
+<div style='width:80%;float:left;'>CustomerInfo_or_nbsp</div>
+<div style='width:20%;float:left;'>Name:</div>
+<div style='width:80%;float:left;'>CustomerName_or_nbsp</div>
+<div style='width:20%;float:left;'>Address:</div>
+<div style='width:80%;float:left;'>CustomerAddress_or_nbsp</div>
+</div></div>
+<div><p><b style='font-size:20px;'>Shipping information</b></p>
+<div style='margin-left:15px;word-wrap:break-word;word-break:break-all;'>Shipping Method: ShippingMethod_or_nbsp<br>Shipping: Shipping_or_nbsp<br>
+</div></div>
+<div><p><b style='font-size:20px;'>Payment information</b></p>
+    Payment_info_or_nbsp
+</div></div>
+<div id='left_div' style='width:45%;float:left;padding-left:15px;margin-bottom:55px;'>
+<div><p><b style='font-size:20px;'>Remarks Content</b></p>
+<div style='margin-left:15px;word-wrap:break-word;word-break:break-all;'>Liftgate Fee(No loading dock): LiftgateFee_or_nbsp<br>
+<div style='width:32%;float:left;'>General notes:</div>
+<div style='width:68%;float:left;'>GeneralNotes_or_nbsp</div>
+<div style='width:32%;float:left;'>Internal notes:</div>
+<div style='width:68%;float:left;'>InternalNotes_or_nbsp</div>
+</div></div></div>
+<div style='clear:both;'></div>
+</div>
+</body>