|
|
@@ -1412,10 +1412,7 @@
|
|
|
|
|
|
|
|
|
}
|
|
|
-+(NSData*) offline_cancelorder :(NSMutableDictionary *) params
|
|
|
-{
|
|
|
- return nil;
|
|
|
-}
|
|
|
+
|
|
|
+(NSData*) offline_add2cart :(NSMutableDictionary *) params;
|
|
|
{
|
|
|
NSMutableDictionary* ret = [[NSMutableDictionary alloc] init];
|
|
|
@@ -5528,6 +5525,9 @@
|
|
|
|
|
|
return [RAUtils dict2data:dic];
|
|
|
}
|
|
|
+
|
|
|
+#pragma mark set price
|
|
|
+
|
|
|
+(NSData*) offline_cartsetprice :(NSMutableDictionary *) params
|
|
|
{
|
|
|
DebugLog(@"cart set price params: %@",params);
|
|
|
@@ -5554,6 +5554,9 @@
|
|
|
return [RAUtils dict2data:dic];
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+#pragma mark set line notes
|
|
|
+
|
|
|
+(NSData*) offline_cartsetlnotes :(NSMutableDictionary *) params
|
|
|
{
|
|
|
NSString *_id = [self valueInParams:params key:@"cartitem_id"];
|
|
|
@@ -5572,10 +5575,57 @@
|
|
|
return [RAUtils dict2data:dic];
|
|
|
}
|
|
|
|
|
|
+#pragma mark set qty
|
|
|
+
|
|
|
+(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
|