FIX : ref_client doesn't exists on supplier invoice, then ref_fourn needs to have a default value when we want to bill several supplier orders

This commit is contained in:
Gauthier PC portable 024 2022-03-29 16:02:39 +02:00
parent a415711a66
commit b7e7c95d2a

View File

@ -291,7 +291,7 @@ if (empty($reshook)) {
$objecttmp->fk_project = $cmd->fk_project;
$objecttmp->multicurrency_code = $cmd->multicurrency_code;
if (empty($createbills_onebythird)) {
$objecttmp->ref_client = $cmd->ref_client;
$objecttmp->ref_supplier = !empty($cmd->ref_supplier) ? $cmd->ref_supplier : dol_print_date(dol_now(), '%Y%m%d%H%M%S');
}
$datefacture = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));