More debug info

This commit is contained in:
Laurent Destailleur 2026-02-07 22:28:11 +01:00
parent a48485195f
commit 6bc3bb0761
3 changed files with 12 additions and 2 deletions

View file

@ -2068,6 +2068,10 @@ class FactureRec extends CommonInvoice
}
if (!$notrigger) {
if (empty($this->context['actionmsgmore'])) {
$this->context['actionmsgmore'] = 'Trigger called by setNextDate';
}
// Call trigger
$result = $this->call_trigger('BILLREC_MODIFY', $user);
if ($result < 0) {

View file

@ -637,8 +637,10 @@ class Facture extends CommonInvoice
$_facrec->date_when = $now;
}
$next_date = $_facrec->getNextDate(); // Calculate next date
$result = $_facrec->setValueFrom('date_last_gen', $now, '', null, 'date', '', $user, '');
//$_facrec->setValueFrom('nb_gen_done', $_facrec->nb_gen_done + 1); // Not required, +1 already included into setNextDate when second param is 1.
$result = $_facrec->setNextDate($next_date, 1);
}
@ -808,8 +810,8 @@ class Facture extends CommonInvoice
}
// Propagate contacts
if (!$error && $this->id && getDolGlobalString('MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN') && !empty($this->origin) && !empty($this->origin_id)) { // Get contact from origin object
$originforcontact = $this->origin;
if (!$error && $this->id && getDolGlobalString('MAIN_PROPAGATE_CONTACTS_FROM_ORIGIN') && (!empty($this->origin_type) || !empty($this->origin)) && !empty($this->origin_id)) { // Get contact from origin object
$originforcontact = empty($this->origin_type) ? $this->origin : $this->origin_type;
$originidforcontact = $this->origin_id;
if ($originforcontact == 'shipping') { // shipment and order share the same contacts. If creating from shipment we take data of order
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';

View file

@ -2359,6 +2359,10 @@ abstract class CommonObject
$this->oldcopy->$field = $oldvalue;
}
if (empty($this->context['actionmsgmore'])) {
$this->context['actionmsgmore'] = 'Trigger called by setValueFrom';
}
if ($result >= 0) {
$result = $this->call_trigger($trigkey, (!empty($fuser) && is_object($fuser)) ? $fuser : $user); // This may set this->errors
}