Create documents in docx, xlsx (MS Office Word and Excel), odt, ods (LibreOffice and OpenOffice) and pdf format without MS Office or others plugins installed from any module and subpanel using templates.
#1536 - Quantities without digits
We are using SuiteCRM Version 7.8.10 with MailMergeReports 2.5.12 for creating documents in modules quotes and invoices in German language.
We are using product quotes (line elements) in Suite CRM standard including field product_qty which is type “decimal”. In SuiteCRM dialogue the quantity is shown without digits, but in MMR the quantity always gets two digits. This is wrong – the same rules of SuiteCRM should be used in MMR documents:
How can we overcome this problem?
Regards, Wolf
6 years ago
Screenshot 1 is the display within SuiteCRM.
Screenshot 2 is from the M-M-R document.
Schreeshots 3 belongs to the Microsoft Word definition file.
6 years ago
Hi Wolf,
Try f_Decimals format funcion, introduced in v2.1.0: - New format function 'f_Decimals', format number of decimals of floats and decimal variables. Example: [a.numvar;onformat=~f_Decimals(1)]
Function to format numbers with a certain number of decimals, to be used as onformat parameter. The decimals number parameter will be passed in parentheses to the function. By default the numbers are formatted using the number of decimals returned by $locale->getPrecision(). Important: If the number of decimals exceeds the value of $locale->getPrecision() then result will be filled with zeros, since at this point we do not have the complete actual value of the number.
In your template, instead of [a_sub1.product_qty], try [a_sub1.product_qty;onformat=~f_Decimals(0)]
Regards