Skip to content
Code-Schnipsel Gruppen Projekte
Commit 1f236c42 erstellt von Patrick Müller's avatar Patrick Müller
Dateien durchsuchen

refactor: allow PurchasingProcess for calculation

refactor: ignore calculation attributes with paid_status DEBIT quiqqer/payment-sepa#11
Übergeordneter 11c9af62
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -606,7 +606,7 @@ public static function calculateInvoicePayments(Invoice $Invoice)
/**
* Calculates the individual amounts paid of an invoice / order
*
* @param InvoiceTemporary|Invoice|QUI\ERP\Order\AbstractOrder $ToCalculate
* @param InvoiceTemporary|Invoice|QUI\ERP\Order\AbstractOrder|QUI\ERP\Purchasing\Processes\PurchasingProcess $ToCalculate
* @return array
*
* @throws QUI\ERP\Exception
......@@ -769,6 +769,7 @@ public static function calculatePayments($ToCalculate)
// Leave everything as it is because a subscription plan order can never be set to "paid"
} elseif ($ToCalculate->getAttribute('paid_status') === QUI\ERP\Constants::TYPE_INVOICE_REVERSAL
|| $ToCalculate->getAttribute('paid_status') === QUI\ERP\Constants::TYPE_INVOICE_CANCEL
|| $ToCalculate->getAttribute('paid_status') === QUI\ERP\Constants::PAYMENT_STATUS_DEBIT
) {
// Leave everything as it is
} elseif ((float)$ToCalculate->getAttribute('toPay') == 0) {
......@@ -819,6 +820,10 @@ public static function isAllowedForCalculation($ToCalculate)
return true;
}
if ($ToCalculate instanceof QUI\ERP\Purchasing\Processes\PurchasingProcess) {
return true;
}
return false;
}
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren