Browse Source

fix automatic calcul of Monnaie complementaire amount with percentage (suppression of 10 factor)

SiM 3 years ago
parent
commit
007bc1fce3
1 changed files with 2 additions and 2 deletions
  1. 2 2
      apps/admin/modules/kataoProduct/templates/editSuccess.php

+ 2 - 2
apps/admin/modules/kataoProduct/templates/editSuccess.php

@@ -207,11 +207,11 @@ function computeMaxSolAmount(){
 	if (!$F('sell_price')) {
 		computeUnitPriceWithTaxes();
 	}
-	$('katao_product_max_sol_amount').value = Math.floor(10 * parseFloat($F('sell_price')) * parseFloat($F('sol_percent')) / 100);
+	$('katao_product_max_sol_amount').value = Math.round(parseFloat($F('sell_price')) * parseFloat($F('sol_percent')) / 100);
 }
 
 function computeSolPercent(){
-	$('sol_percent').value = Math.round(100 * parseFloat($F('katao_product_max_sol_amount')) / parseFloat($F('sell_price')) / 10);
+	$('sol_percent').value = Math.round(100 * parseFloat($F('katao_product_max_sol_amount')) / parseFloat($F('sell_price')));
 }
 
 function computeMargin(){