Selaa lähdekoodia

1.修改Model Detail,用Out of Stock替换In Production。
2.离线增加搜索项:material、made in、 packaging。
3.增加Assembly Introduction。
4.增加Print Wishlist和Email Wishlist。
5.Visa/Master instead of Credit Card。
6.Net 30 change to Net 60。
7.重新排序Payments。
8.修改Category,从Model Detail返回时界面保持原样。
9.增加Blog按钮。

Pen Li 9 vuotta sitten
vanhempi
commit
b452dd8a4b

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


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

@@ -1770,6 +1770,10 @@
 #endif
     
 #ifdef BUILD_NPD
+    [map setValue:@"BLOG" forKey:@"title"];
+    [map setValue:@"rect_change_password" forKey:@"img"];
+    [self.sideMenuItems addObject:map.copy];
+    
     [map setValue:@"NPD Website" forKey:@"title"];
     [map setValue:@"rect_change_password" forKey:@"img"];
     [self.sideMenuItems addObject:map.copy];
@@ -2078,7 +2082,22 @@
         [self.navigationController pushViewController:ViewController animated:YES];
         
     }
-    
+    else if ([title isEqualToString:@"BLOG"]) {
+        
+        NSString* url = @"https://www.newpacificdirect.com";
+        
+        
+        NSString* title = @"NPD BLOG";
+        
+        WebViewController *ViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"WebViewController"];
+        ViewController.url = url;
+        ViewController.title = title;
+        
+        
+        
+        [self.navigationController pushViewController:ViewController animated:YES];
+        
+    }
     else if([title isEqualToString:@"NPD Website"])
     {
         

+ 1 - 1
RedAnt ERP Mobile/common/Functions/PDF+Web/PDFViewController.h

@@ -18,7 +18,7 @@
 @property (strong, nonatomic) IBOutlet UIBarButtonItem *BB_action;
 @property (strong,nonatomic) UIDocumentInteractionController* fileInteractionController;
 @property (nonatomic , copy) void (^onLoadSuccess)(NSString* url );
-
+@property (nonatomic,copy) NSString *cachePath;
 
 @property (nonatomic , copy) void (^onSavePDF)(NSString* name,NSString* file );
 @property (strong,nonatomic) NSString* mail_subject;

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

@@ -271,6 +271,9 @@
                 //    NSError *error = nil;
                 //    BOOL bo = [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error];
                 //    NSAssert(bo,@"创建目录失败");
+                if (self.cachePath.length) {
+                    filePath = self.cachePath;
+                }
                 [self.content writeToFile:filePath atomically:YES];
                 
                 

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

@@ -44,7 +44,6 @@
 @interface CategoryViewController ()
 
 @property (nonatomic,assign) BOOL addAll;
-@property (nonatomic,assign) BOOL disappear;
 @property (nonatomic,strong) NSOperationQueue *dataOperationQueue;
 @property (nonatomic,assign) UIInterfaceOrientation toOrientation;///<屏幕将要旋转到的方向
 
@@ -1428,15 +1427,17 @@
 
     [self checkToolBar];
     
-    self.disappear = NO;
     self.toOrientation = [[UIApplication sharedApplication] statusBarOrientation];
-    [self.collectionview reloadData];
+
+//    [self.collectionview scrollToItemAtIndexPath:self.selectedIndexPath atScrollPosition:16 animated:YES];
+    
+    [self.collectionview layoutIfNeeded];
+    
 }
 
 - (void)viewWillDisappear:(BOOL)animated {
-    // 消除横排切换出去,竖屏切换回来时invalidateSize警告
-    self.disappear = YES;
-    [self.collectionview reloadData];
+    [super viewWillDisappear:animated];
+    
 }
 
 - (void)viewDidLoad
