feat: refs #8298 update price calculation logic and add packagesDiscountFactor column to client table
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javi Gallego 2025-01-16 12:56:04 +01:00
parent 53c604762a
commit 125b7730e7
2 changed files with 2 additions and 6 deletions

View File

@ -236,11 +236,7 @@ BEGIN
ic.cm3delivery
* (
(
zo.price
- (
(zo.price - zo.priceOptimum)
* c.packagesDiscountFactor
)
zo.priceOptimum + (( zo.price - zo.priceOptimum) * 2 * ( 1 - c.packagesDiscountFactor))
)
- IFNULL(zo.bonus, 0)
)

View File

@ -1,3 +1,3 @@
ALTER TABLE `vn`.`client`
ADD COLUMN `packagesDiscountFactor` DECIMAL(4,3) NOT NULL DEFAULT 1.000
COMMENT 'Factor (1-0) que pondera el precio final entre priceOptimum (mejor) y price (peor)';
COMMENT 'Porcentaje de ajuste entre el numero de bultos medio del cliente, y el número medio óptimo para las zonas en las que compra';