Skip to content
Snippets Groups Projects
Commit 0f8a8869 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

FIX Error management during bank account creation

parent cff284b2
No related branches found
No related tags found
No related merge requests found
......@@ -380,7 +380,7 @@ class Account extends CommonObject
/**
* Add an entry into table ".MAIN_DB_PREFIX."bank
*
* @param int $date Date operation
* @param int $date Date operation
* @param string $oper 1,2,3,4... (deprecated) or TYP,VIR,PRE,LIQ,VAD,CB,CHQ...
* @param string $label Descripton
* @param float $amount Amount
......@@ -596,12 +596,15 @@ class Account extends CommonObject
$accline->datec = $this->db->idate($now);
$accline->label = '('.$langs->trans("InitialBankBalance").')';
$accline->amount = price2num($this->solde);
$accline->fk_user_author = $user->id;
$accline->fk_account = $this->id;
$accline->datev = $this->db->idate($this->date_solde);
$accline->dateo = $this->db->idate($this->date_solde);
$accline->fk_type = 'SOLD';
if ($accline->insert() < 0) {
$this->error = $accline->error;
$this->errors = $accline->errors;
return -3;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment