|
|
|
|
|
|
|
|
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)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |