Ray Zhang 10 tahun lalu
induk
melakukan
d5192a04b9
41 mengubah file dengan 973 tambahan dan 121 penghapusan
  1. 2 2
      RedAnt ERP Mobile/common/Functions/address/AddressEditorViewController.m
  2. 1 1
      RedAnt ERP Mobile/common/Functions/camscan/ScannerViewController.m
  3. 18 7
      RedAnt ERP Mobile/common/Functions/cart/BundleModelViewController.m
  4. 95 6
      RedAnt ERP Mobile/common/Functions/cart/CartViewController.m
  5. 13 0
      RedAnt ERP Mobile/common/Functions/category/CategoryHeaderView.h
  6. 21 0
      RedAnt ERP Mobile/common/Functions/category/CategoryHeaderView.m
  7. 1 1
      RedAnt ERP Mobile/common/Functions/category/CategorySearchFilterViewController.m
  8. 27 3
      RedAnt ERP Mobile/common/Functions/category/CategoryViewController.m
  9. 43 5
      RedAnt ERP Mobile/common/Functions/contact/ContactAdvanceSearchViewController.m
  10. 1 0
      RedAnt ERP Mobile/common/Functions/contact/ContactListTableViewCell.h
  11. 100 4
      RedAnt ERP Mobile/common/Functions/contact/ContactListViewController.m
  12. 2 2
      RedAnt ERP Mobile/common/Functions/contact/CustomerEditViewController.m
  13. 5 5
      RedAnt ERP Mobile/common/Functions/contact/CustomerInfoViewController.m
  14. 31 2
      RedAnt ERP Mobile/common/Functions/contact/customer_advanced_search.json
  15. 3 0
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.h
  16. 131 0
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.m
  17. 1 0
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.h
  18. 37 11
      RedAnt ERP Mobile/common/Functions/modelDetail/DetailViewController.m
  19. 3 3
      RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m
  20. 20 9
      RedAnt ERP Mobile/common/Functions/order/OrderDetailViewController.m
  21. 24 10
      RedAnt ERP Mobile/common/Functions/order/OrderListViewController.m
  22. 15 5
      RedAnt ERP Mobile/common/Functions/portfolio/PDFListViewController.m
  23. 10 5
      RedAnt ERP Mobile/common/Functions/portfolio/PortfolioEditQTYViewController.h
  24. 40 2
      RedAnt ERP Mobile/common/Functions/portfolio/PortfolioEditQTYViewController.m
  25. 122 8
      RedAnt ERP Mobile/common/Functions/portfolio/PortfolioViewController.m
  26. 3 3
      RedAnt ERP Mobile/common/Functions/portfolio/TearSheetParamViewController.m
  27. 1 1
      RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchFilterViewController.m
  28. 21 2
      RedAnt ERP Mobile/common/Functions/search+itemsearch/ItemSearchViewController.m
  29. 2 1
      RedAnt ERP Mobile/common/Functions/search+itemsearch/SearchViewController.h
  30. 38 4
      RedAnt ERP Mobile/common/Functions/search+itemsearch/SearchViewController.m
  31. 3 0
      RedAnt ERP Mobile/common/Functions/sidemenu/AboutViewController.h
  32. 12 0
      RedAnt ERP Mobile/common/Functions/sidemenu/AboutViewController.m
  33. 1 1
      RedAnt ERP Mobile/common/Functions/sidemenu/CacheViewController.m
  34. 7 1
      RedAnt ERP Mobile/common/Functions/sidemenu/LoginViewController.m
  35. 1 1
      RedAnt ERP Mobile/common/Functions/sidemenu/ScannerSettingViewController.m
  36. 1 1
      RedAnt ERP Mobile/common/Functions/sidemenu/SimplifiedBuyingProgramViewController.m
  37. 1 1
      RedAnt ERP Mobile/common/Functions/sidemenu/UserListViewController.m
  38. 3 3
      RedAnt ERP Mobile/common/Functions/signature/SignatureViewController.m
  39. 1 1
      RedAnt ERP Mobile/common/categoryMenu_RATree/RAViewController.m
  40. 2 0
      RedAnt ERP Mobile/iSales-NPD/OfflineSettingViewController.h
  41. 110 10
      RedAnt ERP Mobile/iSales-NPD/OfflineSettingViewController.m

+ 2 - 2
RedAnt ERP Mobile/common/Functions/address/AddressEditorViewController.m

@@ -19,7 +19,7 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     
-    UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"back"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+    UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"back"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                                    style:UIBarButtonItemStylePlain
                                                                   target:self
                                                                   action:@selector( onBackClick:)];
@@ -32,7 +32,7 @@
 //    UIBarButtonItem *closeButton =
     
     
-    UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"save"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+    UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"save"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                                    style:UIBarButtonItemStylePlain
                                                                   target:self
                                                                   action:@selector(onSaveClick:)];

+ 1 - 1
RedAnt ERP Mobile/common/Functions/camscan/ScannerViewController.m

@@ -179,7 +179,7 @@
                                                                    target:self
                                                                    action:@selector( onBackClick:)];
     
-    closeButton.tintColor = UIColorFromRGB(0x996633);
+  //  closeButton.tintColor = UIColorFromRGB(0x996633);
     
     self.navigationItem.leftBarButtonItem = closeButton;
     

+ 18 - 7
RedAnt ERP Mobile/common/Functions/cart/BundleModelViewController.m

@@ -9,6 +9,9 @@
 #import "BundleModelViewController.h"
 #import "const.h"
 #import "BundleModelCell.h"
+#import "DefaultTableHeaderView.h"
+#import "DefaultAppearance.h"
+
 #define  DEF_CELL_HEIGHT 44
 //#define  DEF_TABLE_HEIGHT 44
 //#define  LINE_WIDTH 0
@@ -30,7 +33,7 @@
     
     
     
-    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                                     style:UIBarButtonItemStylePlain
                                                                    target:self
                                                                    action:@selector( onCloseClick:)];
@@ -147,8 +150,16 @@
 }
 - (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
 {
-    UIView* myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
-    myView.backgroundColor = UIColorFromRGB(0x996633);
+    
+    
+    NSString* value =[DefaultAppearance get_noneappearance_value:@"DefaultTableHeaderView" valuename:@"title_text_color"];
+    
+    if(value==nil)
+        value=@"";
+    unsigned long color = strtoul([value UTF8String],0,16);
+    
+    DefaultTableHeaderView* myView = [[DefaultTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
+ //   myView.backgroundColor = UIColorFromRGB(0x996633);
     
     myView.layer.shadowColor = [UIColor blackColor].CGColor;
     myView.layer.shadowOffset = CGSizeMake(0, 0);
@@ -156,14 +167,14 @@
     myView.layer.shadowRadius = 2.0;
     
     UILabel *modellabel = [[UILabel alloc] initWithFrame:CGRectMake(50, 5.5, 90, 22)];
-    modellabel.textColor=[UIColor whiteColor];
+    modellabel.textColor=UIColorFromRGB(color);
     modellabel.backgroundColor = [UIColor clearColor];
     modellabel.text=NSLocalizedString(@"Model", nil);
     [modellabel sizeToFit];
     [myView addSubview:modellabel];
     
     UILabel *description = [[UILabel alloc] initWithFrame:CGRectMake(200, 5.5, 90, 22)];
-    description.textColor=[UIColor whiteColor];
+    description.textColor=UIColorFromRGB(color);
     description.backgroundColor = [UIColor clearColor];
     description.text=NSLocalizedString(@"Description", nil);
     [description sizeToFit];
@@ -171,14 +182,14 @@
     
     
     UILabel *qtylabel = [[UILabel alloc] initWithFrame:CGRectMake(400, 5.5, 90, 22)];
-    qtylabel.textColor=[UIColor whiteColor];
+    qtylabel.textColor=UIColorFromRGB(color);
     qtylabel.backgroundColor = [UIColor clearColor];
     qtylabel.text=NSLocalizedString(@"QTY", nil);
     [qtylabel sizeToFit];
     [myView addSubview:qtylabel];
     
     UILabel *pricelabel = [[UILabel alloc] initWithFrame:CGRectMake(450, 5.5, 90, 22)];
-    pricelabel.textColor=[UIColor whiteColor];
+    pricelabel.textColor=UIColorFromRGB(color);
     pricelabel.backgroundColor = [UIColor clearColor];
     pricelabel.text=NSLocalizedString(@"Unit Price", nil);
     [pricelabel sizeToFit];

+ 95 - 6
RedAnt ERP Mobile/common/Functions/cart/CartViewController.m

@@ -20,6 +20,8 @@
 #import "ItemNotesViewController.h"
 
 #import "CartGeneralNotesViewController.h"
+#import "DefaultAppearance.h"
+#import "DefaultTableHeaderView.h"
 
 
 #define ALERT_FREE 1024
@@ -1103,6 +1105,87 @@
 //    
 //    
 //}
+- (IBAction)OnCancelOrderClicked:(id)sender {
+    
+    
+    UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Cancel Order?" message:@"Canceled order cannot be edit anymore." preferredStyle:UIAlertControllerStyleAlert];
+    //block代码块取代了delegate
+    
+    
+    
+    UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Yes" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
+           AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+        UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Cancel Order"];
+        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+            
+            NSDictionary* return_json = [iSalesNetwork cancel_Order:nil order_code:appDelegate.order_code];
+            
+            dispatch_async(dispatch_get_main_queue(), ^{
+                [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+                
+                
+                if([[return_json valueForKey:@"result"] intValue]==2)
+                {
+                    //if([appDelegate.order_code isEqualToString: [self.content_data[indexPath.row] valueForKey:@"order_code"]])
+                    {
+                        appDelegate.order_code= nil;
+                        appDelegate.user_type = 0;
+                        appDelegate.customerInfo = nil;
+                        appDelegate.contact_id = nil;
+                        appDelegate.order_customer_id = nil;
+                        [appDelegate SetSo:nil];
+                        appDelegate.cart_count=0;
+                        [appDelegate update_count_mark];
+                        
+                        
+                    }
+                    //[RAUtils message_alert:nil title:@"Order Canceled" controller:self] ;
+                    //[self ReloadData];
+                    
+//                    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//                    //                        appDelegate.order_code = nil;
+//                    
+//                    [appDelegate closeOrder];
+//                    [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
+                    [((MainViewController*)appDelegate.main_vc) switchToHome];
+                    
+//                    if([appDelegate.mode isEqualToString:@"TM"]&& appDelegate.submit_order_logout)
+//                    {
+//                        [((MainViewController*)appDelegate.main_vc) Loginout:false];
+//                    }
+                }
+                else
+                {
+                    [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Cancel Order" controller:self] ;
+                }
+                
+                
+                
+                
+            });
+        });
+        
+        
+    }];
+    
+    UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"No" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+        NSLog(@"No");
+    }];
+    [alertControl addAction:actionOne];
+    
+    [alertControl addAction:alertthree];
+    
+    //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
+    
+    
+    [self presentViewController:alertControl animated:YES completion:nil];
+    
+    NSLog(@"%@",self.edit_select_arr);
+    
+    
+
+
+}
 
 #pragma mark - commoneditor controller delegate
 -(void) returnValue:(NSMutableDictionary *)value indexPath :(NSIndexPath*) indexPath
