Ver Fonte

修复Order List在编辑状态时登出,再次登录后Create PO按钮依旧处于编辑状态。
修复在合并订单后打开新订单的Place Order中Save Order时释放订单。
修复当前打开订单为Shop Order时,Place Order中显示Submit按钮。
修改Place Order图标,在应用锁定时Order List不可编辑。

Pen Li há 9 anos atrás
pai
commit
e0c8655809

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


+ 1 - 0
RedAnt ERP Mobile/common/Functions/cart/CartViewController.h

@@ -60,4 +60,5 @@
 @property (strong, nonatomic) IBOutlet UILabel *label_items;
 @property (strong, nonatomic) IBOutlet UILabel *label_notes;
 
+
 @end

+ 2 - 3
RedAnt ERP Mobile/common/Functions/cart/CartViewController.m

@@ -657,6 +657,7 @@
                 weakself.notes = [cart_json valueForKey:@"general_note"];
                 weakself.content_arr = [RAUtils dictionary2array:cart_json count_fields:@"count" item_mark:@"item_" items_mark:nil];
                 weakself.currentOrderIsMerged = [[cart_json valueForKey:@"is_merged_order"] boolValue];
+                [Singleton sharedInstance].currentOrderIsMerged = weakself.currentOrderIsMerged;
                 [weakself.itemListTable reloadData];
                 weakself.print_url = [cart_json valueForKey:@"cart_print_url"];
                 
@@ -836,9 +837,7 @@
         
         
         if (![Singleton sharedInstance].permissions_edit_order) {
-            if ([Singleton sharedInstance].placeOrderFromMerge) {
-                [Singleton sharedInstance].placeOrderFromMerge = NO;
-            }
+            
             return;
         }
         

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

@@ -75,14 +75,10 @@
         // 正常情况
         if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
             // customer的订单必须是Sales Order并且有提交权限才能提交
-            if (([Singleton sharedInstance].customer_order_type == 1 || [Singleton sharedInstance].placeOrderFromMerge) && [Singleton sharedInstance].permissions_submit_order) {
+            if ([Singleton sharedInstance].currentOrderIsMerged && [Singleton sharedInstance].permissions_submit_order) {
                 
                 [items addObject:self.btnSubmitOrder];
-                
-                if ([Singleton sharedInstance].placeOrderFromMerge) {
-                    [Singleton sharedInstance].placeOrderFromMerge = NO;
-                }
-                
+
             }
         } else {
             [items addObject:self.btnSubmitOrder];
@@ -1121,7 +1117,11 @@
                 appDelegate.customerInfo = customerInfo;
                 appDelegate.contact_id = [customerInfo valueForKey:@"customer_cid"];
                 }
