Add nb of generation into list of template invoices
This commit is contained in:
parent
423ffefbf3
commit
4eaa1d4f46
@ -2645,7 +2645,7 @@ if ($action == 'create')
|
||||
|
||||
// Public note
|
||||
print '<tr>';
|
||||
print '<td class="border tdtop">';
|
||||
print '<td class="tdtop">';
|
||||
print $form->textwithpicto($langs->trans('NotePublic'), $htmltext);
|
||||
print '</td>';
|
||||
print '<td valign="top" colspan="2">';
|
||||
@ -2656,7 +2656,7 @@ if ($action == 'create')
|
||||
if (empty($user->societe_id))
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td class="border tdtop">';
|
||||
print '<td class="tdtop">';
|
||||
print $form->textwithpicto($langs->trans('NotePrivate'), $htmltext);
|
||||
print '</td>';
|
||||
print '<td valign="top" colspan="2">';
|
||||
|
||||
@ -110,6 +110,7 @@ $arrayfields=array(
|
||||
'f.tva'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>1),
|
||||
'f.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>1),
|
||||
'f.frequency'=>array('label'=>$langs->trans("RecurringInvoiceTemplate"), 'checked'=>1),
|
||||
'f.nb_gen_done'=>array('label'=>$langs->trans("NbGeneration"), 'checked'=>1),
|
||||
'f.date_last_gen'=>array('label'=>$langs->trans("DateLastGeneration"), 'checked'=>1),
|
||||
'f.date_when'=>array('label'=>$langs->trans("NextDateToExecution"), 'checked'=>1),
|
||||
'f.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
||||
@ -948,7 +949,7 @@ if ($action == 'create')
|
||||
// Public note
|
||||
print '<tr>';
|
||||
print '<td class="border tdtop">';
|
||||
print $form->textwithpicto($langs->trans('NotePublic'), $htmltext);
|
||||
print $form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic');
|
||||
print '</td>';
|
||||
print '<td valign="top" colspan="2">';
|
||||
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||
@ -959,7 +960,7 @@ if ($action == 'create')
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td class="border tdtop">';
|
||||
print $form->textwithpicto($langs->trans('NotePrivate'), $htmltext);
|
||||
print $form->textwithpicto($langs->trans('NotePrivate'), $htmltext, 1, 'help', '', 0, 2, 'noteprivate');
|
||||
print '</td>';
|
||||
print '<td valign="top" colspan="2">';
|
||||
$doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, '90%');
|
||||
@ -1250,7 +1251,7 @@ else
|
||||
|
||||
// Note public
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('NotePublic'), $htmltext), 'note_public', $object->note_public, $object, $user->rights->facture->creer);
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic'), 'note_public', $object->note_public, $object, $user->rights->facture->creer);
|
||||
print '</td><td colspan="5">';
|
||||
print $form->editfieldval($langs->trans("NotePublic"), 'note_public', $object->note_public, $object, $user->rights->facture->creer, 'textarea:'.ROWS_4.':60');
|
||||
print '</td>';
|
||||
@ -1258,7 +1259,7 @@ else
|
||||
|
||||
// Note private
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans("NotePrivate"), $htmltext), 'note_private', $object->note_private, $object, $user->rights->facture->creer);
|
||||
print $form->editfieldkey($form->textwithpicto($langs->trans("NotePrivate"), $htmltext, 1, 'help', '', 0, 2, 'noteprivate'), 'note_private', $object->note_private, $object, $user->rights->facture->creer);
|
||||
print '</td><td colspan="5">';
|
||||
print $form->editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $user->rights->facture->creer, 'textarea:'.ROWS_4.':60');
|
||||
print '</td>';
|
||||
@ -1291,16 +1292,17 @@ else
|
||||
print '<div class="ficheaddleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
/*
|
||||
* Recurrence
|
||||
*/
|
||||
$title = $langs->trans("Recurrence");
|
||||
print load_fiche_titre($title, '', 'calendar');
|
||||
//print load_fiche_titre($title, '', 'calendar');
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td colspan="2"><span class="fa fa-calendar"></span> '.$title.'</td></tr>';
|
||||
|
||||
// if "frequency" is empty or = 0, the reccurence is disabled
|
||||
print '<tr><td style="width: 50%">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
@ -1535,7 +1537,7 @@ else
|
||||
* 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, f.frequency,";
|
||||
$sql.= " f.date_last_gen, f.date_when";
|
||||
$sql.= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f";
|
||||
if (! $user->rights->societe->client->voir && ! $socid) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
@ -1646,42 +1648,48 @@ else
|
||||
if (! empty($arrayfields['f.titre']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left">';
|
||||
print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
|
||||
print '<input class="flat" size="6" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Thirpdarty
|
||||
if (! empty($arrayfields['s.nom']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre" align="left"><input class="flat" type="text" size="8" name="search_societe" value="'.$search_societe.'"></td>';
|
||||
print '<td class="liste_titre" align="left"><input class="flat" type="text" size="8" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.total']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_montant_ht" value="'.$search_montant_ht.'">';
|
||||
print '<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.tva']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_montant_vat" value="'.$search_montant_vat.'">';
|
||||
print '<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.total_ttc']['checked']))
|
||||
{
|
||||
// Amount
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.$search_montant_ttc.'">';
|
||||
print '<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).'">';
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.frequency']['checked']))
|
||||
{
|
||||
// Amount
|
||||
// Recurring or not
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print $form->selectyesno('search_frequency', $search_frequency, 1, false, 1);
|
||||
print '</td>';
|
||||
}
|
||||
if (! empty($arrayfields['f.nb_gen_done']['checked']))
|
||||
{
|
||||
// Nb generation
|
||||
print '<td class="liste_titre" align="center">';
|
||||
print '</td>';
|
||||
}
|
||||
// Date invoice
|
||||
if (! empty($arrayfields['f.date_last_gen']['checked']))
|
||||
{
|
||||
@ -1753,6 +1761,10 @@ else
|
||||
print_liste_field_titre($langs->trans("AmountVAT"),$_SERVER['PHP_SELF'],"f.tva","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER['PHP_SELF'],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("RecurringInvoiceTemplate"),$_SERVER['PHP_SELF'],"f.frequency","",$param,'align="center"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['f.nb_gen_done']['checked']))
|
||||
{
|
||||
print_liste_field_titre($langs->trans("NbOfGenerationDone"),$_SERVER['PHP_SELF'],"f.nb_gen_done","",$param,'align="center"',$sortfield,$sortorder);
|
||||
}
|
||||
print_liste_field_titre($langs->trans("DateLastGeneration"),$_SERVER['PHP_SELF'],"f.date_last_gen","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre($langs->trans("NextDateToExecution"),$_SERVER['PHP_SELF'],"f.date_when","",$param,'align="center"',$sortfield,$sortorder);
|
||||
print_liste_field_titre(''); // Field may contains ling text
|
||||
@ -1765,21 +1777,24 @@ else
|
||||
while ($i < min($num,$limit))
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
$var=!$var;
|
||||
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td><a href="'.$_SERVER['PHP_SELF'].'?id='.$objp->facid.'">'.img_object($langs->trans("ShowBill"),"bill").' '.$objp->titre;
|
||||
print "</a></td>\n";
|
||||
|
||||
$companystatic->id=$objp->socid;
|
||||
$companystatic->name=$objp->name;
|
||||
print '<td>'.$companystatic->getNomUrl(1,'customer').'</td>';
|
||||
print '<td class="tdoverflowmax200">'.$companystatic->getNomUrl(1,'customer').'</td>';
|
||||
|
||||
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_ttc).'</td>'."\n";
|
||||
print '<td align="center">'.yn($objp->frequency?1:0).'</td>';
|
||||
if (! empty($arrayfields['f.nb_gen_done']['checked']))
|
||||
{
|
||||
print '<td align="center">'.($objp->frequency ? $objp->nb_gen_done.($objp->nb_gen_max>0?' / '. $objp->nb_gen_max:'') : '').'</td>';
|
||||
}
|
||||
print '<td align="center">'.($objp->frequency ? dol_print_date($objp->date_last_gen,'day') : '').'</td>';
|
||||
print '<td align="center">'.($objp->frequency ? dol_print_date($objp->date_when,'day') : '').'</td>';
|
||||
|
||||
|
||||
@ -404,7 +404,7 @@ class Form
|
||||
* @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span
|
||||
* @param string $incbefore Include code before the text
|
||||
* @param int $noencodehtmltext Do not encode into html entity the htmltext
|
||||
* @param int $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key)
|
||||
* @param string $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key)
|
||||
* @return string Code html du tooltip (texte+picto)
|
||||
* @see Use function textwithpicto if you can.
|
||||
* TODO Move this as static as soon as everybody use textwithpicto or @Form::textwithtooltip
|
||||
@ -487,7 +487,7 @@ class Form
|
||||
* @param string $extracss Add a CSS style to td, div or span tag
|
||||
* @param int $noencodehtmltext Do not encode into html entity the htmltext
|
||||
* @param int $notabs 0=Include table and tr tags, 1=Do not include table and tr tags, 2=use div, 3=use span
|
||||
* @param int $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key)
|
||||
* @param string $tooltiptrigger ''=Tooltip on hover, 'abc'=Tooltip on click (abc is a unique key)
|
||||
* @return string HTML code of text, picto, tooltip
|
||||
*/
|
||||
function textwithpicto($text, $htmltext, $direction = 1, $type = 'help', $extracss = '', $noencodehtmltext = 0, $notabs = 2, $tooltiptrigger='')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user