@@ -1175,8 +1258,14 @@
 }
 - (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
 {
-    UIView* myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
-    myView.backgroundColor = UIColorFromRGB(0x996633);
+    
+    NSString* value =[DefaultAppearance get_noneappearance_value:@"DefaultTableHeaderView" valuename:@"title_text_color"];
+    
+    if(value==nil)
+        value=@"";
+    unsigned long color = strtoul([value UTF8String],0,16);
+    DefaultTableHeaderView* myView = [[DefaultTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
+  //  myView.backgroundColor = UIColorFromRGB(0x996633);
     
     myView.layer.shadowPath =[UIBezierPath bezierPathWithRect:myView.bounds].CGPath;
     
@@ -1186,14 +1275,14 @@
     myView.layer.shadowRadius = 2.0;
     
     UILabel *solabel = [[UILabel alloc] initWithFrame:CGRectMake(130, 5.5, 90, 22)];
-    solabel.textColor=[UIColor whiteColor];
+    solabel.textColor=UIColorFromRGB(color);
     solabel.backgroundColor = [UIColor clearColor];
     solabel.text=NSLocalizedString(@"Description", nil);
     [solabel sizeToFit];
     [myView addSubview:solabel];
     
     UILabel *contactlabel = [[UILabel alloc] initWithFrame:CGRectMake(320, 5.5, 90, 22)];
-    contactlabel.textColor=[UIColor whiteColor];
+    contactlabel.textColor=UIColorFromRGB(color);
     contactlabel.autoresizingMask=UIViewAutoresizingFlexibleLeftMargin;
     contactlabel.backgroundColor = [UIColor clearColor];
     contactlabel.text=NSLocalizedString(@"Unit price", nil);
@@ -1202,7 +1291,7 @@
     
     
     UILabel *modellabel = [[UILabel alloc] initWithFrame:CGRectMake(470, 5.5, 90, 22)];
-    modellabel.textColor=[UIColor whiteColor];
+    modellabel.textColor=UIColorFromRGB(color);
      modellabel.autoresizingMask=UIViewAutoresizingFlexibleLeftMargin;
     modellabel.backgroundColor = [UIColor clearColor];
     modellabel.text=NSLocalizedString(@"Discount/QTY", nil);
@@ -1210,7 +1299,7 @@
     [myView addSubview:modellabel];
     
     UILabel *pricelabel = [[UILabel alloc] initWithFrame:CGRectMake(640, 5.5, 90, 22)];
-    pricelabel.textColor=[UIColor whiteColor];
+    pricelabel.textColor=UIColorFromRGB(color);
     pricelabel.autoresizingMask=UIViewAutoresizingFlexibleLeftMargin;
     pricelabel.backgroundColor = [UIColor clearColor];
     pricelabel.text=NSLocalizedString(@"Set/Subtotal", nil);

+ 13 - 0
RedAnt ERP Mobile/common/Functions/category/CategoryHeaderView.h

@@ -0,0 +1,13 @@
+//
+//  CategoryHeaderView.h
+//  HMLG Mobile
+//
+//  Created by Ray on 5/25/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface CategoryHeaderView : UIView
+
+@end

+ 21 - 0
RedAnt ERP Mobile/common/Functions/category/CategoryHeaderView.m

@@ -0,0 +1,21 @@
+//
+//  CategoryHeaderView.m
+//  HMLG Mobile
+//
+//  Created by Ray on 5/25/16.
+//  Copyright © 2016 United Software Applications, Inc. All rights reserved.
+//
+
+#import "CategoryHeaderView.h"
+
+@implementation CategoryHeaderView
+
+/*
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect {
+    // Drawing code
+}
+*/
+
+@end

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

@@ -34,7 +34,7 @@
     }
     
     
-    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                                     style:UIBarButtonItemStylePlain
                                                                    target:self
                                                                    action:@selector( onCloseClick:)];

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

@@ -27,6 +27,8 @@
 
 #import "DetailViewController.h"
 #import "CategoryCellNPD.h"
+#import "DefaultAppearance.h"
+
 #import "MainViewController.h"
 //#import "ScannerViewController.h"
 #define  DEF_CELL_HEIGHT 44
@@ -1368,6 +1370,15 @@
 -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
 {
     
+
+    
+    NSString* value =[DefaultAppearance get_noneappearance_value:@"CategoryViewController" valuename:@"cell_border_color"];
+
+    if(value==nil)
+        value=@"";
+    unsigned long color = strtoul([value UTF8String],0,16);
+   
+    
     if(self.categoryViewType == CATEGORY_VIEWTYPE_SMALL)
     {
         static NSString * CellIdentifier = @"CategoryCellNPD";
@@ -1408,7 +1419,7 @@
         {
             
             cell.checkImageView.hidden = true;
-            [cell setBackgroundColor: UIColorFromRGB(0x996633)];
+            [cell setBackgroundColor:[UIColor whiteColor]/* UIColorFromRGB(0x996633)*/];
         }
         else
         {
@@ -1464,6 +1475,11 @@
             
             
         }
+
+        cell.layer.borderColor = UIColorFromRGB(color).CGColor;
+        cell.layer.borderWidth = 0.5;
+        //cell.layer.cornerRadius=15;
+        cell.layer.masksToBounds=true;
         return cell;
     }
     else if(self.categoryViewType == CATEGORY_VIEWTYPE_LARGE)
@@ -1504,7 +1520,7 @@
         {
             
             cell.checkImageView.hidden = true;
-            [cell setBackgroundColor: UIColorFromRGB(0x996633)];
+            [cell setBackgroundColor: /*UIColorFromRGB(0x996633)*/[UIColor whiteColor]];
         }
         else
         {
@@ -1554,6 +1570,10 @@
             
             
         }
+        cell.layer.borderColor = UIColorFromRGB(color).CGColor;
+        cell.layer.borderWidth = 0.5;
+        //cell.layer.cornerRadius=15;
+        cell.layer.masksToBounds=true;
         return cell;
     }
     else
@@ -1646,6 +1666,10 @@
             
             
         }
+        cell.layer.borderColor = UIColorFromRGB(color).CGColor;
+        cell.layer.borderWidth = 0.5;
+       // cell.layer.cornerRadius=15;
+        cell.layer.masksToBounds=true;
         return cell;
     }
     
@@ -1871,7 +1895,7 @@
             [item setValue:@"false" forKey:@"checked"];
             currentSelecteCell.checkImageView.hidden = true;
             if(self.categoryViewType != CATEGORY_VIEWTYPE_LIST)
-                [currentSelecteCell setBackgroundColor: UIColorFromRGB(0x996633)];
+                [currentSelecteCell setBackgroundColor: /*UIColorFromRGB(0x996633)*/[UIColor whiteColor]];
             else
                 [currentSelecteCell setBackgroundColor:  [UIColor whiteColor]];
         }

+ 43 - 5
RedAnt ERP Mobile/common/Functions/contact/ContactAdvanceSearchViewController.m

@@ -33,7 +33,7 @@
                                                                    target:self
                                                                    action:@selector( onBackClick:)];
     
-    closeButton.tintColor = UIColorFromRGB(0x996633);
+//    closeButton.tintColor = UIColorFromRGB(0x996633);
     self.navigationItem.leftBarButtonItem = closeButton;
     
     
@@ -43,7 +43,7 @@
                                                                    target:self
                                                                    action:@selector( onSearchClick:)];
     
-    searchButton.tintColor = UIColorFromRGB(0x996633);
+  //  searchButton.tintColor = UIColorFromRGB(0x996633);
     self.navigationItem.rightBarButtonItem = searchButton;
     
     
@@ -121,10 +121,48 @@
             
             if([control isEqualToString:@"img"])
             {
-                NSString* img_url = [itemjson valueForKey:@"img_url"];
+                {
+                    NSString* img_url = [itemjson valueForKey:@"img_url_0"];
+                    
+                    NSString* url_value = [self.data_init valueForKey:img_url];
+                    [itemjson setValue:url_value forKey:@"img_url_0"];
+                }
+                {
+                    NSString* img_url = [itemjson valueForKey:@"img_url_1"];
+                    
+                    NSString* url_value = [self.data_init valueForKey:img_url];
+                    [itemjson setValue:url_value forKey:@"img_url_1"];
+                }
+                {
+                    NSString* img_url = [itemjson valueForKey:@"img_url_2"];
+                    
+                    NSString* url_value = [self.data_init valueForKey:img_url];
+                    [itemjson setValue:url_value forKey:@"img_url_2"];
+                }
+            }
+            else if([control isEqualToString:@"enum"])
+            {
+//                NSMutableDictionary * cadedate = [itemjson objectForKey:@"cadedate"];
+                NSArray* checked = [value componentsSeparatedByString:NSLocalizedString(@",", nil)];
+                NSMutableDictionary* cadejson=[[itemjson objectForKey:@"cadedate"] mutableCopy];
+                int count = [[cadejson valueForKey:@"count"] intValue];
+                // bool setvalue = false;
+                for(int cc=0;cc<count;cc++)
+                {
+                    NSMutableDictionary* valjson=[[cadejson objectForKey:[NSString stringWithFormat:@"val_%d",cc]] mutableCopy];
+                    
+                    NSString* value_id=[NSString stringWithFormat:@"%@",[valjson valueForKey:@"value_id"]];
+                    
+                    int index=[checked indexOfObject:value_id];
+                    if(NSNotFound!=index&& checked!=nil)
+                    {
+                        
+                        valjson[@"check"]=[NSNumber numberWithInt:1];
+                        cadejson[[NSString stringWithFormat:@"val_%d",cc]]=valjson;
+                    }
+                }
                 
-                NSString* url_value = [self.data_init valueForKey:img_url];
-                [itemjson setValue:url_value forKey:@"img_url"];
+                itemjson [@"cadedate"]= cadejson;
             }
             
             [sectionjson setObject:itemjson forKey:[NSString stringWithFormat:@"item_%d",j]];

