mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
* FIX #30044 * Update list.php * Update list.php * Update pdf.lib.php * Update list.php * Update list.php * Update list.php * Update list.php * Update list.php * Update list.php * Update list.php * Update list.php * Update list.php * Update list.php --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
@@ -363,6 +363,7 @@ if (empty($reshook)) {
|
||||
|
||||
$nbOrders = is_array($orders) ? count($orders) : 1;
|
||||
|
||||
$currentIndex = 0;
|
||||
foreach ($orders as $id_order) {
|
||||
$cmd = new Commande($db);
|
||||
if ($cmd->fetch($id_order) <= 0) {
|
||||
@@ -373,6 +374,7 @@ if (empty($reshook)) {
|
||||
$objecttmp = new Facture($db);
|
||||
if (!empty($createbills_onebythird) && !empty($TFactThird[$cmd->socid])) {
|
||||
// If option "one bill per third" is set, and an invoice for this thirdparty was already created, we reuse it.
|
||||
$currentIndex++;
|
||||
$objecttmp = $TFactThird[$cmd->socid];
|
||||
} else {
|
||||
// If we want one invoice per order or if there is no first invoice yet for this thirdparty.
|
||||
@@ -389,6 +391,10 @@ if (empty($reshook)) {
|
||||
$objecttmp->ref_client = $cmd->ref_client;
|
||||
}
|
||||
|
||||
if (empty($objecttmp->note_public)) {
|
||||
$objecttmp->note_public = $langs->transnoentities("Orders");
|
||||
}
|
||||
|
||||
$datefacture = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
|
||||
if (empty($datefacture)) {
|
||||
$datefacture = dol_now();
|
||||
@@ -553,6 +559,11 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($currentIndex <= (getDolGlobalInt("MAXREFONDOC") ? getDolGlobalInt("MAXREFONDOC") : 10)) {
|
||||
$objecttmp->note_public = dol_concatdesc($objecttmp->note_public, $langs->transnoentities($cmd->ref).(empty($cmd->ref_client) ? '' : ' ('.$cmd->ref_client.')'));
|
||||
$objecttmp->update($user);
|
||||
}
|
||||
|
||||
//$cmd->classifyBilled($user); // Disabled. This behavior must be set or not using the workflow module.
|
||||
|
||||
if (!empty($createbills_onebythird) && empty($TFactThird[$cmd->socid])) {
|
||||
|
||||
Reference in New Issue
Block a user