@@ -1609,9 +1610,6 @@
 -(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
 
 {
-    if (self.disappear) {
-        return 0;
-    }
     // 每个Section的item个数
     NSDictionary * item_json = [self.category_data objectForKey:@"items"];
     int count =[[item_json valueForKey:@"count"] intValue];
@@ -2186,6 +2184,7 @@
 #endif
         
         [self showDetailat:detail_id category_id:item_category_id name:[item valueForKey:@"name"] index:indexPath.row];
+       
     }
     
     //    UICollectionViewCell * cell = (UICollectionViewCell *)[collectionView cellForItemAtIndexPath:indexPath];

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

@@ -85,7 +85,8 @@
 @property (nonatomic,copy)  void(^PortfolioBlock)(UIImageView *imageView);
 - (void)AddPhoto :(UIImage*)photo ;
 @property (strong, nonatomic) IBOutlet UILabel *selector_label;
-
+@property (strong, nonatomic) IBOutlet UIButton *introduceBtn;
+@property (nonatomic,copy) void(^introduceBlock)(UIButton *sender);
 -(void)Hide_selector:(bool) bhide;
 
 -(void)ClearPhotos;

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

@@ -1496,5 +1496,14 @@
     
 }
 
+- (IBAction)introduceBtnClick:(UIButton *)sender {
+    
+    if (self.introduceBlock) {
+        self.introduceBlock(sender);
+    }
+    
+}
+
+
 
 @end

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

@@ -25,6 +25,7 @@
 #import "JKMessageBoxController.h"
 
 #import "CartUtils.h"
+#import "PDFViewController.h"
 
 #define  DEF_CELL_HEIGHT 44
 #define  DEF_TABLE_HEIGHT 44
@@ -944,6 +945,16 @@ self.isrefreshing=false;
     
 }
 
