Line 505:
Line 505:
That's all. Now, when you edit your global_coefficient, this will force refresh the total price.
That's all. Now, when you edit your global_coefficient, this will force refresh the total price.
+
+
However, you will still notice one last glitch: when you edit the global_coefficient, the total price isn't reflected instantly, you must refresh the webpage once to see the new price. This is because of how the datasheet and the CustomFields hook are designed: CustomFields is called only exactly where the custom fields are place, thus it is called after the total price, the margin and the remaining debt are printed. Thus, CustomFields updates the value of your custom field only after all those informations get printed, and thus it cannot modify them at this stage. That's why those information are out-of-date, and you must refresh the webpage once to get to see the latest values.
+
+
There is nothing you can do about it. One way to fix that would be to modify how CustomFields save the custom fields, by moving this stage at the very top. However, this would need another hook, which should be called at the very beginning of the page loading.
= Modify the total price PER product/service line with a coefficient (without tampering the discount) =
= Modify the total price PER product/service line with a coefficient (without tampering the discount) =