Skip to content
Code-Schnipsel Gruppen Projekte
Commit 43e1bdd3 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

refactor: invoice#66

Übergeordneter fee8363f
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -619,7 +619,7 @@ public static function calculatePayments($ToCalculate)
);
// if payment status is paid, take it immediately and do not query any transactions
if ($ToCalculate->getAttribute('paid_status') === Invoice::PAYMENT_STATUS_PAID) {
if ($ToCalculate->getAttribute('paid_status') === QUI\ERP\Constants::PAYMENT_STATUS_PAID) {
$paidData = $ToCalculate->getAttribute('paid_data');
$paid = 0;
......@@ -765,13 +765,13 @@ public static function calculatePayments($ToCalculate)
) {
// Leave everything as it is
} elseif ((float)$ToCalculate->getAttribute('toPay') == 0) {
$ToCalculate->setAttribute('paid_status', Invoice::PAYMENT_STATUS_PAID);
$ToCalculate->setAttribute('paid_status', QUI\ERP\Constants::PAYMENT_STATUS_PAID);
} elseif ($ToCalculate->getAttribute('paid') == 0) {
$ToCalculate->setAttribute('paid_status', Invoice::PAYMENT_STATUS_OPEN);
$ToCalculate->setAttribute('paid_status', QUI\ERP\Constants::PAYMENT_STATUS_OPEN);
} elseif ($ToCalculate->getAttribute('toPay')
&& $calculations['sum'] != $ToCalculate->getAttribute('paid')
) {
$ToCalculate->setAttribute('paid_status', Invoice::PAYMENT_STATUS_PART);
$ToCalculate->setAttribute('paid_status', QUI\ERP\Constants::PAYMENT_STATUS_PART);
}
QUI\ERP\Debug::getInstance()->log([
......
<?php
namespace QUI\ERP;
/**
* Class Erp
* - Main ERP Class for all const vars
*
* @package QUI\ERP
*/
class Constants
{
const PAYMENT_STATUS_OPEN = 0;
const PAYMENT_STATUS_PAID = 1;
const PAYMENT_STATUS_PART = 2;
const PAYMENT_STATUS_ERROR = 4;
const PAYMENT_STATUS_CANCELED = 5;
const PAYMENT_STATUS_DEBIT = 11;
const PAYMENT_STATUS_PLAN = 12;
}
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