Browse Source

[Administration] Distribution > commandes : total TTC avec centimes en trop #1039

feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
58c0924b3e
3 changed files with 5 additions and 5 deletions
  1. +2
    -2
      backend/controllers/DistributionController.php
  2. +2
    -2
      backend/web/js/backend.js
  3. +1
    -1
      common/web/js/utils.js

+ 2
- 2
backend/controllers/DistributionController.php View File

$productOrderArray[$productOrder->id_product] = [ $productOrderArray[$productOrder->id_product] = [
'quantity' => $productOrder->quantity * Product::$unitsArray[$productOrder->unit]['coefficient'], 'quantity' => $productOrder->quantity * Product::$unitsArray[$productOrder->unit]['coefficient'],
'unit' => $productOrder->unit, 'unit' => $productOrder->unit,
'price' => number_format($productOrder->price, 3),
'invoice_price' => number_format($productOrder->invoice_price, 3),
'price' => number_format($productOrder->price, 5),
'invoice_price' => number_format($productOrder->invoice_price, 5),
'price_with_tax' => Price::getPriceWithTax($productOrder->price, $productOrder->taxRate->value), 'price_with_tax' => Price::getPriceWithTax($productOrder->price, $productOrder->taxRate->value),
]; ];
} }

+ 2
- 2
backend/web/js/backend.js View File

if (price) { if (price) {
$('#product-price-with-tax').val(getPriceWithTax(price, taxRateSelected)); $('#product-price-with-tax').val(getPriceWithTax(price, taxRateSelected));
// formattage // formattage
$('#product-price').val(parseFloat(price).toFixed(3));
$('#product-price').val(parseFloat(price).toFixed(5));
} }
} }
} }
if (price) { if (price) {
$('#productprice-price-with-tax').val(getPriceWithTax(price, taxRateValue)); $('#productprice-price-with-tax').val(getPriceWithTax(price, taxRateValue));
// formattage // formattage
$('#productprice-price').val(parseFloat(price).toFixed(3));
$('#productprice-price').val(parseFloat(price).toFixed(5));
} }
} }



+ 1
- 1
common/web/js/utils.js View File

* @returns {string} * @returns {string}
*/ */
function getPrice(priceWithTax, taxRate) { function getPrice(priceWithTax, taxRate) {
return numberDecimals(parseFloat(parseFloat(priceWithTax) / (taxRate + 1)), 3);
return numberDecimals(parseFloat(parseFloat(priceWithTax) / (taxRate + 1)), 5);
} }


/** /**

Loading…
Cancel
Save