Fix var not initialized

This commit is contained in:
Laurent Destailleur 2018-03-16 01:05:49 +01:00
parent 46e8692620
commit 07fb29f0c4

View File

@ -937,8 +937,6 @@ class Invoices extends DolibarrApi
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$request_data = (object) $payment_data;
if (! empty($conf->banque->enabled)) {
if(empty($accountid)) {
throw new RestException(400, 'Account ID is mandatory');
@ -962,6 +960,10 @@ class Invoices extends DolibarrApi
$resteapayer = price2num($this->invoice->total_ttc - $totalpaye - $totalcreditnotes - $totaldeposits, 'MT');
$this->db->begin();
$amounts = array();
$multicurrency_amounts = array();
// Clean parameters amount if payment is for a credit note
if ($this->invoice->type == Facture::TYPE_CREDIT_NOTE) {
$resteapayer = price2num($resteapayer,'MT');