FIX Value of payment term and project are not set on correct default
value when invoice generated from template.
This commit is contained in:
parent
079ed88119
commit
64dc44b796
@ -1995,8 +1995,10 @@ if ($action == 'create')
|
|||||||
if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code;
|
if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) $currency_code = $soc->multicurrency_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($soc->id)) $absolute_discount = $soc->getAvailableDiscounts();
|
if (!empty($soc->id)) $absolute_discount = $soc->getAvailableDiscounts();
|
||||||
|
$note_public = $object->getDefaultCreateValueFor('note_public', (is_object($objectsrc)?$objectsrc->note_public:null));
|
||||||
|
$note_private = $object->getDefaultCreateValueFor('note_private', ((! empty($origin) && ! empty($originid) && is_object($objectsrc))?$objectsrc->note_private:null));
|
||||||
|
|
||||||
if (! empty($conf->use_javascript_ajax))
|
if (! empty($conf->use_javascript_ajax))
|
||||||
{
|
{
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||||
@ -2077,13 +2079,19 @@ if ($action == 'create')
|
|||||||
}
|
}
|
||||||
print '</tr>' . "\n";
|
print '</tr>' . "\n";
|
||||||
|
|
||||||
// Predefined invoices
|
// Overwrite value if creation of invoice is from a predefined invoice
|
||||||
if (empty($origin) && empty($originid) && GETPOST('fac_rec','int') > 0)
|
if (empty($origin) && empty($originid) && GETPOST('fac_rec','int') > 0)
|
||||||
{
|
{
|
||||||
$invoice_predefined = new FactureRec($db);
|
$invoice_predefined = new FactureRec($db);
|
||||||
$invoice_predefined->fetch(GETPOST('fac_rec','int'));
|
$invoice_predefined->fetch(GETPOST('fac_rec','int'));
|
||||||
|
|
||||||
$dateinvoice = $invoice_predefined->date_when; // To use next gen date by default later
|
$dateinvoice = $invoice_predefined->date_when; // To use next gen date by default later
|
||||||
|
if (empty($projectid)) $projectid = $invoice_predefined->fk_project;
|
||||||
|
$cond_reglement_id = $invoice_predefined->cond_reglement_id;
|
||||||
|
$mode_reglement_id = $invoice_predefined->mode_reglement_id;
|
||||||
|
$fk_account = $invoice_predefined->fk_account;
|
||||||
|
$note_public = $invoice_predefined->note_public;
|
||||||
|
$note_private = $invoice_predefined->note_private;
|
||||||
|
|
||||||
$sql = 'SELECT r.rowid, r.titre, r.total_ttc';
|
$sql = 'SELECT r.rowid, r.titre, r.total_ttc';
|
||||||
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as r';
|
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_rec as r';
|
||||||
@ -2467,7 +2475,6 @@ if ($action == 'create')
|
|||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>';
|
print '<td class="border" valign="top">' . $langs->trans('NotePublic') . '</td>';
|
||||||
print '<td valign="top" colspan="2">';
|
print '<td valign="top" colspan="2">';
|
||||||
$note_public = $object->getDefaultCreateValueFor('note_public', (is_object($objectsrc)?$objectsrc->note_public:null));
|
|
||||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
|
|
||||||
@ -2477,7 +2484,6 @@ if ($action == 'create')
|
|||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="border" valign="top">' . $langs->trans('NotePrivate') . '</td>';
|
print '<td class="border" valign="top">' . $langs->trans('NotePrivate') . '</td>';
|
||||||
print '<td valign="top" colspan="2">';
|
print '<td valign="top" colspan="2">';
|
||||||
$note_private = $object->getDefaultCreateValueFor('note_private', ((! empty($origin) && ! empty($originid) && is_object($objectsrc))?$objectsrc->note_private:null));
|
|
||||||
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||||
print $doleditor->Create(1);
|
print $doleditor->Create(1);
|
||||||
// print '<textarea name="note_private" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'.</textarea>
|
// print '<textarea name="note_private" wrap="soft" cols="70" rows="'.ROWS_3.'">'.$note_private.'.</textarea>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user