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

去除Employee登陆,显示/隐藏价格的认证。
修复离线登陆时Portfolio Count不正确。

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

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


+ 50 - 25
RedAnt ERP Mobile/common/Functions/MainViewController.m

@@ -2180,20 +2180,33 @@
         UIApplication * app = [UIApplication sharedApplication];
         AppDelegate *appDelegate = (AppDelegate *)[app delegate];
         
-        JKLockController *lockVC = [[JKLockController alloc] init];
-        [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",appDelegate.user]];
-        __weak typeof(self) weakself = self;
-        lockVC.authoReturn = ^(BOOL failure) {
-
-            if (weakself) {
-                __strong typeof(weakself) strongself = weakself;
-                [appDelegate set_priceHidden:false];
+        if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
+            
+            JKLockController *lockVC = [[JKLockController alloc] init];
+            [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",appDelegate.user]];
+            __weak typeof(self) weakself = self;
+            lockVC.authoReturn = ^(BOOL failure) {
                 
-                [strongself initMenuItems];
-                [strongself hideMenu];
-            }
-        };
-        [self.navigationController pushViewController:lockVC animated:YES];
+                if (weakself) {
+                    __strong typeof(weakself) strongself = weakself;
+                    [appDelegate set_priceHidden:false];
+                    
+                    [strongself initMenuItems];
+                    [strongself hideMenu];
+                }
+            };
+            [self.navigationController pushViewController:lockVC animated:YES];
+            
+        } else {
+            
+            [appDelegate set_priceHidden:false];
+            
+            [self initMenuItems];
+            [self hideMenu];
+
+        }
+        
+        
         
      }
     else if([title isEqualToString:@"Hide Price"])
@@ -2201,20 +2214,32 @@
         UIApplication * app = [UIApplication sharedApplication];
         AppDelegate *appDelegate = (AppDelegate *)[app delegate];
         
-        JKLockController *lockVC = [[JKLockController alloc] init];
-        [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",appDelegate.user]];
-        __weak typeof(self) weakself = self;
-        lockVC.authoReturn = ^(BOOL failure) {
+        if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
             
-            if (weakself) {
-                __strong typeof(weakself) strongself = weakself;
-                [appDelegate set_priceHidden:true];
+            JKLockController *lockVC = [[JKLockController alloc] init];
+            [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",appDelegate.user]];
+            __weak typeof(self) weakself = self;
+            lockVC.authoReturn = ^(BOOL failure) {
                 
-                [strongself initMenuItems];
-                [strongself hideMenu];
-            }
-        };
-        [self.navigationController pushViewController:lockVC animated:YES];
+                if (weakself) {
+                    __strong typeof(weakself) strongself = weakself;
+                    [appDelegate set_priceHidden:true];
+                    
+                    [strongself initMenuItems];
+                    [strongself hideMenu];
+                }
+            };
+            [self.navigationController pushViewController:lockVC animated:YES];
+            
+        } else {
+            
+            [appDelegate set_priceHidden:true];
+            
+            [self initMenuItems];
+            [self hideMenu];
+            
+        }
+        
      }
     
     

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

@@ -3263,7 +3263,7 @@
             
 //            int portfolio_count = [iSalesDB get_recordcount:db table:@"portfoliolist" where:@"1=1"];
 //            [header setObject:[NSString stringWithFormat:@"%d",wish_count] forKey:@"portfolio_count"];
-            int portfolio_count = [iSalesDB get_recordcount:db table:@"offline_portfolio" where:@"1=1"];
+            int portfolio_count = [iSalesDB get_recordcount:db table:@"offline_portfolio" where:@"is_delete is  NULL or is_delete != 1"];
             [header setObject:[NSString stringWithFormat:@"%d",portfolio_count] forKey:@"portfolio_count"];
             
             [ret setObject:header forKey:@"header"];
@@ -10255,7 +10255,7 @@
             
             
         } else {
-            [item setObject:[NSString stringWithFormat:@"%f",price] forKey:@"special_price"];
+            [item setObject:[NSString stringWithFormat:@"%.2f",price] forKey:@"special_price"];
         }
         
         if (percentage) {