From 96a5f5be191b8ad13c7a95b1addc5355bb9c7d77 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Jan 2010 00:17:59 +0000 Subject: [PATCH] Fix: Error message if required module missing --- htdocs/compta/tva/index.php | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index cc7ee4c8a8d..1d6148c40a3 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -1,7 +1,7 @@ - * Copyright (C) 2004 �ric Seigne - * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004 Eric Seigne + * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -20,11 +20,11 @@ */ /** - \file htdocs/compta/tva/index.php - \ingroup tax - \brief Page des societes - \version $Id$ -*/ + * \file htdocs/compta/tva/index.php + * \ingroup tax + * \brief Page des societes + * \version $Id$ + */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/tax.lib.php"); require_once(DOL_DOCUMENT_ROOT."/compta/tva/tva.class.php"); @@ -139,9 +139,15 @@ $total = 0; $subtotal = 0; $i=0; for ($m = 1 ; $m < 13 ; $m++ ) { - $coll_listsell = vat_by_quarter($db, $y, 0, $modetax, 'sell', $m); - $coll_listbuy = vat_by_quarter($db, $y, 0, $modetax, 'buy', $m); + $coll_listsell = vat_by_date($db, $y, 0, 0, 0, $modetax, 'sell', $m); + $coll_listbuy = vat_by_date($db, $y, 0, 0, 0, $modetax, 'buy', $m); + if ($coll_listbuy == -1) + { + $langs->load("errors"); + print ''.$langs->trans("ErrorNoAccountancyModuleLoaded").''; + break; + } if ($coll_listbuy == -2) { print ''.$langs->trans("FeatureNotYetAvailable").'';