Browse Source

Statistiques avec les options relatives à l'export & Bug : tarif de livraison différent sur la facture que sur panier

develop
Fabien Normand 1 month ago
parent
commit
188dc8c567
1 changed files with 32 additions and 23 deletions
  1. +32
    -23
      Builder/Order/OrderShopBuilder.php

+ 32
- 23
Builder/Order/OrderShopBuilder.php View File

@@ -412,6 +412,9 @@ class OrderShopBuilder
$orderShop->setStatDeliveryPriceWithTaxAndReduction(
$this->priceSolver->getDeliveryPriceWithTaxAndReduction($orderShop)
);
$orderShop->setStatMarginDeliveryWithReductions(
$this->priceSolver->getMarginDeliveryWithReductions($orderShop)
);

$this->entityManager->persist($orderShop);
if ($flush) {
@@ -573,29 +576,35 @@ class OrderShopBuilder
}


public function setStatsInfo(OrderShopInterface $orderShop, $flush = true)
{
$orderShop->setStatTotal($this->priceSolver->getTotal($orderShop));
$orderShop->setStatTotalWithTax($this->priceSolver->getTotalWithTax($orderShop));
$orderShop->setStatTotalOrderProductsWithReductions(
$this->priceSolver->getTotalOrderProductsWithReductions($orderShop)
);
$orderShop->setStatTotalOrderProductsWithTaxAndReductions(
$this->priceSolver->getTotalOrderProductsWithTaxAndReductions($orderShop)
);
$orderShop->setStatMarginOrderProductsWithReductions(
$this->priceSolver->getMarginOrderProductsWithReductions($orderShop)
);
$orderShop->setStatDeliveryPriceWithReduction($this->priceSolver->getDeliveryPriceWithReduction($orderShop));
$orderShop->setStatDeliveryPriceWithTaxAndReduction(
$this->priceSolver->getDeliveryPriceWithTaxAndReduction($orderShop)
);

$this->entityManager->update($orderShop);
if ($flush) {
$this->entityManager->flush();
}
}
//Semble ne jamais être utilisé
//TODO : à supprimer si pas d'erreur arpès 1/01/2025
// public function setStatsInfo(OrderShopInterface $orderShop, $flush = true)
// {
// $orderShop->setStatTotal($this->priceSolver->getTotal($orderShop));
// $orderShop->setStatTotalWithTax($this->priceSolver->getTotalWithTax($orderShop));
// $orderShop->setStatTotalOrderProductsWithReductions(
// $this->priceSolver->getTotalOrderProductsWithReductions($orderShop)
// );
// $orderShop->setStatTotalOrderProductsWithTaxAndReductions(
// $this->priceSolver->getTotalOrderProductsWithTaxAndReductions($orderShop)
// );
// $orderShop->setStatMarginOrderProductsWithReductions(
// $this->priceSolver->getMarginOrderProductsWithReductions($orderShop)
// );
// $orderShop->setStatDeliveryPriceWithReduction($this->priceSolver->getDeliveryPriceWithReduction($orderShop));
// $orderShop->setStatDeliveryPriceWithTaxAndReduction(
// $this->priceSolver->getDeliveryPriceWithTaxAndReduction($orderShop)
// );
// $orderShop->setStatMarginDeliveryWithReductions(
// $this->priceSolver->getMarginDeliveryWithReductions($orderShop)
// );
//
//
// $this->entityManager->update($orderShop);
// if ($flush) {
// $this->entityManager->flush();
// }
// }


public function setHasReach(int $reachStep, OrderShopInterface $orderShop)

Loading…
Cancel
Save