From 327f31611cbf889a01d1fe4f3b4d24159ed8a4da Mon Sep 17 00:00:00 2001 From: Neil Orley Date: Tue, 24 Oct 2017 14:21:22 +0200 Subject: [PATCH] FIX Data related to customer moved to thirparties api Related to commit : https://github.com/Dolibarr/dolibarr/pull/7691/commits/b6825703b47d7897d78b4a99456e5ab75d181cac --- htdocs/societe/class/api_thirdparties.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index dd743984044..6ed404e28cd 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -83,6 +83,13 @@ class Thirdparties extends DolibarrApi throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } + $filterabsolutediscount = "fk_facture_source IS NULL OR (fk_facture_source IS NOT NULL AND (description LIKE '(DEPOSIT)%' AND description NOT LIKE '(EXCESS RECEIVED)%'))"; + $filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')"; + $absolute_discount = $this->company->getAvailableDiscounts('', $filterabsolutediscount); + $absolute_creditnote = $this->company->getAvailableDiscounts('', $filtercreditnote); + $this->company->absolute_discount = price2num($absolute_discount, 'MT'); + $this->company->absolute_creditnote = price2num($absolute_creditnote, 'MT'); + return $this->_cleanObjectDatas($this->company); }