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

feat: implement onQuiqqerErpGetHistoryByUser event handler

Übergeordneter 5b311db5
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -23,6 +23,10 @@
fire="\QUI\ERP\Accounting\Invoice\EventHandler::onQuiqqerErpGetCommentsByUser"
/>
<event on="onQuiqqerErpGetHistoryByUser"
fire="\QUI\ERP\Accounting\Invoice\EventHandler::onQuiqqerErpGetHistoryByUser"
/>
<event on="onQuiqqerErpOutputSendMail"
fire="\QUI\ERP\Accounting\Invoice\EventHandler::onQuiqqerErpOutputSendMail"
/>
......
......@@ -239,13 +239,31 @@ public static function onQuiqqerErpGetCommentsByUser(
foreach ($invoices as $Invoice) {
$Comments->import($Invoice->getComments());
}
}
/**
* quiqqer/customer: onQuiqqerErpGetHistoryByUser
*
* @param QUI\Users\User $User
* @param QUI\ERP\Comments $Comments
*/
public static function onQuiqqerErpGetHistoryByUser(
QUI\Users\User $User,
QUI\ERP\Comments $Comments
) {
$Handler = Handler::getInstance();
$invoices = $Handler->getInvoicesByUser($User);
foreach ($invoices as $Invoice) {
// created invoice
$Comments->addComment(
QUI::getLocale()->get('quiqqer/invoice', 'erp.comment.invoice.created', [
'invoiceId' => $Invoice->getId()
]),
\strtotime($Invoice->getAttribute('c_date'))
\strtotime($Invoice->getAttribute('c_date')),
'quiqqer/invoice',
'fa fa-history'
);
}
}
......
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