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

fix: missing delete method for temporary invoice deletion fixed

Übergeordneter 6bc27658
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -14,7 +14,7 @@
QUI::$Ajax->registerFunction(
'package_quiqqer_invoice_ajax_invoices_temporary_get',
function ($invoiceId) {
$Invoice = QUI\ERP\Accounting\Invoice\Utils\Invoice::getInvoiceByString($invoiceId);
$Invoice = QUI\ERP\Accounting\Invoice\Utils\Invoice::getTemporaryInvoiceByString($invoiceId);
$invoice = $Invoice->toArray();
if (isset($invoice['invoice_address']) && \is_string($invoice['invoice_address'])) {
......
......@@ -127,7 +127,6 @@ public function getInvoicesByUser(QUI\Users\User $User)
* @param string $invoiceId - ID of a temporary Invoice
* @param QUI\Interfaces\Users\User|null $User
*
* @throws Exception
* @throws QUI\Permissions\Exception
* @throws QUI\Lock\Exception
* @throws QUI\Exception
......@@ -135,7 +134,14 @@ public function getInvoicesByUser(QUI\Users\User $User)
public function delete($invoiceId, $User = null)
{
$Invoice = QUI\ERP\Accounting\Invoice\Utils\Invoice::getInvoiceByString($invoiceId);
$Invoice->delete($User);
if (!($Invoice instanceof InvoiceTemporary)) {
$Invoice = QUI\ERP\Accounting\Invoice\Utils\Invoice::getTemporaryInvoiceByString($invoiceId);
}
if ($Invoice instanceof InvoiceTemporary) {
$Invoice->delete($User);
}
}
/**
......
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