|
@@ -639,31 +639,31 @@
|
|
|
|
|
|
|
|
if([[cart_json valueForKey:@"result"] intValue]==2)
|
|
if([[cart_json valueForKey:@"result"] intValue]==2)
|
|
|
{
|
|
{
|
|
|
- if(qty>=0)
|
|
|
|
|
- item_json[@"available_qty"]=[NSNumber numberWithInt:qty];
|
|
|
|
|
- else
|
|
|
|
|
- [item_json removeObjectForKey:@"available_qty"];
|
|
|
|
|
- if(qty_p>=0)
|
|
|
|
|
- item_json[@"available_percent"]=[NSNumber numberWithInt:qty_p];
|
|
|
|
|
- else
|
|
|
|
|
- [item_json removeObjectForKey:@"available_percent"];
|
|
|
|
|
- item_json[@"linenotes"]=notes;
|
|
|
|
|
- item_json[@"tear_sheet_discount"]=[NSString stringWithFormat:@"%.2f",discount];
|
|
|
|
|
- item_json[@"tear_sheet_price"]=[NSString stringWithFormat:@"%.2f",price];
|
|
|
|
|
- self.content_data[[NSString stringWithFormat:@"item_%d",single_idx]]=item_json;
|
|
|
|
|
- // item_json[@"available_qty"]=[NSNumber numberWithInt:qty];
|
|
|
|
|
- [self.itemListTable reloadData];
|
|
|
|
|
|
|
+// if(qty>=0)
|
|
|
|
|
+// item_json[@"available_qty"]=[NSNumber numberWithInt:qty];
|
|
|
|
|
+// else
|
|
|
|
|
+// [item_json removeObjectForKey:@"available_qty"];
|
|
|
|
|
+// if(qty_p>=0)
|
|
|
|
|
+// item_json[@"available_percent"]=[NSNumber numberWithInt:qty_p];
|
|
|
|
|
+// else
|
|
|
|
|
+// [item_json removeObjectForKey:@"available_percent"];
|
|
|
|
|
+// item_json[@"linenotes"]=notes;
|
|
|
|
|
+// item_json[@"tear_sheet_discount"]=[NSString stringWithFormat:@"%.2f",discount];
|
|
|
|
|
+// item_json[@"tear_sheet_price"]=[NSString stringWithFormat:@"%.2f",price];
|
|
|
|
|
+// self.content_data[[NSString stringWithFormat:@"item_%d",single_idx]]=item_json;
|
|
|
|
|
+// // item_json[@"available_qty"]=[NSNumber numberWithInt:qty];
|
|
|
|
|
+// [self.itemListTable reloadData];
|
|
|
|
|
|
|
|
|
|
|
|
|
- if (qty != -INT32_MAX) {
|
|
|
|
|
- if(qty>=0)
|
|
|
|
|
|
|
+ if (!(qty == -INT32_MAX && qty_p == -MAXFLOAT)) {
|
|
|
|
|
+ // qty
|
|
|
|
|
+ if (qty != -INT32_MAX)
|
|
|
item_json[@"available_qty"]=[NSNumber numberWithInt:qty];
|
|
item_json[@"available_qty"]=[NSNumber numberWithInt:qty];
|
|
|
else
|
|
else
|
|
|
[item_json removeObjectForKey:@"available_qty"];
|
|
[item_json removeObjectForKey:@"available_qty"];
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (qty_p != -MAXFLOAT) {
|
|
|
|
|
- if(qty_p>=0)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // qty_p
|
|
|
|
|
+ if (qty_p != -MAXFLOAT)
|
|
|
item_json[@"available_percent"]=[NSNumber numberWithInt:qty_p];
|
|
item_json[@"available_percent"]=[NSNumber numberWithInt:qty_p];
|
|
|
else
|
|
else
|
|
|
[item_json removeObjectForKey:@"available_percent"];
|
|
[item_json removeObjectForKey:@"available_percent"];
|
|
@@ -1319,7 +1319,7 @@
|
|
|
PortfolioEditQTYViewController * vc =[ parentvc.storyboard instantiateViewControllerWithIdentifier:@"PortfolioEditQTYViewController"];
|
|
PortfolioEditQTYViewController * vc =[ parentvc.storyboard instantiateViewControllerWithIdentifier:@"PortfolioEditQTYViewController"];
|
|
|
|
|
|
|
|
|
|
|
|
|
- NSMutableDictionary * item_json = [[self.content_data objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]] mutableCopy];
|
|
|
|
|
|
|
+ __block NSMutableDictionary * item_json = [[self.content_data objectForKey:[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]] mutableCopy];
|
|
|
|
|
|
|
|
vc.arr_fashion_ids = [[NSArray arrayWithObject:[NSString stringWithFormat:@"%d",[[item_json valueForKey:@"fashion_id"] intValue]]] mutableCopy];
|
|
vc.arr_fashion_ids = [[NSArray arrayWithObject:[NSString stringWithFormat:@"%d",[[item_json valueForKey:@"fashion_id"] intValue]]] mutableCopy];
|
|
|
|
|
|
|
@@ -1357,15 +1357,16 @@
|
|
|
if([[cart_json valueForKey:@"result"] intValue]==2)
|
|
if([[cart_json valueForKey:@"result"] intValue]==2)
|
|
|
{
|
|
{
|
|
|
self.editedRow = indexPath.row;
|
|
self.editedRow = indexPath.row;
|
|
|
- if (qty != -INT32_MAX) {
|
|
|
|
|
- if(qty>=0)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (!(qty == -INT32_MAX && qty_p == -MAXFLOAT)) {
|
|
|
|
|
+ // qty
|
|
|
|
|
+ if (qty != -INT32_MAX)
|
|
|
item_json[@"available_qty"]=[NSNumber numberWithInt:qty];
|
|
item_json[@"available_qty"]=[NSNumber numberWithInt:qty];
|
|
|
else
|
|
else
|
|
|
[item_json removeObjectForKey:@"available_qty"];
|
|
[item_json removeObjectForKey:@"available_qty"];
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (qty_p != -MAXFLOAT) {
|
|
|
|
|
- if(qty_p>=0)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // qty_p
|
|
|
|
|
+ if (qty_p != -MAXFLOAT)
|
|
|
item_json[@"available_percent"]=[NSNumber numberWithInt:qty_p];
|
|
item_json[@"available_percent"]=[NSNumber numberWithInt:qty_p];
|
|
|
else
|
|
else
|
|
|
[item_json removeObjectForKey:@"available_percent"];
|
|
[item_json removeObjectForKey:@"available_percent"];
|