Add user data to collected order invoices array

Include customer user data in the collected order invoices payload by retrieving user information based on customer number. This ensures that relevant user details are available for further processing or integration.
This commit is contained in:
Jepp9350
2025-03-07 16:45:12 +01:00
parent b3c4e9696f
commit fdb536ea3e
@@ -87,6 +87,7 @@ class collected_order_invoices_o extends db
'economic_invoice_draft_id' => null, // This will be overwritten if the external id is set
'economic_invoice_booked_id' => null, // This will be overwritten if the external id is set
'total_net_amount' => self::getTotalAmount(),
'user' => (array)(new users_o())->getUserByCustomerNumber($this->customer_number->value())->asArray(),
];
// If the external id is set, get the invoice draft id
if (!empty($this->external_id->value())) {