+- (BOOL)isOutofStock {
+    NSMutableDictionary* section_json = [[self.detail_data objectForKey:@"img_section"] mutableCopy];
+    NSString *qtyStr = [section_json valueForKey:@"Availability"];
+    
+    if (!qtyStr || !qtyStr.length || [qtyStr isEqualToString:@"In Production"] || [qtyStr isEqualToString:@"0"] || [qtyStr isEqualToString:@"Sold Out"] || [qtyStr isEqualToString:@"Out of Stock"]) {
+        return YES;
+    }
+    return NO;
+}
+
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
 {
     //    DebugLog(@"cellForRowAtIndexPath");
@@ -1033,7 +1044,7 @@ self.isrefreshing=false;
                     
                     if (!appDelegate.order_code) { // 未打开订单状态
                         
-                        if (!qtyStr || !qtyStr.length || [qtyStr isEqualToString:@"In Production"] || [qtyStr isEqualToString:@"0"] || [qtyStr isEqualToString:@"Sold Out"]) {
+                        if ([self isOutofStock]) {
                             
                             if (!appDelegate.can_create_backorder) {
                                 cell.btnaddCart.enabled = NO;
@@ -1054,7 +1065,7 @@ self.isrefreshing=false;
                             // 默认未缺货
                             cell.btnNotifyMe.enabled = NO;
                             
-                            if (!qtyStr || !qtyStr.length || [qtyStr isEqualToString:@"In Production"] || [qtyStr isEqualToString:@"0"] || [qtyStr isEqualToString:@"Sold Out"]) { // 缺货
+                            if ([self isOutofStock]) { // 缺货
                                 
                                 cell.btnNotifyMe.enabled = YES;
                                 
@@ -1062,7 +1073,7 @@ self.isrefreshing=false;
                             
                         } else {
                             // Purchase Order
-                            if (!qtyStr || !qtyStr.length || [qtyStr isEqualToString:@"In Production"] || [qtyStr isEqualToString:@"0"] || [qtyStr isEqualToString:@"Sold Out"]) { // 缺货
+                            if ([self isOutofStock]) { // 缺货
                                 if (!appDelegate.can_create_backorder) {
                                     cell.btnaddCart.enabled = NO;
                                 }
@@ -1086,7 +1097,7 @@ self.isrefreshing=false;
                 cell.btnaddPortfolio.hidden = NO;
                 cell.btnNotifyMe.hidden = NO;
                 
-                if (!qtyStr || !qtyStr.length || [qtyStr isEqualToString:@"In Production"] || [qtyStr isEqualToString:@"0"] || [qtyStr isEqualToString:@"Sold Out"]) { // 缺货
+                if ([self isOutofStock]) { // 缺货
                     if (!appDelegate.can_create_backorder) {
                         cell.btnaddCart.enabled = NO;
                     }
@@ -1412,7 +1423,7 @@ self.isrefreshing=false;
         });
        // cell.backgroundColor = [UIColor whiteColor];
         
-        
+        __weak typeof(self) weakself = self;
         cell.shopCartBlock = ^(UIImageView *imageView){
             self.add_cart=true;
             CGRect rect = [tableView rectForRowAtIndexPath:indexPath];
@@ -1451,6 +1462,12 @@ self.isrefreshing=false;
             [((MainViewController*)appDelegate.main_vc) reloadPortfolio:true immediately:false];
         };
         
+        cell.introduceBlock = ^(UIButton *sender) {
+            NSString *introduce = [weakself.detail_data objectForKey:@"introduce"];
+//            introduce = @"http://127.0.0.1/ios.pdf";
+            [weakself showIntroducePDF:introduce];
+        };
+        
         return cell;
     }
 //    NSDictionary* related_json = [self.detail_data objectForKey:@"related_model"];
@@ -1956,4 +1973,61 @@ self.isrefreshing=false;
     [self presentViewController:emailAddrVC animated:YES completion:nil];
 }
 
+- (void)showIntroducePDF:(NSString *)link {
+    
+    if (link.length == 0) {
+        [RAUtils message_alert:@"There is no resource to open" title:@"Warning" controller:self];
+        return;
+    }
+    
+    BOOL isLocalFile = NO;
+    NSMutableDictionary* section_json = [[self.detail_data objectForKey:@"img_section"] mutableCopy];
+    NSString *name = [section_json valueForKey:@"model_name"];
+    NSString *path = [NSString stringWithFormat:@"%@/Introduce/%@/%@",[RAUtils appCacheDirectory],name,link.lastPathComponent];
+    if ([RAUtils fileExistsAtPath:path]) { // 检查缓存
+        isLocalFile = YES;
+        link = path;
+    } else {
+        // 创建缓存目录
+        NSString *dir = [path stringByDeletingLastPathComponent];
+        [[NSFileManager defaultManager] createDirectoryAtPath:dir withIntermediateDirectories:YES attributes:nil error:nil];
+    }
+    
+    
+    name = [NSString stringWithFormat:@"%@ Assembly Instruction",name];
+    
+    PDFViewController *ViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PDFViewController"];
+    ViewController.url = link;
+    ViewController.canSave = false;
+    ViewController.isLocalfile=isLocalFile;
+    ViewController.cachePath = path;
+    NSString* subject = name;
+    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    NSString* customer_email = [appDelegate.customerInfo valueForKey:@"customer_email"];
+    
+    
+    NSMutableArray* send_to = [[NSMutableArray alloc]init];
+    if(customer_email.length>0)
+    {
+        send_to=[[customer_email componentsSeparatedByString:NSLocalizedString(@";", nil)] mutableCopy];
+
+        
+    }
+    ViewController.mail_to = send_to;
+    
+    ViewController.attachment_name = [NSString stringWithFormat:@"%@.pdf",name];
+    ViewController.mail_subject = subject;
+    
+    ViewController.hidenavi = false;
+    
+    
+//    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:ViewController];
+//    nav.modalPresentationStyle = UIModalPresentationFormSheet;// 只在iPad起作用
+//    CGSize size = [UIScreen mainScreen].bounds.size;
+//    nav.preferredContentSize = CGSizeMake(size.width * 0.8, size.height * 0.8);
+    
+    [self.navigationController pushViewController:ViewController animated:YES];
+}
+
 @end

+ 10 - 10
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -3265,7 +3265,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
             if(availability>0)
                 Availability=[NSString stringWithFormat:@"%d",availability];
             else
-                Availability = @"In Production";
+                Availability = @"Out of Stock";
             
             [img_section setValue:Availability forKey:@"Availability"];
             [img_section setValue:[NSString stringWithFormat:@"%d",stockUcom] forKey:@"stockUom"];
@@ -3404,7 +3404,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
     NSString* keyword = [params valueForKey:@"keyword"];
     keyword=keyword.lowercaseString;
     
-    bool exactMatch = [[params valueForKey:@"exactMatch"] boolValue];
+    bool exactMatch = [[params valueForKey:@"exactMatch"] boolValue]; // search by factory code
     
     
     int limit = [[params valueForKey:@"limit"] intValue];
@@ -3432,7 +3432,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
         sqlQuery=[NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout,c._id,w.is_delete,m.more_color from product m left join wishlist w on m.product_id=w.product_id  left join (select _id,product_id from offline_cart where so_no='%@') c on c.product_id=m.product_id where lower(name) like'%@%%' and m.is_active = 1   order by m.name %@;",appDelegate.order_code, keyword,limit_str]; // select m.name,m.description,m.product_id,w._id,m.closeout from model m left join wishlist w on m.product_id=w.product_id where lower(name) like'%@%%' order by m.name limit %d offset %d ;
     else
         
-        sqlQuery=[NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout,c._id,w.is_delete,m.more_color from product m left join wishlist w on m.product_id=w.product_id  left join (select _id,product_id from offline_cart where so_no='%@') c on c.product_id=m.product_id where (lower(name) like'%%%@%%' or lower(description) like'%%%@%%') and m.is_active = 1 order by m.name %@ ;",appDelegate.order_code, keyword,keyword,limit_str];// select m.name,m.description,m.product_id,w._id,m.closeout from model m left join wishlist w on m.product_id=w.product_id where lower(name) like'%%%@%%' or
+        sqlQuery=[NSString stringWithFormat:@"select m.name,m.description,m.product_id,w._id,m.closeout,c._id,w.is_delete,m.more_color from product m left join wishlist w on m.product_id=w.product_id  left join (select _id,product_id from offline_cart where so_no='%@') c on c.product_id=m.product_id where (lower(name) like'%%%@%%' or lower(description) like'%%%@%%' or lower(made_in) like '%%%@%%' or lower(material) like '%%%@%%' or lower(packaging) like '%%%@%%') and m.is_active = 1 order by m.name %@ ;",appDelegate.order_code, keyword,keyword,keyword,keyword,keyword,limit_str];// select m.name,m.description,m.product_id,w._id,m.closeout from model m left join wishlist w on m.product_id=w.product_id where lower(name) like'%%%@%%' or
     
     DebugLog(@"offline_search sql:%@",sqlQuery);
     sqlite3_stmt * statement;
@@ -10571,27 +10571,27 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
             @"required" : required,
             @"cadedate" : @{
                 @"count" : @(6),
-                @"val_0" : @{
+                @"val_3" : @{
                     @"check" : [payType isEqualToString:@"Check"] ? @(1) : @(0),
                     @"value" : @"Check",
                     @"value_id" : @"Check"
                 },
-                @"val_1" : @{
+                @"val_2" : @{
                     @"check" : [payType isEqualToString:@"Cash"] ? @(1) : @(0),
                     @"value" : @"Cash",
                     @"value_id" : @"Cash"
                 },
-                @"val_2" : @{
+                @"val_1" : @{
                     @"check" : [payType isEqualToString:@"NET 30"] ? @(1) : @(0),
-                    @"value" : @"NET 30",
+                    @"value" : @"NET 60",
                     @"value_id" : @"NET 30"
                 },
-                @"val_3" : @{
+                @"val_4" : @{
                     @"check" : [payType isEqualToString:@"Wire Transfer"] ? @(1) : @(0),
                     @"value" : @"Wire Transfer",
                     @"value_id" : @"Wire Transfer"
                 },
-                @"val_4" : @{
+                @"val_0" : @{
                     @"check" : [payType isEqualToString:@"Credit Card"] ? @(1) : @(0),
                     @"sub_item" : @{
                         @"count" : @(3),
@@ -10745,7 +10745,7 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
                             @"single_select" : @"true"
                         }
                     },
-                    @"value" : @"Credit Card",
+                    @"value" : @"Visa/Master",
                     @"value_id" : @"Credit Card"
                 },
                 @"val_5" : @{

+ 112 - 0
RedAnt ERP Mobile/common/Functions/watchlist/WatchListViewController.m

@@ -22,6 +22,8 @@
 #import "SortButton.h"
 #import "UIColor+JK_HEX.h"
 #import "CartUtils.h"
+#import "PDFViewController.h"
+#import "JKMessageBoxController.h"
 
 #define ALERT_DEL 1025
 //#import "PDFViewController.h"
@@ -33,6 +35,7 @@
 @property (nonatomic,strong) UILabel *qtyLabel;
 
 @property (nonatomic,strong) NSOperationQueue *dataOperationQueue;
+@property (nonatomic,copy) NSString *print_url;
 
 @end
 
@@ -604,6 +607,7 @@
             int result=[[cart_json valueForKey:@"result"] intValue];
             self.content_data = [cart_json mutableCopy];
             [self.itemListTable reloadData];
+            self.print_url = [cart_json objectForKey:@"wishlist_print_url"];
             
             if(result==2||result==1||result==0)
             {
@@ -1273,4 +1277,112 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
 
 }
 
+#pragma mark - Action
+
+- (IBAction)printWishlistClick:(UIBarButtonItem *)sender {
+    
+    if (self.print_url.length == 0) {
+        [RAUtils message_alert:@"There is no resource to print" title:@"Warning" controller:self];
+    }
+    
+    PDFViewController *ViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PDFViewController"];
+    
+    ViewController.url = self.print_url;
+    ViewController.canSave = false;
+    ViewController.isLocalfile=NO;
+    NSString* subject;
+    
+    NSString* cur_time =[RAUtils current_date];
+    subject =@"Wishlist Print";
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    NSString* customer_email=    [appDelegate.customerInfo valueForKey:@"customer_email"];
+    
+    
+    NSMutableArray* send_to = [[NSMutableArray alloc]init];
+    if(customer_email.length>0)
+    {
+        send_to=[[customer_email componentsSeparatedByString:NSLocalizedString(@";", nil)] mutableCopy];
+        
+    }
+    ViewController.mail_to = send_to;
+    
+    ViewController.attachment_name = [NSString stringWithFormat:@"NPD_Wish_List %@.pdf",cur_time];
+    ViewController.mail_subject = subject;
+    
+    ViewController.hidenavi = false;
+    [self.navigationController pushViewController:ViewController animated:YES];
+
+    
+}
+
+- (IBAction)emailWishlistClick:(UIBarButtonItem *)sender {
+    
+    
+    JKMessageBoxController *emailAddrVC = [JKMessageBoxController messageBoxControllerWithTip:@"Please enter email address"];
+    emailAddrVC.textFiled.secureTextEntry = NO;
+    emailAddrVC.yesButtonTitle = @"send";
+    
+    __weak typeof(emailAddrVC) weakVC = emailAddrVC;
+    __weak typeof(self) weakself = self;
+    
+    emailAddrVC.textHandler = ^(NSString *text){
+        
+        // 验证邮箱格式是否正确
+        //        NSString *match = EMAIL_MATCHES;
+        //        NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",match];
+        //        BOOL isEmailAddr = [predicate evaluateWithObject:text];
+        BOOL isEmailAddr = YES;
+        if (isEmailAddr) {
+            
+            // 验证是邮件地址,发送邮件
+            [weakVC dismissViewControllerAnimated:YES completion:^{
+                
+                UIAlertView *waitting_alert = [RAUtils waiting_alert:@"Sending Email" title:@"Waiting"];
+                
+                dispatch_async(dispatch_get_global_queue(0, 0), ^{
+                    
+                    NSDictionary *result = [iSalesNetwork quoteWishlist2EmailAddr:text];
+                    DebugLog(@"email wishlist result: %@",result);
+                    dispatch_async(dispatch_get_main_queue(), ^{
+                        
+                        [waitting_alert dismissWithClickedButtonIndex:0 animated:YES];
+                        
+                        if ([[result objectForKey:@"result"] integerValue] != RESULT_TRUE) {
+                            
+                            UIAlertController *errorAlertVC = [UIAlertController alertControllerWithTitle:@"Warning" message:[NSString stringWithFormat:@"The email send to %@ failed",text] preferredStyle:UIAlertControllerStyleAlert];
+                            UIAlertAction *action = [UIAlertAction actionWithTitle:@"ok" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                                
+                            }];
+                            
+                            [errorAlertVC addAction:action];
+                            [weakself presentViewController:errorAlertVC animated:YES completion:nil];
+                            
+                        }else {
+                            
+                            [RAUtils message_alert:@"Send Email Success" title:@"Message" controller:weakself];
+                            
+                        }
+                        
+                    });
+                    
+                });
+                
+            }];
+            
+        } else {
+            
+            // 非邮件地址,警告
+            [weakVC warning:@"Please enter right email address"];
+            
+        }
+        
+    };
+    
+    [self presentViewController:emailAddrVC animated:YES completion:nil];
+    
+    
+}
+
+
+
 @end

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

@@ -69,5 +69,6 @@
 + (void)removeFileAtPath:(NSString *)path;
 + (NSString *)appCacheDirectory;
 +(NSString*)md5WithFile:(NSString*)path;
++ (BOOL)fileExistsAtPath:(NSString *)path;
 
 @end

+ 10 - 0
RedAnt ERP Mobile/common/RAUtils.m

@@ -959,6 +959,16 @@ done:
     }
     return result;
 }
+
++ (BOOL)fileExistsAtPath:(NSString *)path {
+    
+    NSFileManager *fm = [NSFileManager defaultManager];
+    
+    return [fm fileExistsAtPath:path];
+    
+    return NO;
+}
+
 @end
 
 

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

@@ -179,4 +179,6 @@ extern NSString *const ScreenCodeOfflineSync;
 
 + (NSDictionary *)notifyModel:(NSString *)modelID emailAddr:(NSString *)addr withScreen:(NSString *)screenName;
 
++ (NSDictionary *)quoteWishlist2EmailAddr:(NSString *)addr;
+
 @end

+ 46 - 0
RedAnt ERP Mobile/common/data_provider/iSalesNetwork.m

@@ -4317,4 +4317,50 @@ repeat:
     return @{@"result" : @(RESULT_FALSE)};
 }
 
+
++ (NSDictionary *)quoteWishlist2EmailAddr:(NSString *)addr {
+    
+    NSMutableDictionary* dic = [[NSMutableDictionary alloc] init];
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
+    if(appDelegate.user!=nil)
+        [dic setValue:appDelegate.user forKey:@"user"];
+    
+    if(appDelegate.password!=nil)
+        [dic setValue:appDelegate.password forKey:@"password"];
+    
+    [dic setValue:addr forKey:@"email"];
+    
+    [dic setObject:ScreenCodeWishList forKey:kScreenName];
+    
+    if (appDelegate.customerInfo) {
+        NSString *customer_cid = [appDelegate.customerInfo objectForKey:@"customer_cid"];
+        if (customer_cid) {
+            [dic setValue:customer_cid forKey:@"contactId"];
+        }
+    }
+    
+    NSData* json=nil;
+    if(appDelegate.offline_mode)
+    {
+        return [OLDataProvider offline_notimpl];
+    }
+    else
+    {
+        if(![self IsNetworkAvailable])
+            return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
+        
+        json = [iSalesNetwork get_json:URL_EMAIL_CART parameters:dic];
+    }
+    if(json!=nil)
+    {
+        NSError *error=nil;
+        NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+        
+        
+        return jsobj;
+    }
+    
+    return @{@"result" : @(RESULT_FALSE)};
+}
+
 @end

+ 28 - 5
RedAnt ERP Mobile/iSales-NPD/Base.lproj/Main.storyboard

@@ -566,6 +566,18 @@
                                             <action selector="onAddtoCart:" destination="dSV-Dg-id4" id="3mi-fA-zV0"/>
                                         </connections>
                                     </barButtonItem>
+                                    <barButtonItem width="42" style="plain" systemItem="fixedSpace" id="4gV-KQ-JJH"/>
+                                    <barButtonItem title="Print" id="ElH-Kz-wRI">
+                                        <connections>
+                                            <action selector="printWishlistClick:" destination="dSV-Dg-id4" id="NES-Ca-dNd"/>
+                                        </connections>
+                                    </barButtonItem>
+                                    <barButtonItem width="42" style="plain" systemItem="fixedSpace" id="QHn-B4-Kox"/>
+                                    <barButtonItem title="Email" id="d4C-NX-kua">
+                                        <connections>
+                                            <action selector="emailWishlistClick:" destination="dSV-Dg-id4" id="BHS-9B-vyX"/>
+                                        </connections>
+                                    </barButtonItem>
                                     <barButtonItem style="plain" systemItem="flexibleSpace" id="GCT-Zy-PVt"/>
                                 </items>
                                 <color key="tintColor" red="0.59999999999999998" green="0.40000000000000002" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -956,10 +968,10 @@
                                 <inset key="separatorInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
                                 <prototypes>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="DetailHeaderCell" rowHeight="550" id="PCZ-Ci-oQf" customClass="DetailHeaderCell">
-                                        <rect key="frame" x="0.0" y="56" width="768" height="550"/>
+                                        <rect key="frame" x="0.0" y="55.5" width="768" height="550"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="PCZ-Ci-oQf" id="DiR-eY-PiR">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="549"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="549.5"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="USD 123.45" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="fD8-Km-IT3">
@@ -1037,6 +1049,16 @@
                                                     <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                     <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                 </imageView>
+                                                <button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="IRl-nF-CWX">
+                                                    <rect key="frame" x="215" y="420" width="167" height="30"/>
+                                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                                    <state key="normal" title="Assembly instructions">
+                                                        <color key="titleColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                    </state>
+                                                    <connections>
+                                                        <action selector="introduceBtnClick:" destination="PCZ-Ci-oQf" eventType="touchUpInside" id="6N2-cG-mXO"/>
+                                                    </connections>
+                                                </button>
                                                 <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="selector_name" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="qoq-Cs-JnE">
                                                     <rect key="frame" x="448" y="152" width="135" height="19"/>
                                                     <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
@@ -1187,6 +1209,7 @@
                                             <outlet property="etaval_label" destination="Ydc-b8-vOC" id="zhh-qS-HNd"/>
                                             <outlet property="incoming_stock_label" destination="fNy-qU-zpJ" id="l0g-On-WxI"/>
                                             <outlet property="incomingcount_Label" destination="GP5-lh-dfh" id="K9p-dl-xxC"/>
+                                            <outlet property="introduceBtn" destination="IRl-nF-CWX" id="Na1-rA-mzO"/>
                                             <outlet property="model_label" destination="ec3-Qs-dVj" id="8WN-ol-ISC"/>
                                             <outlet property="pageControl" destination="dlZ-DL-v21" id="sVb-8O-74F"/>
                                             <outlet property="photoStack" destination="xCF-6W-Mpc" id="0en-Ck-CXV"/>
@@ -1208,7 +1231,7 @@
                                         <rect key="frame" x="0.0" y="605.5" width="768" height="600"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="zzF-db-bsq" id="rZ0-x8-h3B">
-                                            <rect key="frame" x="0.0" y="0.0" width="768" height="599"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="768" height="599.5"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Refreshing...
Please wait." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="bSP-hh-M2A">
@@ -1279,7 +1302,7 @@
                                         </tableViewCellContentView>
                                     </tableViewCell>
                                     <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="DetailInfoCell" rowHeight="44" id="hYM-aE-rjR" customClass="DetailKVCell">
-                                        <rect key="frame" x="0.0" y="1806" width="768" height="44"/>
+                                        <rect key="frame" x="0.0" y="1805.5" width="768" height="44"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="hYM-aE-rjR" id="o59-aa-UU2">
                                             <rect key="frame" x="0.0" y="0.0" width="768" height="43"/>
@@ -1356,7 +1379,7 @@
                                 </collectionViewFlowLayout>
                                 <cells>
                                     <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="CategoryCellNPD" id="cah-A8-bXi" customClass="CategoryCellNPD">
-                                        <rect key="frame" x="0.0" y="94.5" width="180" height="251"/>
+                                        <rect key="frame" x="0.0" y="95" width="180" height="251"/>
                                         <autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
                                         <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
                                             <rect key="frame" x="0.0" y="0.0" width="180" height="251"/>

+ 1 - 1
RedAnt ERP Mobile/iSales-NPD/placeOrderTemplate.json

@@ -526,7 +526,7 @@
               "single_select" : "true"
             }
           },
-          "value" : "Credit Card",
+          "value" : "Visa/Master",
           "value_id" : "Credit Card"
         },
         "val_5" : {