瀏覽代碼

修复Notify Me在未打开订单,打开Shop Order以及打开Purchase Order时不正确。
修复离线新建Contact时Price Type错误,及恢复编辑时崩溃。

Pen Li 9 年之前
父節點
當前提交
1cb72e3d78

二進制
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


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

@@ -2,4 +2,89 @@
 <Bucket
    type = "0"
    version = "2.0">
+   <Breakpoints>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            condition = "[nscontact_id isEqualToString:@&quot;ECODYN0001&quot;]"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/offline/OLDataProvider.m"
+            timestampString = "507006778.111966"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "6358"
+            endingLineNumber = "6358"
+            landmarkName = "+offline_contactlist:"
+            landmarkType = "7">
+            <Actions>
+               <BreakpointActionProxy
+                  ActionExtensionID = "Xcode.BreakpointAction.DebuggerCommand">
+                  <ActionContent
+                     consoleCommand = "">
+                  </ActionContent>
+               </BreakpointActionProxy>
+            </Actions>
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "No"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/offline/OLDataProvider.m"
+            timestampString = "507014199.762394"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "5669"
+            endingLineNumber = "5669"
+            landmarkName = "+offline_getPrice"
+            landmarkType = "7">
+            <Locations>
+               <Location
+                  shouldBeEnabled = "No"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "+[OLDataProvider offline_getPrice]"
+                  moduleName = "NPD Mobile"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/macmini1/project/RedAnt%20ERP%20Mobile/common/Functions/offline/OLDataProvider.m"
+                  timestampString = "507014833.451939"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "5669"
+                  endingLineNumber = "5669"
+                  offsetFromSymbolStart = "86">
+               </Location>
+               <Location
+                  shouldBeEnabled = "No"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "__34+[OLDataProvider offline_getPrice]_block_invoke"
+                  moduleName = "NPD Mobile"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/macmini1/project/RedAnt%20ERP%20Mobile/common/Functions/offline/OLDataProvider.m"
+                  timestampString = "507014833.454764"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "5671"
+                  endingLineNumber = "5671"
+                  offsetFromSymbolStart = "84">
+               </Location>
+            </Locations>
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            scope = "0"
+            stopOnStyle = "0">
+         </BreakpointContent>
+      </BreakpointProxy>
+   </Breakpoints>
 </Bucket>

+ 1 - 1
RedAnt ERP Mobile/common/Functions/MainViewController.m

