From a8aeba3ade7e1620df5799ac0c2c6b84264da80d Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 23 Apr 2016 07:05:16 +0200 Subject: [PATCH] FIX: For external api, don't use lengt_accountg without module accountancy activated --- htdocs/product/card.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 0307c4aed5e..527b457c287 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -8,12 +8,12 @@ * Copyright (C) 2010-2015 Juanjo Menent * Copyright (C) 2013-2014 Marcos García * Copyright (C) 2012-2013 Cédric Salvador - * Copyright (C) 2011-2015 Alexandre Spangaro + * Copyright (C) 2011-2016 Alexandre Spangaro * Copyright (C) 2014 Cédric Gross * Copyright (C) 2014-2015 Ferran Marcet * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2016 Charlie Benke + * Copyright (C) 2016 Charlie Benke * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1482,8 +1482,12 @@ else print ''; print ''; print ''; - print length_accountg($object->accountancy_code_sell); - print ''; + if (! empty($conf->accounting->enabled)) { + print length_accountg($object->accountancy_code_sell); + } else { + print $object->accountancy_code_sell; + } + print ''; // Accountancy buy code print ''; @@ -1492,7 +1496,11 @@ else print ''; print ''; print ''; - print length_accountg($object->accountancy_code_buy); + if (! empty($conf->accounting->enabled)) { + print length_accountg($object->accountancy_code_buy); + } else { + print $object->accountancy_code_buy; + } print ''; // Status (to sell)