+ 1 - 0
RedAnt ERP Mobile/common/Functions/contact/ContactListTableViewCell.h

@@ -9,6 +9,7 @@
 #import <UIKit/UIKit.h>
 #import "RTLabel.h"
 @interface ContactListTableViewCell : UITableViewCell
+@property (strong, nonatomic) IBOutlet UIButton *btn_assign;
 
 @property (strong, nonatomic) IBOutlet RTLabel *rtlabel;
 @end

+ 100 - 4
RedAnt ERP Mobile/common/Functions/contact/ContactListViewController.m

@@ -352,9 +352,14 @@ self.label_net_err.hidden=true;
 - (IBAction)onASearch:(UIBarButtonItem *)sender {
     ContactAdvanceSearchViewController * vc =[ self.storyboard instantiateViewControllerWithIdentifier:@"ContactAdvanceSearchViewController"];
     
-    vc.url_type = URL_LOCAL;
+    vc.url_type = URL_REMOTE;
+    
+    vc.request_url=URL_CUSTOMER_ADV_SEARCH;
+    
     
-    vc.request_url=LOCAL_URL_CUSTOMER_ADV_SEARCH;
+    
+    NSMutableDictionary * params= [[NSMutableDictionary alloc] init];
+     vc.params = params;
     
     vc.data_init = self.adv_search;
     
@@ -452,6 +457,97 @@ self.label_net_err.hidden=true;
 //    DebugLog(@"refresh!!!!!!!!");
 //    
 //}
+- (IBAction)onAssignClick:(id)sender {
+    
+    UIButton* btn = (UIButton*)sender;
+    
+    UITableViewCell *cell = (UITableViewCell *)btn.superview.superview;;
+    NSIndexPath *indexPath = [self.table indexPathForCell:cell];
+    NSLog(@"indexPath is = %i",indexPath.row);
+    
+    
+        NSString* contactid=[self.content_data[indexPath.row] valueForKey:@"contact_id"] ;
+    
+    
+    
+    UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Getting Contact information"];
+    
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        NSDictionary* editor_json = [iSalesNetwork request_CustomerInfo:contactid];
+        
+        dispatch_async(dispatch_get_main_queue(), ^{
+            
+            [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
+            
+            if([[editor_json valueForKey:@"result"] intValue]==2)
+            {
+                __block NSMutableDictionary* data_init = [[editor_json objectForKey:@"customerInfo" ] mutableCopy];
+                
+                //---------------- construct customer_contact----------------------
+                NSString* customer_first_name = [data_init valueForKey:@"customer_first_name"];
+                if(customer_first_name==nil)
+                    customer_first_name=@"";
+                
+                NSString* customer_last_name= [data_init valueForKey:@"customer_last_name"];
+                if(customer_last_name==nil)
+                    customer_last_name=@"";
+                NSString* customer_contact = [NSString stringWithFormat:@"%@ %@",customer_first_name,customer_last_name];
+                customer_contact=[customer_contact stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
+                [data_init setValue:customer_contact forKey:@"customer_contact"];
+                
+                data_init[@"is_subaction"]=self.is_subaction;
+                data_init[@"subaction_tag"]= self.subaction_tag;
+//                [self.navigationController popViewControllerAnimated:false];
+                
+                
+                if(self.returnValue)
+                    self.returnValue(data_init,self.from);
+                
+//                dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+//                    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+//                    NSDictionary* editor_json = [iSalesNetwork update_OrderCustomer:appDelegate.order_code customerinfo:data_init];
+//                    
+//                    dispatch_async(dispatch_get_main_queue(), ^{
+//                        
+//                        
+//                        if([[editor_json valueForKey:@"result"] intValue]==2)
+//                        {
+//                            
+////                            [self.navigationController popViewControllerAnimated:false];
+////                            if(self.returnValue)
+////                            {
+////                                
+////                                self.returnValue(data_init);
+////                            }
+//                            
+//                            
+//                            
+//                        }
+//                        else
+//                        {
+//                            [RAUtils message_alert:[editor_json valueForKey:@"err_msg"] title:@"Update Order Customer Infomation" controller:self] ;
+//                        }
+//                        
+//                        
+//                        
+//                    });
+//                });
+                
+            }
+            else
+            {
+                [RAUtils message_alert:[editor_json valueForKey:@"err_msg"] title:@"Loading Contact Information" controller:self] ;
+//                self.btn_assign.enabled=false;
+            }
+            
+            
+        });
+    });
+
+
+    
+}
 #pragma mark - Table view data source
 
 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
@@ -608,7 +704,7 @@ self.label_net_err.hidden=true;
     {
 // UITableViewCell *cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"ContactListCell"];
         
-        
+        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
         NSString *CellIdentifier = @"ContactListTableViewCell";
         ContactListTableViewCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
         
@@ -616,7 +712,7 @@ self.label_net_err.hidden=true;
         
         cell.rtlabel.text = value;
         
-        
+        cell.btn_assign.hidden = !(self.assig_icon&&(appDelegate.contact_id.length==0));
         
   /*      NSString* name= [self.content_data[indexPath.row] valueForKey:@"name"];
         NSString* address= [self.content_data[indexPath.row] valueForKey:@"address"];

+ 2 - 2
RedAnt ERP Mobile/common/Functions/contact/CustomerEditViewController.m

@@ -19,7 +19,7 @@
     [super viewDidLoad];
     
     
-    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"back"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"back"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                                     style:UIBarButtonItemStylePlain
                                                                    target:self
                                                                    action:@selector(onBackClick:)];
@@ -35,7 +35,7 @@
     
     UIBarButtonItem *savebtn = nil;//[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"", nil) style:UIBarButtonItemStylePlain target:self action:@selector(onSaveClick:)];
     
-    savebtn = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"save"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+    savebtn = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"save"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                style:UIBarButtonItemStylePlain
                                               target:self
                                               action:@selector(onSaveClick:)];

+ 5 - 5
RedAnt ERP Mobile/common/Functions/contact/CustomerInfoViewController.m

@@ -166,7 +166,7 @@
                         
                         [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
                         [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
-                       
+                        [((MainViewController*)appDelegate.main_vc) reloadContact:false immediately:false];
                         [self.navigationController popToRootViewControllerAnimated:false];
                         
                         
@@ -239,7 +239,7 @@
     //    //    closeButton.title = @"Close";
     
     
-    UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"back"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+    UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"back"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                                    style:UIBarButtonItemStylePlain
                                                                   target:self
                                                                   action:@selector( onBackClick:)];
@@ -254,7 +254,7 @@
                                                     action:@selector(onEditClick:)];//[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Download", nil) style:UIBarButtonItemStylePlain target:self action:@selector(onDownloadOrderClick:)];
     
     
-    self.btn_edit.tintColor = UIColorFromRGB(0x996633);
+ //   self.btn_edit.tintColor = UIColorFromRGB(0x996633);
     
     
     
@@ -264,7 +264,7 @@
                                                       action:@selector(onAssignClick:)];//[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Download", nil) style:UIBarButtonItemStylePlain target:self action:@selector(onDownloadOrderClick:)];
     
     
-    self.btn_assign.tintColor = UIColorFromRGB(0x996633);
+//    self.btn_assign.tintColor = UIColorFromRGB(0x996633);
     
     
     self.btn_reset = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"reset"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
@@ -273,7 +273,7 @@
                                                      action:@selector(onResetClick:)];//[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Download", nil) style:UIBarButtonItemStylePlain target:self action:@selector(onDownloadOrderClick:)];
     
     
-    self.btn_reset.tintColor = UIColorFromRGB(0x996633);
+//    self.btn_reset.tintColor = UIColorFromRGB(0x996633);
     
 //     AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     

+ 31 - 2
RedAnt ERP Mobile/common/Functions/contact/customer_advanced_search.json

@@ -4,7 +4,7 @@
     "section_count": 1,
     "section_0": {
         "title": "Contact Information",
-        "count": 12,
+        "count": 13,
         
         "item_0": {
             "aname": "Country",
@@ -90,10 +90,39 @@
             "control": "edit",
             "value": "",
             "keyboard": "default"
+        },
+        "item_12": {
+            "control": "enum",
+            "name": "price_name",
+            "cadedate": {
+                "count": 5,
+                "val_1": {
+                    "value": "West Wholesale Price",
+                    "value_id": "West Wholesale Price"
+                },
+                "val_0": {
+                    
+                    "value": "West Dealer Price",
+                    "value_id": "West Dealer Price"
+                },
+                "val_3": {
+                    "value": "East Wholesale Price",
+                    "value_id": "East Wholesale Price"
+                },
+                "val_2": {
+                    "value": "East Dealer Price",
+                    "value_id": "East Dealer Price"
+                },
+                "val_4": {
+                    "value": "Container",
+                    "value_id": "Container"
+                }
+            },
+            "single_select": "false",
+            "aname": "Price Type"
         }
         
         
         
-        
     }
 }

+ 3 - 0
RedAnt ERP Mobile/common/Functions/modelDetail/DetailHeaderCell.h

@@ -63,6 +63,8 @@
 @property (strong, nonatomic) IBOutlet UITextField *quantity_text;
 @property (strong, nonatomic) IBOutlet UIButton *btnaddCart;
 @property (strong, nonatomic) IBOutlet UIButton *btnaddWish;
+@property (strong, nonatomic) IBOutlet UIButton *btnaddPortfolio;
+
 @property (strong, nonatomic) IBOutlet UILabel *eta_label;
 
 @property (strong, nonatomic) IBOutlet UILabel *incoming_stock_label;
@@ -77,6 +79,7 @@
 @property (nonatomic,copy)  void(^set_cqty)(int cqty);
 @property (nonatomic,copy)  void(^set_update_data)(bool bupdate);
 @property (nonatomic,copy)  void(^WatchlistBlock)(UIImageView *imageView);
+@property (nonatomic,copy)  void(^PortfolioBlock)(UIImageView *imageView);
 - (void)AddPhoto :(UIImage*)photo ;
 @property (strong, nonatomic) IBOutlet UILabel *selector_label;
 

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

@@ -54,6 +54,137 @@
 //    self.label_net_err.layer.masksToBounds=true;
     // Initialization code
 }
+- (IBAction)add_toPortfolio:(id)sender {
+    
+    //    int count=[self.quantity_text.text intValue];
+    UIApplication * app = [UIApplication sharedApplication];
+    AppDelegate *appDelegate = (AppDelegate *)[app delegate];
+    MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
+    if(appDelegate.bLogin==false)
+    {
+        UIViewController *vc= [RAUtils getViewController:self];
+        LoginViewController * loginvc =[ vc.storyboard instantiateViewControllerWithIdentifier:@"LoginViewController"];
+        //        loginvc.delegate = self;
+        //    loginvc.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
+        
+        loginvc.returnValue = ^(bool blogin){
+            
+            
+            //            UIApplication * app = [UIApplication sharedApplication];
+            //            AppDelegate *appDelegate = (AppDelegate *)[app delegate];
+            
+            
+            
+            
+            if(blogin)
+            {
+                
+                if(self.set_update_data)
+                    self.set_update_data(true);
+                
+                [main_vc checklogin:true];
+                
+                dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+                    
+                    NSDictionary* return_json = [iSalesNetwork add_toPortfolio:self.product_id ];
+                    
+                    dispatch_async(dispatch_get_main_queue(), ^{
+                        
+                        if([[return_json valueForKey:@"result"] intValue]==2)
+                        {
+                            
+                            // NSLog(@"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+                            [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
+                            if(self.WatchlistBlock!=nil)
+                            {
+                                UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
+                                
+                                
+                                CGRect iv_rect = CGRectMake(self.btnaddPortfolio.center.x-50, self.btnaddPortfolio.center.y-50, 100, 100);
+                                UIImageView* iv = [[UIImageView alloc] initWithFrame:iv_rect];
+                                iv.image = img;
+                                //                        [self.contentView addSubview:iv];
+                                self.PortfolioBlock(iv);
+                                
+                            }
+                        }
+                        else
+                        {
+                            [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add to portfolio" controller:vc] ;
+                        }
+                        
+                        
+                        
+                    });
+                });
+                
+                
+            }
+            
+            //            self.offset = 0;
+            //            [self.content_data removeAllObjects];
+            //            [self loadpage];
+            //
+            //            [[self navigationController] setNavigationBarHidden:YES animated:NO];
+            
+        };
+        
+        UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:loginvc] ;
+        
+        
+        
+        
+        
+        //    [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];
+        
+        navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//有三种状态,自己看看是哪种
+        [vc presentViewController:navi animated:YES completion:^{
+            
+            //        navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
+            
+            NSLog(@"LoginViewController present.........");
+            
+            //   self.btop = false;
+            //  <#code#>
+        }];
+    }
+    else
+    {
+        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+            
+            NSDictionary* return_json = [iSalesNetwork add_toPortfolio:self.product_id ];
+            
+            dispatch_async(dispatch_get_main_queue(), ^{
+                
+                if([[return_json valueForKey:@"result"] intValue]==2)
+                {
+                    [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
+                    if(self.WatchlistBlock!=nil)
+                    {
+                        UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
+                        
+                        
+                        CGRect iv_rect = CGRectMake(self.btnaddPortfolio.center.x-50, self.btnaddPortfolio.center.y-50, 100, 100);
+                        UIImageView* iv = [[UIImageView alloc] initWithFrame:iv_rect];
+                        iv.image = img;
+                        //                        [self.contentView addSubview:iv];
+                        self.PortfolioBlock(iv);
+                        
+                    }
+                }
+                else
+                {
+                    UIViewController *vc= [RAUtils getViewController:self];
+                    [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add to portfolio" controller:vc] ;
+                }
+                
+                
+                
+            });
+        });
+    }
+}
+
 - (IBAction)add_toWatchList:(id)sender {
     
     //    int count=[self.quantity_text.text intValue];

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

@@ -31,6 +31,7 @@
 @property (nonatomic , copy) void (^OnBack)(bool add_cart,bool add_wish,bool update_data);
 @property bool add_cart;
 @property bool add_wish;
+@property bool add_portfolio;
 @property bool update_data;
 //@property CALayer layer;
 @property (strong, nonatomic) IBOutlet UILabel *label_net_err;

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

@@ -20,6 +20,8 @@
 #import "RAUtils.h"
 #import "MainViewController.h"
 #import "QRCodeGenerator.h"
+#import "DefaultTableHeaderView.h"
+#import "DefaultAppearance.h"
 
 
 
@@ -306,13 +308,13 @@ self.isrefreshing=false;
     
     
 }
-- (IBAction)onShareClick:(id)sender {
-//        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-//    
-//    [appDelegate test_onDecodedDataResult:@"371252"];
-//        [self onDecodedData:@"3712524-235"];
-        return;
-}
+//- (IBAction)OnAddPortfolio:(id)sender {
+////        AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+////    
+////    [appDelegate test_onDecodedDataResult:@"371252"];
+////        [self onDecodedData:@"3712524-235"];
+//        return;
+//}
 -(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
 {
 //    [self.detailTable reloadData];
@@ -569,12 +571,23 @@ self.isrefreshing=false;
 //}
 -(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
 {
+    
+
+    
+    NSString* value =[DefaultAppearance get_noneappearance_value:@"DefaultTableHeaderView" valuename:@"title_text_color"];
+    
+    if(value==nil)
+        value=@"";
+    unsigned long color = strtoul([value UTF8String],0,16);
+    
     NSString *sectionTitle = [self tableView:tableView titleForHeaderInSection:section];
     if (sectionTitle == nil) {
         return nil;
     }
-    UIView* myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
-    myView.backgroundColor =  UIColorFromRGB(0x996633);
+    
+    
+    DefaultTableHeaderView* myView = [[DefaultTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
+   // myView.backgroundColor =  UIColorFromRGB(0x996633);
     myView.layer.shadowPath =[UIBezierPath bezierPathWithRect:myView.bounds].CGPath;
     myView.layer.shadowColor = [UIColor blackColor].CGColor;
     myView.layer.shadowOffset = CGSizeMake(0, 0);
@@ -582,8 +595,8 @@ self.isrefreshing=false;
     myView.layer.shadowRadius = 2.0;
     
     UILabel *titlelabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 5.5, 90, 22)];
-    titlelabel.textColor=[UIColor whiteColor];
-    titlelabel.backgroundColor = [UIColor clearColor];
+    titlelabel.textColor=UIColorFromRGB(color);
+  //  titlelabel.backgroundColor = [UIColor clearColor];
     titlelabel.text=sectionTitle;
     [titlelabel sizeToFit];
     
@@ -1243,6 +1256,19 @@ self.isrefreshing=false;
             [self startAnimationWithRect:headRect ImageView:imageView];
         };
         
+        cell.PortfolioBlock = ^(UIImageView *imageView){
+            self.add_portfolio=true;
+            CGRect rect = [tableView rectForRowAtIndexPath:indexPath];
+            rect.origin.y = rect.origin.y - [self.detailTable contentOffset].y;
+            CGRect headRect = imageView.frame;
+            headRect.origin.y = rect.origin.y+headRect.origin.y;
+            [self startAnimationWithRect:headRect ImageView:imageView];
+            
+            AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+            
+            [((MainViewController*)appDelegate.main_vc) reloadPortfolio:true immediately:false];
+        };
+        
         return cell;
     }
 //    NSDictionary* related_json = [self.detail_data objectForKey:@"related_model"];

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

@@ -61,7 +61,7 @@
     
     
     
-    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                                     style:UIBarButtonItemStylePlain
                                                                    target:self
                                                                    action:@selector(onCloseClick:)];
@@ -78,7 +78,7 @@
     
     UIBarButtonItem *savebtn = nil;//[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"", nil) style:UIBarButtonItemStylePlain target:self action:@selector(onSaveClick:)];
     
-    savebtn = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"save"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+    savebtn = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"save"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                style:UIBarButtonItemStylePlain
                                               target:self
                                               action:@selector(onSaveClick:)];
@@ -90,7 +90,7 @@
                                                          target:self
                                                          action:@selector(onCommitOrderClick:)];
     
-    self.btnSubmitOrder.tintColor= UIColorFromRGB(0x996633);
+  //  self.btnSubmitOrder.tintColor= UIColorFromRGB(0x996633);
     
     
     //savebtn setBackgroundImage:(nullable UIImage *) forState:<#(UIControlState)#> style:<#(UIBarButtonItemStyle)#> barMetrics:<#(UIBarMetrics)#>

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

@@ -23,6 +23,9 @@
 #import "SignatureViewController.h"
 #import "MainViewController.h"
 #import "AFHTTPSessionManager.h"
+#import "DefaultAppearance.h"
+#import "DefaultTableHeaderView.h"
+
 #define  DEF_CELL_HEIGHT 44
 #define  DEF_TABLE_HEIGHT 44
 #define  LINE_WIDTH 0
@@ -122,7 +125,7 @@
                                                                    target:self
                                                                    action:@selector( onBackClick:)];
     
-    closeButton.tintColor = UIColorFromRGB(0x996633);
+//    closeButton.tintColor = UIColorFromRGB(0x996633);
     
     
     
@@ -135,7 +138,7 @@
                                                    target:self
                                                    action:@selector(onOpenOrderClick:)];//[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Edit", nil) style:UIBarButtonItemStylePlain target:self action:@selector(onOpenOrderClick:)];
     
-    self.btnOpen.tintColor = UIColorFromRGB(0x996633);
+//    self.btnOpen.tintColor = UIColorFromRGB(0x996633);
     
     
     
@@ -144,7 +147,7 @@
                                                    target:self
                                                    action:@selector(onSignOrderClick:)];//[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Edit", nil) style:UIBarButtonItemStylePlain target:self action:@selector(onOpenOrderClick:)];
     
-    self.btnSign.tintColor = UIColorFromRGB(0x996633);
+//    self.btnSign.tintColor = UIColorFromRGB(0x996633);
     
     
     self.btnCopy =[[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"copy"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
@@ -152,7 +155,7 @@
                                                   target:self
                                                   action:@selector(onCopyOrderClick:)];// [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Commit", nil) style:UIBarButtonItemStylePlain target:self action:@selector(onCommitOrderClick:)];
     
-    self.btnCopy.tintColor = UIColorFromRGB(0x996633);
+ //   self.btnCopy.tintColor = UIColorFromRGB(0x996633);
     
     // self.btnSend = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Email", nil) style:UIBarButtonItemStylePlain target:self action:@selector(onSendMailClick:)];
     
@@ -162,7 +165,7 @@
                                                        style:UIBarButtonItemStylePlain
                                                       target:self
                                                       action:@selector(onReleaseOrderClick:)];
-    self.btnRelease.tintColor = UIColorFromRGB(0x996633);
+//    self.btnRelease.tintColor = UIColorFromRGB(0x996633);
     
     self.btnPDF = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"sales_order"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                    style:UIBarButtonItemStylePlain
@@ -170,7 +173,7 @@
                                                   action:@selector(onDownloadOrderClick:)];//[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Download", nil) style:UIBarButtonItemStylePlain target:self action:@selector(onDownloadOrderClick:)];
     
     
-    self.btnPDF.tintColor = UIColorFromRGB(0x996633);
+ //   self.btnPDF.tintColor = UIColorFromRGB(0x996633);
     
     //        UIBarButtonItem *item1 = [[UIBarButtonItem alloc] init];
     //        item1.title = @"item1";
@@ -955,8 +958,16 @@
 - (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
 {
     
-    UIView* myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
-    myView.backgroundColor = UIColorFromRGB(0x996633);;
+    
+    NSString* value =[DefaultAppearance get_noneappearance_value:@"DefaultTableHeaderView" valuename:@"title_text_color"];
+    
+    if(value==nil)
+        value=@"";
+    unsigned long color = strtoul([value UTF8String],0,16);
+    
+    
+    DefaultTableHeaderView* myView = [[DefaultTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
+  //  myView.backgroundColor = UIColorFromRGB(0x996633);;
     
     
     myView.layer.shadowPath =[UIBezierPath bezierPathWithRect:myView.bounds].CGPath;
@@ -1010,7 +1021,7 @@
     
     
     UILabel *titlelabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 5.5, 200, 20)];
-    titlelabel.textColor=[UIColor whiteColor];
+    titlelabel.textColor=UIColorFromRGB(color);;
     titlelabel.backgroundColor = [UIColor clearColor];
     titlelabel.text=NSLocalizedString(labeltitle, nil);
     [titlelabel sizeToFit];

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

@@ -14,7 +14,8 @@
 #import "MainViewController.h"
 
 #import "ContactListViewController.h"
-
+#import "DefaultAppearance.h"
+#import "DefaultTableHeaderView.h"
 
 @interface OrderListViewController ()
 
@@ -672,8 +673,15 @@ dispatch_async(self.loading_queue, ^{
 
 - (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
 {
-    UIView* myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
-    myView.backgroundColor =  UIColorFromRGB(0x996633);
+    
+    NSString* value =[DefaultAppearance get_noneappearance_value:@"DefaultTableHeaderView" valuename:@"title_text_color"];
+    
+    if(value==nil)
+        value=@"";
+    unsigned long color = strtoul([value UTF8String],0,16);
+    
+    DefaultTableHeaderView* myView = [[DefaultTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
+  //  myView.backgroundColor =  UIColorFromRGB(0x996633);
     myView.layer.shadowPath =[UIBezierPath bezierPathWithRect:myView.bounds].CGPath;
     myView.layer.shadowColor = [UIColor blackColor].CGColor;
     myView.layer.shadowOffset = CGSizeMake(0, 0);
@@ -682,28 +690,28 @@ dispatch_async(self.loading_queue, ^{
     
     
     UILabel *statuslabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 2, 130, 22)];
-    statuslabel.textColor=[UIColor whiteColor];
+    statuslabel.textColor=UIColorFromRGB(color);
     statuslabel.backgroundColor = [UIColor clearColor];
     statuslabel.text=NSLocalizedString(@"Status", nil);
     [statuslabel sizeToFit];
     [myView addSubview:statuslabel];
     
     UILabel *solabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 21, 130, 22)];
-    solabel.textColor=[UIColor whiteColor];
+    solabel.textColor=UIColorFromRGB(color);
     solabel.backgroundColor = [UIColor clearColor];
     solabel.text=NSLocalizedString(@"SO#", nil);
     [solabel sizeToFit];
     [myView addSubview:solabel];
     
     UILabel *userlabel = [[UILabel alloc] initWithFrame:CGRectMake(155, 2, 135, 22)];
-    userlabel.textColor=[UIColor whiteColor];
+    userlabel.textColor=UIColorFromRGB(color);
     userlabel.backgroundColor = [UIColor clearColor];
     userlabel.text=NSLocalizedString(@"Sales rep", nil);
     [userlabel sizeToFit];
     [myView addSubview:userlabel];
     
     UILabel *creatorlabel = [[UILabel alloc] initWithFrame:CGRectMake(155, 21, 135, 22)];
-    creatorlabel.textColor=[UIColor whiteColor];
+    creatorlabel.textColor=UIColorFromRGB(color);
     creatorlabel.backgroundColor = [UIColor clearColor];
     creatorlabel.text=NSLocalizedString(@"Create by", nil);
     [creatorlabel sizeToFit];
@@ -711,7 +719,7 @@ dispatch_async(self.loading_queue, ^{
     
     UILabel *contactlabel = [[UILabel alloc] initWithFrame:CGRectMake(300, 11, 150, 22)];
     
-    contactlabel.textColor=[UIColor whiteColor];
+    contactlabel.textColor=UIColorFromRGB(color);
     contactlabel.backgroundColor = [UIColor clearColor];
     contactlabel.text=NSLocalizedString(@"Contact", nil);
     [contactlabel sizeToFit];
@@ -1094,7 +1102,7 @@ dispatch_async(self.loading_queue, ^{
     
     // 添加一个编辑按钮
     
-    UITableViewRowAction *cancelAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Cancel"handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
+    UITableViewRowAction *cancelAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Cancel Order"handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
         
         NSLog(@"edit click");
         
@@ -1111,7 +1119,7 @@ dispatch_async(self.loading_queue, ^{
             UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Cancel Order"];
             dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
                 
-                NSDictionary* return_json = [iSalesNetwork cancel_Order:orderid];
+                NSDictionary* return_json = [iSalesNetwork cancel_Order:orderid order_code:nil];
                 
                 dispatch_async(dispatch_get_main_queue(), ^{
                     [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
@@ -1122,7 +1130,13 @@ dispatch_async(self.loading_queue, ^{
                         if([appDelegate.order_code isEqualToString: [self.content_data[indexPath.row] valueForKey:@"order_code"]])
                         {
                             appDelegate.order_code= nil;
+                            appDelegate.user_type = 0;
+                            appDelegate.customerInfo = nil;
+                            appDelegate.contact_id = nil;
+                            appDelegate.order_customer_id = nil;
                             [appDelegate SetSo:nil];
+                            appDelegate.cart_count=0;
+                            [appDelegate update_count_mark];
                             
                             
                         }

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

@@ -11,6 +11,9 @@
 #import "iSalesNetwork.h"
 #import "PDFViewController.h"
 #import "MainViewController.h"
+#import "DefaultAppearance.h"
+#import "DefaultTableHeaderView.h"
+
 @interface PDFListViewController ()
 
 @end
@@ -275,8 +278,15 @@
 
 - (UIView *) tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
 {
-    UIView* myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
-    myView.backgroundColor =  UIColorFromRGB(0x996633);
+    
+    NSString* value =[DefaultAppearance get_noneappearance_value:@"DefaultTableHeaderView" valuename:@"title_text_color"];
+    
+    if(value==nil)
+        value=@"";
+    unsigned long color = strtoul([value UTF8String],0,16);
+    
+    DefaultTableHeaderView* myView = [[DefaultTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 0.0001)];
+  //  myView.backgroundColor =  UIColorFromRGB(color);
     
     myView.layer.shadowColor = [UIColor blackColor].CGColor;
     myView.layer.shadowOffset = CGSizeMake(0, 0);
@@ -285,7 +295,7 @@
     
     
     UILabel *namelabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 11, 75, 22)];
-    namelabel.textColor=[UIColor whiteColor];
+    namelabel.textColor=UIColorFromRGB(color);
     namelabel.backgroundColor = [UIColor clearColor];
     namelabel.text=NSLocalizedString(@"Name", nil);
     [namelabel sizeToFit];
@@ -299,7 +309,7 @@
 //    [myView addSubview:solabel];
     
     UILabel *notelabel = [[UILabel alloc] initWithFrame:CGRectMake(250, 11, 75, 22)];
-    notelabel.textColor=[UIColor whiteColor];
+    notelabel.textColor=UIColorFromRGB(color);
     notelabel.backgroundColor = [UIColor clearColor];
     notelabel.text=NSLocalizedString(@"Notes", nil);
     [notelabel sizeToFit];
@@ -309,7 +319,7 @@
     
     UILabel *timelabel = [[UILabel alloc] initWithFrame:CGRectMake(553,11, 148, 22)];
     timelabel.autoresizingMask=UIViewAutoresizingFlexibleLeftMargin;
-    timelabel.textColor=[UIColor whiteColor];
+    timelabel.textColor=UIColorFromRGB(color);
     timelabel.backgroundColor = [UIColor clearColor];
 
     timelabel.text=@"Create time";

+ 10 - 5
RedAnt ERP Mobile/common/Functions/portfolio/PortfolioEditQTYViewController.h

@@ -8,23 +8,28 @@
 
 #import <UIKit/UIKit.h>
 
-@interface PortfolioEditQTYViewController : UIViewController<UITextFieldDelegate>
+@interface PortfolioEditQTYViewController : UIViewController<UITextFieldDelegate, UITextViewDelegate>
 @property int qty;
 @property (strong, nonatomic) IBOutlet UITextField *editQTY;
-@property (nonatomic , copy) void (^onSetValue)(int qty , double price, double discount);
+@property (nonatomic , copy) void (^onSetValue)(int qty , double price, double discount, NSString* notes);
 @property (strong, nonatomic) IBOutlet UILabel *labelQueryQTY;
 @property (strong, nonatomic) IBOutlet UIButton *buttonRefresh;
-@property (strong, nonatomic)  NSString * fashionid;
-
+//@property (strong, nonatomic)  NSString * fashionid;
+@property (strong, nonatomic) NSMutableArray* arr_fashion_ids;
 
 @property  double price;
 
 @property  double discount;
+@property (strong, nonatomic) NSString* linenotes;
 
 @property (strong, nonatomic) IBOutlet UITextField *editPrice;
 @property (strong, nonatomic) IBOutlet UITextField *editDiscount;
 @property (strong, nonatomic) IBOutlet UILabel *labelDiscount;
-@property (strong, nonatomic) IBOutlet UILabel *labelCalPrice;
+//@property (strong, nonatomic) IBOutlet UILabel *labelCalPrice;
+@property (strong, nonatomic) IBOutlet UILabel *label_multiItems;
+@property (strong, nonatomic) IBOutlet UITextView *tv_linenote;
+@property (strong, nonatomic) IBOutlet UILabel *labelpriceafter;
 
 @property (strong, nonatomic) IBOutlet UILabel *labelNewPrice;
 @end
+

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

@@ -18,7 +18,11 @@
 
 - (void)viewDidLoad {
     [super viewDidLoad];
+    
     self.edgesForExtendedLayout = UIRectEdgeNone;
+    
+    
+     self.tv_linenote.text=self.linenotes ;
     self.editQTY.text = [NSString stringWithFormat:@"%d",self.qty];
     [self requestqty];
     
@@ -29,6 +33,30 @@
     self.editDiscount.text = [NSString stringWithFormat:@"%@", [RAUtils FloatFormat:self.discount] ];
     
     self.labelNewPrice.text = [NSString stringWithFormat:@"%.2f",self.price* (1.0-self.discount/100)];
+    if(self.arr_fashion_ids.count!=1)
+    {
+        self.label_multiItems.text=[NSString stringWithFormat:@"%d items selected",self.arr_fashion_ids.count ];
+        self.label_multiItems.hidden = false;
+        self.editPrice.enabled = false;
+        self.editPrice.text = nil;
+        self.buttonRefresh.hidden = true;
+        self.labelQueryQTY.hidden = true;
+        
+        self.labelNewPrice.hidden = true;
+        self.labelpriceafter.hidden = true;
+    }
+    
+    
+    
+    self.tv_linenote.layer.backgroundColor = [[UIColor clearColor] CGColor];
+    
+    self.tv_linenote.layer.borderColor = [[UIColor lightGrayColor] CGColor];
+    
+    self.tv_linenote.layer.borderWidth = 0.5;
+    
+    self.tv_linenote.layer.cornerRadius = 8.0f;
+    
+    [self.tv_linenote.layer setMasksToBounds:YES];
     
 //    if(self.hide_discount)
 //    {
@@ -52,11 +80,14 @@
 }
 -(void) requestqty
 {
+    
+    if(self.arr_fashion_ids.count!=1)
+        return;
     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];
+        NSDictionary* detail_json = [iSalesNetwork request_model_qty:self.arr_fashion_ids[0]];
         
         dispatch_async(dispatch_get_main_queue(), ^{
             self.buttonRefresh.enabled=true;
@@ -131,7 +162,7 @@
     [self dismissViewControllerAnimated:NO
                              completion:^{
                                  if(self.onSetValue)
-                                     self.onSetValue( self.qty,self.price,self.discount);
+                                     self.onSetValue( self.qty,self.price,self.discount, self.linenotes);
                                  
                              }];
 }
@@ -151,6 +182,11 @@
     // Pass the selected object to the new view controller.
 }
 */
+#pragma mark textView delegate
+- (void)textViewDidEndEditing:(UITextView *)textView
+{
+     [self update_newprice];
+}
 #pragma mark textField delegate
 - (BOOL)textFieldShouldReturn:(UITextField *)textField {
     [textField resignFirstResponder];
@@ -236,6 +272,8 @@
     
     self.labelNewPrice.text = [NSString stringWithFormat:@"%.2f",self.price* (1.0-self.discount/100)];
     
+    self.linenotes = self.tv_linenote.text;
+    
 }
 - (void)textFieldDidEndEditing:(UITextField *)textField
 {

+ 122 - 8
RedAnt ERP Mobile/common/Functions/portfolio/PortfolioViewController.m

@@ -98,7 +98,7 @@
                             msg = [msg stringByAppendingString:appDelegate.customerInfo[@"customer_name"]];
                             
                         }
-                    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:msg delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil),NSLocalizedString(@"Add to new order", nil), nil];
+                    UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:msg delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Check for saved order", nil),NSLocalizedString(@"Create new order", nil), nil];
                     
                     
                     
