فهرست منبع

20170119

fix npd mobile offline sales order missing combine item price in payment count.
Ray Zhang 9 سال پیش
والد
کامیت
463aeaaa11
1فایلهای تغییر یافته به همراه6 افزوده شده و 4 حذف شده
  1. 6 4
      RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

+ 6 - 4
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -1003,7 +1003,9 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
                         combine_item[@"count"]=[NSString stringWithFormat:@"%d",[combine_item[@"modulus"] intValue]*item_count];
                        // combine_item[@"count"]=[NSNumber numberWithInt:[combine_item[@"modulus"] intValue]*item_count];
                         
-                        combine_item[@"amount"]=[NSString stringWithFormat:@"%.2f",[combine_item[@"modulus"] intValue]*item_count* [combine_item[@"unit_price"] floatValue]];
+                        double combine_amount=[combine_item[@"modulus"] intValue]*item_count* [combine_item[@"unit_price"] floatValue];
+                        credits+=combine_amount;
+                        combine_item[@"amount"]=[NSString stringWithFormat:@"%.2f",combine_amount];
                         combine_item[@"ln#"]=[NSString stringWithFormat:@"%d.%d",count+1,c+2];
                         row1[[NSString stringWithFormat:@"item_%d", row1count] ]=combine_item;
                         row1count++;
@@ -1029,10 +1031,10 @@ NSString* gprice = [self get_portfolio_price :appDelegate.contact_id item_id:ite
 //            itemjson[@"ln#"]=[NSString stringWithFormat:@"%d.%d",count+1,1];
 //            fee_row0[@"item_0"]=@{@"name":@"Payments/Credits:" ,@"value": [NSString stringWithFormat:@"%.2f",credits]};
 
-            if(credits>0)
+//            if(credits>0)
                 fee_row0[@"item_0"]=@{@"name":@"Payments/Credits:" ,@"value": [NSString stringWithFormat:@"%.2f",credits]};
-            else
-                fee_row0[@"item_0"]=@{@"name":@"Payments/Credits:" ,@"value": @""};
+//            else
+//                fee_row0[@"item_0"]=@{@"name":@"Payments/Credits:" ,@"value": @""};
             
             if(shipping>0)
                 fee_row0[@"item_1"]=@{@"name":@"Shipping:" ,@"value": [NSString stringWithFormat:@"%.2f",shipping]};