|
|
@@ -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;
|
|
|
|