Ray Zhang 10 years ago
parent
commit
b915660ded
26 changed files with 478 additions and 180 deletions
  1. 13 0
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellTextView.m
  2. 6 0
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.h
  3. 15 2
      RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m
  4. 4 3
      RedAnt ERP Mobile/common/Functions/MainViewController.m
  5. 3 2
      RedAnt ERP Mobile/common/Functions/PDF+Web/PDFViewController.m
  6. 20 8
      RedAnt ERP Mobile/common/Functions/cart/CartViewController.m
  7. 2 0
      RedAnt ERP Mobile/common/Functions/cart/ModelItemCell.h
  8. 1 1
      RedAnt ERP Mobile/common/Functions/category/CategoryViewController.m
  9. 1 1
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.m
  10. 4 4
      RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m
  11. 14 5
      RedAnt ERP Mobile/common/Functions/order/OrderDetailViewController.m
  12. 53 63
      RedAnt ERP Mobile/common/Functions/order/OrderListViewController.m
  13. 3 34
      RedAnt ERP Mobile/common/Functions/order/status_filter_cadedate_open.json
  14. 2 2
      RedAnt ERP Mobile/common/Functions/portfolio/PDFListViewController.m
  15. 6 1
      RedAnt ERP Mobile/common/Functions/portfolio/PortfolioEditQTYViewController.h
  16. 168 1
      RedAnt ERP Mobile/common/Functions/portfolio/PortfolioEditQTYViewController.m
  17. 53 35
      RedAnt ERP Mobile/common/Functions/portfolio/PortfolioViewController.m
  18. 1 0
      RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchFilterViewController.h
  19. 9 1
      RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchFilterViewController.m
  20. 1 1
      RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchViewController.h
  21. 15 1
      RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchViewController.m
  22. 1 1
      RedAnt ERP Mobile/common/Functions/search+itemsearch/SearchViewController.m
  23. 1 1
      RedAnt ERP Mobile/common/RAUtils.h
  24. 17 8
      RedAnt ERP Mobile/common/RAUtils.m
  25. 2 1
      RedAnt ERP Mobile/common/data_provider/iSalesNetwork.h
  26. 63 4
      RedAnt ERP Mobile/common/data_provider/iSalesNetwork.m

+ 13 - 0
RedAnt ERP Mobile/common/CommonEditor/CommonEditorCellTextView.m

@@ -11,6 +11,19 @@
 @implementation CommonEditorCellTextView
 
 - (void)awakeFromNib {
+    
+    
+    
+    self.textview.layer.backgroundColor = [[UIColor clearColor] CGColor];
+    
+    self.textview.layer.borderColor = [[UIColor lightGrayColor] CGColor];
+    
+    self.textview.layer.borderWidth = 0.5;
+    
+    self.textview.layer.cornerRadius = 8.0f;
+    
+    [self.textview.layer setMasksToBounds:YES];
+    
     // Initialization code
 }
 

+ 6 - 0
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.h

@@ -56,6 +56,12 @@
 -(NSString*) getValue:(NSString*)name;
 
 @property bool keyboard_show;
+
+//禁止下拉刷新
+@property bool disable_dropdown_refresh;
+
+@property (strong,nonatomic) NSString* loading_msg;
+@property (strong,nonatomic) NSString* loading_title;
 //-(NSMutableDictionary*) translate_json: (NSDictionary*) injson;
 
 

+ 15 - 2
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m

@@ -88,13 +88,20 @@
 {
     [super viewDidLoad];
     
+    if(self.loading_msg==nil)
+        self.loading_msg = @"Please Wait";
+    if(self.loading_title==nil)
+        self.loading_title = @"Loading...";
+    
     UIRefreshControl *ref = [[UIRefreshControl alloc]init];
     ref.tag = 200 ;
     ref.attributedTitle = [[NSAttributedString alloc]initWithString:@"Pull to refresh"];
     ref.tintColor = [UIColor colorWithRed:0.10 green:0.68 blue:0.94 alpha:0.7];
     //    ref.hidden = true;
     [ref addTarget:self action:@selector(manually_refresh) forControlEvents:UIControlEventValueChanged];
-    [self.editorTable addSubview:ref];
+    
+    if(!self.disable_dropdown_refresh)
+        [self.editorTable addSubview:ref];
     
     
     
@@ -392,9 +399,15 @@
     if(self.url_type==URL_REMOTE)
     {
         
+        
+        
+        UIAlertView * waitalert = [RAUtils waiting_alert:self.loading_msg title:self.loading_title];
+        
         self.params[@"refresh_trigger"]=trigger;
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
             
+            
+            
             NSDictionary* refresh_params=[self get_refresh_param];
             
             NSArray* changed_key=[refresh_params allKeys];
@@ -407,7 +420,7 @@
             NSDictionary* editor_json = [iSalesNetwork request_Editor:self.request_url params:self.params];
             
             dispatch_async(dispatch_get_main_queue(), ^{
-                
+                [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
                 
                 
                 if([[editor_json valueForKey:@"result"] intValue]==2)

+ 4 - 3
RedAnt ERP Mobile/common/Functions/MainViewController.m

@@ -652,8 +652,8 @@
         return;
     
     
-    if([self.current_VC isKindOfClass:[OrderListViewController class]])
-        return;
+//    if([self.current_VC isKindOfClass:[OrderListViewController class]])
+//        return;
     
     
     UIApplication * app = [UIApplication sharedApplication];
@@ -983,6 +983,7 @@
     //  AppDelegate *appDelegate = (AppDelegate *)[app delegate];
     
     self.itemSearchViewController.covertype = coverttype;
+    self.itemSearchViewController.saved_covertype = coverttype;
     [self.itemSearchViewController reload_container_getdata:true];
     
     //    .categoryString = [@"Category" stringByAppendingString:[self categoryString:categoryid node:appDelegate.categoryMenu level:0]];
@@ -1866,7 +1867,7 @@
     else if([title isEqualToString:@"NPD Website"])
     {
         
-        NSString* url = @"https://www.newpacificdirect.com";
+        NSString* url = @"https://www.newpacificdirect.com/general.htm?websiteId=1";//@"https://www.newpacificdirect.com";
         
         
         NSString* title = @"NPD";

+ 3 - 2
RedAnt ERP Mobile/common/Functions/PDF+Web/PDFViewController.m

@@ -473,7 +473,7 @@
 {
 
 
-    UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Prepare printing..."];
+    UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"preparing print..."];
 
     UIPrintInteractionController* airPrinterController=[UIPrintInteractionController sharedPrintController];
     UIPrintInfo *printInfo = [UIPrintInfo printInfo];
@@ -581,7 +581,7 @@
 //                          }
 //                          [self prepareReturn:nil];
 
-                          [self.navigationController popViewControllerAnimated:true];
+                          //[self.navigationController popViewControllerAnimated:true];
                       }
                   }];
              }
@@ -647,6 +647,7 @@
 //
 //    [self prepareReturn:nil];
 
+    if(self.autoPrint)
     [self.navigationController popViewControllerAnimated:true];
 }
 @end

+ 20 - 8
RedAnt ERP Mobile/common/Functions/cart/CartViewController.m

@@ -119,8 +119,8 @@
         
         
     }];
