فهرست منبع

1.修改NPD Order List区分Store和Customer。

Pen Li 8 سال پیش
والد
کامیت
c41d889544

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

@@ -1734,12 +1734,12 @@
     }
 #endif
     
-    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER) {
+    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore ) {
         [map setValue:@"Price Setting" forKey:@"title"];
         //        [map setValue:@"rect_market_news" forKey:@"img"];
         [self.sideMenuItems addObject:map.copy];
     }
-    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER) {
+    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore ) {
         if ([Singleton sharedInstance].global_lock) {
             [map setValue:@"Unlock" forKey:@"title"];
         } else {
@@ -1766,7 +1766,7 @@
 //        //        [map setValue:@"rect_market_news" forKey:@"img"];
 //        [self.sideMenuItems addObject:map.copy];
 //    }
-    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER) {
+    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore ) {
         if ([Singleton sharedInstance].global_lock) {
             [map setValue:@"Unlock" forKey:@"title"];
         } else {
@@ -2424,7 +2424,7 @@
         UIApplication * app = [UIApplication sharedApplication];
         AppDelegate *appDelegate = (AppDelegate *)[app delegate];
         
-        if (appDelegate.user_type == USER_ROLE_CUSTOMER && [Singleton sharedInstance].global_lock) {
+        if (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore  && [Singleton sharedInstance].global_lock) {
             
             JKLockController *lockVC = [[JKLockController alloc] init];
             [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",appDelegate.user]];
@@ -2458,7 +2458,7 @@
         UIApplication * app = [UIApplication sharedApplication];
         AppDelegate *appDelegate = (AppDelegate *)[app delegate];
         
-        if (appDelegate.user_type == USER_ROLE_CUSTOMER && [Singleton sharedInstance].global_lock) {
+        if (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore  && [Singleton sharedInstance].global_lock) {
             
             JKLockController *lockVC = [[JKLockController alloc] init];
             [lockVC setPasswordKey:[NSString stringWithFormat:@"%@_password",appDelegate.user]];

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

@@ -185,7 +185,7 @@
     UIApplication * app = [UIApplication sharedApplication];
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
     
-    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER) {
+    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
         self.shop_order_filter = [Singleton sharedInstance].shop_order_status_filter;
         self.sales_order_filter = [Singleton sharedInstance].sales_order_status_filter;
         if(self.init_style==OL_OPEN)
@@ -311,7 +311,7 @@
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     NSMutableArray *items = [self.toolbarView.items mutableCopy];
     
-    if(appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER) {
+    if(appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
         
         //  Check for Saved Order中Type和History Type不一致导致Status不正确
         [Singleton sharedInstance].customer_order_type = self.orderType;
@@ -360,7 +360,7 @@
     }
     
     // 非Customer用户不用区分Sales Order 和 Shop Order
-    if (appDelegate.user_type != USER_ROLE_CUSTOMER) {
+    if (appDelegate.user_type != USER_ROLE_CUSTOMER || (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeCustomer)) {
         self.orderTypeSegmentControl.hidden = YES;
         CGFloat y = CGRectGetMinY(self.orderTypeSegmentControl.frame);
         CGFloat height = CGRectGetHeight(self.orderTypeSegmentControl.frame);
@@ -388,7 +388,7 @@
     }
     
     // 显示Sales Order与否
-    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER) {
+    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
         if ([Singleton sharedInstance].global_lock || ![Singleton sharedInstance].customer_can_see_sales_Order) { // 是否解锁,是否有查看Sales Order权限
             if (self.orderTypeSegmentControl.numberOfSegments > 1) {
                 [self.orderTypeSegmentControl removeSegmentAtIndex:1 animated:YES];
@@ -558,7 +558,7 @@
     
     BOOL isMerged = NO;
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
-    if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
+    if (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
         if (self.orderType == 0) {
             isMerged = NO;
         } else {
@@ -756,7 +756,7 @@
 //            appDelegate.order_code= nil;
 //            [appDelegate SetSo:nil];
             
-            if (appDelegate.user_type == USER_ROLE_EMPLOYEE) {
+            if (appDelegate.user_type == USER_ROLE_EMPLOYEE || (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeCustomer)) {
                 //     MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
                 ContactListViewController* cvc = [self.storyboard instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
                 cvc.showNavibar = true;
@@ -797,7 +797,7 @@
                 
                 [self.navigationController pushViewController:cvc animated:true];
             }
-            else if (appDelegate.user_type == USER_ROLE_CUSTOMER){
+            else if (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore){
                 [self neworder];
             }
             
@@ -947,7 +947,7 @@
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     
     UILabel *pricelabel = nil;
-    if(appDelegate.user_type==USER_ROLE_CUSTOMER&&self.orderType==1)
+    if(appDelegate.user_type==USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore && self.orderType==1)
         pricelabel=[[UILabel alloc] initWithFrame:CGRectMake(/*492*/self.table_order.frame.size.width-276, 2, 100, 22)];
     else
         pricelabel=[[UILabel alloc] initWithFrame:CGRectMake(/*492*/self.table_order.frame.size.width-276, 11, 100, 22)];
@@ -959,7 +959,7 @@
     [myView addSubview:pricelabel];
     
     
-    if(appDelegate.user_type==USER_ROLE_CUSTOMER&&self.orderType==1)
+    if(appDelegate.user_type==USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore && self.orderType==1)
     {
         UILabel *polabel = nil;
         polabel=[[UILabel alloc] initWithFrame:CGRectMake(/*492*/self.table_order.frame.size.width-276, 21, 100, 22)];
@@ -1074,7 +1074,7 @@
         NSInteger statusCode = [[self.content_data[indexPath.row] valueForKey:@"orderStatus"] integerValue];
         NSString* purchase_time= [self.content_data[indexPath.row] valueForKey:@"purchase_time"];
         NSString* status = [self.content_data[indexPath.row] valueForKey:@"order_status"] ;
-        if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER) {
+        if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
             status = [ERPUtils orderStatus:statusCode];
         }
         NSString* customer_name = [self.content_data[indexPath.row] valueForKey:@"customer_name"];
@@ -1084,7 +1084,7 @@
         NSString *po = [self.content_data[indexPath.row] valueForKey:@"po_id"];
         
         CGRect price_frame = cell.labelprice.frame;
-        if (appDelegate.user_type == USER_ROLE_CUSTOMER && self.orderType == 1) {
+        if (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore && self.orderType == 1) {
             
             cell.label_po.hidden = NO;
             price_frame.origin.y = 5;
@@ -1182,7 +1182,7 @@
         return;
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
 
-    if(appDelegate.user_type==USER_ROLE_CUSTOMER) { // Customer
+    if(appDelegate.user_type==USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) { // Customer
         if ([Singleton sharedInstance].global_lock) { // Order list 被锁
             [RAUtils message_alert:@"Permission Needed.\nGoto Menu -> Unlock" title:@"Warning" controller:self];
             return;
@@ -1275,7 +1275,7 @@
 //    NSString* order_status= [self.content_data[indexPath.row] valueForKey:@"order_status"];
     NSInteger statusCode = [[self.content_data[indexPath.row] valueForKey:@"orderStatus"] integerValue];
     
-    if(appDelegate.user_type==USER_ROLE_EMPLOYEE) {
+    if(appDelegate.user_type==USER_ROLE_EMPLOYEE || (appDelegate.user_type==USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeCustomer)) {
 
         UITableViewRowAction *deleteRowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
             
@@ -1457,7 +1457,7 @@
         
         
         
-    } else if (appDelegate.user_type==USER_ROLE_CUSTOMER) {
+    } else if (appDelegate.user_type==USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
         
 //        UITableViewRowAction *add2MergeListAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Add To Combine List" handler:^(UITableViewRowAction * _Nonnull action, NSIndexPath * _Nonnull indexPath) {
 //            
@@ -1692,7 +1692,7 @@
 //    NSString* order_status= [self.content_data[indexPath.row] valueForKey:@"order_status"];
     NSInteger statusCode = [[self.content_data[indexPath.row] valueForKey:@"orderStatus"] integerValue];
     
-    if(appDelegate.user_type==USER_ROLE_CUSTOMER) {
+    if(appDelegate.user_type==USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
         // saved && ((type==0 && merge_permission) || type == 1 || can_cancel)
 
         BOOL isSavedOrder = /*[order_status isEqualToString:@"Saved Order"]*/statusCode == 1;
@@ -2160,7 +2160,7 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
         [self.table_order setEditing:NO animated:YES];
         self.editOrderListButton.image = [UIImage imageNamed:@"Combinegray"];
     }
-    if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
+    if (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
         self.orderTypeSegmentControl.selectedSegmentIndex = 0;
         [Singleton sharedInstance].customer_order_type = 0;
         

+ 1 - 1
RedAnt ERP Mobile/common/data_provider/RANetwork.m

@@ -4011,7 +4011,7 @@ repeat:
         appDelegate.user_type = [[objheader valueForKey:@"user_type"] intValue];
         appDelegate.user_icon =[objheader valueForKey:@"user_img"] ;
         appDelegate.bLogin = true;
-        
+        appDelegate.customer_type = [[objheader valueForKey:@"customer_login_type"] integerValue];
         
         
         

+ 5 - 0
RedAnt ERP Mobile/iSales-GATIT/AppDelegate.h

@@ -13,6 +13,10 @@
 #import "ActiveViewController.h"
 #import "SyncControlPanelViewController.h"
 
+typedef enum {
+    CustomerTypeStore     = 0,
+    CustomerTypeCustomer  = 1
+} CustomerType;
 
 @interface AppDelegate : UIResponder <UIApplicationDelegate,ScanApiHelperDelegate , NSURLConnectionDataDelegate>
 
@@ -25,6 +29,7 @@
 @property bool bLogin;
 @property bool bEnable_Cache;
 @property long user_type;
+@property CustomerType customer_type;
 @property (strong , nonatomic) NSString* contact_id;
 
 

+ 5 - 0
RedAnt ERP Mobile/iSales-HOMER/AppDelegate.h

@@ -13,6 +13,10 @@
 #import "ActiveViewController.h"
 #import "SyncControlPanelViewController.h"
 
+typedef enum {
+    CustomerTypeStore     = 0,
+    CustomerTypeCustomer  = 1
+} CustomerType;
 
 @interface AppDelegate : UIResponder <UIApplicationDelegate,ScanApiHelperDelegate , NSURLConnectionDataDelegate>
 
@@ -25,6 +29,7 @@
 @property bool bLogin;
 @property bool bEnable_Cache;
 @property long user_type;
+@property CustomerType customer_type;
 @property (strong , nonatomic) NSString* contact_id;
 
 

+ 5 - 0
RedAnt ERP Mobile/iSales-NPD/AppDelegate.h

@@ -13,6 +13,10 @@
 #import "ActiveViewController.h"
 #import "SyncControlPanelViewController.h"
 
+typedef enum {
+    CustomerTypeStore     = 0,
+    CustomerTypeCustomer  = 1
+} CustomerType;
 
 @interface AppDelegate : UIResponder <UIApplicationDelegate,ScanApiHelperDelegate , NSURLConnectionDataDelegate>
 
@@ -25,6 +29,7 @@
 @property bool bLogin;
 @property bool bEnable_Cache;
 @property long user_type;
+@property CustomerType customer_type;
 @property (strong , nonatomic) NSString* contact_id;
 
 

+ 5 - 0
RedAnt ERP Mobile/iSales-USAI/AppDelegate.h

@@ -13,6 +13,10 @@
 #import "ActiveViewController.h"
 #import "SyncControlPanelViewController.h"
 
+typedef enum {
+    CustomerTypeStore     = 0,
+    CustomerTypeCustomer  = 1
+} CustomerType;
 
 @interface AppDelegate : UIResponder <UIApplicationDelegate,ScanApiHelperDelegate , NSURLConnectionDataDelegate>
 
@@ -25,6 +29,7 @@
 @property bool bLogin;
 @property bool bEnable_Cache;
 @property long user_type;
+@property CustomerType customer_type;
 @property (strong , nonatomic) NSString* contact_id;