FIX Max nb of generation of recurring invoice should not show warning
This commit is contained in:
parent
50d86a7cfd
commit
622042e9b2
@ -1518,7 +1518,7 @@ else
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Date when
|
// Date when (next invoice generation)
|
||||||
print '<tr><td>';
|
print '<tr><td>';
|
||||||
if ($action == 'date_when' || $object->frequency > 0)
|
if ($action == 'date_when' || $object->frequency > 0)
|
||||||
{
|
{
|
||||||
@ -1534,7 +1534,14 @@ else
|
|||||||
print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day', $object->date_when, null, '', '', 0, 'strikeIfMaxNbGenReached');
|
print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day', $object->date_when, null, '', '', 0, 'strikeIfMaxNbGenReached');
|
||||||
}
|
}
|
||||||
//var_dump(dol_print_date($object->date_when+60, 'dayhour').' - '.dol_print_date($now, 'dayhour'));
|
//var_dump(dol_print_date($object->date_when+60, 'dayhour').' - '.dol_print_date($now, 'dayhour'));
|
||||||
if ($action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) print img_warning($langs->trans("Late"));
|
if (! $object->isMaxNbGenReached())
|
||||||
|
{
|
||||||
|
if ($action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) print img_warning($langs->trans("Late"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print img_info($langs->trans("MaxNumberOfGenerationReached"));
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|||||||
@ -598,11 +598,18 @@ if ($resql)
|
|||||||
// Date next generation
|
// Date next generation
|
||||||
if (! empty($arrayfields['f.date_when']['checked']))
|
if (! empty($arrayfields['f.date_when']['checked']))
|
||||||
{
|
{
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print ($objp->frequency ? ($invoicerectmp->isMaxNbGenReached()?'<strike>':'').dol_print_date($db->jdate($objp->date_when),'day').($invoicerectmp->isMaxNbGenReached()?'</strike>':'') : '<span class="opacitymedium">'.$langs->trans('NA').'</span>');
|
print ($objp->frequency ? ($invoicerectmp->isMaxNbGenReached()?'<strike>':'').dol_print_date($db->jdate($objp->date_when),'day').($invoicerectmp->isMaxNbGenReached()?'</strike>':'') : '<span class="opacitymedium">'.$langs->trans('NA').'</span>');
|
||||||
if ($objp->frequency > 0 && $db->jdate($objp->date_when) && $db->jdate($objp->date_when) < $now) print img_warning($langs->trans("Late"));
|
if (! $invoicerectmp->isMaxNbGenReached())
|
||||||
print '</td>';
|
{
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if ($objp->frequency > 0 && $db->jdate($objp->date_when) && $db->jdate($objp->date_when) < $now) print img_warning($langs->trans("Late"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print img_info($langs->trans("MaxNumberOfGenerationReached"));
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (! $i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
if (! empty($arrayfields['f.datec']['checked']))
|
if (! empty($arrayfields['f.datec']['checked']))
|
||||||
{
|
{
|
||||||
@ -629,7 +636,11 @@ if ($resql)
|
|||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if ($user->rights->facture->creer && empty($invoicerectmp->suspended))
|
if ($user->rights->facture->creer && empty($invoicerectmp->suspended))
|
||||||
{
|
{
|
||||||
if (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today)
|
if ($invoicerectmp->isMaxNbGenReached())
|
||||||
|
{
|
||||||
|
print $langs->trans("MaxNumberOfGenerationReached");
|
||||||
|
}
|
||||||
|
elseif (empty($objp->frequency) || $db->jdate($objp->date_when) <= $today)
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&socid='.$objp->socid.'&fac_rec='.$objp->facid.'">';
|
print '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&socid='.$objp->socid.'&fac_rec='.$objp->facid.'">';
|
||||||
print $langs->trans("CreateBill").'</a>';
|
print $langs->trans("CreateBill").'</a>';
|
||||||
|
|||||||
@ -521,3 +521,4 @@ BillCreated=%s bill(s) created
|
|||||||
StatusOfGeneratedDocuments=Status of document generation
|
StatusOfGeneratedDocuments=Status of document generation
|
||||||
DoNotGenerateDoc=Do not generate document file
|
DoNotGenerateDoc=Do not generate document file
|
||||||
AutogenerateDoc=Auto generate document file
|
AutogenerateDoc=Auto generate document file
|
||||||
|
MaxNumberOfGenerationReached=Max number of gen. reached
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user