-    UIAlertAction *actionTwo = [UIAlertAction actionWithTitle:@"Add To Wish List" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
-        UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Add To Wish List"];
+    UIAlertAction *actionTwo = [UIAlertAction actionWithTitle:@"Move To Wish List" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+        UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Move Models To Wish List"];
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
             
             NSDictionary* cart_json = [iSalesNetwork move_cart2wish:ids];
@@ -133,11 +133,13 @@
                 {
                     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                     [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
+                    
+                    [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:true];
                     [self end_edit];
                 }
                 else
                 {
-                    [RAUtils message_alert:[cart_json valueForKey:@"err_msg"] title:@"Add To Wish List" controller:self] ;
+                    [RAUtils message_alert:[cart_json valueForKey:@"err_msg"] title:@"Move Models To Wish List" controller:self] ;
                 }
                 
                 
@@ -730,7 +732,7 @@
     
     CreateOrderViewController * orderinfoVC =[ self.storyboard instantiateViewControllerWithIdentifier:@"CreateOrderViewController"];
     
-    
+    orderinfoVC.disable_dropdown_refresh=true;
     orderinfoVC.url_type = URL_REMOTE;
     orderinfoVC.request_url=URL_CARTDELIVERY;
     
@@ -1274,12 +1276,22 @@
     //    discount = 5.0;
     cell.discount = discount;
     
+    
+    CGRect frame = cell.frame;
+    
+    
     if(notes.length>0)
     {
         cell.labelNotes.text = [@"Note: " stringByAppendingString:[notes stringByReplacingOccurrencesOfString:@"\n" withString:@" "]];
+        frame.size.height = 146;
     }
     else
+    {
         cell.labelNotes.text = nil;
+        frame.size.height = 120;
+    }
+    
+  //  cell.frame = frame;
     
     NSString* discountstr=[NSString stringWithFormat:@"%@%% off", [RAUtils FloatFormat:discount]];
     
@@ -1312,10 +1324,10 @@
     {
         NSMutableDictionary * item_json = [self.content_arr[indexPath.row] mutableCopy];//[[self.content_data objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]] mutableCopy];
         
-        int count=[[item_json valueForKey:@"count"] intValue];
+//        int count=[[item_json valueForKey:@"count"] intValue];
         
-        if(count==qty)
-            return;
+//        if(count==qty)
+//            return;
         [item_json setValue:[NSString stringWithFormat:@"%d",qty] forKey:@"count"];
         [item_json setValue:[ext valueForKey:@"cuft"] forKey:@"cuft"];
                 [item_json setValue:[ext valueForKey:@"carton"] forKey:@"carton"];
@@ -2051,7 +2063,7 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
             
             CreateOrderViewController * orderinfoVC =[ self.storyboard instantiateViewControllerWithIdentifier:@"CreateOrderViewController"];
             
-            
+            orderinfoVC.disable_dropdown_refresh=true;
             orderinfoVC.url_type = URL_REMOTE;
             orderinfoVC.request_url=URL_CARTDELIVERY;
             

+ 2 - 0
RedAnt ERP Mobile/common/Functions/cart/ModelItemCell.h

@@ -55,6 +55,8 @@
 
 @property (nonatomic , copy) void (^onReturnQTY)(int qty , NSDictionary* ext);
 
+@property (strong, nonatomic) IBOutlet UILabel *available_qty_label;
+@property (strong, nonatomic) IBOutlet UILabel *available_qty_value_label;
 
 //@property (strong,nonatomic) NSString* last_edit;
 

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

@@ -757,7 +757,7 @@
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                 
                 [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
-                [RAUtils message_alert:nil title:@" Multiple items added to Wish List" controller:self] ;
+                [RAUtils message_alert:nil title:@" Multiple items added to \nWish List" controller:self] ;
                 
                 
                 

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

@@ -288,7 +288,7 @@ self.isrefreshing=false;
 //        
 //        if([type isEqualToString:@"kv"])
 //        {
-//            
+//
 //            [sectionToReload addIndex:i+1];
 //        }
 //    }

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

@@ -328,7 +328,7 @@
                 
                 [RAUtils message_alert:nil title:@"Order Saved" controller:self] ;
                 
-                if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.save_order_logout && appDelegate.user_type ==USER_ROLE_EMPLOYEE)
+                if([appDelegate.mode isEqualToString:@"TM"]&& appDelegate.save_order_logout && appDelegate.user_type ==USER_ROLE_EMPLOYEE)
                 {
                     [((MainViewController*)appDelegate.main_vc) Loginout:false];
                     [self prepareReturn:nil];
@@ -695,7 +695,7 @@
 //                                                                }
 //                                                                else
                                                                 {
-                                                                    if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
+                                                                    if([appDelegate.mode isEqualToString:@"TM"]&& appDelegate.submit_order_logout)
                                                                     {
                                                                         //bbb
                                                                         [((MainViewController*)appDelegate.main_vc) Loginout:false];
@@ -884,7 +884,7 @@
 //                                    }
 //                                    else
                                     {
-                                        if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
+                                        if([appDelegate.mode isEqualToString:@"TM"]&& appDelegate.submit_order_logout)
                                         {
                                             //bbb
                                             [((MainViewController*)appDelegate.main_vc) Loginout:false];
@@ -1169,7 +1169,7 @@
                         [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
                         [((MainViewController*)appDelegate.main_vc) switchToHome];
                         
-                        if([appDelegate.mode isEqualToString:@"Trade Show Mode"]&& appDelegate.submit_order_logout)
+                        if([appDelegate.mode isEqualToString:@"TM"]&& appDelegate.submit_order_logout)
                         {
                             [((MainViewController*)appDelegate.main_vc) Loginout:false];
                         }

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

@@ -358,16 +358,22 @@
         
     }];
     
-    UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Without Thumbnails" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+    UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Without Thumbnails" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
         NSString* url=[self.content_data valueForKey:@"pdfUrl"];
         NSLog(@"pdf url:%@",url);
         ViewController.url = url;
         [self.navigationController pushViewController:ViewController animated:YES];
         
     }];
+    
+    
+        UIAlertAction *alertCancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {}];
     [alertControl addAction:actionOne];
     
     [alertControl addAction:alertthree];
+    [alertControl addAction:alertCancel];
+    
+
     
     //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
     
@@ -680,6 +686,9 @@
 }
 -(void) loaddata
 {
+    UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Loading"];
+    
+    
     
     
     dispatch_async(dispatch_get_main_queue(), ^{
@@ -706,7 +715,7 @@
             
             dispatch_async(dispatch_get_main_queue(), ^{
                 
-                
+                [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
                 [self.mum stopAnimating];
                 if([[order_json valueForKey:@"result"] intValue]==2)
                 {
@@ -739,7 +748,7 @@
                 NSString* status = [self.content_data valueForKey:@"order_status"];
                 NSString* lock_user = [self.content_data valueForKey:@"opened_customer"];
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-                if([status isEqualToString:@"SO Saved"])
+                if([status isEqualToString:@"Saved Order"])
                 {
                     //                        [self.btnOpen setImage:[[UIImage imageNamed:@"edit"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
                     //
@@ -1412,8 +1421,8 @@
                     cell.priceLabel.text =[self.content_data valueForKey:@"Shipping"];
                     break;
                 case 2:
-                    cell.chargeLabel.text = @"Lift Gate Fee:";
-                    cell.priceLabel.text =[self.content_data valueForKey:@"Lift Gate Fee"];
+                    cell.chargeLabel.text = @"Liftgate Fee(No loading dock):";
+                    cell.priceLabel.text =[self.content_data valueForKey:@"Liftgate Fee(No loading dock)"];
                     break;
                 case 3:
                     cell.chargeLabel.text = @"Handling Fee:";

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

@@ -25,6 +25,7 @@
 {
     self.offset = 0;
     [self.content_data removeAllObjects];
+    self.status_cadedate = nil;
 }
 -(void) reload_container_getdata:(bool) update_data
 {
@@ -123,45 +124,32 @@
 //                                              attributes:nil];
 //        
 //    }
+    
+    [self loadfilter];
+    
 
+}
+-(void) loadfilter
+{
     
+    if(self.status_cadedate!=nil)
+        return;
+    UIApplication * app = [UIApplication sharedApplication];
+    AppDelegate *appDelegate = (AppDelegate *)[app delegate];
     NSData* json =nil;
     if(self.init_style==OL_OPEN)
+    {
         json=[NSData dataWithContentsOfFile:[[NSBundle mainBundle]  pathForResource:@"status_filter_cadedate_open" ofType:@"json" ]];
+        NSError *error=nil;
+        self.status_cadedate = [[NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error] mutableCopy];
+        
+    }
     else
-        json=[NSData dataWithContentsOfFile:dist_path];
-    NSError *error=nil;
-    self.status_cadedate = [[NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error] mutableCopy];
-
-//    [self.table_order addSubview:ref];
-
-    
-//    self.scrollView.contentSize=CGSizeMake(1024, 1024);
-    
-//    self.btnrefresh = [UIButton buttonWithType:UIButtonTypeCustom];
-//    //    self.btnrefresh.titleLabel.text =@"Load more";
-//    [self.btnrefresh setTitle:NSLocalizedString(@"load_more", nil) forState:UIControlStateNormal];
-//    //    [self.btnrefresh.titleLabel sizeToFit];
-//    self.btnrefresh.titleLabel.adjustsFontSizeToFitWidth = YES;
-//    self.btnrefresh.hidden = true;
-//    [self.btnrefresh setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
-//    self.btnrefresh.backgroundColor = [UIColor lightGrayColor];
-//    [self.btnrefresh addTarget:self action:@selector(loadmore) forControlEvents:UIControlEventTouchUpInside];
-//    self.btnrefresh.frame =CGRectMake(0.0f, 0.0f, self.table_order.bounds.size.width, 44.0f);
-//    self.table_order.tableFooterView = self.btnrefresh;//tableFooterView;
-//    [self loadpage];
-
-    
-//    
-//    
-//    self.toolbarView.layer.shadowPath =[UIBezierPath bezierPathWithRect:self.toolbarView.bounds].CGPath;
-//    self.toolbarView.layer.masksToBounds = false;
-//    //添加四个边阴影
-//    
-//    self.toolbarView.layer.shadowColor = [UIColor blackColor].CGColor;
-//    self.toolbarView.layer.shadowOffset = CGSizeMake(0, 0);
-//    self.toolbarView.layer.shadowOpacity = 0.5;
-//    self.toolbarView.layer.shadowRadius = 2.0;
+    {
+        //        json=//[NSData dataWithContentsOfFile:dist_path];
+        //    NSError *error=nil;
+        self.status_cadedate = appDelegate.OrderFilter;//[[NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error] mutableCopy];
+    }
 }
 - (IBAction)onCancel:(id)sender {
     if(self.onCancel)
@@ -187,7 +175,7 @@
 - (void)viewWillAppear:(BOOL)animated
 {
     [super viewWillAppear:animated];
-    
+     [self loadfilter];
     
 
     
@@ -1142,7 +1130,7 @@ dispatch_async(dispatch_get_main_queue(), ^{
     
     
   
-    if([order_status isEqualToString:@"SO Saved"]&&appDelegate.can_cancel_order)
+    if([order_status isEqualToString:@"Saved Order"]&&appDelegate.can_cancel_order)
         return @[cancelAction];
     
     else
@@ -1180,7 +1168,7 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
     
     NSString* order_status= [self.content_data[indexPath.row] valueForKey:@"order_status"];
     
-    if(![order_status isEqualToString:@"SO Saved"]&&! [order_status isEqualToString:@"Quote Saved"])
+    if(![order_status isEqualToString:@"Saved Order"]&&! [order_status isEqualToString:@"Quote Saved"])
     return UITableViewCellEditingStyleNone;
     else
         return UITableViewCellEditingStyleDelete;
@@ -1201,35 +1189,37 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
     
     
     self.status_cadedate = value;
+    UIApplication * app = [UIApplication sharedApplication];
+    AppDelegate *appDelegate = (AppDelegate *)[app delegate];
+    appDelegate.OrderFilter = value;
     
     
-    
-    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
-    NSString *documents = [paths objectAtIndex:0];
-    NSString *dist_path = [documents stringByAppendingPathComponent:@"status_filter_cadedate.json"];
-    
-    
-    //    if ([[NSFileManager defaultManager] fileExistsAtPath:dist_path]) {
-    //
-    //        NSLog(@"文件已经存在了");
-    //
-    //    }
-    //    else
-    //    {
-    //
-    //
-    //
-            //        NSLog(@"resourceSampleImagesFolderPath=%@",resourceFolderPath);
-    
-NSData *data = [NSJSONSerialization dataWithJSONObject:self.status_cadedate options:kNilOptions error:nil];
-    
-            //        NSLog(@"mainBundleFile==%@",mainBundleFile);
-    
-            [[NSFileManager defaultManager] createFileAtPath:dist_path
-    
-                                                    contents:data
-    
-                                                  attributes:nil];
+//    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
+//    NSString *documents = [paths objectAtIndex:0];
+//    NSString *dist_path = [documents stringByAppendingPathComponent:@"status_filter_cadedate.json"];
+//    
+//    
+//    //    if ([[NSFileManager defaultManager] fileExistsAtPath:dist_path]) {
+//    //
+//    //        NSLog(@"文件已经存在了");
+//    //
+//    //    }
+//    //    else
+//    //    {
+//    //
+//    //
+//    //
+//            //        NSLog(@"resourceSampleImagesFolderPath=%@",resourceFolderPath);
+//    
+//NSData *data = [NSJSONSerialization dataWithJSONObject:self.status_cadedate options:kNilOptions error:nil];
+//    
+//            //        NSLog(@"mainBundleFile==%@",mainBundleFile);
+//    
+//            [[NSFileManager defaultManager] createFileAtPath:dist_path
+//    
+//                                                    contents:data
+//    
+//                                                  attributes:nil];
     //
     //    }
     

+ 3 - 34
RedAnt ERP Mobile/common/Functions/order/status_filter_cadedate_open.json

@@ -1,39 +1,8 @@
 {
-    "count":8,
-    
-    
-    "val_0": {
-        "value": "Quote Saved",
-        "value_id": 0,
-        "check":1
-    },
-    "val_1": {
-        "value": "SO Saved",
+    "count":1,
+     "val_0": {
+        "value": "Saved Order",
         "value_id": 1,
         "check":1
-    },
-    "val_2": {
-        "value": "Quote Submitted",
-        "value_id": 10
-    },
-    "val_3": {
-        "value": "SO Submitted",
-        "value_id": 11
-    },
-    "val_4": {
-        "value": "Processing",
-        "value_id": 12
-    },
-    "val_5": {
-        "value": "Shipped",
-        "value_id": 13
-    },
-    "val_6": {
-        "value": "Closed",
-        "value_id": 14
-    },
-    "val_7": {
-        "value": "Cancelled",
-        "value_id": 15
     }
 }

+ 2 - 2
RedAnt ERP Mobile/common/Functions/portfolio/PDFListViewController.m

@@ -551,7 +551,7 @@
 
 {
     
-    NSString* listid= [self.content_data[indexPath.row] valueForKey:@"tearsheets_id"];
+    NSString* listid= [self.content_data[indexPath.row] valueForKey:@"tearsheetsId"];
     
     UITableViewRowAction *deleteRowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
         
@@ -567,7 +567,7 @@
         
 
         
-            UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Are you sure to remove portfolio?" message:nil preferredStyle:UIAlertControllerStyleAlert];
+            UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Are you sure to remove this portfolio?" message:nil preferredStyle:UIAlertControllerStyleAlert];
             //block代码块取代了delegate
             
             

+ 6 - 1
RedAnt ERP Mobile/common/Functions/portfolio/PortfolioEditQTYViewController.h

@@ -8,6 +8,11 @@
 
 #import <UIKit/UIKit.h>
 
-@interface PortfolioEditQTYViewController : UIViewController
+@interface PortfolioEditQTYViewController : UIViewController<UITextFieldDelegate>
 @property int qty;
+@property (strong, nonatomic) IBOutlet UITextField *editQTY;
+@property (nonatomic , copy) void (^onSetValue)(int qty);
+@property (strong, nonatomic) IBOutlet UILabel *labelQueryQTY;
+@property (strong, nonatomic) IBOutlet UIButton *buttonRefresh;
+@property (strong, nonatomic)  NSString * fashionid;
 @end

+ 168 - 1
RedAnt ERP Mobile/common/Functions/portfolio/PortfolioEditQTYViewController.m

@@ -7,7 +7,8 @@
 //
 
 #import "PortfolioEditQTYViewController.h"
-
+#import "iSalesNetwork.h"
+#define NUMBERS @"0123456789\n"
 @interface PortfolioEditQTYViewController ()
 
 @end
@@ -16,14 +17,91 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
+    self.editQTY.text = [NSString stringWithFormat:@"%d",self.qty];
+    [self requestqty];
     // Do any additional setup after loading the view.
 }
+- (IBAction)onRefreshClick:(id)sender {
+    [self requestqty];
+}
 
 - (void)didReceiveMemoryWarning {
     [super didReceiveMemoryWarning];
     // Dispose of any resources that can be recreated.
 }
+-(void) requestqty
+{
+    self.buttonRefresh.enabled=false;
+    self.labelQueryQTY.text = @"Query current QTY...";
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        NSDictionary* detail_json = [iSalesNetwork request_model_qty:self.fashionid];
+        
+        dispatch_async(dispatch_get_main_queue(), ^{
+            self.buttonRefresh.enabled=true;
+//            NSDictionary* imgsection = [detail_json objectForKey:@"img_section"];
+            //          AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+            
+            if([[detail_json valueForKey:@"result"] intValue]==2)
+            {
+                
+                NSString* qty = [detail_json valueForKey:@"quantity_available"];
+                self.labelQueryQTY.text = [NSString stringWithFormat:@"Current Available QTY: %@",qty];
+               // self.detailTable.hidden = false;
+                
+                
+            }
+            else
 
+                {
+                    self.labelQueryQTY.text=@"Tap Refresh to query current QTY";
+                    [RAUtils message_alert:[detail_json valueForKey:@"err_msg"] title:@"Request Available QTY"/*@"Loading Model Detail Failed."*/ controller:self] ;
+                }
+            
+           
+            
+        });
+    });
+}
+- (IBAction)onSaveClick:(id)sender {
+    
+    
+//    if([self.editDiscount.text floatValue]>100.0)
+//    {
+//        //        UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Discount error" message:@"Discount must less than 100" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
+//        //
+//        //
+//        //        [alert show];
+//        
+//        [RAUtils alert_view:@"Fields with * mark cannot be empty." title:@"Some Requried Fields Are Missing."];
+//        
+//        self.editDiscount.text=@"0";
+//        
+//        return;
+//    }
+//    
+//    
+//    [self update_newprice];
+    
+    
+    if(self.editQTY.text.length==0)
+        self.qty=0;
+    else
+        self.qty=[self.editQTY.text intValue];
+    [self dismissViewControllerAnimated:NO
+                             completion:^{
+                                 if(self.onSetValue)
+                                     self.onSetValue( self.qty);
+                                 
+                             }];
+}
+- (IBAction)onCloseClicked:(id)sender {
+    [self dismissViewControllerAnimated:NO
+                             completion:^{
+                                 
+                                 
+                             }];
+}
 /*
 #pragma mark - Navigation
 
@@ -33,5 +111,94 @@
     // Pass the selected object to the new view controller.
 }
 */
+#pragma mark textField delegate
+- (BOOL)textFieldShouldReturn:(UITextField *)textField {
+    [textField resignFirstResponder];
+    return NO;
+}
+-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
+    
+
+    
+    if(textField.text.length==0 && [string isEqualToString:@"."])
+        return false;
+    
+      NSCharacterSet *cs;
+    cs = [[NSCharacterSet characterSetWithCharactersInString:NUMBERS]invertedSet];
+    //
+    NSString *filtered = [[string componentsSeparatedByCharactersInSet:cs]componentsJoinedByString:@""];
+    
+    BOOL canChange = [string isEqualToString:filtered];
+    //
+    //
+    //
+    //
+    return canChange;
+    //    return true;
+}
+
+//- (void)textFieldDidEndEditing:(UITextField *)textField
+//{
+//    
+////    if(textField.tag==2)
+////    {
+////        if(textField.text.length==0)
+////            textField.text=@"0";
+////        
+////        if([textField.text floatValue]>100.0)
+////        {
+////            //            UIAlertView * alert = [[UIAlertView alloc] initWithTitle: @"Discount error" message:@"Discount must less than 100" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
+////            //            //        UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error!" message:@"User&Password can not be empty!" delegate:nil cancelButtonTitle:NSLocalizedString(@"ok", nil) , nil];
+////            //            [alert show];
+////            
+////            
+////            
+////            [RAUtils alert_view:@"Discount must less than 100." title:@"Input Error."];
+////            textField.text=@"0";
+////        }
+////    }
+////    else
+////    {
+////        float f = [textField.text floatValue];
+////        textField.text=[NSString stringWithFormat:@"%.2f",f];
+////    }
+////    
+////    [self update_newprice];
+//    
+//    //    UITableViewCell *cell = (UITableViewCell *) textField.superview.superview;
+//    //    NSIndexPath *   indexPath = [self.editorTable indexPathForCell:cell];
+//    //
+//    //
+//    //    NSMutableDictionary* section_json=nil;
+//    //
+//    //
+//    //    //    NSLog(@"endedit %d_%d",indexPath.section,indexPath.row);
+//    //    NSMutableDictionary* item_json =[((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row] mutableCopy];
+//    //
+//    //
+//    //    [item_json setValue:@"true" forKey:@"dirty"];
+//    //    [item_json setValue:textField.text forKey:@"value"];
+//    //    section_json = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]] mutableCopy];
+//    //    int count=0;
+//    //
+//    //    count=[[section_json valueForKey:@"count"] intValue];
+//    //
+//    //    for(int i=0;i<count;i++)
+//    //    {
+//    //        NSDictionary * olditem=[section_json objectForKey:[NSString stringWithFormat:@"item_%d",i ]];
+//    //        if([[olditem valueForKey:@"name"] isEqualToString:[item_json valueForKey:@"name" ]])
+//    //            [section_json setObject:item_json  forKey:[NSString stringWithFormat:@"item_%d",i ]];
+//    //        
+//    //        
+//    //    }
+//    //    
+//    //    [self.content_data_download setObject:section_json forKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]];
+//}
+//
+//- (void)textFieldDidBeginEditing:(UITextField *)textField
+//{
+//    //
+//    //    self.lastedit = textField;
+//}
 
 @end

+ 53 - 35
RedAnt ERP Mobile/common/Functions/portfolio/PortfolioViewController.m

@@ -713,6 +713,23 @@
     cell.labelDescription.text = description;
     //    cell.labelIdentifier.text = identifier;
     
+    
+    int qty= [[item_json valueForKey:@"available_qty"] intValue];
+    
+    
+    
+    if(![[item_json allKeys] containsObject:@"available_qty"])
+    {
+        cell.available_qty_label.hidden=true;
+        cell.available_qty_value_label.hidden=true;
+    }
+    else
+    {
+        cell.available_qty_label.hidden=false;
+        cell.available_qty_value_label.hidden=false;
+        cell.available_qty_value_label.text = [NSString stringWithFormat:@"%d",qty];
+        
+    }
     NSString* str_price =[NSString stringWithFormat:@"%.2f",price * (1.0-discount/100)];
     if(appDelegate.can_see_price&&appDelegate.price_hidden==false)
     {
@@ -910,7 +927,7 @@
             
             
             
-            //  [self reload_data];//[main_vc checklogin:true];
+           
         };
         
         
@@ -957,45 +974,45 @@
         
         NSMutableDictionary * item_json = [[self.content_data objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]] mutableCopy];
         
-        
-        
+
+        vc.fashionid =        [NSString stringWithFormat:@"%d",[[item_json valueForKey:@"fashion_id"] intValue]];
         vc.qty = [[item_json valueForKey:@"available_qty"] intValue];
         //    vc.delegate = parentvc.self;
         //    loginvc.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
-//        vc.onSetValue = ^(double price,double discount){
-//            
-//            
-//            UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Update Price"];
-//            
-//            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-//                
-//                NSDictionary* cart_json = nil;
-//                
-//                cart_json= [iSalesNetwork portfolio_setPrice:[NSString stringWithFormat:@"%d",[[item_json valueForKey:@"item_id"] intValue]] price:price discount:discount];
-//                
-//                dispatch_async(dispatch_get_main_queue(), ^{
-//                    [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
-//                    
-//                    
-//                    if([[cart_json valueForKey:@"result"] intValue]==2)
-//                    {
-//                        [self reload_data];
-//                    }
-//                    else
-//                    {
-//                        [RAUtils message_alert:[cart_json valueForKey:@"err_msg"] title:@"Edit Price" controller:self] ;
-//                    }
-//                    
-//                    
-//                    
-//                    
-//                });
-//            });
-//            
+        vc.onSetValue = ^(int qty){
+            
+            
+            UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Update QTY"];
+            
+            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+                
+                NSDictionary* cart_json = nil;
+                
+                cart_json= [iSalesNetwork portfolio_setQTY:[NSString stringWithFormat:@"%d",[[item_json valueForKey:@"item_id"] intValue]] QTY:qty];
+                
+                dispatch_async(dispatch_get_main_queue(), ^{
+                    [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+                    
+                    
+                    if([[cart_json valueForKey:@"result"] intValue]==2)
+                    {
+                        [self reload_data];
+                    }
+                    else
+                    {
+                        [RAUtils message_alert:[cart_json valueForKey:@"err_msg"] title:@"Edit QTY" controller:self] ;
+                    }
+                    
+                    
+                    
+                    
+                });
+            });
+//
 //            
 //            
-//            //  [self reload_data];//[main_vc checklogin:true];
-//        };
+            //  [self reload_data];//[main_vc checklogin:true];
+        };
         
         
         UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:vc] ;
@@ -1041,6 +1058,7 @@
             [arr addObject:editRowAction];
             
         }
+        [arr addObject:EditQTYAction];
         return arr;
       //  return @[deleteRowAction, editRowAction];
     }

+ 1 - 0
RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchFilterViewController.h

@@ -20,6 +20,7 @@
 @property (strong, nonatomic) IBOutlet UITextField *textModelDescription;
 @property (strong, nonatomic) IBOutlet UIButton *buttonAlert;
 @property (nonatomic , copy) void (^SearchClick)(NSString* ids,NSString* modelname,NSString* modeldescrip,NSString* alert);
+@property (nonatomic , copy) void (^ResetClick)();
 
 @property (strong, nonatomic) NSDictionary* alert_cadedate;
 @property (strong, nonatomic) NSString* modelname;

+ 9 - 1
RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchFilterViewController.m

@@ -46,6 +46,14 @@
     
     
 }
+
+
+- (IBAction)onResetClick:(id)sender {
+    if(self.ResetClick)
+        self.ResetClick();
+    [self dismissViewControllerAnimated:true completion:nil];
+}
+
 - (IBAction)onSearchClick:(id)sender {
     
     NSString* ids= [[self get_checkedIDs:self.categoryMenu]componentsJoinedByString:@","];
@@ -61,7 +69,7 @@
     NSString* alert = [self.buttonAlert titleForState:UIControlStateNormal];
     if(alert.length==0 || [alert isEqualToString:@"Click to select"])
         alert = nil;
-    NSLog(ids);
+   // NSLog(ids);
     
     if(self.SearchClick)
         self.SearchClick(ids, modelname, modeldescrip, alert);

+ 1 - 1
RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchViewController.h

@@ -35,7 +35,7 @@
 
 @property (strong,nonatomic) NSString* covertype;
 
-
+@property (strong,nonatomic) NSString* saved_covertype;
 @property (strong,nonatomic) NSString* ctgid;
 @property (strong,nonatomic) NSString* modelname;
 @property (strong,nonatomic) NSString* modeldescrip;

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

@@ -293,6 +293,20 @@
         
     };
     
+    
+    filterVC.ResetClick =^()
+    {
+        self.ctgid = nil;
+        self.modelname = nil;
+        self.modeldescrip = nil;
+        self.alert = nil;
+        self.covertype = self.saved_covertype;
+        self.offset = 0;
+        //  [self.content_data removeAllObjects];
+        [self reload];
+        NSLog(@"search");
+        
+    };
     UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:filterVC] ;
     
     
@@ -1058,7 +1072,7 @@
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
                 
                 [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
-                    [RAUtils message_alert:nil title:@" Multiple items added to Wish List" controller:self] ;
+                    [RAUtils message_alert:nil title:@" Multiple items added to \nWish List" controller:self] ;
                     
                     
                 [self end_select:1];

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

@@ -984,7 +984,7 @@
                     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
  
                 [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
-                    [RAUtils message_alert:nil title:@" Multiple items added to Wish List" controller:self] ;
+                    [RAUtils message_alert:nil title:@" Multiple items added to \nWish List" controller:self] ;
                     
                     
                 [self end_select:1];

+ 1 - 1
RedAnt ERP Mobile/common/RAUtils.h

@@ -28,7 +28,7 @@ typedef void (^add_to_cart_Handler)(void);
 + (float)fileSizeForDir:(NSString*)path;//计算文件夹下文件的总大小;
 +(void) deletefiles :(NSString*) path;
 
-
++(NSDictionary*) string2dict:(NSString*) str;
 +(NSString*) dict2string:(NSDictionary*) dict;
 +(NSString*) arr2string:(NSArray *) arr separator:(NSString*)separator trim:(bool) btrim;
 

+ 17 - 8
RedAnt ERP Mobile/common/RAUtils.m

@@ -364,7 +364,7 @@
                                     
                                     
                                     if(appDelegate.order_code==nil)
-                                        [self neworder:vc selectorholder:vc selector:addtocart];
+                                        [self neworder:vc selectorholder:holder selector:addtocart];
                                     //                                                            neworder();
                                     
                                     //    [main_vc checklogin:true];
@@ -390,7 +390,7 @@
                             }
                             else
                             {
-                                [self neworder:vc selectorholder:vc selector:addtocart];
+                                [self neworder:vc selectorholder:holder selector:addtocart];
                             }
                             
                         }
@@ -517,7 +517,7 @@
                                 
                                 
                                 if(appDelegate.order_code==nil)
-                                    [self neworder:vc selectorholder:vc selector:addtocart];
+                                    [self neworder:vc selectorholder:holder selector:addtocart];
                                 //                                                            neworder();
                                 
                                 //    [main_vc checklogin:true];
@@ -543,7 +543,7 @@
                         }
                         else
                         {
-                            [self neworder:vc selectorholder:vc selector:addtocart];
+                            [self neworder:vc selectorholder:holder selector:addtocart];
                         }
                         
                     }
@@ -659,7 +659,7 @@
                                                 
                                                 
                                                 if(appDelegate.order_code==nil)
-                                                    [self neworder:vc selectorholder:vc selector:addtocart];
+                                                    [self neworder:vc selectorholder:holder selector:addtocart];
                                                 //                                                            neworder();
                                                 
                                                 //    [main_vc checklogin:true];
@@ -685,7 +685,7 @@
                                         }
                                         else
                                         {
-                                            [self neworder:vc selectorholder:vc selector:addtocart];
+                                            [self neworder:vc selectorholder:holder selector:addtocart];
                                         }
                                         
                                     }
@@ -814,7 +814,7 @@
                                                     
                                                     
                                                     if(appDelegate.order_code==nil)
-                                                        [self neworder:vc selectorholder:vc selector:addtocart];
+                                                        [self neworder:vc selectorholder:holder selector:addtocart];
                                                     //                                                            neworder();
                                                     
                                                     //    [main_vc checklogin:true];
@@ -840,7 +840,7 @@
                                             }
                                             else
                                             {
-                                                [self neworder:vc selectorholder:vc selector:addtocart];
+                                                [self neworder:vc selectorholder:holder selector:addtocart];
                                             }
                                             
                                         }
@@ -1014,6 +1014,15 @@
     NSString * ret = [marr componentsJoinedByString:separator];
     return ret;
 }
++(NSDictionary*) string2dict:(NSString*) str
+{
+    NSError *error = nil;
+    NSDictionary *string2dic = [NSJSONSerialization JSONObjectWithData: [str dataUsingEncoding:NSUTF8StringEncoding]
+                                                               options: NSJSONReadingMutableContainers
+                                                                 error: &error];
+    NSLog(@"%@",string2dic);
+    return string2dic;
+}
 +(NSString*) dict2string:(NSDictionary*) dict
 {
 

+ 2 - 1
RedAnt ERP Mobile/common/data_provider/iSalesNetwork.h

@@ -28,6 +28,7 @@
 +(NSDictionary*)load_HomePage: (int) price_template customid:(int) customid;
 +(NSDictionary*)retrieve_password: (NSString*) user email:(NSString*) email;
 
++(NSDictionary*)request_model_qty: (NSString*) fashionId;
 
 
 
@@ -57,7 +58,7 @@
 +(NSDictionary*)request_Cart;
 +(NSDictionary*)request_WatchList;
 +(NSDictionary*) portfolio_setPrice:(NSString*) watchlist_id price:(float) price discount:(float) discount;
-
++(NSDictionary*) portfolio_setQTY:(NSString*) watchlist_id QTY:(int)qty;
 
 +(NSDictionary*) cart_remove:(NSString* ) item_ids;
 +(NSDictionary*) cart_check:(NSString* ) item_ids;

+ 63 - 4
RedAnt ERP Mobile/common/data_provider/iSalesNetwork.m

@@ -266,7 +266,7 @@ repeat:{
                                                              error:nil];
         if(![url isEqualToString:URL_ERR_LOG])
         {
-            [iSalesNetwork err_log:[RAUtils base64en:[RAUtils dict2string:params]] result:[RAUtils base64en:[RAUtils dict2string:ret]] module:url];
+            [iSalesNetwork err_log:[RAUtils base64en:[RAUtils dict2string:params]] result:[RAUtils base64en:[RAUtils dict2string:ret]] module:url code:RESULT_NET_ERROR];
         }
         return jsonData;
         
@@ -321,9 +321,9 @@ repeat:{
             [jsobj setValue:MSG_VER_LOW forKey:@"err_msg"];
         }
         
-        if(![url isEqualToString:URL_ERR_LOG]&&result!=2)
+        if(![url isEqualToString:URL_ERR_LOG]/*&&result!=-3*/&&result!=2)
         {
-            [iSalesNetwork err_log:[RAUtils base64en:[RAUtils dict2string:params]] result:[RAUtils base64en:str] module:url];
+            [iSalesNetwork err_log:[RAUtils base64en:[RAUtils dict2string:params]] result:[RAUtils base64en:str] module:url code:result];
         }
         NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsobj
                                                            options:0
@@ -1236,7 +1236,7 @@ repeat:{
     NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
     return jsobj;
 }
-+(NSDictionary*)err_log:(NSString*) up_params result:(NSString*)result module:(NSString*) module //device:(NSString*) device
++(NSDictionary*)err_log:(NSString*) up_params result:(NSString*)result module:(NSString*) module code:(int) code//device:(NSString*) device
 {
     if(![self IsNetworkAvailable])
         return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
@@ -1246,6 +1246,8 @@ repeat:{
         [params setValue:appDelegate.user forKey:@"user"];
 
     [params setValue:up_params forKey:@"upparam"];
+    
+    [params setValue:[NSNumber numberWithInt:code ] forKey:@"code"];
   
         [params setValue:result forKey:@"result"];
     [params setValue:module forKey:@"interfac"];
@@ -1597,7 +1599,32 @@ repeat:{
     NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
     return jsobj;
 }
++(NSDictionary*) portfolio_setQTY:(NSString*) watchlist_id QTY:(int)qty
+{
+    if(![self IsNetworkAvailable])
+        return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
+    NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    if(appDelegate.user!=nil)
+        [params setValue:appDelegate.user forKey:@"user"];
+    if(appDelegate.contact_id!=nil)
+        [params setValue:appDelegate.contact_id forKey:@"contactId"];
+    if(appDelegate.password!=nil)
+        [params setValue:appDelegate.password forKey:@"password"];
+    
+    [params setValue:watchlist_id forKey:@"item_id"];
+    
+    [params setValue:[NSString stringWithFormat:@"%d",qty] forKey:@"available_qty"];
 
+    
+    
+    NSData* json=[self get_json:URL_DM_SET_QTY parameters:params];
+    if(json==nil)
+        return nil;
+    NSError *error=nil;
+    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+    return jsobj;
+}
 +(NSDictionary*) portfolio_setPrice:(NSString*) watchlist_id price:(float) price discount:(float) discount
 {
     if(![self IsNetworkAvailable])
@@ -2103,6 +2130,31 @@ repeat:{
 //    return jsobj;
 //}
 
+
++(NSDictionary*)request_model_qty: (NSString*) fashionId
+{
+    if(![self IsNetworkAvailable])
+        return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
+    
+    
+    NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
+        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+        if(appDelegate.user!=nil)
+            [params setValue:appDelegate.user forKey:@"user"];
+        if(appDelegate.contact_id!=nil)
+            [params setValue:appDelegate.contact_id forKey:@"contactId"];
+        if(appDelegate.password!=nil)
+            [params setValue:appDelegate.password forKey:@"password"];
+    [params setValue:fashionId  forKey:@"fashionId"];
+    
+    NSData* json=[self get_json:URL_REQUEST_MODEL_QTY parameters:params];
+    if(json==nil)
+        return nil;
+    NSError *error=nil;
+    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+    return jsobj;
+}
+
 +(NSDictionary*)retrieve_password: (NSString*) user email:(NSString*) email
 {
     if(![self IsNetworkAvailable])
@@ -2216,6 +2268,7 @@ repeat:{
         
         appDelegate.ipad_perm =nil ;
         appDelegate.user_type = USER_ROLE_UNKNOWN;
+        appDelegate.OrderFilter= nil;
         [appDelegate SetSo:nil];
         [appDelegate set_main_button_panel];
     }
@@ -2457,6 +2510,12 @@ repeat:{
         
         appDelegate.ipad_perm =[objheader valueForKey:@"ipad_perm"] ;
         
+        NSString* strfilter = [objheader valueForKey:@"statusFilter"] ;
+        
+ 
+        
+         appDelegate.OrderFilter= [[RAUtils string2dict:strfilter] mutableCopy];
+        
         
         [appDelegate set_main_button_panel];