From 9a1c684870722ac7ce145e52a1c3e9fa1d229905 Mon Sep 17 00:00:00 2001 From: Neil Orley Date: Fri, 27 Oct 2017 10:02:17 +0200 Subject: [PATCH] FIX wrong paramters name in the usecreditnote method Rename 'creditnoteid' with 'discountid' in the URI Rename 'creditId' with 'discountid' in the method --- htdocs/compta/facture/class/api_invoices.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index cc5db388af7..801fb03e6fe 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -701,7 +701,7 @@ class Invoices extends DolibarrApi * @param int $id Id of invoice * @param int $discountid Id of a discount coming from a credit note * - * @url POST {id}/usecreditnote/{creditnoteid} + * @url POST {id}/usecreditnote/{discountid} * * @return int * @throws 400 @@ -719,7 +719,7 @@ class Invoices extends DolibarrApi if(empty($id)) { throw new RestException(400, 'Invoice ID is mandatory'); } - if(empty($creditId)) { + if(empty($discountid)) { throw new RestException(400, 'Credit ID is mandatory'); }