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

实现Submit Order方法,增加Ready For Submit状态

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

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


+ 32 - 0
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -13,5 +13,37 @@
             stopOnStyle = "0">
             stopOnStyle = "0">
          </BreakpointContent>
          </BreakpointContent>
       </BreakpointProxy>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/data_provider/iSalesNetwork.m"
+            timestampString = "495944149.948286"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "788"
+            endingLineNumber = "788"
+            landmarkName = "+commit_Order:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/data_provider/iSalesNetwork.m"
+            timestampString = "495944248.440445"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "768"
+            endingLineNumber = "768"
+            landmarkName = "+commit_Order:"
+            landmarkType = "5">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
    </Breakpoints>
 </Bucket>
 </Bucket>

+ 44 - 27
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -6341,6 +6341,11 @@
             nsstatus=@"Closed";
             nsstatus=@"Closed";
             break;
             break;
         }
         }
+        case -11:
+        {
+            nsstatus = @"Ready For Submit";
+            break;
+        }
             
             
             
             
             
             
@@ -8666,11 +8671,7 @@
     return  ret;
     return  ret;
 }
 }
 
 
-+(NSData*) offline_saveorder :(NSMutableDictionary *) param
-{
-//  "logistic_note" = "PERSONAL PICK UP";
-    // logist_note_text
-    // "logistic_note" = "USE MY CARRIER";
++ (NSData *)saveorder:(NSMutableDictionary *)param submit:(BOOL)submit {
     NSString *so_id = [self valueInParams:param key:@"orderCode" translateSingleQuote:YES];
     NSString *so_id = [self valueInParams:param key:@"orderCode" translateSingleQuote:YES];
     NSString *general_notes = [self valueInParams:param key:@"comments" translateSingleQuote:YES];
     NSString *general_notes = [self valueInParams:param key:@"comments" translateSingleQuote:YES];
     general_notes = [NSString stringWithFormat:@"general_notes = '%@',",general_notes] ;
     general_notes = [NSString stringWithFormat:@"general_notes = '%@',",general_notes] ;
@@ -8737,11 +8738,12 @@
     NSString *logistic_note = [self valueInParams:param key:@"logistic_note" translateSingleQuote:YES];
     NSString *logistic_note = [self valueInParams:param key:@"logistic_note" translateSingleQuote:YES];
     logistic_note = [logistic_note isEqualToString:@"USE MY CARRIER"] ? [NSString stringWithFormat:@"logistic_note = '%@\n\t%@',",logistic_note,logistic_note_text] : [NSString stringWithFormat:@"logistic_note = '%@',",logistic_note];
     logistic_note = [logistic_note isEqualToString:@"USE MY CARRIER"] ? [NSString stringWithFormat:@"logistic_note = '%@\n\t%@',",logistic_note,logistic_note_text] : [NSString stringWithFormat:@"logistic_note = '%@',",logistic_note];
     
     
-//    NSString *erpOrderStatus = [self valueInParams:param key:@"erpOrderStatus"];
+    //    NSString *erpOrderStatus = [self valueInParams:param key:@"erpOrderStatus"];
     NSNumber *erpOrderStatus_number = [param objectForKey:@"erpOrderStatus"];
     NSNumber *erpOrderStatus_number = [param objectForKey:@"erpOrderStatus"];
-    NSString *erpOrderStatus = !erpOrderStatus_number ? @"" : [NSString stringWithFormat:@"submit_as = %@,",erpOrderStatus_number];
+    NSString *erpOrderStatus = !erpOrderStatus_number ? @"" : [NSString stringWithFormat:@"submit_as = %@,",erpOrderStatus_number]; // submit as
 
 
     
     
+    
     NSString *paymentType = [self valueInParams:param key:@"paymentType" translateSingleQuote:YES];
     NSString *paymentType = [self valueInParams:param key:@"paymentType" translateSingleQuote:YES];
     paymentType = [NSString stringWithFormat:@"paymentType = '%@',",paymentType];
     paymentType = [NSString stringWithFormat:@"paymentType = '%@',",paymentType];
     
     
@@ -8781,7 +8783,7 @@
     
     
     NSNumber *card_type_number = [param objectForKey:@"credit_card_type"];
     NSNumber *card_type_number = [param objectForKey:@"credit_card_type"];
     NSString *credit_card_type = [NSString stringWithFormat:@"credit_card_type = '%@',",[card_type_number integerValue] == 0 ? @"VISA" : @"MASTER CARD"];
     NSString *credit_card_type = [NSString stringWithFormat:@"credit_card_type = '%@',",[card_type_number integerValue] == 0 ? @"VISA" : @"MASTER CARD"];
-   
+    
     
     
     NSString *credit_card_zipcode = [self valueInParams:param key:@"credit_card_zipcode" translateSingleQuote:YES];
     NSString *credit_card_zipcode = [self valueInParams:param key:@"credit_card_zipcode" translateSingleQuote:YES];
     credit_card_zipcode = [NSString stringWithFormat:@"credit_card_zipcode = '%@',",credit_card_zipcode];
     credit_card_zipcode = [NSString stringWithFormat:@"credit_card_zipcode = '%@',",credit_card_zipcode];
@@ -8810,12 +8812,12 @@
     NSString *customer_phone = [self valueInParams:param key:@"customer_phone" translateSingleQuote:YES];
     NSString *customer_phone = [self valueInParams:param key:@"customer_phone" translateSingleQuote:YES];
     NSString *contact_phone = [NSString stringWithFormat:@"phone = '%@',",[AESCrypt fastencrypt:customer_phone]];
     NSString *contact_phone = [NSString stringWithFormat:@"phone = '%@',",[AESCrypt fastencrypt:customer_phone]];
     customer_phone = [NSString stringWithFormat:@"customer_phone = '%@',",customer_phone];
     customer_phone = [NSString stringWithFormat:@"customer_phone = '%@',",customer_phone];
-   
+    
     
     
     NSString *customer_fax = [self valueInParams:param key:@"customer_fax" translateSingleQuote:YES];
     NSString *customer_fax = [self valueInParams:param key:@"customer_fax" translateSingleQuote:YES];
     NSString *contact_fax = [NSString stringWithFormat:@"fax = '%@',",customer_fax];
     NSString *contact_fax = [NSString stringWithFormat:@"fax = '%@',",customer_fax];
     customer_fax = [NSString stringWithFormat:@"customer_fax = '%@',",customer_fax];
     customer_fax = [NSString stringWithFormat:@"customer_fax = '%@',",customer_fax];
-   
+    
     
     
     //
     //
     NSString *customer_name = [self valueInParams:param key:@"customer_name" translateSingleQuote:YES];
     NSString *customer_name = [self valueInParams:param key:@"customer_name" translateSingleQuote:YES];
@@ -8854,27 +8856,27 @@
     NSString *receive_name = [self valueInParams:param key:@"receive_name" translateSingleQuote:YES];
     NSString *receive_name = [self valueInParams:param key:@"receive_name" translateSingleQuote:YES];
     receive_name = [NSString stringWithFormat:@"receive_name = '%@',",receive_name];
     receive_name = [NSString stringWithFormat:@"receive_name = '%@',",receive_name];
     
     
-
+    
     NSString *receive_ext = [self valueInParams:param key:@"receive_ext" translateSingleQuote:YES];
     NSString *receive_ext = [self valueInParams:param key:@"receive_ext" translateSingleQuote:YES];
     receive_ext = [NSString stringWithFormat:@"receive_ext = '%@',",receive_ext];
     receive_ext = [NSString stringWithFormat:@"receive_ext = '%@',",receive_ext];
     
     
-
+    
     NSString *receive_contact = [self valueInParams:param key:@"receive_contact" translateSingleQuote:YES];
     NSString *receive_contact = [self valueInParams:param key:@"receive_contact" translateSingleQuote:YES];
     receive_contact = [NSString stringWithFormat:@"receive_contact = '%@',",receive_contact];
     receive_contact = [NSString stringWithFormat:@"receive_contact = '%@',",receive_contact];
     
     
-
+    
     NSString *receive_phone = [self valueInParams:param key:@"receive_phone" translateSingleQuote:YES];
     NSString *receive_phone = [self valueInParams:param key:@"receive_phone" translateSingleQuote:YES];
     receive_phone = [NSString stringWithFormat:@"receive_phone = '%@',",receive_phone];
     receive_phone = [NSString stringWithFormat:@"receive_phone = '%@',",receive_phone];
     
     
-
+    
     NSString *receive_email = [self valueInParams:param key:@"receive_email" translateSingleQuote:YES];
     NSString *receive_email = [self valueInParams:param key:@"receive_email" translateSingleQuote:YES];
     receive_email = [NSString stringWithFormat:@"receive_email = '%@',",receive_email];
     receive_email = [NSString stringWithFormat:@"receive_email = '%@',",receive_email];
     
     
-
+    
     NSString *receive_fax = [self valueInParams:param key:@"receive_fax" translateSingleQuote:YES];
     NSString *receive_fax = [self valueInParams:param key:@"receive_fax" translateSingleQuote:YES];
     receive_fax = [NSString stringWithFormat:@"receive_fax = '%@',",receive_fax];
     receive_fax = [NSString stringWithFormat:@"receive_fax = '%@',",receive_fax];
     
     
-
+    
     
     
     NSString *sender_cid = [self valueInParams:param key:@"sender_cid" translateSingleQuote:YES];
     NSString *sender_cid = [self valueInParams:param key:@"sender_cid" translateSingleQuote:YES];
     sender_cid = [NSString stringWithFormat:@"sender_cid = '%@',",sender_cid];
     sender_cid = [NSString stringWithFormat:@"sender_cid = '%@',",sender_cid];
@@ -8904,22 +8906,22 @@
     shipping_billto_cid = [NSString stringWithFormat:@"shipping_billto_cid = '%@',",shipping_billto_cid];
     shipping_billto_cid = [NSString stringWithFormat:@"shipping_billto_cid = '%@',",shipping_billto_cid];
     
     
     NSString *shipping_billto_name = [self valueInParams:param key:@"shipping_billto_name" translateSingleQuote:YES];
     NSString *shipping_billto_name = [self valueInParams:param key:@"shipping_billto_name" translateSingleQuote:YES];
-     shipping_billto_name = [NSString stringWithFormat:@"shipping_billto_name = '%@',",shipping_billto_name];
+    shipping_billto_name = [NSString stringWithFormat:@"shipping_billto_name = '%@',",shipping_billto_name];
     
     
     NSString *shipping_billto_ext = [self valueInParams:param key:@"shipping_billto_ext" translateSingleQuote:YES];
     NSString *shipping_billto_ext = [self valueInParams:param key:@"shipping_billto_ext" translateSingleQuote:YES];
-     shipping_billto_ext = [NSString stringWithFormat:@"shipping_billto_ext = '%@',",shipping_billto_ext];
+    shipping_billto_ext = [NSString stringWithFormat:@"shipping_billto_ext = '%@',",shipping_billto_ext];
     
     
     NSString *shipping_billto_contact = [self valueInParams:param key:@"shipping_billto_contact" translateSingleQuote:YES];
     NSString *shipping_billto_contact = [self valueInParams:param key:@"shipping_billto_contact" translateSingleQuote:YES];
-     shipping_billto_contact = [NSString stringWithFormat:@"shipping_billto_contact = '%@',",shipping_billto_contact];
+    shipping_billto_contact = [NSString stringWithFormat:@"shipping_billto_contact = '%@',",shipping_billto_contact];
     
     
     NSString *shipping_billto_phone = [self valueInParams:param key:@"shipping_billto_phone" translateSingleQuote:YES];
     NSString *shipping_billto_phone = [self valueInParams:param key:@"shipping_billto_phone" translateSingleQuote:YES];
-     shipping_billto_phone = [NSString stringWithFormat:@"shipping_billto_phone = '%@',",shipping_billto_phone];
+    shipping_billto_phone = [NSString stringWithFormat:@"shipping_billto_phone = '%@',",shipping_billto_phone];
     
     
     NSString *shipping_billto_fax = [self valueInParams:param key:@"shipping_billto_fax" translateSingleQuote:YES];
     NSString *shipping_billto_fax = [self valueInParams:param key:@"shipping_billto_fax" translateSingleQuote:YES];
-     shipping_billto_fax = [NSString stringWithFormat:@"shipping_billto_fax = '%@',",shipping_billto_fax];
+    shipping_billto_fax = [NSString stringWithFormat:@"shipping_billto_fax = '%@',",shipping_billto_fax];
     
     
     NSString *shipping_billto_email = [self valueInParams:param key:@"shipping_billto_email" translateSingleQuote:YES];
     NSString *shipping_billto_email = [self valueInParams:param key:@"shipping_billto_email" translateSingleQuote:YES];
-     shipping_billto_email = [NSString stringWithFormat:@"shipping_billto_email = '%@',",shipping_billto_email];
+    shipping_billto_email = [NSString stringWithFormat:@"shipping_billto_email = '%@',",shipping_billto_email];
     
     
     
     
     NSString *billing_cid = [self valueInParams:param key:@"billing_cid" translateSingleQuote:YES];
     NSString *billing_cid = [self valueInParams:param key:@"billing_cid" translateSingleQuote:YES];
@@ -8966,16 +8968,23 @@
     returnto_email = [NSString stringWithFormat:@"returnto_email = '%@',",returnto_email];
     returnto_email = [NSString stringWithFormat:@"returnto_email = '%@',",returnto_email];
     
     
     NSString *order_status = @"status = 1,";
     NSString *order_status = @"status = 1,";
+    if (submit) {
+        order_status = @"status = -11,";
+    }
     
     
-//    NSString *sync_data = [AESCrypt fastencrypt:[RAUtils dict2string:param]];
+    //    NSString *sync_data = [AESCrypt fastencrypt:[RAUtils dict2string:param]];
     NSString *sync_data = [self translateSingleQuote:[RAUtils dict2string:param]];
     NSString *sync_data = [self translateSingleQuote:[RAUtils dict2string:param]];
+    NSString *sync_sql = @"";
+    if (submit) {
+        sync_sql = [NSString stringWithFormat:@",sync_data = '%@' ",sync_data];
+    }
     
     
-    NSString *orderSql = [NSString stringWithFormat:@"update offline_order set %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ so_id = '%@',sync_data = '%@' where so_id = '%@';",order_status,general_notes,internal_notes,poNumber,must_call,sign_picpath,total_price,paymentsAndCredits,handling_fee_placeholder,lift_gate,lift_gate_placeholder,logist,logistic_note,erpOrderStatus,paymentType,credit_card_address1,credit_card_address2,credit_card_city,credit_card_first_name,credit_card_last_name,credit_card_number,credit_card_security_code,credit_card_state,credit_card_type,credit_card_zipcode,credit_card_expiration_year,credit_card_expiration_month,customer_cid,customer_contact,customer_email,customer_phone,customer_fax,receive_cid,receive_name,receive_ext,receive_contact,receive_phone,receive_email,receive_fax,sender_cid,sender_name,sender_ext,sender_contact,sender_phone,sender_fax,sender_email,shipping_billto_cid,shipping_billto_name,shipping_billto_ext,shipping_billto_contact,shipping_billto_phone,shipping_billto_fax,shipping_billto_email,billing_cid,billing_name,billing_ext,billing_contact,billing_phone,billing_fax,billing_email,returnto_cid,returnto_name,returnto_ext,returnto_contact,returnto_phone,returnto_fax,returnto_email,so_id,sync_data,so_id];
+    NSString *orderSql = [NSString stringWithFormat:@"update offline_order set %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ %@ so_id = '%@' %@ where so_id = '%@';",order_status,general_notes,internal_notes,poNumber,must_call,sign_picpath,total_price,paymentsAndCredits,handling_fee_placeholder,lift_gate,lift_gate_placeholder,logist,logistic_note,erpOrderStatus,paymentType,credit_card_address1,credit_card_address2,credit_card_city,credit_card_first_name,credit_card_last_name,credit_card_number,credit_card_security_code,credit_card_state,credit_card_type,credit_card_zipcode,credit_card_expiration_year,credit_card_expiration_month,customer_cid,customer_contact,customer_email,customer_phone,customer_fax,receive_cid,receive_name,receive_ext,receive_contact,receive_phone,receive_email,receive_fax,sender_cid,sender_name,sender_ext,sender_contact,sender_phone,sender_fax,sender_email,shipping_billto_cid,shipping_billto_name,shipping_billto_ext,shipping_billto_contact,shipping_billto_phone,shipping_billto_fax,shipping_billto_email,billing_cid,billing_name,billing_ext,billing_contact,billing_phone,billing_fax,billing_email,returnto_cid,returnto_name,returnto_ext,returnto_contact,returnto_phone,returnto_fax,returnto_email,so_id,sync_sql,so_id];
     
     
     DebugLog(@"save order contactSql: %@",contactSql);
     DebugLog(@"save order contactSql: %@",contactSql);
     DebugLog(@"save order orderSql: %@",orderSql);
     DebugLog(@"save order orderSql: %@",orderSql);
     
     
-//    int contact_ret = [iSalesDB execSql:contactSql];
+    //    int contact_ret = [iSalesDB execSql:contactSql];
     
     
     int order_ret = [iSalesDB execSql:orderSql];
     int order_ret = [iSalesDB execSql:orderSql];
     
     
@@ -8985,12 +8994,20 @@
     NSMutableDictionary *dic = [NSMutableDictionary dictionary];
     NSMutableDictionary *dic = [NSMutableDictionary dictionary];
     [dic setValue:[NSNumber numberWithInteger:ret] forKey:@"result"];
     [dic setValue:[NSNumber numberWithInteger:ret] forKey:@"result"];
     [dic setValue:@"Regular Mode" forKey:@"mode"];
     [dic setValue:@"Regular Mode" forKey:@"mode"];
-//    [dic setValue:@"160409" forKey:@"min_ver"];
+    //    [dic setValue:@"160409" forKey:@"min_ver"];
     [dic setObject:so_id forKey:@"so#"];
     [dic setObject:so_id forKey:@"so#"];
     return [RAUtils dict2data:dic];
     return [RAUtils dict2data:dic];
 
 
 }
 }
 
 
