|
|
@@ -10720,7 +10720,7 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
- NSString *sqlQuery =[NSString stringWithFormat:@"select _id,product_id,name,description,item_id,fashion_id,available_qty,percentage,percent,ifnull(sheet_price,'null'),sheet_discount,img,line_note,is_delete,createtime,modify_time from offline_portfolio where %@",where];
|
|
|
+ NSString *sqlQuery =[NSString stringWithFormat:@"select _id,product_id,name,description,item_id,fashion_id,ifnull(available_qty,'null'),ifnull(percentage,'null'),ifnull(percent,'null'),ifnull(sheet_price,'null'),sheet_discount,img,line_note,is_delete,createtime,modify_time from offline_portfolio where %@",where];
|
|
|
|
|
|
|
|
|
[ret setValue:[NSNumber numberWithInt:AP_USER_NOT_AUTH ] forKey:@"result"];
|
|
|
@@ -10755,15 +10755,34 @@
|
|
|
price = [[self get_model_default_price:appDelegate.contact_id product_id:nil item_id:@(item_id) db:db] doubleValue];
|
|
|
}
|
|
|
|
|
|
+ NSString *qty_null = [self textAtColumn:6 statement:stmt];
|
|
|
+ NSString *is_percent_null = [self textAtColumn:7 statement:stmt];
|
|
|
+ NSString *percent_null = [self textAtColumn:8 statement:stmt];
|
|
|
+
|
|
|
[item setValue:[NSNumber numberWithInteger:_id] forKey:@"_id"];
|
|
|
[item setValue:[NSNumber numberWithInteger:product_id] forKey:@"product_id"];
|
|
|
[item setValue:[NSNumber numberWithInteger:item_id] forKey:@"item_id"];
|
|
|
[item setValue:[NSNumber numberWithInteger:fashion_id] forKey:@"fashion_id"];
|
|
|
- [item setValue:[NSNumber numberWithInteger:is_percent] forKey:@"percentage"];
|
|
|
[item setValue:[NSNumber numberWithInteger:is_delete] forKey:@"is_delete"];
|
|
|
- [item setValue:[NSNumber numberWithInteger:qty] forKey:@"available_qty"];
|
|
|
|
|
|
- [item setValue:[NSNumber numberWithDouble:percent] forKey:@"percent"];
|
|
|
+ if ([qty_null isEqualToString:@"null"]) {
|
|
|
+// [item setValue:@"null" forKey:@"available_qty"];
|
|
|
+ } else {
|
|
|
+ [item setValue:[NSNumber numberWithInteger:qty] forKey:@"available_qty"];
|
|
|
+ }
|
|
|
+
|
|
|
+ if ([is_percent_null isEqualToString:@"null"]) {
|
|
|
+// [item setValue:@"null" forKey:@"percentage"];
|
|
|
+ } else {
|
|
|
+ [item setValue:[NSNumber numberWithInteger:is_percent] forKey:@"percentage"];
|
|
|
+ }
|
|
|
+
|
|
|
+ if ([percent_null isEqualToString:@"null"]) {
|
|
|
+// [item setValue:@"null" forKey:@"percent"];
|
|
|
+ } else {
|
|
|
+ [item setValue:[NSNumber numberWithDouble:percent] forKey:@"percent"];
|
|
|
+ }
|
|
|
+
|
|
|
[item setValue:[NSNumber numberWithDouble:price] forKey:@"sheet_price"];
|
|
|
[item setValue:[NSNumber numberWithDouble:discount] forKey:@"sheet_discount"];
|
|
|
|