439
edits
(→Implementing the change of total price in the Dolibarr interface: Updated code to be more generic and work with latest Dolibarr versions) |
(→Implementing the change of total price in the Dolibarr interface: Better code again...) |
||
| Line 549: | Line 549: | ||
// Applying a multiplying/dividing coefficient to an HT price will give a mathematically correct TTC price since the taxes are also a multiplier | // Applying a multiplying/dividing coefficient to an HT price will give a mathematically correct TTC price since the taxes are also a multiplier | ||
// However, if you want to apply other mathematical operations (like addition or substaction), you should use the total price with $line->total_ttc | // However, if you want to apply other mathematical operations (like addition or substaction), you should use the total price with $line->total_ttc | ||
if ( | if (!empty($linecf->customfields->cf_coefficient)) { | ||
echo price($line->total_ht * $linecf->customfields->cf_coefficient); | echo price($line->total_ht * $linecf->customfields->cf_coefficient); | ||
} else { | } else { | ||
edits