NEW template invoices support substition key
__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__ __INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__
This commit is contained in:
parent
3e6ac36025
commit
9253207842
@ -286,6 +286,8 @@ class Facture extends CommonInvoice
|
||||
$result=$_facrec->fetch($this->fac_rec);
|
||||
$result=$_facrec->fetchObjectLinked(); // This load $_facrec->linkedObjectsIds
|
||||
|
||||
$originaldatewhen = $_facrec->date_when;
|
||||
|
||||
$this->socid = $_facrec->socid; // Invoice created on same thirdparty than template
|
||||
$this->entity = $_facrec->entity; // Invoice created in same entity than template
|
||||
|
||||
@ -361,8 +363,13 @@ class Facture extends CommonInvoice
|
||||
'__INVOICE_PREVIOUS_YEAR__' => dol_print_date(dol_time_plus_duree($this->date, -1, 'y'), '%Y'),
|
||||
'__INVOICE_YEAR__' => dol_print_date($this->date, '%Y'),
|
||||
'__INVOICE_NEXT_YEAR__' => dol_print_date(dol_time_plus_duree($this->date, 1, 'y'), '%Y'),
|
||||
// Only for tempalte invoice
|
||||
'__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__' => dol_print_date($originaldatewhen, 'dayhour'),
|
||||
'__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__' => dol_print_date(dol_time_plus_duree($originaldatewhen, $_facrec->frequency, $_facrec->unit_frequency), 'dayhour')
|
||||
);
|
||||
|
||||
//var_dump($substitutionarray);exit;
|
||||
|
||||
$substitutionisok=true;
|
||||
complete_substitutions_array($substitutionarray, $outputlangs);
|
||||
|
||||
|
||||
@ -995,7 +995,10 @@ if ($action == 'create')
|
||||
'__INVOICE_NEXT_MONTH_TEXT__' => $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B').')',
|
||||
'__INVOICE_PREVIOUS_YEAR__' => $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'y'),'%Y').')',
|
||||
'__INVOICE_YEAR__' => $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date,'%Y').')',
|
||||
'__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'),'%Y').')'
|
||||
'__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'),'%Y').')',
|
||||
// Only on template invoices
|
||||
'__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__' => $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')',
|
||||
'__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__' => $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency),'dayhour').')',
|
||||
);
|
||||
$substitutionarray['__(TransKey)__']=$langs->trans("TransKey");
|
||||
|
||||
@ -1314,7 +1317,10 @@ else
|
||||
'__INVOICE_NEXT_MONTH_TEXT__' => $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B').')',
|
||||
'__INVOICE_PREVIOUS_YEAR__' => $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'),'%Y').')',
|
||||
'__INVOICE_YEAR__' => $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample,'%Y').')',
|
||||
'__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'),'%Y').')'
|
||||
'__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'),'%Y').')',
|
||||
// Only on template invoices
|
||||
'__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__' => $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')',
|
||||
'__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__' => $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency),'dayhour').')',
|
||||
);
|
||||
$substitutionarray['__(TransKey)__']=$langs->trans("TransKey");
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user