|
|
@@ -653,6 +653,39 @@
|
|
|
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)
|
|
|
+ item_json[@"available_qty"]=[NSNumber numberWithInt:qty];
|
|
|
+ else
|
|
|
+ [item_json removeObjectForKey:@"available_qty"];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (qty_p != -MAXFLOAT) {
|
|
|
+ if(qty_p>=0)
|
|
|
+ item_json[@"available_percent"]=[NSNumber numberWithInt:qty_p];
|
|
|
+ else
|
|
|
+ [item_json removeObjectForKey:@"available_percent"];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (notes) {
|
|
|
+ item_json[@"linenotes"]=notes;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (discount != -MAXFLOAT) {
|
|
|
+ item_json[@"tear_sheet_discount"]=[NSString stringWithFormat:@"%.2f",discount];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (price != -MAXFLOAT) {
|
|
|
+ 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];
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -731,6 +764,7 @@
|
|
|
// loginvc.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
|
|
|
vc.onSetValue = ^(int qty,double qty_p,double price, double discount , NSString* notes){
|
|
|
|
|
|
+ NSLog(@"price:%f,discount:%f",price,discount);
|
|
|
|
|
|
UIAlertView * waitalert = [RAUtils waiting_alert:@"Please wait" title:@"Updating Quantity"];
|
|
|
|
|
|
@@ -1324,17 +1358,32 @@
|
|
|
if([[cart_json valueForKey:@"result"] intValue]==2)
|
|
|
{
|
|
|
self.editedRow = indexPath.row;
|
|
|
- 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];
|
|
|
+ if (qty != -INT32_MAX) {
|
|
|
+ if(qty>=0)
|
|
|
+ item_json[@"available_qty"]=[NSNumber numberWithInt:qty];
|
|
|
+ else
|
|
|
+ [item_json removeObjectForKey:@"available_qty"];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (qty_p != -MAXFLOAT) {
|
|
|
+ if(qty_p>=0)
|
|
|
+ item_json[@"available_percent"]=[NSNumber numberWithInt:qty_p];
|
|
|
+ else
|
|
|
+ [item_json removeObjectForKey:@"available_percent"];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (notes) {
|
|
|
+ item_json[@"linenotes"]=notes;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (discount != -MAXFLOAT) {
|
|
|
+ item_json[@"tear_sheet_discount"]=[NSString stringWithFormat:@"%.2f",discount];
|
|
|
+ }
|
|
|
+
|
|
|
+ if (price != -MAXFLOAT) {
|
|
|
+ item_json[@"tear_sheet_price"]=[NSString stringWithFormat:@"%.2f",price];
|
|
|
+ }
|
|
|
+
|
|
|
self.content_data[[NSString stringWithFormat:@"item_%ld",(long)indexPath.row]]=item_json;
|
|
|
// item_json[@"available_qty"]=[NSNumber numberWithInt:qty];
|
|
|
self.indexPath=indexPath;
|