ADD option MAIN_DONT_KEEP_NOTE_ON_CLONING to remove note on cloning

This commit is contained in:
ro@t.com 2019-10-10 15:57:26 +02:00
parent 060452ecf2
commit 2149b155d1
2 changed files with 10 additions and 1 deletions

View File

@ -1287,7 +1287,11 @@ class Propal extends CommonObject
$object->datep = $now; // deprecated
$object->fin_validite = $object->date + ($object->duree_validite * 24 * 3600);
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $object->ref_client = '';
if ($conf->global->MAIN_DONT_KEEP_NOTE_ON_CLONING==1)
{
$object->note_private = '';
$object->note_public = '';
}
// Create clone
$object->context['createfromclone']='createfromclone';
$result=$object->create($user);

View File

@ -1046,6 +1046,11 @@ class Facture extends CommonInvoice
$object->close_code = '';
$object->close_note = '';
$object->products = $object->lines; // For backward compatibility
if ($conf->global->MAIN_DONT_KEEP_NOTE_ON_CLONING==1)
{
$object->note_private = '';
$object->note_public = '';
}
// Loop on each line of new invoice
foreach($object->lines as $i => $line)