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

1.修改NPD区分Customer账号登陆。

Pen Li 8 лет назад
Родитель
Сommit
336f9c0260

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

@@ -1674,7 +1674,7 @@
         
         
     }
     }
 #endif
 #endif
-    if(appDelegate.user_type==USER_ROLE_EMPLOYEE)
+    if(appDelegate.user_type==USER_ROLE_EMPLOYEE || (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeCustomer))
     {
     {
 //        [map setValue:@"Contact" forKey:@"title"];
 //        [map setValue:@"Contact" forKey:@"title"];
 //        [map setValue:@"rect_contact_list" forKey:@"img"];
 //        [map setValue:@"rect_contact_list" forKey:@"img"];

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

@@ -500,7 +500,7 @@
 
 
     // Shop 权限检查
     // Shop 权限检查
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-    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].permissions_edit_order) {
         if (![Singleton sharedInstance].permissions_edit_order) {
             
             
             CGRect frame0 = self.cancelOrderButton.frame;
             CGRect frame0 = self.cancelOrderButton.frame;
@@ -993,7 +993,7 @@
 -(void)placeOrder
 -(void)placeOrder
 {
 {
     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     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 (![Singleton sharedInstance].permissions_edit_order) {
         if (![Singleton sharedInstance].permissions_edit_order) {
@@ -2666,7 +2666,11 @@
         return arr;
         return arr;
         //    return @[deleteRowAction,addWatchAction, editRowAction,freeRowAction];
         //    return @[deleteRowAction,addWatchAction, editRowAction,freeRowAction];
     } else if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
     } else if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
-        return @[notifyMeAction,deleteRowAction,addWatchAction,editRowAction];
+        if (appDelegate.customer_type == CustomerTypeStore) {
+            return @[notifyMeAction,deleteRowAction,addWatchAction,editRowAction];
+        } else {
+            return @[notifyMeAction,deleteRowAction,addWatchAction];
+        }
     }
     }
     else
     else
         return @[deleteRowAction,addWatchAction];
         return @[deleteRowAction,addWatchAction];

+ 2 - 2
RedAnt ERP Mobile/common/Functions/category/CategoryViewController.m

@@ -796,7 +796,7 @@
 //        return;
 //        return;
 //    }
 //    }
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
-    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER) {
+    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
         [RAUtils message_alert:@"Cannot Add to portfolio." title:@"Warning" controller:self] ;
         [RAUtils message_alert:@"Cannot Add to portfolio." title:@"Warning" controller:self] ;
         return;
         return;
     }
     }
@@ -1436,7 +1436,7 @@
     // customer 隐藏add to portfolio
     // customer 隐藏add to portfolio
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     NSMutableArray *items = [self.selectToolbar.items mutableCopy];
     NSMutableArray *items = [self.selectToolbar.items mutableCopy];
-    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER) {
+    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
         
         
         if ([items containsObject:self.addPortfolioBtn]) {
         if ([items containsObject:self.addPortfolioBtn]) {
             
             

+ 1 - 1
RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.m

@@ -91,7 +91,7 @@
     UIApplication * app = [UIApplication sharedApplication];
     UIApplication * app = [UIApplication sharedApplication];
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
     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) {
         [[NSNotificationCenter defaultCenter] postNotificationName:No_Rights_Notification object:nil];
         [[NSNotificationCenter defaultCenter] postNotificationName:No_Rights_Notification object:nil];
         return;
         return;
     }
     }

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

@@ -1156,7 +1156,7 @@ self.isrefreshing=false;
             };
             };
             
             
             
             
-            if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
+            if (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
                 
                 
                 cell.btnaddPortfolio.hidden = YES;
                 cell.btnaddPortfolio.hidden = YES;
                 
                 
@@ -1307,7 +1307,7 @@ self.isrefreshing=false;
             };
             };
             
             
             
             
-            if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
+            if (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
                 
                 
                 cell.btnaddPortfolio.hidden = YES;
                 cell.btnaddPortfolio.hidden = YES;
                 
                 

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

@@ -1912,7 +1912,7 @@
                     [self.navigationController popViewControllerAnimated:true];
                     [self.navigationController popViewControllerAnimated:true];
                 }
                 }
                 
                 
