Jelajahi Sumber

orderDetail方法中增加customerInfo等数据。

Pen Li 9 tahun lalu
induk
melakukan
4ef553cbb9

TEMPAT SAMPAH
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 50 - 4
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -2748,6 +2748,7 @@
     return [params valueForKey:key] ? [params valueForKey:key] : @"";
     return [params valueForKey:key] ? [params valueForKey:key] : @"";
 }
 }
 
 
+
 #pragma mark contact list
 #pragma mark contact list
 
 
 +(NSDictionary*) offline_contactlist :(NSMutableDictionary *) params
 +(NSDictionary*) offline_contactlist :(NSMutableDictionary *) params
@@ -4236,13 +4237,12 @@
 {
 {
     
     
     DebugLog(@"offline oderdetail params: %@",params);
     DebugLog(@"offline oderdetail params: %@",params);
-    return nil;
-    
+
     
     
     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 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 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 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 ];
     
     
     sqlite3 *db = [iSalesDB get_db];
     sqlite3 *db = [iSalesDB get_db];
     sqlite3_stmt * statement;
     sqlite3_stmt * statement;
@@ -4266,7 +4266,8 @@
             if(soid==nil)
             if(soid==nil)
                 soid= "";
                 soid= "";
             NSString *nssoid= [[NSString alloc]initWithUTF8String:soid];
             NSString *nssoid= [[NSString alloc]initWithUTF8String:soid];
-            
+            // so#
+            ret[@"so#"] = nssoid;
             
             
             char *poNumber = (char*)sqlite3_column_text(statement, 2);
             char *poNumber = (char*)sqlite3_column_text(statement, 2);
             if(poNumber==nil)
             if(poNumber==nil)
@@ -4389,6 +4390,8 @@
             double shipping = sqlite3_column_double(statement, 15);
             double shipping = sqlite3_column_double(statement, 15);
             
             
             double lift_gate = sqlite3_column_double(statement, 16);
             double lift_gate = sqlite3_column_double(statement, 16);
+            // 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, 17);
             if(general_notes==nil)
             if(general_notes==nil)
@@ -4491,6 +4494,49 @@
             moreInfo = [moreInfo stringByReplacingOccurrencesOfString:@"ReturnToAddress_or_&nbsp" withString:returnToAddr];
             moreInfo = [moreInfo stringByReplacingOccurrencesOfString:@"ReturnToAddress_or_&nbsp" withString:returnToAddr];
             
             
             ret[@"more_order_info"] = moreInfo;
             ret[@"more_order_info"] = moreInfo;
+            
+            // handling fee
+            double handlingFee = sqlite3_column_double(statement, 36);
+            ret[@"Handling Fee"] = [NSString stringWithFormat:@"$%.2f",handlingFee];
+            
+            // payments/Credits
+            double payments_and_credist = sqlite3_column_double(statement, 37);
+            ret[@"Payments/Credits"] = [NSString stringWithFormat:@"$%.2f",payments_and_credist];
+            
+            // total
+            double totalPrice = sqlite3_column_double(statement, 38);
+            ret[@"Total"] = [NSString stringWithFormat:@"$%.2f",totalPrice];
+            
+            // 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;
+            
         }
         }