Ray Zhang 10 жил өмнө
parent
commit
7d2a66fd2b

+ 1 - 0
RedAnt ERP Mobile/common/AES/AESCrypt.h

@@ -29,6 +29,7 @@
 
 #import <Foundation/Foundation.h>
 
+
 @interface AESCrypt : NSObject
 
 + (NSString *)encrypt:(NSString *)message password:(NSString *)password;

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

@@ -469,7 +469,7 @@
                 
                 
                 
-                UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Add to pending order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+                UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Check for saved order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
                     
                     
                     //  vc.disable_refresh = true;
@@ -500,7 +500,7 @@
                     
                 }];
                 
-                UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Add to new order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+                UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Create new order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
                     
                     
                     {
@@ -611,7 +611,7 @@
                                 
                                 
                                 
-                                UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Add to pending order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+                                UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Check for saved order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
                                     
                                     
                                     //  vc.disable_refresh = true;
@@ -642,7 +642,7 @@
                                     
                                 }];
                                 
-                                UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Add to new order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+                                UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Create new order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
                                     
                                     
                                     {
@@ -729,7 +729,7 @@
                                     
                                     
                                     
-                                    UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Add to pending order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+                                    UIAlertAction *actionOne = [UIAlertAction actionWithTitle:@"Check for saved order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
                                         
                                         
                                         //  vc.disable_refresh = true;
@@ -797,7 +797,7 @@
                                     
                                    
                                     
-                                    UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Add to new order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
+                                    UIAlertAction *alertthree = [UIAlertAction actionWithTitle:@"Create new order" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
                                         
                                         
                                         {
@@ -901,14 +901,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];

+ 3 - 3
RedAnt ERP Mobile/common/data_provider/iSalesNetwork.h

@@ -33,7 +33,7 @@
 +(NSDictionary*)commoneditor_partialrefresh: (NSMutableDictionary*)params url:(NSString*)url;
 
 //+(NSDictionary*)Search: (NSString*) category customid:(int) customid price_template:(int) price_template sort:(int) sort_by filter:(NSString*) filter keyword:(NSString*) keyword;
-+(NSDictionary*)Category: (NSString*) category customid:(int) customid price_template:(int) price_template sort:(int) sort_by filter:(NSString*) filter keyword:(NSString*) keyword offset:(long) offset limit:(long) limit alert:(NSString*)alert qty:(NSString*)qty available:(NSString*)available price:(NSString*)price;
++(NSDictionary*)Category: (NSString*) category customid:(int) customid price_template:(int) price_template sort:(int) sort_by filter:(NSString*) filter keyword:(NSString*) keyword offset:(long) offset limit:(long) limit alert:(NSString*)alert qty:(NSString*)qty available:(NSString*)available price:(NSString*)price bestseller:(NSString*)bestseller modelname:(NSString*) modelname modeldescrip:(NSString*)modeldescrip ;
 
 +(bool) IsNetworkAvailable;
 +(int)parse_authinfo : (NSData *) json user:(NSString*) user password:(NSString*) password;
@@ -59,7 +59,7 @@
 +(NSDictionary*) add_toWatchList:(NSString* ) item_id;
 +(NSDictionary*)request_Cart;
 +(NSDictionary*)request_WatchList;
-+(NSDictionary*) portfolio_setPrice:(NSString*) watchlist_id price:(float) price discount:(float) discount QTY:(int)qty notes:(NSString*)notes;
++(NSDictionary*) portfolio_setPrice:(NSString*) watchlist_id price:(float) price discount:(float) discount QTY:(int)qty qty_p:(float) qty_p notes:(NSString*)notes;
 //+(NSDictionary*) portfolio_setQTY:(NSString*) watchlist_id QTY:(int)qty;
 
 +(NSDictionary*) cart_remove:(NSString* ) item_ids;
@@ -94,7 +94,7 @@
 
 
 +(NSDictionary*)Search:(long ) offset limit :(long)limit keywords :(NSString*) keywords matchfull:(bool)matchfull;
-+(NSDictionary*)ItemSearch:(long ) offset limit :(long)limit covertype:(NSString* ) covertype ctgid:(NSString*)ctgid modelname:(NSString*) modelname modeldescrip:(NSString*)modeldescrip alert:(NSString*)alert available:(NSString*)available;
++(NSDictionary*)ItemSearch:(long ) offset limit :(long)limit covertype:(NSString* ) covertype ctgid:(NSString*)ctgid modelname:(NSString*) modelname modeldescrip:(NSString*)modeldescrip alert:(NSString*)alert qty:(NSString*)qty available:(NSString*)available price:(NSString*)price bestseller:(NSString*)bestseller;
 
 +(NSDictionary*)request_Editor:(NSString*) request_url params:(NSMutableDictionary*)params;
 

+ 23 - 9
RedAnt ERP Mobile/common/data_provider/iSalesNetwork.m

@@ -792,7 +792,7 @@ repeat:{
         [params setValue:appDelegate.password forKey:@"password"];
     
     [params setValue:order_id forKey:@"orderId"];
-    [params setValue:order_code forKey:@"order_code"];
+    [params setValue:order_code forKey:@"orderCode"];
     //    [params setValue:sourceid forKey:@"sourceid"];
     //    [params setValue:editor forKey:@"editor"];
     NSData* json=[self get_json:URL_CANCEL_ORDER parameters:params];
@@ -1666,7 +1666,7 @@ repeat:{
 //    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
 //    return jsobj;
 //}
-+(NSDictionary*) portfolio_setPrice:(NSString*) watchlist_id price:(float) price discount:(float) discount QTY:(int)qty notes:(NSString*)notes
++(NSDictionary*) portfolio_setPrice:(NSString*) watchlist_id price:(float) price discount:(float) discount QTY:(int)qty qty_p:(float) qty_p notes:(NSString*)notes
 {
     if(![self IsNetworkAvailable])
         return [RAUtils error_json:RESULT_NET_NOTAVAILABLE err_msg:nil];
@@ -1683,10 +1683,13 @@ repeat:{
     
     if(notes.length>0)
         [params setValue:notes forKey:@"notes"];
-    [params setValue:[NSString stringWithFormat:@"%f",price] forKey:@"price"];
+    if(price>=0)
+        [params setValue:[NSString stringWithFormat:@"%f",price] forKey:@"price"];
     
     [params setValue:[NSString stringWithFormat:@"%f",discount] forKey:@"discount"];
-    
+    if(qty_p>=0)
+        [params setValue:[NSString stringWithFormat:@"%f",qty_p] forKey:@"available_percent"];
+    if(qty>=0)
     [params setValue:[NSString stringWithFormat:@"%d",qty] forKey:@"available_qty"];
     
     NSData* json=[self get_json:URL_PORTFOLIO_SET_PRICE parameters:params];
@@ -1859,7 +1862,7 @@ repeat:{
 //    //        [params setValue:appDelegate.contact_id forKey:@"contactId"];
 //    if(appDelegate.password!=nil)
 //        [params setValue:appDelegate.password forKey:@"password"];
-    [params setValue:vid forKey:@"vid"];
+    [params setValue:vid forKey:@"downSerial"];
     NSData* json=[self get_json:URL_DOWNLOAD_OFFLINE parameters:params];
     if(json==nil)
         return nil;
@@ -2082,7 +2085,7 @@ repeat:{
 //    return jsobj;
 //    
 //}
-+(NSDictionary*)Category: (NSString*) category customid:(int) customid price_template:(int) price_template sort:(int) sort_by filter:(NSString*) filter keyword:(NSString*) keyword  offset:(long) offset limit:(long) limit alert:(NSString*)alert qty:(NSString*)qty available:(NSString*)available price:(NSString*)price
++(NSDictionary*)Category: (NSString*) category customid:(int) customid price_template:(int) price_template sort:(int) sort_by filter:(NSString*) filter keyword:(NSString*) keyword  offset:(long) offset limit:(long) limit alert:(NSString*)alert qty:(NSString*)qty available:(NSString*)available price:(NSString*)price bestseller:(NSString*)bestseller modelname:(NSString*) modelname modeldescrip:(NSString*)modeldescrip
 {
     
 
@@ -2106,6 +2109,9 @@ repeat:{
     [params setValue:qty forKey:@"sold_by_qty"];
     [params setValue:available forKey:@"available"];
     [params setValue:price forKey:@"price"];
+    [params setValue:bestseller forKey:@"bestseller"];
+    [params setValue:modelname forKey:@"modelName"];
+    [params setValue:modeldescrip forKey:@"modelDescription"];
     
     [params setValue:[NSString stringWithFormat:@"%d",price_template]  forKey:@"price_template"];
     [params setValue:[NSString stringWithFormat:@"%d",customid]  forKey:@"custom_id"];
@@ -2158,9 +2164,9 @@ repeat:{
     [params setValue:[NSString stringWithFormat:@"%ld",limit]  forKey:@"limit"];
     [params setValue:[NSString stringWithFormat:@"%ld",offset]  forKey:@"offset"];
     if(matchfull)
-        [params setValue:@"true"  forKey:@"full_world"];
+        [params setValue:@"true"  forKey:@"exactMatch"];
     else
-        [params setValue:@"false"  forKey:@"full_world"];
+        [params setValue:@"false"  forKey:@"exactMatch"];
     NSData* json=[self get_json:URL_SEARCH parameters:params];
     if(json==nil)
         return nil;
@@ -2169,7 +2175,7 @@ repeat:{
     return jsobj;
 }
 
-+(NSDictionary*)ItemSearch:(long ) offset limit :(long)limit covertype:(NSString* ) covertype ctgid:(NSString*)ctgid modelname:(NSString*) modelname modeldescrip:(NSString*)modeldescrip alert:(NSString*)alert available:(NSString*)available
++(NSDictionary*)ItemSearch:(long ) offset limit :(long)limit covertype:(NSString* ) covertype ctgid:(NSString*)ctgid modelname:(NSString*) modelname modeldescrip:(NSString*)modeldescrip alert:(NSString*)alert qty:(NSString*)qty available:(NSString*)available price:(NSString*)price bestseller:(NSString*)bestseller
 {
     
     // for debug
@@ -2187,6 +2193,11 @@ repeat:{
         [params setValue:appDelegate.password forKey:@"password"];
     if(appDelegate.order_code!=nil)
         [params setValue:appDelegate.order_code forKey:@"orderCode"];
+    
+    
+    
+    
+    
     //    [params setValue:[NSString stringWithFormat:@"%d",price_template]  forKey:@"price_template"];
     //    [params setValue:[NSString stringWithFormat:@"%d",customid]  forKey:@"custom_id"];
     //    [params setValue:[NSString stringWithFormat:@"%@",category]  forKey:@"category"];
@@ -2197,7 +2208,10 @@ repeat:{
     [params setValue:modelname forKey:@"modelName"];
     [params setValue:modeldescrip forKey:@"modelDescription"];
     [params setValue:alert forKey:@"alert"];
+    [params setValue:qty forKey:@"sold_by_qty"];
     [params setValue:available forKey:@"available"];
+    [params setValue:price forKey:@"price"];
+    [params setValue:bestseller forKey:@"bestseller"];
     
     [params setValue:[NSString stringWithFormat:@"%ld",limit]  forKey:@"limit"];
     [params setValue:[NSString stringWithFormat:@"%ld",offset]  forKey:@"offset"];