-                if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
+                if (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
                     
                     
                     if (![Singleton sharedInstance].currentOrderIsMerged) {
                     if (![Singleton sharedInstance].currentOrderIsMerged) {
                         [self releaseOrderAfterSave];
                         [self releaseOrderAfterSave];

+ 1 - 1
RedAnt ERP Mobile/common/Functions/order/OrderDetailViewController.m

@@ -1185,7 +1185,7 @@
                 int model_count =[[self.content_data valueForKey:@"model_count"] intValue];
                 int model_count =[[self.content_data valueForKey:@"model_count"] intValue];
                 if(model_count>0)/*&& ! appDelegate.offline_mode*/
                 if(model_count>0)/*&& ! appDelegate.offline_mode*/
                 {
                 {
-                    if(appDelegate.user_type== USER_ROLE_EMPLOYEE)
+                    if(appDelegate.user_type== USER_ROLE_EMPLOYEE || (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeCustomer))
                         self.btnPDF.enabled =true;
                         self.btnPDF.enabled =true;
                     else
                     else
                     {
                     {

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

@@ -756,7 +756,7 @@
 //            appDelegate.order_code= nil;
 //            appDelegate.order_code= nil;
 //            [appDelegate SetSo:nil];
 //            [appDelegate SetSo:nil];
             
             
-            if (appDelegate.user_type == USER_ROLE_EMPLOYEE || (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeCustomer)) {
+            if (appDelegate.user_type == USER_ROLE_EMPLOYEE) {
                 //     MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
                 //     MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
                 ContactListViewController* cvc = [self.storyboard instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
                 ContactListViewController* cvc = [self.storyboard instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
                 cvc.showNavibar = true;
                 cvc.showNavibar = true;
@@ -797,7 +797,7 @@
                 
                 
                 [self.navigationController pushViewController:cvc animated:true];
                 [self.navigationController pushViewController:cvc animated:true];
             }
             }
-            else if (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore){
+            else if (appDelegate.user_type == USER_ROLE_CUSTOMER){
                 [self neworder];
                 [self neworder];
             }
             }
             
             

+ 1 - 1
RedAnt ERP Mobile/common/Functions/order/RAOrderEditorViewController.m

@@ -886,7 +886,7 @@ static const int totalPage = 3;
                     [self.navigationController popViewControllerAnimated:true];
                     [self.navigationController popViewControllerAnimated:true];
                 }
                 }
                 
                 
-                if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
+                if (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
                     
                     
                     if (![Singleton sharedInstance].currentOrderIsMerged) {
                     if (![Singleton sharedInstance].currentOrderIsMerged) {
                         [self releaseOrderAfterSave];
                         [self releaseOrderAfterSave];

+ 5 - 2
RedAnt ERP Mobile/common/Functions/order/RAOrderPreviewController.m

@@ -1905,7 +1905,7 @@
                     [self.navigationController popToRootViewControllerAnimated:true];
                     [self.navigationController popToRootViewControllerAnimated:true];
                 }
                 }
                 
                 
-                if (appDelegate.user_type == USER_ROLE_CUSTOMER) {
+                if (appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
                     
                     
                     if (![Singleton sharedInstance].currentOrderIsMerged) {
                     if (![Singleton sharedInstance].currentOrderIsMerged) {
                         [self releaseOrderAfterSave];
                         [self releaseOrderAfterSave];
@@ -3367,7 +3367,10 @@
     
     
 
 
         UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Order Submission"];
         UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Order Submission"];
-        
+    
+        if([upparams[@"shipping"] isEqualToString:@"Shipping To Be Quoted"]||[upparams[@"shipping"] isEqualToString:@"To Be Quoted"])
+            upparams[@"shipping"] = nil;
+    
         [upparams setValue:@"true" forKey:@"isHold"];
         [upparams setValue:@"true" forKey:@"isHold"];
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
             
             

+ 2 - 2
RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchViewController.m

@@ -466,7 +466,7 @@
     // customer 隐藏add to portfolio
     // customer 隐藏add to portfolio
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     NSMutableArray *items = [self.selectToolbar.items mutableCopy];
     NSMutableArray *items = [self.selectToolbar.items mutableCopy];
-    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER) {
+    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
         
         
         if ([items containsObject:self.addPortfolioBtn]) {
         if ([items containsObject:self.addPortfolioBtn]) {
             
             
@@ -1221,7 +1221,7 @@
 //        return;
 //        return;
 //    }
 //    }
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
-    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER) {
+    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
         [RAUtils message_alert:@"Cannot Add to portfolio." title:@"Warning" controller:self] ;
         [RAUtils message_alert:@"Cannot Add to portfolio." title:@"Warning" controller:self] ;
         return;
         return;
     }
     }

+ 2 - 2
RedAnt ERP Mobile/common/Functions/search+itemsearch/SearchViewController.m

@@ -164,7 +164,7 @@
     // customer 隐藏add to portfolio
     // customer 隐藏add to portfolio
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     NSMutableArray *items = [self.selectToolbar.items mutableCopy];
     NSMutableArray *items = [self.selectToolbar.items mutableCopy];
-    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER) {
+    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
         
         
         if ([items containsObject:self.addPortfolioBtn]) {
         if ([items containsObject:self.addPortfolioBtn]) {
             
             
@@ -1031,7 +1031,7 @@
 //    }
 //    }
     
     
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
     AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
-    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER) {
+    if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
         [RAUtils message_alert:@"Cannot Add to portfolio." title:@"Warning" controller:self] ;
         [RAUtils message_alert:@"Cannot Add to portfolio." title:@"Warning" controller:self] ;
         return;
         return;
     }
     }