diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php
index 270a6b1ab09..cad9547ec4c 100644
--- a/htdocs/accountancy/index.php
+++ b/htdocs/accountancy/index.php
@@ -63,111 +63,118 @@ print load_fiche_titre($langs->trans("AccountancyArea"), '', 'title_accountancy'
$step = 0;
-print $langs->trans("AccountancyAreaDescIntro")."
\n";
-print "
\n";print "
\n";
-
-print_fiche_titre(' '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."
\n";
-print '
';
-print "
\n";
-
-// STEPS
-$step++;
-print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("AccountingJournals").'');
-print "
\n";
-$step++;
-print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").'');
-print "
\n";
-$step++;
-print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").'');
-print "
\n";
-
-print "
\n";
-print $langs->trans("AccountancyAreaDescActionOnceBis");
-print "
\n";
-print "
\n";
-
-$step++;
-print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'');
-print "
\n";
-
-$step++;
-print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuBankAccounts").'')."\n";
-print "
\n";
-
-$step++;
-$textlink = ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuVatAccounts").'';
-print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
-print "
\n";
-if (! empty($conf->tax->enabled))
+if ($conf->accounting->enabled)
{
- $textlink = ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuTaxAccounts").'';
- $step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
- print "
\n";
+ print $langs->trans("AccountancyAreaDescIntro")."
\n";
+ print "
\n";print "
\n";
+
+ print_fiche_titre(' '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."
\n";
+ print '
';
+ print "
\n";
+
+ // STEPS
+ $step++;
+ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("AccountingJournals").'');
+ print "
\n";
+ $step++;
+ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Pcg_version").'');
+ print "
\n";
+ $step++;
+ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("Chartofaccounts").'');
+ print "
\n";
+
+ print "
\n";
+ print $langs->trans("AccountancyAreaDescActionOnceBis");
+ print "
\n";
+ print "
\n";
+
+ $step++;
+ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'');
+ print "
\n";
+
+ $step++;
+ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuBankAccounts").'')."\n";
+ print "
\n";
+
+ $step++;
+ $textlink = ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuVatAccounts").'';
+ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
+ print "
\n";
+ if (! empty($conf->tax->enabled))
+ {
+ $textlink = ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup").'-'.$langs->transnoentitiesnoconv("MenuTaxAccounts").'';
+ $step++;
+ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
+ print "
\n";
+ }
+ /*if (! empty($conf->salaries->enabled))
+ {
+ $step++;
+ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'');
+ // htdocs/admin/salaries.php
+ print "
\n";
+ print "
\n";
+ }*/
+ if (! empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
+ {
+ $step++;
+ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'');
+ print "
\n";
+ }
+ /*
+ if (! empty($conf->loan->enabled))
+ {
+ $step++;
+ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, ''.$langs->transnoentitiesnoconv("MenuSpecialExpenses").'-'.$langs->transnoentitiesnoconv("Loans").' '.$langs->transnoentitiesnoconv("or").' '.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'');
+ print "
\n";
+ }
+ if (! empty($conf->don->enabled))
+ {
+ $step++;
+ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDonationAccounts").'');
+ print "
\n";
+ }*/
+
+ $step++;
+ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("ProductsBinding").'');
+ print "
\n";
+
+
+ print '
';
+
+
+ print "
\n";
+ print_fiche_titre(' '.$langs->trans("AccountancyAreaDescActionFreq"), '', '');
+ print '
';
+ print "
\n";
+ $step = 0;
+
+ $langs->loadLangs(array('bills', 'trips'));
+
+ $step++;
+ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), ''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'')."\n";
+ print "
\n";
+
+ $step++;
+ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), ''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'')."\n";
+ print "
\n";
+
+ $step++;
+ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), ''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'')."\n";
+ print "
\n";
+
+ $step++;
+ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("Journalization"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n";
+ print "
\n";
+
+ $step++;
+ print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64+$step))."
\n";
+ print "
\n";
}
-/*if (! empty($conf->salaries->enabled))
+else
{
- $step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, ''.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'');
- // htdocs/admin/salaries.php
- print "
\n";
- print "
\n";
-}*/
-if (! empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
-{
- $step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'');
- print "
\n";
+ print $langs->trans("Module10Desc")."
\n";
}
-/*
-if (! empty($conf->loan->enabled))
-{
- $step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, ''.$langs->transnoentitiesnoconv("MenuSpecialExpenses").'-'.$langs->transnoentitiesnoconv("Loans").' '.$langs->transnoentitiesnoconv("or").' '.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'');
- print "
\n";
-}
-if (! empty($conf->don->enabled))
-{
- $step++;
- print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDonationAccounts").'');
- print "
\n";
-}*/
-
-$step++;
-print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("ProductsBinding").'');
-print "
\n";
-
-
-print '
';
-
-
-print "
\n";
-print_fiche_titre(' '.$langs->trans("AccountancyAreaDescActionFreq"), '', '');
-print '
';
-print "
\n";
-$step = 0;
-
-$langs->loadLangs(array('bills', 'trips'));
-
-$step++;
-print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsCustomers"), ''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("CustomersVentilation").'')."\n";
-print "
\n";
-
-$step++;
-print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("BillsSuppliers"), ''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("SuppliersVentilation").'')."\n";
-print "
\n";
-
-$step++;
-print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64+$step), $langs->transnoentitiesnoconv("ExpenseReports"), ''.$langs->transnoentitiesnoconv("MenuAccountancy")."-".$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'')."\n";
-print "
\n";
-
-$step++;
-print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64+$step), $langs->transnoentitiesnoconv("Journalization"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n";
-print "
\n";
-
-$step++;
-print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64+$step))."
\n";
-print "
\n";
llxFooter();
$db->close();
diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php
index aebce8e4b07..5a4360e327c 100644
--- a/htdocs/compta/facture/class/facture-rec.class.php
+++ b/htdocs/compta/facture/class/facture-rec.class.php
@@ -992,6 +992,7 @@ class FactureRec extends CommonInvoice
$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 suspended = 0';
+ $sql.= ' AND entity = '.$conf->entity; // MUST STAY = $conf->entity here
$sql.= $db->order('entity', 'ASC');
//print $sql;exit;
@@ -1006,7 +1007,7 @@ class FactureRec extends CommonInvoice
$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);
@@ -1015,49 +1016,59 @@ class FactureRec extends CommonInvoice
$facturerec = new FactureRec($db);
$facturerec->fetch($line->rowid);
- // Set entity context
- $conf->entity = $facturerec->entity;
+ if ($facturerec->id > 0)
+ {
+ // Set entity context
+ $conf->entity = $facturerec->entity;
- dol_syslog("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref.", entity=".$facturerec->entity);
+ dol_syslog("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref.", entity=".$facturerec->entity);
- $error=0;
+ $error=0;
- $facture = new Facture($db);
- $facture->fac_rec = $facturerec->id; // We will create $facture from this recurring invoice
- $facture->fk_fac_rec_source = $facturerec->id; // We will create $facture from this recurring invoice
+ $facture = new Facture($db);
+ $facture->fac_rec = $facturerec->id; // We will create $facture from this recurring invoice
+ $facture->fk_fac_rec_source = $facturerec->id; // We will create $facture from this recurring invoice
- $facture->type = self::TYPE_STANDARD;
- $facture->brouillon = 1;
- $facture->date = (empty($facturerec->date_when)?$now:$facturerec->date_when); // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later.
- $facture->socid = $facturerec->socid;
+ $facture->type = self::TYPE_STANDARD;
+ $facture->brouillon = 1;
+ $facture->date = (empty($facturerec->date_when)?$now:$facturerec->date_when); // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later.
+ $facture->socid = $facturerec->socid;
- $invoiceidgenerated = $facture->create($user);
- if ($invoiceidgenerated <= 0)
- {
- $this->errors = $facture->errors;
- $this->error = $facture->error;
- $error++;
- }
- if (! $error && $facturerec->auto_validate)
- {
- $result = $facture->validate($user);
- if ($result <= 0)
- {
- $this->errors = $facture->errors;
- $this->error = $facture->error;
- $error++;
- }
- }
- if (! $error && $facturerec->generate_pdf)
- {
- $result = $facture->generateDocument($facturerec->modelpdf, $langs);
- if ($result <= 0)
- {
- $this->errors = $facture->errors;
- $this->error = $facture->error;
- $error++;
- }
- }
+ $invoiceidgenerated = $facture->create($user);
+ if ($invoiceidgenerated <= 0)
+ {
+ $this->errors = $facture->errors;
+ $this->error = $facture->error;
+ $error++;
+ }
+ if (! $error && $facturerec->auto_validate)
+ {
+ $result = $facture->validate($user);
+ if ($result <= 0)
+ {
+ $this->errors = $facture->errors;
+ $this->error = $facture->error;
+ $error++;
+ }
+ }
+ if (! $error && $facturerec->generate_pdf)
+ {
+ $result = $facture->generateDocument($facturerec->modelpdf, $langs);
+ if ($result <= 0)
+ {
+ $this->errors = $facture->errors;
+ $this->error = $facture->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)
{
diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php
index 33132620662..3175a70a47c 100644
--- a/htdocs/compta/facture/fiche-rec.php
+++ b/htdocs/compta/facture/fiche-rec.php
@@ -1497,7 +1497,7 @@ else
}
print '';
- // Date when
+ // Date when (next invoice generation)
print '| ';
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');
}
//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 ' | ';
print '
';
diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php
index 0a2b9f72d60..4d88d29999f 100644
--- a/htdocs/compta/facture/invoicetemplate_list.php
+++ b/htdocs/compta/facture/invoicetemplate_list.php
@@ -598,13 +598,20 @@ if ($resql)
// Date next generation
if (! empty($arrayfields['f.date_when']['checked']))
{
- print '';
- print ' ';
- print ($objp->frequency ? ($invoicerectmp->isMaxNbGenReached()?'':'').dol_print_date($db->jdate($objp->date_when),'day').($invoicerectmp->isMaxNbGenReached()?'':'') : ''.$langs->trans('NA').'');
- if ($objp->frequency > 0 && $db->jdate($objp->date_when) && $db->jdate($objp->date_when) < $now) print img_warning($langs->trans("Late"));
- print ' ';
- print ' | ';
- if (! $i) $totalarray['nbfield']++;
+ print '';
+ print ' ';
+ print ($objp->frequency ? ($invoicerectmp->isMaxNbGenReached()?'':'').dol_print_date($db->jdate($objp->date_when),'day').($invoicerectmp->isMaxNbGenReached()?'':'') : ''.$langs->trans('NA').'');
+ if (! $invoicerectmp->isMaxNbGenReached())
+ {
+ 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 ' ';
+ print ' | ';
+ if (! $i) $totalarray['nbfield']++;
}
if (! empty($arrayfields['f.datec']['checked']))
{
@@ -631,7 +638,11 @@ if ($resql)
print '';
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 '';
print $langs->trans("CreateBill").'';
diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php
index 707b75b95fe..7730f6aafe4 100644
--- a/htdocs/cron/card.php
+++ b/htdocs/cron/card.php
@@ -624,7 +624,7 @@ else
}
else
{
- $mc->getInfo($obj->entity);
+ $mc->getInfo($object->entity);
print $mc->label;
}
print " | ";
diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php
index aeb0d7229b4..6991891c5b8 100644
--- a/htdocs/cron/class/cronjob.class.php
+++ b/htdocs/cron/class/cronjob.class.php
@@ -1050,8 +1050,9 @@ class Cronjob extends CommonObject
{
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);
+ if ($this->entity > 0) $object->entity = $this->entity; // We work on a dedicated entity
$params_arr = array_map('trim', explode(",",$this->params));
diff --git a/htdocs/expensereport/note.php b/htdocs/expensereport/note.php
index a715d85f6a6..063406b1878 100644
--- a/htdocs/expensereport/note.php
+++ b/htdocs/expensereport/note.php
@@ -90,7 +90,7 @@ if ($id > 0 || ! empty($ref))
print '';
print '
';
-var_dump($value_public);
+
$cssclass="titlefield";
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index b9a1b7b0fa1..cec2b306c4e 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -2208,6 +2208,7 @@ elseif (! empty($object->id))
// modified by hook
if (empty($reshook))
{
+ $object->fetchObjectLinked(); // Links are used to show or not button, so we load them now.
// Validate
if ($object->statut == 0 && $num > 0)
@@ -2336,7 +2337,7 @@ elseif (! empty($object->id))
// Ship
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) {
print '
';
} else {
diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang
index f92e17321b6..8471cd22fe6 100644
--- a/htdocs/langs/en_US/bills.lang
+++ b/htdocs/langs/en_US/bills.lang
@@ -532,3 +532,4 @@ AutoFillDateFrom=Set start date for service line with invoice date
AutoFillDateFromShort=Set start date
AutoFillDateTo=Set end date for service line with next invoice date
AutoFillDateToShort=Set end date
+MaxNumberOfGenerationReached=Max number of gen. reached