New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NEW Enable auto update PDF on update note #9018
Conversation
Generate order/invoice PDF on update public note
@@ -2511,6 +2511,27 @@ function update_note($note,$suffix='') | |||
$this->note = $note; // deprecated | |||
$this->note_private = $note; | |||
} | |||
if($suffix != '_private' && in_array($this->table_element, array('commande_fournisseur', 'commande', 'propal', 'facture_fourn', 'facture' ))){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "update_note" method is a CRUD method to affect the database values. I would prefer to see code to build PDF that is not related with DAO principle after the call of update_note
I can transfer code into "htdocs/core/actions_setnotes.inc.php", Ok ? |
Yes, good idea. |
htdocs/core/actions_setnotes.inc.php
Outdated
$hidedetails = (GETPOST('hidedetails','int') ? GETPOST('hidedetails','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0)); | ||
$hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0)); | ||
$hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); | ||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this require_once necessary ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why.
There is no dedicated code to supplier product added by the PR, so why adding this ? The require is surely at the wrong place.
Generate order/invoice PDF on update public note