@@ -107,7 +107,7 @@
                     }
                     else
                     {
-                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
+                        UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Check for saved order", nil), nil];
                         
                         // alert.
                         [alert show];
@@ -160,14 +160,14 @@
                     msg = [msg stringByAppendingString:appDelegate.customerInfo[@"customer_name"]];
                     
                 }
-            UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:msg delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil),NSLocalizedString(@"Add to new order", nil), nil];
+            UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:msg delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Check for saved order", nil),NSLocalizedString(@"Create new order", nil), nil];
             
             // alert.
             [alert show];
             }
             else
             {
-                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Add to pending order", nil), nil];
+                UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Add to cart", nil) message:NSLocalizedString(@"", nil) delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:NSLocalizedString(@"Check for saved order", nil), nil];
                 
                 // alert.
                 [alert show];
@@ -549,6 +549,119 @@
     }
     
 }
+- (IBAction)onEditClick:(id)sender {
+    NSMutableArray* checked = [[NSMutableArray alloc] init];
+    
+    
+    
+    int count = [[self.content_data valueForKey:@"count"] intValue];
+    for(int i=0;i<count;i++)
+    {
+        NSMutableDictionary * item_json = [[self.content_data objectForKey:[NSString stringWithFormat:@"item_%d",i]] mutableCopy];
+        int check = [[item_json valueForKey:@"check"] intValue];
+        if(check==1)
+        {
+            [checked addObject:[NSNumber numberWithInt:[[item_json valueForKey:@"item_id"] intValue]]];
+            
+        }
+    }
+    // disable for debug
+    if(checked.count==0)
+        return;
+    
+    //    NSMutableDictionary * params= [[NSMutableDictionary alloc] init];
+    NSString * ids = [checked componentsJoinedByString:@","];
+    
+    {
+        
+        NSLog(@"edit click");
+        
+        
+        
+        UIViewController* parentvc=self;
+        
+        
+        
+        
+        PortfolioEditQTYViewController * vc =[ parentvc.storyboard instantiateViewControllerWithIdentifier:@"PortfolioEditQTYViewController"];
+        
+        
+//        NSMutableDictionary * item_json = [[self.content_data objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]] mutableCopy];
+        
+        vc.arr_fashion_ids = checked;
+        
+        //        vc.fashionid =        [NSString stringWithFormat:@"%d",[[item_json valueForKey:@"fashion_id"] intValue]];
+//        vc.qty = [[item_json valueForKey:@"available_qty"] intValue];
+//        
+//        vc.discount=[[item_json valueForKey:@"tear_sheet_discount"] floatValue];
+//        vc.price = [[item_json valueForKey:@"tear_sheet_price"] floatValue];
+        
+        
+        //    vc.delegate = parentvc.self;
+        //    loginvc.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
+        vc.onSetValue = ^(int qty,double price, double discount , NSString* notes){
+            
+            
+            UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Updating Quantity"];
+            
+            dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+                
+                NSDictionary* cart_json = nil;
+                
+                cart_json= [iSalesNetwork portfolio_setPrice:ids price:price discount:discount QTY:qty notes:notes];
+                
+                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];
+        };
+        
+        
+        UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:vc] ;
+        
+        
+        
+        
+        
+        //    [self hackModalSheetSize:CGSizeMake(450, 200) ofVC:navi];
+        
+        navi.modalPresentationStyle = UIModalTransitionStyleCrossDissolve;//有三种状态,自己看看是哪种
+        [parentvc presentViewController:navi animated:YES completion:^{
+            
+            //        navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
+            
+            NSLog(@"EditModelPriceViewController present.........");
+            
+            //   self.btop = false;
+            //  <#code#>
+        }];
+        
+     //   [tableView reloadRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationMiddle];
+        
+        
+        
+        
+    }
+}
+
 - (IBAction)onDeleteClick:(id)sender {
     NSMutableArray* checked = [[NSMutableArray alloc] init];
     
@@ -1031,17 +1144,18 @@
         
         NSMutableDictionary * item_json = [[self.content_data objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]] mutableCopy];
         
+        vc.arr_fashion_ids = [[NSArray arrayWithObject:[NSString stringWithFormat:@"%d",[[item_json valueForKey:@"fashion_id"] intValue]]] mutableCopy];
 
-        vc.fashionid =        [NSString stringWithFormat:@"%d",[[item_json valueForKey:@"fashion_id"] intValue]];
+//        vc.fashionid =        [NSString stringWithFormat:@"%d",[[item_json valueForKey:@"fashion_id"] intValue]];
         vc.qty = [[item_json valueForKey:@"available_qty"] intValue];
-        
+        vc.linenotes=[item_json valueForKey:@"linenotes"] ;
         vc.discount=[[item_json valueForKey:@"tear_sheet_discount"] floatValue];
         vc.price = [[item_json valueForKey:@"tear_sheet_price"] floatValue];
         
         
         //    vc.delegate = parentvc.self;
         //    loginvc.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
-        vc.onSetValue = ^(int qty,double price, double discount){
+        vc.onSetValue = ^(int qty,double price, double discount , NSString* notes){
             
             
             UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Updating Quantity"];
@@ -1050,7 +1164,7 @@
                 
                 NSDictionary* cart_json = nil;
                 
-                cart_json= [iSalesNetwork portfolio_setPrice:[NSString stringWithFormat:@"%d",[[item_json valueForKey:@"item_id"] intValue]] price:price discount:discount QTY:qty];
+                cart_json= [iSalesNetwork portfolio_setPrice:[NSString stringWithFormat:@"%d",[[item_json valueForKey:@"item_id"] intValue]] price:price discount:discount QTY:qty notes:notes];
                 
                 dispatch_async(dispatch_get_main_queue(), ^{
                     [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];

+ 3 - 3
RedAnt ERP Mobile/common/Functions/portfolio/TearSheetParamViewController.m

@@ -27,7 +27,7 @@
                                                                    action:@selector(onCloseClick:)];
     //[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Close", nil) style:UIBarButtonItemStylePlain target:self action:@selector(onCloseClick:)];
     //    closeButton.title = @"Close";
-    closeButton.tintColor = UIColorFromRGB(0x996633);
+  //  closeButton.tintColor = UIColorFromRGB(0x996633);
     self.navigationItem.leftBarButtonItem = closeButton;
     
     
@@ -39,7 +39,7 @@
                                                  target:self
                                                  action:@selector(onPreviewClick:)];
     
-    previewbtn.tintColor = UIColorFromRGB(0x996633);
+  //  previewbtn.tintColor = UIColorFromRGB(0x996633);
     
     UIBarButtonItem *savebtn = nil;//[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"", nil) style:UIBarButtonItemStylePlain target:self action:@selector(onSaveClick:)];
     
@@ -48,7 +48,7 @@
                                               target:self
                                               action:@selector(onSaveClick:)];
     
-    savebtn.tintColor = UIColorFromRGB(0x996633);
+  //  savebtn.tintColor = UIColorFromRGB(0x996633);
     _savebtn = savebtn;
     
     

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

@@ -140,7 +140,7 @@
     
     
     
-    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                                     style:UIBarButtonItemStylePlain
                                                                    target:self
                                                                    action:@selector( onCloseClick:)];

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

