fix: when invoice is created by WORKFLOW_ORDER_AUTOCREATE_INVOICE on ORDER_CLOSE, the invoice must have the default bank account of the thirdparty is it's empty on order (#29462)
* fix: when invoice is created by WORKFLOW_ORDER_AUTOCREATE_INVOICE on ORDER_CLOSE, the invoice must have the default bank account of the thirdparty is it's empty on order * fix: add control on back stattement
This commit is contained in:
parent
c29a27d79d
commit
768846191b
1 changed files with 8 additions and 0 deletions
|
|
@ -116,6 +116,14 @@ class InterfaceWorkflowManager extends DolibarrTriggers
|
|||
if ($ret < 0) {
|
||||
$this->error = $newobject->error;
|
||||
$this->errors[] = $newobject->error;
|
||||
} else {
|
||||
if (empty($object->fk_account) && !empty($object->thirdparty->fk_account) && !getDolGlobalInt('BANK_ASK_PAYMENT_BANK_DURING_ORDER')) {
|
||||
$res = $newobject->setBankAccount($object->thirdparty->fk_account, true, $user);
|
||||
if ($ret < 0) {
|
||||
$this->error = $newobject->error;
|
||||
$this->errors[] = $newobject->error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$object->clearObjectLinkedCache();
|
||||
|
|
|
|||
Loading…
Reference in a new issue