From b48cb74c4642f759cd5a2eb37b4865bd212608b3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 11 Nov 2009 15:55:32 +0000 Subject: [PATCH] Fix: bad verification --- htdocs/cashdesk/templates/menu.tpl.php | 35 ++++++++++++++++++-------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/htdocs/cashdesk/templates/menu.tpl.php b/htdocs/cashdesk/templates/menu.tpl.php index ca8c5ba72fc..d20d0185c3f 100644 --- a/htdocs/cashdesk/templates/menu.tpl.php +++ b/htdocs/cashdesk/templates/menu.tpl.php @@ -22,16 +22,31 @@ include_once(DOL_DOCUMENT_ROOT.'/societe.class.php'); include_once(DOL_DOCUMENT_ROOT.'/compta/bank/account.class.php'); include_once(DOL_DOCUMENT_ROOT.'/product/stock/entrepot.class.php'); -$company=new Societe($db); -$company->fetch($conf->global->CASHDESK_ID_THIRDPARTY); -$bankcash=new Account($db); -$bankcash->fetch($conf->global->CASHDESK_ID_BANKACCOUNT); -$bankcb=new Account($db); -$bankcb->fetch($conf->global->CASHDESK_ID_BANKACCOUNT_CB); -$bankcheque=new Account($db); -$bankcheque->fetch($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE); -$warehouse=new Entrepot($db); -//$warehouse->fetch($conf->global->CASHDESK_ID_WAREHOUSE); +if (!empty($conf->global->CASHDESK_ID_THIRDPARTY)) +{ + $company=new Societe($db); + $company->fetch($conf->global->CASHDESK_ID_THIRDPARTY); +} +if (!empty($conf->global->CASHDESK_ID_BANKACCOUNT)) +{ + $bankcash=new Account($db); + $bankcash->fetch($conf->global->CASHDESK_ID_BANKACCOUNT); +} +if (!empty($conf->global->CASHDESK_ID_BANKACCOUNT_CB)) +{ + $bankcb=new Account($db); + $bankcb->fetch($conf->global->CASHDESK_ID_BANKACCOUNT_CB); +} +if (!empty($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE)) +{ + $bankcheque=new Account($db); + $bankcheque->fetch($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE); +} +if (!empty($conf->global->CASHDESK_ID_WAREHOUSE)) +{ + $warehouse=new Entrepot($db); + $warehouse->fetch($conf->global->CASHDESK_ID_WAREHOUSE); +} $langs->load("@cashdesk"); $langs->load("main");