++(NSData*) offline_saveorder :(NSMutableDictionary *) param
+{
+//  "logistic_note" = "PERSONAL PICK UP";
+    // logist_note_text
+    // "logistic_note" = "USE MY CARRIER";
+    return [self saveorder:param submit:NO];
+}
+
 #pragma mark add to cart by name
 #pragma mark add to cart by name
 
 
 +(NSData*) offline_add2cartbyname :(NSMutableDictionary *) params
 +(NSData*) offline_add2cartbyname :(NSMutableDictionary *) params
@@ -9080,7 +9097,7 @@
 #pragma mark submit order
 #pragma mark submit order
 +(NSData*) offline_submitorder :(NSMutableDictionary *) params;
 +(NSData*) offline_submitorder :(NSMutableDictionary *) params;
 {
 {
-        return [RAUtils dict2data:[self offline_notimpl]];
+    return [self saveorder:params submit:YES];
 }
 }
 #pragma mark copy order
 #pragma mark copy order
 
 

+ 6 - 1
RedAnt ERP Mobile/common/Functions/order/offline_status_filter_cadedate.json

@@ -39,5 +39,10 @@
         "value": "Temp Order",
         "value": "Temp Order",
         "value_id": "0"
         "value_id": "0"
     },
     },
-    "count": 8
+    "val_8": {
+        "check": 1,
+        "value": "Ready For Submit",
+        "value_id": "-11"
+    },
+    "count": 9
 }
 }