1
edit
m (→Comments) Tag: 2017 source edit |
m (Typos) |
||
| Line 333: | Line 333: | ||
Note that an external module can use them for links between Dolibarr tables and its module tables but a better recommended solution is to use the trigger to implement the deletion of its tables when a record of a parent official table is deleted. | Note that an external module can use them for links between Dolibarr tables and its module tables but a better recommended solution is to use the trigger to implement the deletion of its tables when a record of a parent official table is deleted. | ||
==Using Database triggers / | ==Using Database triggers / stored procedures== | ||
Using Database triggers is not allowed into the code of Dolibarr, so you should have no troubles with Database triggers. | Using Database triggers is not allowed into the code of Dolibarr, so you should have no troubles with Database triggers. | ||
| Line 500: | Line 500: | ||
print 239.2 - 229.3 - 9.9; | print 239.2 - 229.3 - 9.9; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
You wont get zero but a very small decimal number. If you get zero | You wont get zero but a very small decimal number. If you get zero here, you should be able to find other examples that don't work. | ||
Problem of float is general, so a variable that is a result of a calculation using decimal numbers must ALWAYS be cleaned using the function '''price2num()''' with the | Problem of float is general, so a variable that is a result of a calculation using decimal numbers must ALWAYS be cleaned using the function '''price2num()''' with the second parameter to: 'MU', 'MT' or 'MS' depending on need (see description of function). | ||
<syntaxhighlight lang="PHP"> | <syntaxhighlight lang="PHP"> | ||
print price2num(239.2 - 229.3 - 9.9, 'MT'); | print price2num(239.2 - 229.3 - 9.9, 'MT'); | ||
edit