Fixing style errors.

This commit is contained in:
stickler-ci 2020-09-13 13:18:42 +00:00
parent 929804f4d2
commit 8d3bc3ee6f

View File

@ -1522,7 +1522,7 @@ class Invoices extends DolibarrApi
return $paiement_id; return $paiement_id;
} }
/** /**
* Update a payment * Update a payment
* *
@ -1539,28 +1539,28 @@ class Invoices extends DolibarrApi
public function putPayment($id, $num_paiement = '') public function putPayment($id, $num_paiement = '')
{ {
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
if (!DolibarrApiAccess::$user->rights->facture->creer) { if (!DolibarrApiAccess::$user->rights->facture->creer) {
throw new RestException(401); throw new RestException(401);
} }
if (empty($id)) { if (empty($id)) {
throw new RestException(400, 'Payment ID is mandatory'); throw new RestException(400, 'Payment ID is mandatory');
} }
$paiement = new Paiement($this->db); $paiement = new Paiement($this->db);
$result = $paiement->fetch($id); $result = $paiement->fetch($id);
if (!$result) { if (!$result) {
throw new RestException(404, 'Paiement not found'); throw new RestException(404, 'Paiement not found');
} }
if (!empty($num_paiement)) { if (!empty($num_paiement)) {
$result = $paiement->update_num($num_paiement); $result = $paiement->update_num($num_paiement);
if ($result < 0) { if ($result < 0) {
throw new RestException(500, 'Error when updating the payment num'); throw new RestException(500, 'Error when updating the payment num');
} }
} }
return [ return [
'success' => [ 'success' => [
'code' => 200, 'code' => 200,