@@ -404,7 +404,7 @@
 - (void)viewDidLoad
 {
     [super viewDidLoad];
-    
+//    NSLog(@"decrypt:%@",[AESCrypt fastdecrypt:@"vafHUwfRPIUbPNVnKhLc5aAVK7sOFRztlfJVRHW7QVa/qGgm11E5UwfYWZEBTQpH"]);
     
     self.automaticallyAdjustsScrollViewInsets = NO;
     NSString* value =[DefaultAppearance get_noneappearance_value:@"DefaultColor" valuename:@"labelcolor"];

+ 46 - 8
RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.m

@@ -967,7 +967,7 @@ self.isrefreshing=false;
         if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER) {
             cell.btnaddPortfolio.hidden = YES;
             
-            if (!notifyMe_switch || (![Singleton sharedInstance].currentOrderIsMerged) && appDelegate.order_code) {
+            if (!notifyMe_switch) {
                 
                 cell.btnNotifyMe.hidden = YES;
                 CGRect wishListFrame = cell.btnaddWish.frame;
@@ -1034,14 +1034,52 @@ self.isrefreshing=false;
                 cell.btnNotifyMe.layer.cornerRadius = 3.0f;
                 cell.btnNotifyMe.layer.masksToBounds = YES;
                 NSString *qtyStr = [section_json valueForKey:@"Availability"];
-                if (!qtyStr || !qtyStr.length || [qtyStr isEqualToString:@"In Production"] || [qtyStr isEqualToString:@"0"] || [qtyStr isEqualToString:@"Sold Out"]) {
-                    cell.btnaddCart.enabled = NO;
-                    cell.btnNotifyMe.alpha = 1.0;
-                    cell.btnNotifyMe.enabled = YES;
+                
+                //
+                
+                if (!appDelegate.order_code) { // 未打开订单状态
+                    
+                    if (!qtyStr || !qtyStr.length || [qtyStr isEqualToString:@"In Production"] || [qtyStr isEqualToString:@"0"] || [qtyStr isEqualToString:@"Sold Out"]) {
+                        cell.btnaddCart.enabled = NO;
+                        cell.btnNotifyMe.alpha = 1.0;
+                        cell.btnNotifyMe.enabled = YES;
+                    } else {
+                        cell.btnNotifyMe.enabled = NO;
+                        cell.btnNotifyMe.alpha = 0.4;
+                        cell.btnaddCart.enabled = YES;
+                    }
+                    
                 } else {
-                    cell.btnNotifyMe.enabled = NO;
-                    cell.btnNotifyMe.alpha = 0.4;
-                    cell.btnaddCart.enabled = YES;
+                    // 打开订单状态
+                    if (![Singleton sharedInstance].currentOrderIsMerged) {
+                        // Shop Order
+                        cell.btnaddCart.enabled = YES;
+                        // 默认未缺货
+                        cell.btnNotifyMe.alpha = 0.4;
+                        cell.btnNotifyMe.enabled = NO;
+                        
+                        if (!qtyStr || !qtyStr.length || [qtyStr isEqualToString:@"In Production"] || [qtyStr isEqualToString:@"0"] || [qtyStr isEqualToString:@"Sold Out"]) { // 缺货
+                        
+                            cell.btnNotifyMe.alpha = 1.0;
+                            cell.btnNotifyMe.enabled = YES;
+                            
+                        }
+                        
+                    } else {
+                        // Purchase Order
+                        if (!qtyStr || !qtyStr.length || [qtyStr isEqualToString:@"In Production"] || [qtyStr isEqualToString:@"0"] || [qtyStr isEqualToString:@"Sold Out"]) { // 缺货
+                            cell.btnaddCart.enabled = NO;
+                            cell.btnNotifyMe.alpha = 1.0;
+                            cell.btnNotifyMe.enabled = YES;
+                        } else { // 未缺货
+                            cell.btnNotifyMe.enabled = NO;
+                            cell.btnNotifyMe.alpha = 0.4;
+                            cell.btnaddCart.enabled = YES;
+                        }
+                        
+                    }
+                    
+                    
                 }
 
                 

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

@@ -5680,7 +5680,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
         NSMutableDictionary *priceDic = [NSMutableDictionary dictionary];
         [priceDic setValue:[NSString stringWithUTF8String:name] forKey:@"value"];
         [priceDic setValue:[NSNumber numberWithInt:type] forKey:@"value_id"];
-        NSString *key = [NSString stringWithFormat:@"val_%d",orderBy];
+        NSString *key = [NSString stringWithFormat:@"val_%ld",(*count)++];
         [priceDic setValue:[NSNumber numberWithInt:0] forKey:@"check"];
         
         if (orderBy == 0) {
@@ -6283,7 +6283,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     [ret setValue:@"2" forKey:@"result"];
     [ret setValue:[NSNumber numberWithInt:count ]  forKey:@"total"];
     
-    
+//    sqlQuery = @"select editable,decrypt(company_name),country,addr,zipcode,state,city,contact_name,phone,contact_id,addr_1,addr_2,addr_3,addr_4,first_name,last_name,fax,email from offline_contact where  Sales_Order_Customer = 1 and is_active=1  order by decrypt(company_name) limit 25 offset 0";
     if (sqlite3_prepare_v2(db, [sqlQuery UTF8String], -1, &statement, nil) == SQLITE_OK)
     {
         

+ 8 - 0
RedAnt ERP Mobile/common/Price Setting/PriceSettingViewController.m

@@ -132,6 +132,14 @@
         categoryPriceVC.categoryGivenPrice = dic.mutableCopy;
         
         [self.navigationController pushViewController:categoryPriceVC animated:YES];
+    } else {
+        
+        NSString *msg = [dic objectForKey:@"msg"];
+        if (!msg) {
+            msg = @"Some Error Occured,Please Try Again";
+        }
+        [RAUtils message_alert:msg title:@"Set Store Price" controller:self];
+        
     }
 }
 

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

@@ -614,8 +614,8 @@ void UncaughtExceptionHandler(NSException *exception) {
                     CustomerEditViewController * cuseditVC =[mainStoryBoard instantiateViewControllerWithIdentifier:@"CustomerEditViewController"];
                     
                     cuseditVC.bnewcustomer=false;
-                    cuseditVC.url_type = URL_RESTORE;
-                    cuseditVC.request_url=URL_EDIT_CUSTOMER;
+                    cuseditVC.url_type = URL_REMOTE;
+                    cuseditVC.request_url=URL_NEW_CUSTOMER;
                     
                     cuseditVC.params = params;
                     cuseditVC.content_data_download = restored_data;
@@ -677,7 +677,7 @@ void UncaughtExceptionHandler(NSException *exception) {
                     CreateOrderViewController * orderinfoVC =[mainStoryBoard instantiateViewControllerWithIdentifier:@"CreateOrderViewController"];
                     
                     orderinfoVC.disable_dropdown_refresh=true;
-                    orderinfoVC.url_type = URL_RESTORE;
+                    orderinfoVC.url_type = URL_REMOTE;
                     orderinfoVC.request_url=URL_CARTDELIVERY;
                     orderinfoVC.params = params;
                     orderinfoVC.content_data_download = restored_data;
@@ -691,7 +691,7 @@ void UncaughtExceptionHandler(NSException *exception) {
                     
                     AddressEditorViewController * addressVC =[mainStoryBoard instantiateViewControllerWithIdentifier:@"AddressEditorViewController"];
                     
-                    addressVC.url_type = URL_RESTORE;
+                    addressVC.url_type = URL_REMOTE;
                     addressVC.request_url=URL_ADDRESS_EDOTOR;
                     
                     NSMutableDictionary * params= [[NSMutableDictionary alloc] init];