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:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user