@@ -16,6 +16,8 @@
 #import "ContactListViewController.h"
 
 #import "MainViewController.h"
+#import "DefaultAppearance.h"
+
 #define  DEF_CELL_HEIGHT 44
 #define  DEF_TABLE_HEIGHT 44
 #define  LINE_WIDTH 0
@@ -1239,7 +1241,11 @@
 }
 -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
 {
+    NSString* value =[DefaultAppearance get_noneappearance_value:@"CategoryViewController" valuename:@"cell_border_color"];
     
+    if(value==nil)
+        value=@"";
+    unsigned long color = strtoul([value UTF8String],0,16);
     if(self.categoryViewType == CATEGORY_VIEWTYPE_SMALL)
     {
         static NSString * CellIdentifier = @"CategoryCellNPD";
@@ -1277,7 +1283,7 @@
         {
             
             cell.checkImageView.hidden = true;
-            [cell setBackgroundColor: UIColorFromRGB(0x996633)];
+            [cell setBackgroundColor:[UIColor whiteColor]/* UIColorFromRGB(0x996633)*/];
         }
         else
         {
@@ -1334,6 +1340,10 @@
             
             
         }
+        cell.layer.borderColor = UIColorFromRGB(color).CGColor;
+        cell.layer.borderWidth = 0.5;
+        //cell.layer.cornerRadius=15;
+        cell.layer.masksToBounds=true;
         return cell;
     }
     else if(self.categoryViewType == CATEGORY_VIEWTYPE_LARGE)
@@ -1369,7 +1379,7 @@
         {
             
             cell.checkImageView.hidden = true;
-            [cell setBackgroundColor: UIColorFromRGB(0x996633)];
+            [cell setBackgroundColor:[UIColor whiteColor]/* UIColorFromRGB(0x996633)*/];
         }
         else
         {
@@ -1421,6 +1431,11 @@
             
             
         }
+        cell.layer.borderColor = UIColorFromRGB(color).CGColor;
+        cell.layer.borderWidth = 0.5;
+        //cell.layer.cornerRadius=15;
+        cell.layer.masksToBounds=true;
+        return cell;
         return cell;
     }
     else
