-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX round capital societe #29211
FIX round capital societe #29211
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The substitution array must contains brut data, so a number must have a php number format in memory. And price format a data for output so data is no more a number but a string with special chars. A data can't be reused once formated with price.
May be you want to use price2num function ?
@@ -323,7 +323,7 @@ public function get_substitutionarray_thirdparty($object, $outputlangs, $array_k | |||
'company_supplieraccountancycode'=>$object->code_compta_fournisseur, | |||
'company_juridicalstatus'=>$object->forme_juridique, | |||
'company_outstanding_limit'=>$object->outstanding_limit, | |||
'company_capital'=>$object->capital, | |||
'company_capital'=> price($object->capital, 0, '', 1, -1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The substitution array must contains brut data, so a number must have a php number format in memory. And price format a data for output so data is no more a number but a string with special chars. A data can't be reused once formated with price.
May be you want to use price2num function ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok so can we have a new array key like company_capital_formated ? we have things like that for total fields of customer documents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, i think it is a better idea to have company_capital_formatted if you want to use a ready text formatted price.
company_capital = brut data
company_capital_formatted = data formatted according to language, country, currency and rounding setup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eldy I've made the change
Instructions
$societe->capital
Does not respect "Limites et précisions"
FIX|Fix #[rounding capital]
add price() for display capital
before 2000000.00000000 (double24.8)
after fix 2 000 000,00 with price()