Add fields to link recurring invoice lines with contract origin when it
comes from this.
This commit is contained in:
parent
d715345c82
commit
9cbbf07351
@ -306,8 +306,9 @@ if ($action == 'create')
|
|||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Auto validate the invoice
|
// Auto validate the invoice
|
||||||
print "<tr><td>".$langs->trans("InvoiceAutoValidate")."</td><td>";
|
print "<tr><td>".$langs->trans("StatusOfGeneratedInvoices")."</td><td>";
|
||||||
print $form->selectyesno('auto_validate', 0, 1);
|
$select = array('0'=>$langs->trans('BillStatusDraft'),'1'=>$langs->trans('BillStatusValidated'));
|
||||||
|
print $form->selectarray('auto_validate', $select, GETPOST('auto_validate'));
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
@ -719,31 +720,65 @@ else
|
|||||||
//{
|
//{
|
||||||
// Date when
|
// Date when
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print $form->editfieldkey($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'dayhour');
|
if ($action == 'date_when' || $object->frequency > 0)
|
||||||
|
{
|
||||||
|
print $form->editfieldkey($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'dayhour');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("NextDateToExecution");
|
||||||
|
}
|
||||||
print '</td><td colspan="5">';
|
print '</td><td colspan="5">';
|
||||||
print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'dayhour');
|
if ($action == 'date_when' || $object->frequency > 0)
|
||||||
|
{
|
||||||
|
print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'dayhour');
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|
||||||
// Max period / Rest period
|
// Max period / Rest period
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print $form->editfieldkey($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max, $object, $user->rights->facture->creer);
|
if ($action == 'nb_gen_max' || $object->frequency > 0)
|
||||||
|
{
|
||||||
|
print $form->editfieldkey($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max, $object, $user->rights->facture->creer);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("MaxPeriodNumber");
|
||||||
|
}
|
||||||
print '</td><td colspan="5">';
|
print '</td><td colspan="5">';
|
||||||
print $form->editfieldval($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max, $object, $user->rights->facture->creer);
|
if ($action == 'nb_gen_max' || $object->frequency > 0)
|
||||||
|
{
|
||||||
|
print $form->editfieldval($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max, $object, $user->rights->facture->creer);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '';
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("RestPeriodNumber").'</td>';
|
print '<tr><td>'.$langs->trans("RestPeriodNumber").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print ($object->nb_gen_max-$object->nb_gen_done);
|
if ($object->frequency > 0)
|
||||||
|
{
|
||||||
|
print ($object->nb_gen_max-$object->nb_gen_done);
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Auto validate
|
// Status of generated invoices
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
print $form->editfieldkey($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->rights->facture->creer);
|
if ($action == 'auto_validate' || $object->frequency > 0)
|
||||||
|
print $form->editfieldkey($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->rights->facture->creer);
|
||||||
|
else
|
||||||
|
print $langs->trans("StatusOfGeneratedInvoices");
|
||||||
print '</td><td colspan="5">';
|
print '</td><td colspan="5">';
|
||||||
$select = 'select;0:'.$langs->trans('BillStatusDraft').',1:'.$langs->trans('BillStatusValidated');
|
$select = 'select;0:'.$langs->trans('BillStatusDraft').',1:'.$langs->trans('BillStatusValidated');
|
||||||
print $form->editfieldval($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->rights->facture->creer, $select);
|
if ($action == 'auto_validate' || $object->frequency > 0)
|
||||||
|
{
|
||||||
|
print $form->editfieldval($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->rights->facture->creer, $select);
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
//}
|
//}
|
||||||
@ -869,7 +904,7 @@ else
|
|||||||
/*
|
/*
|
||||||
* List mode
|
* List mode
|
||||||
*/
|
*/
|
||||||
$sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre, f.total, f.tva as total_vat, f.total_ttc";
|
$sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre, f.total, f.tva as total_vat, f.total_ttc, f.frequency";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f";
|
||||||
$sql.= " WHERE f.fk_soc = s.rowid";
|
$sql.= " WHERE f.fk_soc = s.rowid";
|
||||||
$sql.= " AND f.entity = ".$conf->entity;
|
$sql.= " AND f.entity = ".$conf->entity;
|
||||||
@ -894,6 +929,7 @@ else
|
|||||||
print_liste_field_titre($langs->trans("AmountHT"),'','','','','align="right"');
|
print_liste_field_titre($langs->trans("AmountHT"),'','','','','align="right"');
|
||||||
print_liste_field_titre($langs->trans("AmountVAT"),'','','','','align="right"');
|
print_liste_field_titre($langs->trans("AmountVAT"),'','','','','align="right"');
|
||||||
print_liste_field_titre($langs->trans("AmountTTC"),'','','','','align="right"');
|
print_liste_field_titre($langs->trans("AmountTTC"),'','','','','align="right"');
|
||||||
|
print_liste_field_titre($langs->trans("RecurringInvoiceTemplate"),'','','','','align="center"');
|
||||||
print_liste_field_titre(''); // Field may contains ling text
|
print_liste_field_titre(''); // Field may contains ling text
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
@ -917,6 +953,7 @@ else
|
|||||||
print '<td align="right">'.price($objp->total).'</td>'."\n";
|
print '<td align="right">'.price($objp->total).'</td>'."\n";
|
||||||
print '<td align="right">'.price($objp->total_vat).'</td>'."\n";
|
print '<td align="right">'.price($objp->total_vat).'</td>'."\n";
|
||||||
print '<td align="right">'.price($objp->total_ttc).'</td>'."\n";
|
print '<td align="right">'.price($objp->total_ttc).'</td>'."\n";
|
||||||
|
print '<td align="center">'.yn($objp->frequency?1:0).'</td>';
|
||||||
|
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if ($user->rights->facture->creer)
|
if ($user->rights->facture->creer)
|
||||||
|
|||||||
@ -41,7 +41,8 @@ ALTER TABLE llx_facture ADD INDEX idx_facture_fk_statut (fk_statut);
|
|||||||
|
|
||||||
UPDATE llx_projet as p set p.opp_percent = (SELECT percent FROM llx_c_lead_status as cls WHERE cls.rowid = p.fk_opp_status) WHERE p.opp_percent IS NULL AND p.fk_opp_status IS NOT NULL;
|
UPDATE llx_projet as p set p.opp_percent = (SELECT percent FROM llx_c_lead_status as cls WHERE cls.rowid = p.fk_opp_status) WHERE p.opp_percent IS NULL AND p.fk_opp_status IS NOT NULL;
|
||||||
|
|
||||||
|
ALTER TABLE llx_facturedet ADD COLUMN fk_contract_line integer NULL AFTER rang;
|
||||||
|
ALTER TABLE llx_facturedet_rec ADD COLUMN import_key varchar(14);
|
||||||
|
|
||||||
CREATE TABLE llx_website
|
CREATE TABLE llx_website
|
||||||
(
|
(
|
||||||
|
|||||||
@ -57,6 +57,7 @@ create table llx_facturedet
|
|||||||
fk_code_ventilation integer DEFAULT 0 NOT NULL,
|
fk_code_ventilation integer DEFAULT 0 NOT NULL,
|
||||||
special_code integer DEFAULT 0, -- code pour les lignes speciales
|
special_code integer DEFAULT 0, -- code pour les lignes speciales
|
||||||
rang integer DEFAULT 0, -- position of line
|
rang integer DEFAULT 0, -- position of line
|
||||||
|
fk_contract_line integer NULL, -- id of contract line when invoice comes from contract lines
|
||||||
import_key varchar(14),
|
import_key varchar(14),
|
||||||
|
|
||||||
situation_percent real, -- % progression of lines invoicing
|
situation_percent real, -- % progression of lines invoicing
|
||||||
|
|||||||
@ -47,8 +47,9 @@ create table llx_facturedet_rec
|
|||||||
info_bits integer DEFAULT 0, -- TVA NPR ou non
|
info_bits integer DEFAULT 0, -- TVA NPR ou non
|
||||||
special_code integer UNSIGNED DEFAULT 0, -- code pour les lignes speciales
|
special_code integer UNSIGNED DEFAULT 0, -- code pour les lignes speciales
|
||||||
rang integer DEFAULT 0, -- ordre d'affichage
|
rang integer DEFAULT 0, -- ordre d'affichage
|
||||||
fk_contract_line integer NULL, -- id of contract line when predefined invoice comes from contract lines
|
fk_contract_line integer NULL, -- id of contract line when template invoice comes from contract lines
|
||||||
fk_unit integer DEFAULT NULL,
|
fk_unit integer DEFAULT NULL,
|
||||||
|
import_key varchar(14),
|
||||||
|
|
||||||
fk_multicurrency integer,
|
fk_multicurrency integer,
|
||||||
multicurrency_code varchar(255),
|
multicurrency_code varchar(255),
|
||||||
|
|||||||
@ -140,6 +140,7 @@ ErrorCantCancelIfReplacementInvoiceNotValidated=Error, can't cancel an invoice t
|
|||||||
BillFrom=From
|
BillFrom=From
|
||||||
BillTo=To
|
BillTo=To
|
||||||
ActionsOnBill=Actions on invoice
|
ActionsOnBill=Actions on invoice
|
||||||
|
RecurringInvoiceTemplate=Recurring invoice
|
||||||
NotARecurringInvoiceTemplate=Not a recurring template invoice
|
NotARecurringInvoiceTemplate=Not a recurring template invoice
|
||||||
NewBill=New invoice
|
NewBill=New invoice
|
||||||
LastBills=Last %s invoices
|
LastBills=Last %s invoices
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user