Просмотр исходного кода

160816

Fix order list status not show
Add edit order func
Ray Zhang 9 лет назад
Родитель
Сommit
c650a9e3d8

+ 1 - 0
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.h

@@ -47,6 +47,7 @@
 +(NSData*) offline_createorder :(NSMutableDictionary *) params;
 +(NSData*) offline_orderlist :(NSMutableDictionary *) params;
 +(NSData*) offline_orderdetail :(NSMutableDictionary *) params;
++(NSData*) offline_editorder :(NSMutableDictionary *) params;
 
 +(NSDictionary*) offline_category_menu ;
 +(NSDictionary*) offline_home ;

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

@@ -1335,15 +1335,63 @@
             double total_price = sqlite3_column_double(statement, 7);
             
             
-            
+            NSString* nsstatus=@"";
+            switch (status) {
+                case 0:
+                {
+                    nsstatus=@"Temp Order";
+                    break;
+                }
+                case 1:
+                {
+                    nsstatus=@"Saved Order";
+                    break;
+                }
+                case 10:
+                {
+                    nsstatus=@"Quote Submitted";
+                    break;
+                }
+                case 11:
+                {
+                    nsstatus=@"Sales Order Submitted";
+                    break;
+                }
+                case 12:
+                {
+                    nsstatus=@"Processing";
+                    break;
+                }
+                case 13:
+                {
+                    nsstatus=@"Shipped";
+                    break;
+                }
+                case 14:
+                {
+                    nsstatus=@"Closed";
+                    break;
+                }
+                case 15:
+                {
+                    nsstatus=@"Cancelled";
+                    break;
+                }
+                    
+                    
+                default:
+                    break;
+            }
             
             item[@"sales_rep"]= nssales_rep;
             item[@"orderStatus"]= [NSString stringWithFormat:@"%d",status];
+            item[@"order_status"]= nsstatus;
             item[@"so#"]= nssoid;
-            item[@"price"]= [NSString stringWithFormat:@"$%.2f",total_price];;
+            item[@"price"]= [NSString stringWithFormat:@"$%.2f",total_price];
             item[@"create_by"]= nscreate_by;
             item[@"customer_name"]= nscompany_name;
-            item[@"order_id"]= [NSString stringWithFormat:@"%d",order_id];;
+            item[@"order_id"]= [NSString stringWithFormat:@"%d",order_id];
+            item[@"order_code"]= nssoid;//[NSString stringWithFormat:@"%d",order_id];
             item[@"purchase_time"]= nscreate_time;
             
             
@@ -1589,6 +1637,29 @@
 
         return [RAUtils dict2data:ret];
 }
++(NSData*) offline_editorder :(NSMutableDictionary *) params
+{
+    NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
+    
+    
+
+    NSString* orderCode = [params valueForKey:@"orderCode"];
+    
+
+    
+    sqlite3 *db = [iSalesDB get_db];
+    
+    int cart_count=[iSalesDB get_recordcount:db table:@"offline_cart" where:[NSString stringWithFormat:@"so_no='%@'",orderCode]];
+    
+    int wish_count=[iSalesDB get_recordcount:db table:@"offline_wishlist" where:@"1=1"];
+    ret[@"wish_count"]=[NSNumber numberWithInt:wish_count ];
+    ret[@"cart_count"]=[NSNumber numberWithInt:cart_count ];
+    ret[@"result"]=[NSNumber numberWithInt:RESULT_TRUE ];
+    
+    [iSalesDB close_db:db];
+    
+    return [RAUtils dict2data:ret];
+}
 
 +(NSData*) offline_login :(NSMutableDictionary *) params
 {