Commit 6c7a074e authored by Progi1984's avatar Progi1984
Browse files

Merge remote-tracking branch 'upstream/1.7.7.x' into merge177x1780build

parents 5e53f4f1 14cb6a4c
......@@ -1798,17 +1798,17 @@ window.priceCalculation = (function () {
});
/** combinations : update TTC price field on HT change */
$(document).on('keyup', '.combination-form .attribute_priceTE', function () {
$(document).on('blur', '.combination-form .attribute_priceTE', function() {
priceCalculation.impactTaxInclude($(this));
priceCalculation.impactFinalPrice($(this));
});
/** combinations : update HT price field on TTC change */
$(document).on('keyup', '.combination-form .attribute_priceTI', function () {
$(document).on('blur', '.combination-form .attribute_priceTI', function() {
priceCalculation.impactTaxExclude($(this));
priceCalculation.impactFinalPrice($(this));
});
/** combinations : update price fields on ecotax change */
$(document).on('keyup', '.combination-form .attribute_ecotaxTi', function () {
$(document).on('blur', '.combination-form .attribute_ecotaxTi', function() {
priceCalculation.impactPricesForEcotax($(this));
priceCalculation.impactFinalPrice($(this));
});
......@@ -1981,9 +1981,8 @@ window.priceCalculation = (function () {
if (!isNaN(priceTE) && priceTE !== 0) {
const rates = this.getRates();
const computationMethod = taxElem.find('option:selected').attr('data-computation-method');
priceTI = ps_round(addTaxes(priceTE, rates, computationMethod), displayPricePrecision);
priceTI = truncateDecimals(priceTI, displayPricePrecision);
const computation_method = taxElem.find('option:selected').attr('data-computation-method');
priceTI = ps_round(addTaxes(priceTE, rates, computation_method), displayPricePrecision);
}
return priceTI;
......@@ -1999,9 +1998,8 @@ window.priceCalculation = (function () {
if (!isNaN(priceTI) && priceTI !== 0) {
const rates = this.getRates();
const computationMethod = taxElem.find('option:selected').attr('data-computation-method');
priceTE = ps_round(removeTaxes(priceTI, rates, computationMethod), displayPricePrecision);
priceTE = truncateDecimals(priceTE, displayPricePrecision);
const computation_method = taxElem.find('option:selected').attr('data-computation-method');
priceTE = ps_round(removeTaxes(priceTI, rates, computation_method), displayPricePrecision);
}
return priceTE;
......@@ -2034,7 +2032,6 @@ window.priceCalculation = (function () {
const productPriceTE = priceCalculation.getProductBasePrice();
let finalPriceTE = productPriceTE + impactPriceTE + ecotaxTE;
finalPriceTE = ps_round(finalPriceTE, displayPricePrecision);
finalPriceTE = truncateDecimals(finalPriceTE, displayPricePrecision);
finalPriceContainer.html(finalPriceTE);
finalPriceContainer.data('price', finalPriceTE);
......@@ -2058,7 +2055,6 @@ window.priceCalculation = (function () {
const productPriceTE = priceCalculation.getProductBasePrice();
let finalPriceTI = this.computePriceTaxIncluded(productPriceTE + impactPriceTE) + ecotaxTI;
finalPriceTI = ps_round(finalPriceTI, displayPricePrecision);
finalPriceTI = truncateDecimals(finalPriceTI, displayPricePrecision);
finalPriceTIContainer.html(finalPriceTI);
finalPriceTIContainer.data('price', finalPriceTI);
......@@ -2083,7 +2079,6 @@ window.priceCalculation = (function () {
// Compute impact price tax excluded then update the price tax included
let impactPriceTI = currentFinalPriceTI - ecotaxTI - productPriceTI;
impactPriceTI = ps_round(impactPriceTI, displayPricePrecision);
impactPriceTI = truncateDecimals(impactPriceTI, displayPricePrecision);
const impactPriceTE = this.computePriceTaxExcluded(impactPriceTI);
this.updateImpactTEInput(impactPriceTE, obj);
......@@ -2163,7 +2158,6 @@ window.priceCalculation = (function () {
const productPrice = priceCalculation.getProductBasePrice();
let finalPrice = productPrice + combinationEcotaxTE + impactPriceTE;
finalPrice = ps_round(finalPrice, displayPricePrecision);
finalPrice = truncateDecimals(finalPrice, displayPricePrecision);
return finalPrice;
},
......
......@@ -3824,8 +3824,8 @@ class ProductCore extends ObjectModel
$array_tmp = [
'price' => $row['price'],
'ecotax' => $row['ecotax'],
'attribute_price' => $row['attribute_price'] ?: null,
'attribute_ecotax' => $row['attribute_ecotax'] ?: null,
'attribute_price' => $row['attribute_price'] ?? null,
'attribute_ecotax' => $row['attribute_ecotax'] ?? null,
];
self::$_pricesLevel2[$cache_id_2][(int) $row['id_product_attribute']] = $array_tmp;
......
......@@ -1403,6 +1403,18 @@ Release Notes for PrestaShop 1.7
- #17152: Revert "Functional tests - Fix disable shop function" (by @SimonGrn)
- #17150: Functional tests - Fix disable shop function (by @boubkerbribri)
####################################
# v1.7.7.8 - (2021-09-03)
####################################
- Back Office:
- Bug fix:
- #25749: Product combination price edit : Use blur instead of onkeyup to avoid price flip (by @sowbiba and @atomiix)
- Core:
- Improvement:
- #25757: Define version to 1778 (by @sowbiba)
- Bug fix:
- #25784: Use null coalescing operator to fix notice (by @kpodemski)
####################################
# v1.7.7.7 - (2021-08-18)
####################################
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment