Преглед изворни кода

完成方法:offline_cancelorder : 和 offline_cartsetqty :

Pen Li пре 9 година
родитељ
комит
d7c9a5db23

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


+ 0 - 16
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -13,21 +13,5 @@
             stopOnStyle = "0">
             stopOnStyle = "0">
          </BreakpointContent>
          </BreakpointContent>
       </BreakpointProxy>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "common/Functions/offline/OLDataProvider.m"
-            timestampString = "493637550.230845"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "5213"
-            endingLineNumber = "5213"
-            landmarkName = "+offline_orderdetail:"
-            landmarkType = "5">
-         </BreakpointContent>
-      </BreakpointProxy>
    </Breakpoints>
    </Breakpoints>
 </Bucket>
 </Bucket>

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

@@ -1412,10 +1412,7 @@
     
     
     
     
 }
 }
-+(NSData*) offline_cancelorder :(NSMutableDictionary *) params
-{
-    return nil;
-}
+
 +(NSData*) offline_add2cart :(NSMutableDictionary *) params;
 +(NSData*) offline_add2cart :(NSMutableDictionary *) params;
 {
 {
     NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
     NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
@@ -5528,6 +5525,9 @@
     
     
     return [RAUtils dict2data:dic];
     return [RAUtils dict2data:dic];
 }
 }
+
+#pragma mark set price
+
 +(NSData*) offline_cartsetprice :(NSMutableDictionary *) params
 +(NSData*) offline_cartsetprice :(NSMutableDictionary *) params
 {
 {
     DebugLog(@"cart set price params: %@",params);
     DebugLog(@"cart set price params: %@",params);
@@ -5554,6 +5554,9 @@
     return [RAUtils dict2data:dic];
     return [RAUtils dict2data:dic];
     
     
 }
 }
+
+#pragma mark set line notes
+
 +(NSData*) offline_cartsetlnotes :(NSMutableDictionary *) params
 +(NSData*) offline_cartsetlnotes :(NSMutableDictionary *) params
 {
 {
     NSString *_id = [self valueInParams:params key:@"cartitem_id"];
     NSString *_id = [self valueInParams:params key:@"cartitem_id"];
@@ -5572,10 +5575,57 @@
     return [RAUtils dict2data:dic];
     return [RAUtils dict2data:dic];
 }
 }
 
 
+#pragma mark set qty
+
 +(NSData*) offline_cartsetqty :(NSMutableDictionary *) params
 +(NSData*) offline_cartsetqty :(NSMutableDictionary *) params
 {
 {
-    return nil;
+    NSString *_id = [self valueInParams:params key:@"cartitem_id"];
+    int item_count = [params[@"inputInt"] integerValue];
+    
+    NSString *sql = [NSString stringWithFormat:@"update offline_cart set item_count = %d where _id = %@;",item_count,_id];
+    
+    int ret = [iSalesDB execSql:sql];
+    
+    __block int item_id = 0;
+    
+    [iSalesDB jk_query:[NSString stringWithFormat:@"select item_id from offline_cart where _id = %@;",_id] completion:^(sqlite3_stmt *stmt, NSMutableDictionary *container, long *count) {
+        item_id = sqlite3_column_int(stmt, 0);
+    }];
+    
+    
+    
+    NSDictionary* bsubtotaljson=[self model_subtotal:item_id count:item_count db:[iSalesDB get_db] compute_part:true];
+
+    
+    NSMutableDictionary *dic = [NSMutableDictionary dictionary];
+    [dic setValue:[NSNumber numberWithInteger:ret] forKey:@"result"];
+    [dic setValue:@"Regular Mode" forKey:@"mode"];
+    [dic setValue:@"160409" forKey:@"min_ver"];
+    [dic setValue:bsubtotaljson[@"cuft"] forKey:@"cuft"];
+    [dic setValue:bsubtotaljson[@"weight"] forKey:@"weight"];
+    [dic setValue:bsubtotaljson[@"carton"] forKey:@"carton"];
+    
+    return [RAUtils dict2data:dic];
+
 }
 }
 
 
+#pragma mark cancel order
+
++(NSData*) offline_cancelorder :(NSMutableDictionary *) params
+{
+    NSString *orderCode = [self valueInParams:params key:@"orderCode"];
+    
+    NSString *sql = [NSString stringWithFormat:@"update offline_order set status = 2,erpOrderStatus = 15 where so_id = '%@';",orderCode];
+    
+    int ret = [iSalesDB execSql:sql];
+    
+    NSMutableDictionary *dic = [NSMutableDictionary dictionary];
+    [dic setValue:[NSNumber numberWithInteger:ret] forKey:@"result"];
+    [dic setValue:@"Regular Mode" forKey:@"mode"];
+    [dic setValue:@"160409" forKey:@"min_ver"];
+    
+    return [RAUtils dict2data:dic];
+    
+}
 
 
 @end
 @end