Module CustomFields Cases: Difference between revisions

Jump to navigation Jump to search
(→‎Implementing the change of total price in the Dolibarr interface: Updated code to be more generic and work with latest Dolibarr versions)
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 (isset($linecf->customfields->cf_coefficient)) {
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 {
439

edits

Navigation menu