Skip to content
Code-Schnipsel Gruppen Projekte
Bestätigt Commit ff762d13 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

feat: erp process object extended

New event so that other modules can link into the ERP process as history. + invoice and order creation event added
Übergeordneter 685d639d
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
2 Merge Requests!61feat: erp process object extended,!60feat: erp process object extended
......@@ -675,6 +675,14 @@
<de><![CDATA[[startCurrency] = [rate]]]></de>
<en><![CDATA[[startCurrency] = [rate]]]></en>
</locale>
<locale name="created.invoice">
<de><![CDATA[Rechnung #[invoiceId] erstellt]]></de>
<en><![CDATA[Created invoice #[invoiceId]]]></en>
</locale>
<locale name="created.order">
<de><![CDATA[Bestellung #[orderId] erstellt]]></de>
<en><![CDATA[Created order #[orderId]]]></en>
</locale>
</groups>
<groups name="quiqqer/erp" datatype="js">
......
......@@ -9,6 +9,7 @@
use QUI;
use function count;
use function strtotime;
/**
* Class Process
......@@ -91,7 +92,7 @@ public function getHistory(): Comments
try {
$result = QUI::getDataBase()->fetch([
'from' => $this->table(),
'from' => $this->table(),
'where' => [
'id' => $this->processId
],
......@@ -126,16 +127,32 @@ public function getCompleteHistory(): Comments
$History = $this->getHistory();
$invoices = $this->getInvoices();
$orders = $this->getOrders();
$orders = $this->getOrders();
foreach ($invoices as $Invoice) {
$History->addComment(
QUI::getLocale()->get('quiqqer/erp', 'created.invoice', [
'invoiceId' => $Invoice->getId()
]),
strtotime($Invoice->getAttribute('date'))
);
$History->import($Invoice->getHistory());
}
foreach ($orders as $Order) {
$History->addComment(
QUI::getLocale()->get('quiqqer/erp', 'created.order', [
'orderId' => $Order->getId()
]),
strtotime($Order->getAttribute('date'))
);
$History->import($Order->getHistory());
}
QUI::getEvents()->fireEvent('quiqqerErpGetCompleteHistory', [$this]);
return $History;
}
......@@ -280,7 +297,7 @@ public function getTransactions(): ?array
return $this->transactions;
}
$Transactions = QUI\ERP\Accounting\Payments\Transactions\Handler::getInstance();
$Transactions = QUI\ERP\Accounting\Payments\Transactions\Handler::getInstance();
$this->transactions = $Transactions->getTransactionsByProcessId($this->processId);
return $this->transactions;
......
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