Bläddra i källkod

[Backend] Distribution > création commande : coche Tiller #1054

feature/souke
Guillaume Bourgeois 1 år sedan
förälder
incheckning
c72ace9a26
1 ändrade filer med 7 tillägg och 4 borttagningar
  1. +7
    -4
      common/logic/Order/Order/Repository/OrderRepository.php

+ 7
- 4
common/logic/Order/Order/Repository/OrderRepository.php Visa fil

@@ -2,6 +2,7 @@

namespace common\logic\Order\Order\Repository;

use common\helpers\MeanPayment;
use common\logic\AbstractRepository;
use common\logic\Distribution\Distribution\Model\Distribution;
use common\logic\Distribution\ProductDistribution\Repository\ProductDistributionRepository;
@@ -313,11 +314,13 @@ class OrderRepository extends AbstractRepository
$creditFunctioning = $this->producerRepository->getPointSaleCreditFunctioning($pointSale);

if ($order->id_user && $this->producerRepository->getConfig('credit') && $pointSale->credit) {
if ($creditFunctioning == Producer::CREDIT_FUNCTIONING_OPTIONAL) {
return 0;
} elseif ($creditFunctioning == Producer::CREDIT_FUNCTIONING_MANDATORY) {
if($order->mean_payment == MeanPayment::CREDIT || $creditFunctioning == Producer::CREDIT_FUNCTIONING_MANDATORY) {
return 1;
} elseif ($creditFunctioning == Producer::CREDIT_FUNCTIONING_USER) {
}
elseif ($creditFunctioning == Producer::CREDIT_FUNCTIONING_OPTIONAL) {
return 0;
}
elseif ($creditFunctioning == Producer::CREDIT_FUNCTIONING_USER) {
$userProducer = UserProducer::searchOne([
'id_user' => $order->id_user,
'id_producer' => $distribution->id_producer

Laddar…
Avbryt
Spara