|
|
@@ -1754,7 +1754,7 @@
|
|
|
itemjson[@"cuft"]=[NSNumber numberWithDouble:cuft];
|
|
|
itemjson[@"weight"]=[NSNumber numberWithDouble:weight];
|
|
|
itemjson[@"carton"]=[NSNumber numberWithInt:carton];
|
|
|
- itemjson[@"cart_item_id"]=[NSNumber numberWithInt:_id];
|
|
|
+ itemjson[@"cart_item_id"]=[NSNumber numberWithInt:_id].stringValue;
|
|
|
itemjson[@"check"]=@"true";
|
|
|
itemjson[@"product_id"]=[NSNumber numberWithInt:product_id].stringValue;
|
|
|
itemjson[@"count"]=[NSNumber numberWithInt:item_count];
|
|
|
@@ -5503,18 +5503,70 @@
|
|
|
|
|
|
return [RAUtils dict2data:dic];
|
|
|
}
|
|
|
+
|
|
|
+#pragma mark cart delete
|
|
|
+
|
|
|
+(NSData*) offline_cartremove :(NSMutableDictionary *) params
|
|
|
{
|
|
|
+// cartItemId = 548;
|
|
|
+// orderCode = MOB1608110001;
|
|
|
+
|
|
|
+ NSString *_id = [self valueInParams:params key:@"cartItemId"];
|
|
|
+ NSString *orderCode = [self valueInParams:params key:@"MOB1608110001"];
|
|
|
|
|
|
- return nil;
|
|
|
+ NSString *sql = [NSString stringWithFormat:@"delete from offline_cart where _id = %@ and so_no = '%@';",_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];
|
|
|
}
|
|
|
+(NSData*) offline_cartsetprice :(NSMutableDictionary *) params
|
|
|
{
|
|
|
- return nil;
|
|
|
+ DebugLog(@"cart set price params: %@",params);
|
|
|
+// "cartitem_id" = 1;
|
|
|
+// discount = "0.000000";
|
|
|
+// "item_note" = "";
|
|
|
+// price = "269.000000";
|
|
|
+
|
|
|
+ NSString *_id = [self valueInParams:params key:@"cartitem_id"];
|
|
|
+ NSString *notes = [self valueInParams:params key:@"item_note"];
|
|
|
+ NSString *discount = [self valueInParams:params key:@"discount"];
|
|
|
+ NSString *price = [self valueInParams:params key:@"discount"];
|
|
|
+ price = [self translateSingleQuote:[AESCrypt fastencrypt:price]];
|
|
|
+
|
|
|
+ NSString *sql = [NSString stringWithFormat:@"update offline_cart set str_price = '%@',discount = %f where _id = %@",price,discount.doubleValue,_id];
|
|
|
+
|
|
|
+ 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];
|
|
|
+
|
|
|
}
|
|
|
+(NSData*) offline_cartsetlnotes :(NSMutableDictionary *) params
|
|
|
{
|
|
|
- return nil;
|
|
|
+ NSString *_id = [self valueInParams:params key:@"cartitem_id"];
|
|
|
+ NSString *notes = [self valueInParams:params key:@"notes"];
|
|
|
+ notes = [self translateSingleQuote:notes];
|
|
|
+
|
|
|
+ NSString *sql = [NSString stringWithFormat:@"update offline_cart set line_note = '%@' where _id = %@",notes,_id];
|
|
|
+
|
|
|
+ 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];
|
|
|
}
|
|
|
|
|
|
|