Add support for dynamic currency conversion in invoices

Introduced dynamic currency handling in invoice generation by adding methods to set currency and retrieve conversion rates. Adjusted logic to ensure accurate currency conversions when processing orders, draft invoices, and customer data. Default behavior falls back to DKK if no currency is specified.
This commit is contained in:
Jepp9350
2025-03-31 14:42:19 +02:00
parent 67cf1c5880
commit 68ab9bc84c
6 changed files with 89 additions and 11 deletions
+3 -2
View File
@@ -92,10 +92,11 @@ class economic implements economic_i
/**
* Get a invoiceDraft (Helper) from the Economic system
* @param int $draft_invoice_number The Economic draft invoice number
* @param string $currency The conversion rate to use (default: DKK)
* @return economic_invoice_draft
*/
public function getInvoiceDraft(int $draft_invoice_number): economic_invoice_draft
public function getInvoiceDraft(int $draft_invoice_number, string $currency = 'DKK'): economic_invoice_draft
{
return new $this->helpers->economic_invoice_draft($draft_invoice_number);
return new $this->helpers->economic_invoice_draft($draft_invoice_number, $currency);
}
}