Fix RUM number if customer account not defined

This commit is contained in:
Laurent Destailleur 2022-10-02 22:32:05 +02:00
parent eebb8290f2
commit c0dac5d5db

View File

@ -1709,7 +1709,7 @@ class BonPrelevement extends CommonObject
{
global $langs;
$pre = substr(dol_string_nospecial(dol_string_unaccent($langs->transnoentitiesnoconv('RUM'))), 0, 3); // Must always be on 3 char ('RUM' or 'UMR'. This is a protection against bad translation)
return $pre.'-'.$row_code_client.'-'.$row_drum.'-'.date('U', $row_datec);
return $pre.($row_code_client ? '-'.$row_code_client : '').'-'.$row_drum.'-'.date('U', $row_datec);
}
@ -1823,8 +1823,8 @@ class BonPrelevement extends CommonObject
$Rowing = sprintf("%010d", $row_idfac);
// Define value for RUM
// Example: RUMCustomerCode-CustomerBankAccountId-01424448606 (note: Date is date of creation of CustomerBankAccountId)
$Rum = empty($row_rum) ? $this->buildRumNumber($row_code_client, $row_datec, $row_drum) : $row_rum;
// Example: RUM-CustomerCode-CustomerBankAccountId-01424448606 (note: Date is the timestamp of the date of creation of CustomerBankAccountId)
$Rum = (empty($row_rum) ? $this->buildRumNumber($row_code_client, $row_datec, $row_drum) : $row_rum);
// Define date of RUM signature
$DtOfSgntr = dol_print_date($row_datec, '%Y-%m-%d');