Explorar el Código

161213
Modify
add tax logic for shop order place order

Ray Zhang hace 9 años
padre
commit
582bfc30df

+ 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;