Browse Source

[Administration] Distributions > liste commandes : libellé "Gratuit" si montant à 0€ #1262

feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
8ce6d78360
2 changed files with 7 additions and 4 deletions
  1. +1
    -1
      backend/views/distribution/index.php
  2. +6
    -3
      common/logic/Order/Order/Repository/OrderRepository.php

+ 1
- 1
backend/views/distribution/index.php View File

<a href="javascript:void(0);" @click="orderPaymentModalClick" :data-id-order="order.id"> <a href="javascript:void(0);" @click="orderPaymentModalClick" :data-id-order="order.id">
<order-state-payment :order="order" :producer="producer"></order-state-payment> <order-state-payment :order="order" :producer="producer"></order-state-payment>
</a> </a>
<span class="glyphicon glyphicon-time" title="Débit automatique du crédit la veille de la distribution" v-if="order.auto_payment && (order.amount_paid == 0 || order.amount_paid < order.amount)"></span>
<span class="glyphicon glyphicon-time" title="Débit automatique du crédit la veille de la distribution" v-if="order.amount != 0 && order.auto_payment && (order.amount_paid == 0 || order.amount_paid < order.amount)"></span>
</td> </td>
<td class="column-credit" v-if="!idActivePointSale || (pointSaleActive && pointSaleActive.credit == 1)"> <td class="column-credit" v-if="!idActivePointSale || (pointSaleActive && pointSaleActive.credit == 1)">
<template v-if="order.isCreditContext"> <template v-if="order.isCreditContext">

+ 6
- 3
common/logic/Order/Order/Repository/OrderRepository.php View File

$titleLabel = ''; $titleLabel = '';


if(!$amountPaid) { if(!$amountPaid) {
if($isOrderPaid) {
if($isOrderPaid && $amountTotal != 0) {
$label = 'Facture payée'; $label = 'Facture payée';
} }
elseif($this->isCreditAutoPayment($order)) {
elseif($this->isCreditAutoPayment($order) && $amountTotal != 0) {
if($order->subscription && $order->subscription->auto_payment == 0) { if($order->subscription && $order->subscription->auto_payment == 0) {
$label = 'Crédit désactivé'; $label = 'Crédit désactivé';
} }
$label = 'Crédit non débité'; $label = 'Crédit non débité';
} }
} }
elseif($amountTotal == 0) {
$label = 'Gratuit';
}
else { else {
$label = 'Non réglé'; $label = 'Non réglé';
} }
$classLabel = 'warning'; $classLabel = 'warning';
$titleLabel = 'Paiement en surplus'; $titleLabel = 'Paiement en surplus';
} }
elseif($isOrderPaid) {
elseif(($isOrderPaid && $amountTotal != 0) || $amountTotal == 0) {
$classLabel = 'success'; $classLabel = 'success';
} }
elseif($orderPaymentStatus == Order::PAYMENT_UNPAID) { elseif($orderPaymentStatus == Order::PAYMENT_UNPAID) {

Loading…
Cancel
Save