Преглед изворни кода

161213
Modify
add tax logic for shop order place order

Ray Zhang пре 9 година
родитељ
комит
582bfc30df
1 измењених фајлова са 3 додато и 3 уклоњено
  1. 3 3
      RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m

+ 3 - 3
RedAnt ERP Mobile/common/Functions/order/CreateOrderViewController.m

@@ -1182,14 +1182,14 @@
     
     NSString* name = [item_json valueForKey:@"name"];
     
-    if([name isEqualToString:@"shipping"]|| [name isEqualToString:@"handling_fee_value"]||[name isEqualToString:@"lift_gate_value"])
+    if([name isEqualToString:@"shipping"]|| [name isEqualToString:@"handling_fee_value"]||[name isEqualToString:@"lift_gate_value"]||[name isEqualToString:@"tax_percentage"])
     {
         float shipping = [self getprice:@"shipping" section:indexPath.section];
         float paymentsAndCredits = [self getprice:@"paymentsAndCredits" section:indexPath.section];
         float handling_fee_value = [self getprice:@"handling_fee_value" section:indexPath.section];
         float lift_gate =[self getprice:@"lift_gate_value" section:indexPath.section];
-        
-        float totalprice=shipping+paymentsAndCredits+handling_fee_value+lift_gate;
+        float tax = [self getprice:@"tax_percentage" section:indexPath.section]/100.0*paymentsAndCredits;
+        float totalprice=shipping+paymentsAndCredits+handling_fee_value+lift_gate+tax;
         
         section_json = [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%ld",(long)indexPath.section ]] mutableCopy];
         int count=0;