439
edits
(→Change subprice in database: update overloading function, should work now) |
|||
| Line 357: | Line 357: | ||
Then here are two alternative ways of implementing the change of the subprice relativery to this coefficient. | Then here are two alternative ways of implementing the change of the subprice relativery to this coefficient. | ||
== Change | == Change total price in database == | ||
Here we will use a "save" overloading function to change the | Here we will use a "save" overloading function to change the total price directly in the database, thus we won't have to modify anything else (eg: in PDT or ODT) since the total price will be already updated in the database. | ||
Warning: this method will work only with CustomFields => 3.2. | Warning: this method will work only with CustomFields => 3.2.23 since the "save" overloading function did not work for products lines before. | ||
Just add the following overloading function in your customfields_fields_extend.lib.php file: | Just add the following overloading function in your customfields_fields_extend.lib.php file: | ||
| Line 401: | Line 401: | ||
</source> | </source> | ||
This should show the correct | This should show the correct total price on the Dolibarr's interface without modifying the unit subprice (P.U. Unit): | ||
[[File:Cfe2.jpg]] | |||
You have nothing to edit in your PDF or ODT template, since the new subprice with applied coefficient will be automatically printed instead of the old one without coefficient. | |||
== Change printed subprice without tampering the subprice in the database == | == Change printed subprice without tampering the subprice in the database == | ||
edits