Przeglądaj źródła

Pages commandes

feature/export_comptable
Fab 4 lat temu
rodzic
commit
88d70cc94a
4 zmienionych plików z 13 dodań i 7 usunięć
  1. +1
    -1
      ShopBundle/Controller/Backend/OrderController.php
  2. +1
    -1
      ShopBundle/Form/Backend/ReductionCommon/UnitType.php
  3. +6
    -0
      ShopBundle/Resources/views/backend/order/macros.html.twig
  4. +5
    -5
      ShopBundle/Services/Price/OrderShopPriceUtils.php

+ 1
- 1
ShopBundle/Controller/Backend/OrderController.php Wyświetl plik

@@ -340,7 +340,7 @@ class OrderController extends AdminController
if ($formOrderReductionCredit->isSubmitted() && $formOrderReductionCredit->isValid()) {
$reductionCredit = $formOrderReductionCredit->get('reductionCredit')->getData();
$orderShop->reductionError = array();
if ($this->orderUtils->isReductionCreditAllowToBeAddToOrder($orderShop, $reductionCredit)) {
if ($this->orderUtils->isReductionCreditAllowAddToOrder($orderShop, $reductionCredit)) {
$orderReductionCredit = $this->orderUtils->createOrderReductionCredit($orderShop, $reductionCredit);
$this->em->persist($orderReductionCredit);
$this->em->flush();

+ 1
- 1
ShopBundle/Form/Backend/ReductionCommon/UnitType.php Wyświetl plik

@@ -21,7 +21,7 @@ class UnitType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
dump($options);
$builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event, $options) {
$builder = $event->getForm()->getParent();


+ 6
- 0
ShopBundle/Resources/views/backend/order/macros.html.twig Wyświetl plik

@@ -93,6 +93,12 @@
<td>${orderReductionCart.amount}€</td>
</tr>
</template>
<template v-for="(orderReductionCredit, key) in order.orderReductionCredits">
<tr>
<th>${orderReductionCredit.title}</th>
<td>${orderReductionCredit.amount}€</td>
</tr>
</template>
<tr>
<th>Total produits après réductions TTC </th>
<td>${order.totalOrderProductsWithTaxAndReductions}€</td>

+ 5
- 5
ShopBundle/Services/Price/OrderShopPriceUtils.php Wyświetl plik

@@ -127,9 +127,9 @@ class OrderShopPriceUtils implements OrderShopPriceUtilsInterface
);
} else if ($orderReductionCart->getUnit() == 'amount') {
if ($orderReductionCart->getBehaviorTaxRate() == 'tax-excluded') {
$price = $orderReductionCart->getValue();
$amount = $orderReductionCart->getValue();
} else if ($orderReductionCart->getBehaviorTaxRate() == 'tax-included') {
$price = $orderReductionCart->getValue() / $this->getTaxRateAverage($order);
$amount = $this->round($orderReductionCart->getValue() / $this->getTaxRateAverage($order));
}

}
@@ -151,7 +151,7 @@ class OrderShopPriceUtils implements OrderShopPriceUtilsInterface
}
elseif ($orderReductionCart->getUnit() == 'amount') {
if ($orderReductionCart->getBehaviorTaxRate() == 'tax-excluded') {
$amount = $orderReductionCart->getValue() * $this->getTaxRateAverage($order);
$amount = $this->round($orderReductionCart->getValue() * $this->getTaxRateAverage($order));
}
elseif ($orderReductionCart->getBehaviorTaxRate() == 'tax-included') {
$amount = $orderReductionCart->getValue() ;
@@ -170,7 +170,7 @@ class OrderShopPriceUtils implements OrderShopPriceUtilsInterface
$amount = $orderReductionCredit->getValue();
}
else if ($orderReductionCredit->getBehaviorTaxRate() == 'tax-included') {
$amount = $orderReductionCredit->getValue() / $this->getTaxRateAverage($order);
$amount = $this->round($orderReductionCredit->getValue() / $this->getTaxRateAverage($order));
}

return $amount;
@@ -180,7 +180,7 @@ class OrderShopPriceUtils implements OrderShopPriceUtilsInterface
{
$amountWithTax = 0;
if ($orderReductionCredit->getBehaviorTaxRate() == 'tax-excluded') {
$amountWithTax = $orderReductionCredit->getValue() * $this->getTaxRateAverage($order);
$amountWithTax = $this->round($orderReductionCredit->getValue() * $this->getTaxRateAverage($order));
}
elseif ($orderReductionCredit->getBehaviorTaxRate() == 'tax-included') {
$amountWithTax = $orderReductionCredit->getValue();

Ładowanie…
Anuluj
Zapisz