FIX : We need to have a different default_ref_supplier for each new fourn invoice
This commit is contained in:
parent
b7e7c95d2a
commit
6480877b99
@ -274,6 +274,8 @@ if (empty($reshook)) {
|
|||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
|
$default_ref_supplier=dol_print_date(dol_now(), '%Y%m%d%H%M%S');
|
||||||
|
|
||||||
foreach ($orders as $id_order) {
|
foreach ($orders as $id_order) {
|
||||||
$cmd = new CommandeFournisseur($db);
|
$cmd = new CommandeFournisseur($db);
|
||||||
if ($cmd->fetch($id_order) <= 0) {
|
if ($cmd->fetch($id_order) <= 0) {
|
||||||
@ -291,7 +293,7 @@ if (empty($reshook)) {
|
|||||||
$objecttmp->fk_project = $cmd->fk_project;
|
$objecttmp->fk_project = $cmd->fk_project;
|
||||||
$objecttmp->multicurrency_code = $cmd->multicurrency_code;
|
$objecttmp->multicurrency_code = $cmd->multicurrency_code;
|
||||||
if (empty($createbills_onebythird)) {
|
if (empty($createbills_onebythird)) {
|
||||||
$objecttmp->ref_supplier = !empty($cmd->ref_supplier) ? $cmd->ref_supplier : dol_print_date(dol_now(), '%Y%m%d%H%M%S');
|
$objecttmp->ref_supplier = !empty($cmd->ref_supplier) ? $cmd->ref_supplier : $default_ref_supplier+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$datefacture = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
$datefacture = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user