瀏覽代碼

[Administration] Commande : correctif cagnotte débitée lors d'un changement de point de vente où la cagnotte n'est pas activée

feature/rotating_product
Guillaume Bourgeois 5 月之前
父節點
當前提交
1c8459bf6e
共有 1 個檔案被更改,包括 9 行新增10 行删除
  1. +9
    -10
      domain/Order/Order/OrderRepository.php

+ 9
- 10
domain/Order/Order/OrderRepository.php 查看文件

@@ -353,20 +353,19 @@ class OrderRepository extends AbstractRepository

public function isCreditAutoPayment(Order $order, bool $debitCreditOnFunctioningOptional = false)
{
if($order->subscription) {
if($order->subscription->auto_payment == Subscription::AUTO_PAYMENT_YES) {
return true;
}
$pointSale = $order->pointSale;
if($pointSale) {
if($order->subscription && $pointSale->payment_method_credit) {
if($order->subscription->auto_payment == Subscription::AUTO_PAYMENT_YES) {
return true;
}

if($order->subscription->auto_payment == Subscription::AUTO_PAYMENT_NO) {
return false;
if($order->subscription->auto_payment == Subscription::AUTO_PAYMENT_NO) {
return false;
}
}
}

$pointSale = $order->pointSale;
if($pointSale) {
$creditFunctioning = $this->producerRepository->getPointSaleCreditFunctioning($pointSale);

if ($order->id_user && $this->producerSolver->getConfig('credit') && $pointSale->payment_method_credit) {
if($order->mean_payment == MeanPayment::CREDIT || $creditFunctioning == Producer::CREDIT_FUNCTIONING_MANDATORY) {
return true;

Loading…
取消
儲存