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

Merge branch 'next-2.x' into 'main'

fix(Invoice): set global process id + permissions at create credit note

See merge request !65
Übergeordnete 092581b5 ff59bafc
No related branches found
No related tags found
2 Merge Requests!80Update 'next-3.x' with latest changes from 'main',!65fix(Invoice): set global process id + permissions at create credit note
Pipeline #9061 mit Warnungen bestanden mit Phasen
in 46 Sekunden
......@@ -899,8 +899,7 @@ public function copy(
* @throws QUI\Permissions\Exception
*/
public function createCreditNote(
QUI\Interfaces\Users\User $PermissionUser = null,
bool|string $globalProcessId = false
QUI\Interfaces\Users\User $PermissionUser = null
): InvoiceTemporary {
// a credit node cant create a credit note
if ($this->getInvoiceType() === QUI\ERP\Constants::TYPE_INVOICE_CREDIT_NOTE) {
......@@ -920,7 +919,7 @@ public function createCreditNote(
[$this]
);
$Copy = $this->copy(QUI::getUsers()->getSystemUser(), $globalProcessId);
$Copy = $this->copy(QUI::getUsers()->getSystemUser(), $this->getGlobalProcessId());
$articles = $Copy->getArticles()->getArticles();
// change all prices
......@@ -1029,7 +1028,7 @@ public function createCreditNote(
$Copy->setAttribute('date', date('Y-m-d H:i:s'));
$Copy->setAttribute('additional_invoice_text', $additionalText);
$Copy->setAttribute('currency_data', $this->getAttribute('currency_data'));
$Copy->setInvoiceType(QUI\ERP\Constants::TYPE_INVOICE_CREDIT_NOTE);
$Copy->setInvoiceType(QUI\ERP\Constants::TYPE_INVOICE_CREDIT_NOTE, QUI::getUsers()->getSystemUser());
if ($this->getAttribute('invoice_address')) {
try {
......@@ -1209,7 +1208,7 @@ public function createReversal(
$Copy->setAttribute('date', date('Y-m-d H:i:s'));
$Copy->setAttribute('additional_invoice_text', $additionalText);
$Copy->setAttribute('currency_data', $this->getAttribute('currency_data'));
$Copy->setInvoiceType(QUI\ERP\Constants::TYPE_INVOICE_REVERSAL);
$Copy->setInvoiceType(QUI\ERP\Constants::TYPE_INVOICE_REVERSAL, QUI::getUsers()->getSystemUser());
if ($this->getAttribute('invoice_address')) {
try {
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren