From ff1311c8fd6540cf1ad74c49a1f87937860622c9 Mon Sep 17 00:00:00 2001 From: mikael Date: Sat, 12 Oct 2024 11:53:25 +0200 Subject: [PATCH] Bug fix #31369 date_solde not taken into account when sent through API --- htdocs/compta/bank/class/api_bankaccounts.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index 663eef6f6f391..8b4c78ecf2f85 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -170,6 +170,8 @@ public function post($request_data = null) } // Date of the initial balance (required to create an account). $account->date_solde = time(); + // Use the value of date_solde sent through API otherwise let date_solde value to now which was initialised just before + if (isset($request_data['date_solde'])) { $account->date_solde = $this->_checkValForAPI('date_solde', $request_data['date_solde'], $account); } // courant and type are the same thing but the one used when // creating an account is courant $account->courant = $account->type; // deprecated