Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: htdocs/compta/facture/invoicetemplate_list.php htdocs/langs/en_US/bills.lang
This commit is contained in:
commit
faea6861c3
@ -63,6 +63,8 @@ print load_fiche_titre($langs->trans("AccountancyArea"), '', 'title_accountancy'
|
|||||||
|
|
||||||
$step = 0;
|
$step = 0;
|
||||||
|
|
||||||
|
if ($conf->accounting->enabled)
|
||||||
|
{
|
||||||
print $langs->trans("AccountancyAreaDescIntro")."<br>\n";
|
print $langs->trans("AccountancyAreaDescIntro")."<br>\n";
|
||||||
print "<br>\n";print "<br>\n";
|
print "<br>\n";print "<br>\n";
|
||||||
|
|
||||||
@ -168,6 +170,11 @@ print "<br>\n";
|
|||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64+$step))."<br>\n";
|
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64+$step))."<br>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans("Module10Desc")."<br>\n";
|
||||||
|
}
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
@ -992,6 +992,7 @@ class FactureRec extends CommonInvoice
|
|||||||
$sql.= " AND (date_when IS NULL OR date_when <= '".$db->idate($today)."')";
|
$sql.= " AND (date_when IS NULL OR date_when <= '".$db->idate($today)."')";
|
||||||
$sql.= ' AND (nb_gen_done < nb_gen_max OR nb_gen_max = 0)';
|
$sql.= ' AND (nb_gen_done < nb_gen_max OR nb_gen_max = 0)';
|
||||||
$sql.= ' AND suspended = 0';
|
$sql.= ' AND suspended = 0';
|
||||||
|
$sql.= ' AND entity = '.$conf->entity; // MUST STAY = $conf->entity here
|
||||||
$sql.= $db->order('entity', 'ASC');
|
$sql.= $db->order('entity', 'ASC');
|
||||||
//print $sql;exit;
|
//print $sql;exit;
|
||||||
|
|
||||||
@ -1006,7 +1007,7 @@ class FactureRec extends CommonInvoice
|
|||||||
|
|
||||||
$saventity = $conf->entity;
|
$saventity = $conf->entity;
|
||||||
|
|
||||||
while ($i < $num) // Loop on each template invoice
|
while ($i < $num) // Loop on each template invoice. If $num = 0, test is false at first pass.
|
||||||
{
|
{
|
||||||
$line = $db->fetch_object($resql);
|
$line = $db->fetch_object($resql);
|
||||||
|
|
||||||
@ -1015,6 +1016,8 @@ class FactureRec extends CommonInvoice
|
|||||||
$facturerec = new FactureRec($db);
|
$facturerec = new FactureRec($db);
|
||||||
$facturerec->fetch($line->rowid);
|
$facturerec->fetch($line->rowid);
|
||||||
|
|
||||||
|
if ($facturerec->id > 0)
|
||||||
|
{
|
||||||
// Set entity context
|
// Set entity context
|
||||||
$conf->entity = $facturerec->entity;
|
$conf->entity = $facturerec->entity;
|
||||||
|
|
||||||
@ -1058,6 +1061,14 @@ class FactureRec extends CommonInvoice
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
$this->error="Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity."\n";
|
||||||
|
$this->errors[]="Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity;
|
||||||
|
dol_syslog("createRecurringInvoices Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity);
|
||||||
|
}
|
||||||
|
|
||||||
if (! $error && $invoiceidgenerated >= 0)
|
if (! $error && $invoiceidgenerated >= 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1497,7 +1497,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)
|
||||||
{
|
{
|
||||||
@ -1513,7 +1513,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 (! $object->isMaxNbGenReached())
|
||||||
|
{
|
||||||
if ($action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) print img_warning($langs->trans("Late"));
|
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>';
|
||||||
|
|
||||||
|
|||||||
@ -601,7 +601,14 @@ if ($resql)
|
|||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
print '<div class="nowraponall">';
|
print '<div class="nowraponall">';
|
||||||
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 (! $invoicerectmp->isMaxNbGenReached())
|
||||||
|
{
|
||||||
if ($objp->frequency > 0 && $db->jdate($objp->date_when) && $db->jdate($objp->date_when) < $now) print img_warning($langs->trans("Late"));
|
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 '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
if (! $i) $totalarray['nbfield']++;
|
if (! $i) $totalarray['nbfield']++;
|
||||||
@ -631,7 +638,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>';
|
||||||
|
|||||||
@ -624,7 +624,7 @@ else
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mc->getInfo($obj->entity);
|
$mc->getInfo($object->entity);
|
||||||
print $mc->label;
|
print $mc->label;
|
||||||
}
|
}
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|||||||
@ -1050,8 +1050,9 @@ class Cronjob extends CommonObject
|
|||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::run_jobs START ".$this->objectname."->".$this->methodename."(".$this->params.");", LOG_DEBUG);
|
dol_syslog(get_class($this)."::run_jobs START ".$this->objectname."->".$this->methodename."(".$this->params.");", LOG_DEBUG);
|
||||||
|
|
||||||
// Create Object for the call module
|
// Create Object for the called module
|
||||||
$object = new $this->objectname($this->db);
|
$object = new $this->objectname($this->db);
|
||||||
|
if ($this->entity > 0) $object->entity = $this->entity; // We work on a dedicated entity
|
||||||
|
|
||||||
$params_arr = array_map('trim', explode(",",$this->params));
|
$params_arr = array_map('trim', explode(",",$this->params));
|
||||||
|
|
||||||
|
|||||||
@ -90,7 +90,7 @@ if ($id > 0 || ! empty($ref))
|
|||||||
|
|
||||||
print '<div class="fichecenter">';
|
print '<div class="fichecenter">';
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
var_dump($value_public);
|
|
||||||
$cssclass="titlefield";
|
$cssclass="titlefield";
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
|
||||||
|
|
||||||
|
|||||||
@ -2208,6 +2208,7 @@ elseif (! empty($object->id))
|
|||||||
// modified by hook
|
// modified by hook
|
||||||
if (empty($reshook))
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
|
$object->fetchObjectLinked(); // Links are used to show or not button, so we load them now.
|
||||||
|
|
||||||
// Validate
|
// Validate
|
||||||
if ($object->statut == 0 && $num > 0)
|
if ($object->statut == 0 && $num > 0)
|
||||||
@ -2336,7 +2337,7 @@ elseif (! empty($object->id))
|
|||||||
// Ship
|
// Ship
|
||||||
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER))
|
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER))
|
||||||
{
|
{
|
||||||
if (in_array($object->statut, array(3,4))) {
|
if (in_array($object->statut, array(3,4,5))) {
|
||||||
if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->receptionner) {
|
if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->receptionner) {
|
||||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/fourn/commande/dispatch.php?id=' . $object->id . '">' . $langs->trans('ReceiveProducts') . '</a></div>';
|
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/fourn/commande/dispatch.php?id=' . $object->id . '">' . $langs->trans('ReceiveProducts') . '</a></div>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -532,3 +532,4 @@ AutoFillDateFrom=Set start date for service line with invoice date
|
|||||||
AutoFillDateFromShort=Set start date
|
AutoFillDateFromShort=Set start date
|
||||||
AutoFillDateTo=Set end date for service line with next invoice date
|
AutoFillDateTo=Set end date for service line with next invoice date
|
||||||
AutoFillDateToShort=Set end date
|
AutoFillDateToShort=Set end date
|
||||||
|
MaxNumberOfGenerationReached=Max number of gen. reached
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user