Browse Source

Shop Order保存时释放订单。

Pen Li 9 years ago
parent
commit
f0245da7d9

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


+ 28 - 0
RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m

@@ -1093,6 +1093,15 @@
                     [self.navigationController popViewControllerAnimated:true];
                 }
                 
+                if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
+                    
+                    if ([Singleton sharedInstance].customer_order_type == 0) {
+                        [self releaseOrderAfterSave];
+                    }
+                    
+                    
+                }
+                
                 
                 //                if ([[upparams valueForKey:@"close_on_save"] boolValue]) {
                 //                    appDelegate.order_code = nil;
@@ -2298,4 +2307,23 @@
 //    return pricename;
 //}
 
+- (void)releaseOrderAfterSave {
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        [iSalesNetwork release_Order:appDelegate.order_code];
+    });
+    
+    
+    [appDelegate closeOrder]; 
+    [appDelegate SetSo:nil];
+    appDelegate.cart_count=0;
+    [appDelegate update_count_mark];
+    [((MainViewController*)appDelegate.main_vc) switchToHome];
+
+    [self prepareReturn:nil];
+    [self.navigationController popToRootViewControllerAnimated:false];
+    
+}
+
 @end