@@ -1513,6 +1528,10 @@
             
             
         }
+        cell.layer.borderColor = UIColorFromRGB(color).CGColor;
+        cell.layer.borderWidth = 0.5;
+        // cell.layer.cornerRadius=15;
+        cell.layer.masksToBounds=true;
         return cell;
     }
 }

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

@@ -28,7 +28,7 @@
 @property bool showDetail;
 @property (strong, nonatomic) IBOutlet UIActivityIndicatorView *mum;
 
-
+@property bool loadmore_matchfull;
 @property bool isSelectionMode;
 @property (strong, nonatomic) IBOutlet UIBarButtonItem *addCartBtn;
 @property (strong, nonatomic) IBOutlet UIBarButtonItem *addWishBtn;
@@ -37,6 +37,7 @@
 @property int select_count;
 @property (strong, nonatomic) IBOutlet UIToolbar *selectToolbar;
 
+@property (strong, nonatomic) IBOutlet UISwitch *switch_matchfull;
 
 @property (strong, nonatomic) IBOutlet UILabel *label_net_err;
 @end

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

@@ -14,6 +14,8 @@
 #import "ContactListViewController.h"
 
 #import "MainViewController.h"
+#import "DefaultAppearance.h"
+
 #define  DEF_CELL_HEIGHT 44
 #define  DEF_TABLE_HEIGHT 44
 #define  LINE_WIDTH 0
@@ -1056,7 +1058,7 @@
         
 
         
-        NSDictionary* category_more=[iSalesNetwork Search:self.offset limit:20 keywords:self.keywords];
+        NSDictionary* category_more=[iSalesNetwork Search:self.offset limit:20 keywords:self.keywords matchfull:self.loadmore_matchfull];
         dispatch_async(dispatch_get_main_queue(), ^{
             [self.mum stopAnimating];
             
@@ -1161,9 +1163,10 @@
         self.mum.center = self.view.center;
         self.mum.hidden = false;
         [self.mum startAnimating];
+        self.loadmore_matchfull = self.switch_matchfull.isOn;
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         
-        NSDictionary* category_data=[iSalesNetwork Search:0 limit:20 keywords:self.keywords];
+        NSDictionary* category_data=[iSalesNetwork Search:0 limit:20 keywords:self.keywords matchfull:self.switch_matchfull.isOn];
         
         dispatch_async(dispatch_get_main_queue(), ^{
             
@@ -1233,6 +1236,18 @@
     // Pass the selected object to the new view controller.
 }
 */
+- (IBAction)onMatchFullChanged:(id)sender {
+    
+    NSDictionary * item_json = [self.category_data objectForKey:@"items"];
+    int count =[[item_json valueForKey:@"count"] intValue];
+    
+//    if(count!=0)
+//    {
+//        self.offset = 0;
+//        [self reload];
+//    }
+//    
+}
 
 #pragma mark - searchBar delegate;
 - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar
@@ -1285,6 +1300,13 @@
 }
 -(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
 {
+    NSString* value =[DefaultAppearance get_noneappearance_value:@"CategoryViewController" valuename:@"cell_border_color"];
+    
+    if(value==nil)
+        value=@"";
+    unsigned long color = strtoul([value UTF8String],0,16);
+    
+    
     if(self.categoryViewType == CATEGORY_VIEWTYPE_SMALL)
     {
         static NSString * CellIdentifier = @"CategoryCellNPD";
@@ -1324,7 +1346,7 @@
         {
             
             cell.checkImageView.hidden = true;
-            [cell setBackgroundColor: UIColorFromRGB(0x996633)];
+            [cell setBackgroundColor:[UIColor whiteColor]/* UIColorFromRGB(0x996633)*/];
         }
         else
         {
@@ -1380,6 +1402,10 @@
             
             
         }
+        cell.layer.borderColor = UIColorFromRGB(color).CGColor;
+        cell.layer.borderWidth = 0.5;
+        //cell.layer.cornerRadius=15;
+        cell.layer.masksToBounds=true;
         return cell;
     }
     else if(self.categoryViewType == CATEGORY_VIEWTYPE_LARGE)
@@ -1422,7 +1448,7 @@
         {
             
             cell.checkImageView.hidden = true;
-            [cell setBackgroundColor: UIColorFromRGB(0x996633)];
+            [cell setBackgroundColor:[UIColor whiteColor]/* UIColorFromRGB(0x996633)*/];
         }
         else
         {
@@ -1472,6 +1498,10 @@
             
             
         }
+        cell.layer.borderColor = UIColorFromRGB(color).CGColor;
+        cell.layer.borderWidth = 0.5;
+        //cell.layer.cornerRadius=15;
+        cell.layer.masksToBounds=true;
         return cell;
     }
     else
@@ -1564,6 +1594,10 @@
             
             
         }
+        cell.layer.borderColor = UIColorFromRGB(color).CGColor;
+        cell.layer.borderWidth = 0.5;
+        //cell.layer.cornerRadius=15;
+        cell.layer.masksToBounds=true;
         return cell;
     }
     

+ 3 - 0
RedAnt ERP Mobile/common/Functions/sidemenu/AboutViewController.h

@@ -11,5 +11,8 @@
 @interface AboutViewController : UIViewController
 //@property (strong, nonatomic) IBOutlet UILabel *labelAbout;
 @property (strong, nonatomic) IBOutlet UILabel *labelVer;
+@property (strong, nonatomic) IBOutlet UILabel *label_appname;
+@property (strong, nonatomic) IBOutlet UILabel *label_company;
+@property (strong, nonatomic) IBOutlet UITextView *tvcompany;
 
 @end

+ 12 - 0
RedAnt ERP Mobile/common/Functions/sidemenu/AboutViewController.m

@@ -7,6 +7,8 @@
 //
 
 #import "AboutViewController.h"
+#import "config.h"
+
 
 @interface AboutViewController ()
 
@@ -31,9 +33,19 @@
     NSDictionary* infoDict =[[NSBundle mainBundle] infoDictionary];
     NSString* build =[infoDict objectForKey:@"CFBundleVersion"];
     NSString* version =[infoDict objectForKey:@"CFBundleShortVersionString"];
+#ifdef BUILD_NPD
     NSString* versionNum = [NSString stringWithFormat:@"Version: npd %@ Build %@",version,build];
+#endif
+
+#ifdef BUILD_HMLG
+    NSString* versionNum = [NSString stringWithFormat:@"Version: HOMELEGANCE %@ Build %@",version,build];
+#endif
+    
     
     self.labelVer.text = versionNum;
+    self.label_appname.text=APP_NAME;
+    self.label_company.text=COMPANY_NAME;
+    self.tvcompany.text=COMPANY_INFO;
     
 }
 

