>From 16fa9a7cd0ff6b8b6367590240dd7bf98741434c Mon Sep 17 00:00:00 2001 From: Eric Seigne
Date: Mon, 7 Jan 2019 16:50:47 +0100 Subject: [PATCH 1/2] do not use empty because of account could be '0 = zero' --- htdocs/accountancy/journal/purchasesjournal.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 41579cd5cd..f090c52a19 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -7,6 +7,7 @@ * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018 Eric Seigne * * 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 @@ -139,7 +140,7 @@ if ($result) { $num = $db->num_rows($result); // Variables - $cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER)) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined'; + $cptfour = ( $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER != "" ) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined'; $cpttva = (! empty($conf->global->ACCOUNTING_VAT_BUY_ACCOUNT)) ? $conf->global->ACCOUNTING_VAT_BUY_ACCOUNT : 'NotDefined'; $i = 0; @@ -147,7 +148,7 @@ if ($result) { $obj = $db->fetch_object($result); // Controls - $compta_soc = (! empty($obj->code_compta_fournisseur)) ? $obj->code_compta_fournisseur : $cptfour; + $compta_soc = ( $obj->code_compta_fournisseur != "" ) ? $obj->code_compta_fournisseur : $cptfour; $compta_prod = $obj->compte; if (empty($compta_prod)) { @@ -741,7 +742,7 @@ if (empty($action) || $action == 'view') { journalHead($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''), '', $varlink); // Button to write into Ledger - if (empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') { + if (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') { print img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone"); print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, ''.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").''); } @@ -876,7 +877,7 @@ if (empty($action) || $action == 'view') { // Account print "