Browse Source

[Administration] Facture 2 Four de l'Ariette : facture non réglée malgré le réglement #1268

feature/souke
Guillaume Bourgeois 1 year ago
parent
commit
1e6786f05a
2 changed files with 3 additions and 2 deletions
  1. +1
    -1
      backend/controllers/DocumentController.php
  2. +2
    -1
      common/logic/Document/Invoice/Service/InvoiceSolver.php

+ 1
- 1
backend/controllers/DocumentController.php View File

if($documentManager->isDocumentInvoice($document) && $documentManager->isStatusValid($document)) { if($documentManager->isDocumentInvoice($document) && $documentManager->isStatusValid($document)) {
$payment = $paymentManager->instanciatePayment( $payment = $paymentManager->instanciatePayment(
Payment::TYPE_PAYMENT, Payment::TYPE_PAYMENT,
number_format($documentManager->getAmountWithTax($document), 3),
number_format($documentManager->getAmountWithTax($document, Order::INVOICE_AMOUNT_TOTAL), 2),
$this->getProducerCurrent(), $this->getProducerCurrent(),
null, null,
null, null,

+ 2
- 1
common/logic/Document/Invoice/Service/InvoiceSolver.php View File

use common\helpers\Price; use common\helpers\Price;
use common\logic\Document\Document\Service\DocumentSolver; use common\logic\Document\Document\Service\DocumentSolver;
use common\logic\Document\Invoice\Model\Invoice; use common\logic\Document\Invoice\Model\Invoice;
use common\logic\Order\Order\Model\Order;


class InvoiceSolver extends DocumentSolver class InvoiceSolver extends DocumentSolver
{ {


public function isInvoicePaid(Invoice $invoice): bool public function isInvoicePaid(Invoice $invoice): bool
{ {
return $this->getInvoiceAmountPaid($invoice) >= Price::numberTwoDecimals($this->getAmountWithTax($invoice));
return $this->getInvoiceAmountPaid($invoice) >= Price::numberTwoDecimals($this->getAmountWithTax($invoice, Order::INVOICE_AMOUNT_TOTAL));
} }
} }

Loading…
Cancel
Save