Nie możesz wybrać więcej, niż 25 tematów
Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
|
- <?php
-
- namespace domain\Document\Invoice;
-
- use common\helpers\Price;
- use domain\Document\Document\DocumentSolver;
- use domain\Order\Order\Order;
-
- class InvoiceSolver extends DocumentSolver
- {
- public function getInvoiceAmountPaid(Invoice $invoice): float
- {
- $amountPaid = 0;
-
- foreach($invoice->payments as $payment) {
- $amountPaid += $payment->amount;
- }
-
- return $amountPaid;
- }
-
- public function isInvoicePaid(Invoice $invoice): bool
- {
- return $this->getInvoiceAmountPaid($invoice) >= Price::numberTwoDecimals($this->getAmountWithTax($invoice, Order::INVOICE_AMOUNT_TOTAL));
- }
- }
|