+ 1 - 1
RedAnt ERP Mobile/common/Functions/sidemenu/CacheViewController.m

@@ -59,7 +59,7 @@
     }
     
     
-    UIBarButtonItem* closeBTN = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+    UIBarButtonItem* closeBTN = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                    style:UIBarButtonItemStylePlain
                                                   target:self
                                                   action:@selector(onCloseClick:)];

+ 7 - 1
RedAnt ERP Mobile/common/Functions/sidemenu/LoginViewController.m

@@ -31,10 +31,16 @@
 - (void)viewDidLoad
 {
     [super viewDidLoad];
+#ifdef BUILD_HMLG
+    self.title=@"HMLG";
+#endif
+#ifdef BUILD_NPD
+    self.title=@"NPD";
+#endif
     self.showList = false;
     
   
-    self.bb_close.image=[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
+    self.bb_close.image=[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAutomatic];
     
     [self.checkSavePassword setImage:[UIImage imageNamed:@"checkbox"] forState:UIControlStateNormal];
     [self.checkSavePassword setImage:[UIImage imageNamed:@"checkbox_check"] forState:UIControlStateSelected];

+ 1 - 1
RedAnt ERP Mobile/common/Functions/sidemenu/ScannerSettingViewController.m

@@ -46,7 +46,7 @@
 
     self.edgesForExtendedLayout = UIRectEdgeNone ;
     
-    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                                     style:UIBarButtonItemStylePlain
                                                                    target:self
                                                                    action:@selector( onCloseClick:)];

+ 1 - 1
RedAnt ERP Mobile/common/Functions/sidemenu/SimplifiedBuyingProgramViewController.m

@@ -17,7 +17,7 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     
-    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                                     style:UIBarButtonItemStylePlain
                                                                    target:self
                                                                    action:@selector( onCloseClick:)];

+ 1 - 1
RedAnt ERP Mobile/common/Functions/sidemenu/UserListViewController.m

@@ -20,7 +20,7 @@
     
     self.edgesForExtendedLayout = UIRectEdgeNone;
     
-    self.bb_close.image=[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
+    self.bb_close.image=[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAutomatic];
     
     
     

+ 3 - 3
RedAnt ERP Mobile/common/Functions/signature/SignatureViewController.m

@@ -38,7 +38,7 @@
                                                                    target:self
                                                                    action:@selector( onBackClick:)];
     
-    closeButton.tintColor = UIColorFromRGB(0x996633);
+ //   closeButton.tintColor = UIColorFromRGB(0x996633);
     self.navigationItem.leftBarButtonItem=closeButton;
     
     
@@ -46,12 +46,12 @@
                                                                style:UIBarButtonItemStylePlain
                                                               target:self
                                                               action:@selector( onClear:)];
-        clearBtn.tintColor = UIColorFromRGB(0x996633);
+     //   clearBtn.tintColor = UIColorFromRGB(0x996633);
     UIBarButtonItem *doneBtn=[[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"save"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                               style:UIBarButtonItemStylePlain
                                                              target:self
                                                              action:@selector( onDone:)];
-        doneBtn.tintColor = UIColorFromRGB(0x996633);
+     //   doneBtn.tintColor = UIColorFromRGB(0x996633);
     
     //  id aa = self.navigationItem;
     

+ 1 - 1
RedAnt ERP Mobile/common/categoryMenu_RATree/RAViewController.m

@@ -136,7 +136,7 @@
     [self.label_net_err addGestureRecognizer:tap];
     
     
-    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]
+    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
                                                                     style:UIBarButtonItemStylePlain
                                                                    target:self
                                                                    action:@selector( CloseClick:)];

+ 2 - 0
RedAnt ERP Mobile/iSales-NPD/OfflineSettingViewController.h

@@ -19,4 +19,6 @@
 @property (strong, nonatomic) IBOutlet UIProgressView *progress_update;
 @property (strong, nonatomic) IBOutlet UIButton *btn_clearcache;
 @property (strong, nonatomic) IBOutlet UITextView *tv_log;
+
+-(void) onLogUpdate;
 @end

+ 110 - 10
RedAnt ERP Mobile/iSales-NPD/OfflineSettingViewController.m

@@ -7,6 +7,7 @@
 //
 
 #import "OfflineSettingViewController.h"
+#import "iSalesNetwork.h"
 
 @interface OfflineSettingViewController ()
 
@@ -25,6 +26,28 @@
     
     self.switch_offline.on = offline;
     
+    
+    
+    self.edgesForExtendedLayout = UIRectEdgeNone ;
+    
+    UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithImage:[[UIImage imageNamed:@"close"] imageWithRenderingMode:UIImageRenderingModeAutomatic]
+                                                                    style:UIBarButtonItemStylePlain
+                                                                   target:self
+                                                                   action:@selector( onCloseClick:)];
+    self.navigationItem.rightBarButtonItem = closeButton;
+    
+    
+    self.tv_log.layer.borderWidth=1 ; //边框粗细
+    self.tv_log.layer.borderColor=[UIColor darkGrayColor].CGColor; //边框颜色
+    
+    
+}
+
+- (void)onCloseClick:(UIButton *)sender {
+    
+    //    if(self.onDismissVC)
+    //        self.onDismissVC();
+    [self dismissViewControllerAnimated:true completion:nil];
 }
 
 - (void)didReceiveMemoryWarning {
@@ -33,21 +56,98 @@
 }
 - (IBAction)onChangeOfflineSwitch:(id)sender {
     
+
+    
     NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
-    [defaults removeObjectForKey:@"EnableOfflineMode"];
-    [defaults setBool:self.switch_offline.isOn forKey:@"EnableOfflineMode"];
     
-    [defaults synchronize];
+    if(self.switch_offline.isOn==false)
+    {
+        //disable offline
+        [defaults removeObjectForKey:@"EnableOfflineMode"];
+        [defaults setBool:self.switch_offline.isOn forKey:@"EnableOfflineMode"];
+        
+        [defaults synchronize];
+    }
+    else
+    {
+        NSString*  ver = [defaults stringForKey:@"OfflineVer"] ;
+        if(ver.length==0)
+        {
+            
+            UIAlertController *alertControl = [UIAlertController alertControllerWithTitle:@"Offline data does not exist, do you like download now?" message:nil preferredStyle:UIAlertControllerStyleAlert];
+            //block代码块取代了delegate
+            
+            
+            UIAlertAction *actionTwo = [UIAlertAction actionWithTitle:@"Download" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+             //   UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait..." title:@"Checking offline data"];
+                //init offline mode
+                dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+                    
+                    
+                  //  [self check_offline];
+                });
+                
+                
+                
+                
+            }];
+            
+            UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
+                [self.switch_offline setOn:false];
+                //[RAUtils message_alert:@"No item in the cart" title:@"Offline" controller:self] ;
+            }];
+            
+            [alertControl addAction:actionTwo];
+            [alertControl addAction:alertthree];
+            
+            //UIAlertControllerStyle类型为UIAlertControllerStyleAlert可以添加addTextFieldWithConfigurationHandler:^(UITextField *textField)
+            
+            
+            [self presentViewController:alertControl animated:YES completion:nil];
+            
+            
+            
+            
+            
+            
+            
+            
+        }
+        else
+        {
+            
+        }
+    }
+}
+
+-(void) download_file:(NSString*)url type:(NSString*)type
+{
     
 }
-/*
-#pragma mark - Navigation
 
-// In a storyboard-based application, you will often want to do a little preparation before navigation
-- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
-    // Get the new view controller using [segue destinationViewController].
-    // Pass the selected object to the new view controller.
+
+
+-(void) onLogUpdate
+{
+    UIApplication * app = [UIApplication sharedApplication];
+    AppDelegate *appDelegate = (AppDelegate *)[app delegate];
+    
+    dispatch_async(dispatch_get_main_queue(), ^{
+        self.tv_log.text = appDelegate.downloadlog;
+        
+        [self.tv_log scrollRangeToVisible:NSMakeRange(appDelegate.downloadlog.length-1,0)];
+    });
+    
+    
 }
-*/
+/*
+ #pragma mark - Navigation
+ 
+ // In a storyboard-based application, you will often want to do a little preparation before navigation
+ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+ // Get the new view controller using [segue destinationViewController].
+ // Pass the selected object to the new view controller.
+ }
+ */
 
 @end