浏览代码

Pages commandes

feature/export_comptable
Fab 4 年前
父节点
当前提交
88d70cc94a
共有 4 个文件被更改,包括 13 次插入7 次删除
  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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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();

正在加载...
取消
保存