-                [RAUtils message_alert:[editor_json objectForKey:@"so#"] title:@"Order Saved" controller:self] ;
+                NSString *msg = nil;
+                if ([editor_json objectForKey:@"so#"]) {
+                    msg = [@"SO#:" stringByAppendingString:[editor_json objectForKey:@"so#"]];
+                }
+                [RAUtils message_alert:msg title:@"Order Saved" controller:self] ;
                 
                 if([appDelegate.mode isEqualToString:@"TM"]&& appDelegate.save_order_logout && appDelegate.user_type ==USER_ROLE_EMPLOYEE)
                 {
@@ -1132,7 +1132,7 @@
                 
                 if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
                     
-                    if ([Singleton sharedInstance].customer_order_type == 0) {
+                    if (![Singleton sharedInstance].currentOrderIsMerged) {
                         [self releaseOrderAfterSave];
                     }
                     

+ 12 - 3
RedAnt ERP Mobile/common/Functions/order/OrderListViewController.m

@@ -1903,6 +1903,11 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
 
 - (IBAction)editOrderListButtonClick:(UIBarButtonItem *)sender {
 
+    if ([Singleton sharedInstance].global_lock) { // Order list 被锁
+        [RAUtils message_alert:@"Permission Needed.\nGoto Menu -> Unlock" title:@"Warning" controller:self];
+        return;
+    }
+    
     UIImage *gray = [UIImage imageNamed:@"Combinegray"];
     UIImage *green = [[UIImage imageNamed:@"Combinegreen"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
     
@@ -2037,13 +2042,17 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
                 appDelegate.order_status = orderStatus;
                 [appDelegate SetSo:so];
                 
-                [Singleton sharedInstance].placeOrderFromMerge = YES;
+                __weak MainViewController *mainVC = (MainViewController*)appDelegate.main_vc;
                 
                 [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
                 [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
                 [((MainViewController*)appDelegate.main_vc) reloadContact:true immediately:false];
                 [((MainViewController*)appDelegate.main_vc) switchToCart];
-                [((MainViewController*)appDelegate.main_vc).cartViewController placeOrder];
+                
+                mainVC.cartViewController.onFinishLoad=^{
+                    [mainVC.cartViewController placeOrder];
+                    mainVC.cartViewController.onFinishLoad=nil;
+                };
                 
             }
             else
@@ -2091,7 +2100,7 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
     self.orderType = 0;
     if (self.table_order.isEditing) {
         [self.table_order setEditing:NO animated:YES];
-        self.editOrderListButton.title = @"Select";
+        self.editOrderListButton.image = [UIImage imageNamed:@"Combinegray"];
     }
     if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
         self.orderTypeSegmentControl.selectedSegmentIndex = 0;

+ 1 - 1
RedAnt ERP Mobile/iSales-NPD/AppDelegate.m

@@ -740,7 +740,7 @@ void UncaughtExceptionHandler(NSException *exception) {
     // Place Order恢复是否能提交订单
     [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithBool:YES] forKey:@"urgency_resume"];
     [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInteger:self.user_type] forKey:@"urgency_userType"];
-    if ([Singleton sharedInstance].customer_order_type == 1 && [Singleton sharedInstance].permissions_submit_order) {
+    if ([Singleton sharedInstance].currentOrderIsMerged && [Singleton sharedInstance].permissions_submit_order) {
         [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithBool:YES] forKey:@"urgency_submitOrder"];
     }
 }

+ 8 - 8
RedAnt ERP Mobile/iSales-NPD/Base.lproj/Main.storyboard

@@ -2573,7 +2573,7 @@
                                     <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="jew-M1-our" customClass="DefaultImageButton">
                                         <frame key="frameInset" minY="85" width="126" height="30" maxX="18"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
-                                        <state key="normal" title="Place Order" backgroundImage="btn_placeorder">
+                                        <state key="normal" title="Place Order" backgroundImage="continue">
                                             <color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
                                         </state>
                                         <userDefinedRuntimeAttributes>
@@ -3023,7 +3023,7 @@
                                         <rect key="frame" x="0.0" y="22" width="768" height="66"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="H8t-DU-AtW" id="q6R-9a-SsD">
-                                            <frame key="frameInset" width="768" height="65.5"/>
+                                            <frame key="frameInset" width="768" height="66"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="WEB1509140024" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="fu3-Bf-ZH2" userLabel="So#">
@@ -3034,14 +3034,14 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="12345678.00" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="N3e-hc-gFF" userLabel="price">
-                                                    <frame key="frameInset" minY="23" width="100" maxX="176" maxY="21.5"/>
+                                                    <frame key="frameInset" minY="23" width="100" maxX="176" maxY="22"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMinX="YES" heightSizable="YES"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="02/02/2015 10:10:10" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="qf1-u6-uMA" userLabel="date">
-                                                    <frame key="frameInset" minY="11" width="148" maxX="15" maxY="11.5"/>
+                                                    <frame key="frameInset" minY="11" width="148" maxX="15" maxY="12"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMinX="YES" heightSizable="YES"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -3062,7 +3062,7 @@
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="99999" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="kLZ-2K-sGp">
-                                                    <frame key="frameInset" minY="5" width="100" maxX="176" maxY="39.5"/>
+                                                    <frame key="frameInset" minY="5" width="100" maxX="176" maxY="40"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMinX="YES" heightSizable="YES"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="15"/>
                                                     <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -6404,11 +6404,11 @@ Email: redantsupport@united-us.net</string>
                                         <rect key="frame" x="0.0" y="22" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Vyi-Ez-P2a" id="LVn-pY-YDc">
-                                            <frame key="frameInset" width="768" height="43.5"/>
+                                            <frame key="frameInset" width="768" height="44"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <view contentMode="scaleToFill" id="N1s-I8-bJv" customClass="RTLabel">
-                                                    <frame key="frameInset" minX="15" minY="8" maxX="59" maxY="7.5"/>
+                                                    <frame key="frameInset" minX="15" minY="8" maxX="59" maxY="8"/>
                                                     <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                     <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                 </view>
@@ -8643,7 +8643,6 @@ Email: redantsupport@united-us.net</string>
         <image name="btn_cancel" width="102" height="30"/>
         <image name="btn_cancelorder" width="30" height="30"/>
         <image name="btn_ok" width="102" height="30"/>
-        <image name="btn_placeorder" width="131" height="30"/>
         <image name="btn_reset" width="102" height="30"/>
         <image name="btn_retrieve" width="102" height="30"/>
         <image name="btn_save" width="102" height="30"/>
@@ -8657,6 +8656,7 @@ Email: redantsupport@united-us.net</string>
         <image name="checkbox" width="16" height="16"/>
         <image name="close" width="32" height="32"/>
         <image name="contact" width="96" height="96"/>
+        <image name="continue" width="131" height="30"/>
         <image name="filter" width="32" height="32"/>
         <image name="layout_list" width="40" height="40"/>
         <image name="layout_small" width="40" height="40"/>

+ 23 - 0
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/continue.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "continue.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "continue@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "continue@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/continue.imageset/continue.png


BIN
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/continue.imageset/continue@2x.png


BIN
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/continue.imageset/continue@3x.png


+ 1 - 2
RedAnt ERP Mobile/iSales-NPD/Singleton.h

@@ -34,8 +34,7 @@ typedef enum {
 @property (nonatomic,assign) BOOL customer_can_see_sales_Order;///<是否有权查看Sales Order,控制Order List
 @property (nonatomic,strong) NSMutableDictionary *shop_order_status_filter;///<Shop Order Status
 @property (nonatomic,copy) NSString *specialInstruction;///<登陆时传的Special Instruction,在提交订单时显示
-@property (nonatomic,assign) BOOL placeOrderFromMerge;///<是否是合并订单成功后打开的订单,使用于Order List -》 Open Order、Cart -》Place Order、Place order -》 Submit
-
+@property (nonatomic,assign) BOOL currentOrderIsMerged;///<当前打开的订单是否为Purchas Order
 #pragma mark - Employee