Open KreativeKrise opened 1 month ago
My workaround for now:
if (isModEnabled('numberwords')) {
dol_include_once('/numberwords/core/substitutions/functions_numberwords.lib.php');
$textAmount = numberwords_getLabelFromNumber($outputlangs, $amount, $object->multicurrency_code);
} else {
$textAmount = dol_convertToWord($amount, $outputlangs, $object->multicurrency_code, true);
}
Can you try this fix: Replace the line: $langs->getLabelFromNumber($num, $type); with $langs->getLabelFromNumber($num, $currency);
is it ok with this change ?
The module only ever returns the default currency from Dolibarr. It does not matter which currency I select in an invoice, for example.
I'm using
dol_convertToWord($amount, $outputlangs, $object->multicurrency_code, true);
. But this method just calls$langs->getLabelFromNumber($num, $type);
in the background. This method does not recognize any currency, which is why the default currency is used.So if the default Dolibarr method is not working, which method shall I use?