Fix $conf not defined

This commit is contained in:
Laurent Destailleur 2019-11-12 10:13:22 +01:00
parent c02cd80b75
commit 3430a88c72
2 changed files with 8 additions and 9 deletions

View File

@ -1301,9 +1301,9 @@ class Propal extends CommonObject
if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $object->ref_client = ''; if (empty($conf->global->MAIN_KEEP_REF_CUSTOMER_ON_CLONING)) $object->ref_client = '';
if ($conf->global->MAIN_DONT_KEEP_NOTE_ON_CLONING == 1) if ($conf->global->MAIN_DONT_KEEP_NOTE_ON_CLONING == 1)
{ {
$object->note_private = ''; $object->note_private = '';
$object->note_public = ''; $object->note_public = '';
} }
// Create clone // Create clone
$object->context['createfromclone'] = 'createfromclone'; $object->context['createfromclone'] = 'createfromclone';
$result = $object->create($user); $result = $object->create($user);

View File

@ -1006,7 +1006,7 @@ class Facture extends CommonInvoice
*/ */
public function createFromClone(User $user, $fromid = 0) public function createFromClone(User $user, $fromid = 0)
{ {
global $hookmanager; global $conf, $hookmanager;
$error = 0; $error = 0;
@ -1048,11 +1048,10 @@ class Facture extends CommonInvoice
$object->close_code = ''; $object->close_code = '';
$object->close_note = ''; $object->close_note = '';
$object->products = $object->lines; // For backward compatibility $object->products = $object->lines; // For backward compatibility
if ($conf->global->MAIN_DONT_KEEP_NOTE_ON_CLONING == 1) if ($conf->global->MAIN_DONT_KEEP_NOTE_ON_CLONING == 1) {
{ $object->note_private = '';
$object->note_private = ''; $object->note_public = '';
$object->note_public = ''; }
}
// Loop on each line of new invoice // Loop on each line of new invoice
foreach ($object->lines as $i => $line) foreach ($object->lines as $i => $line)