From 74f663decd3ad0af0e4119d4cd07e1698424dfdb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Sep 2011 23:06:16 +0000 Subject: [PATCH] New: Add patch from Guillaume Baron --- htdocs/compta/tva/index.php | 134 ++++++++++++++++++------------------ 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 1bf26612ea5..a84d800164a 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -33,11 +33,11 @@ $langs->load("other"); $year=$_GET["year"]; if ($year == 0 ) { - $year_current = strftime("%Y",time()); - $year_start = $year_current; + $year_current = strftime("%Y",time()); + $year_start = $year_current; } else { - $year_current = $year; - $year_start = $year; + $year_current = $year; + $year_start = $year; } // Security check @@ -62,27 +62,27 @@ function pt ($db, $sql, $date) $num = $db->num_rows($result); $i = 0; $total = 0; - print ""; - print ""; - print ""; - print ""; - print "\n"; + print '
$date".$langs->trans("Amount")." 
'; + print ''; + print ''; + print ''; + print ''."\n"; print "\n"; $var=True; while ($i < $num) { $obj = $db->fetch_object($result); $var=!$var; - print ""; - print "\n"; + print ''; + print '\n"; $total = $total + $obj->mm; - print "\n"; + print '\n"; print "\n"; $i++; } - print ""; + print '"; print "
'.$date.''.$langs->trans("Amount").' 
$obj->dm
'.$obj->dm."".price($obj->mm)." '.price($obj->mm)." 
".$langs->trans("Total")." :".price($total)." 
'.$langs->trans("Total")." :".price($total)." 
"; $db->free($result); @@ -141,71 +141,71 @@ $total=0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0; $i=0; for ($m = 1 ; $m < 13 ; $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); + $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 (! is_array($coll_listbuy) && $coll_listbuy == -1) - { - $langs->load("errors"); - print ''.$langs->trans("ErrorNoAccountancyModuleLoaded").''; - break; - } - if (! is_array($coll_listbuy) && $coll_listbuy == -2) - { - print ''.$langs->trans("FeatureNotYetAvailable").''; - break; - } + if (! is_array($coll_listbuy) && $coll_listbuy == -1) + { + $langs->load("errors"); + print ''.$langs->trans("ErrorNoAccountancyModuleLoaded").''; + break; + } + if (! is_array($coll_listbuy) && $coll_listbuy == -2) + { + print ''.$langs->trans("FeatureNotYetAvailable").''; + break; + } - $var=!$var; - print ""; - print ''.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").''; + $var=!$var; + print ""; + print ''.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").''; - $x_coll = 0; - foreach($coll_listsell as $vatrate=>$val) - { - $x_coll+=$val['vat']; - } - $subtotalcoll = $subtotalcoll + $x_coll; - print "".price($x_coll).""; + $x_coll = 0; + foreach($coll_listsell as $vatrate=>$val) + { + $x_coll+=$val['vat']; + } + $subtotalcoll = $subtotalcoll + $x_coll; + print "".price($x_coll).""; - $x_paye = 0; - foreach($coll_listbuy as $vatrate=>$val) - { - $x_paye+=$val['vat']; - } - $subtotalpaye = $subtotalpaye + $x_paye; - print "".price($x_paye).""; + $x_paye = 0; + foreach($coll_listbuy as $vatrate=>$val) + { + $x_paye+=$val['vat']; + } + $subtotalpaye = $subtotalpaye + $x_paye; + print "".price($x_paye).""; - $diff = $x_coll - $x_paye; - $total = $total + $diff; - $subtotal = $subtotal + $diff; + $diff = $x_coll - $x_paye; + $total = $total + $diff; + $subtotal = $subtotal + $diff; - print "".price($diff)."\n"; - print " \n"; - print "\n"; + print "".price($diff)."\n"; + print " \n"; + print "\n"; - $i++; - if ($i > 2) { - print ''; - print ''.$langs->trans("SubTotal").':'; - print ''.price($subtotalcoll).''; - print ''.price($subtotalpaye).''; - print ''.price($subtotal).''; - print ' '; - $i = 0; - $subtotalcoll=0; $subtotalpaye=0; $subtotal=0; - } + $i++; + if ($i > 2) { + print ''; + print ''.$langs->trans("SubTotal").':'; + print ''.price($subtotalcoll).''; + print ''.price($subtotalpaye).''; + print ''.price($subtotal).''; + print ' '; + $i = 0; + $subtotalcoll=0; $subtotalpaye=0; $subtotal=0; + } } print ''.$langs->trans("TotalToPay").':'.price($total).''; print " \n"; print ''; /*} -else -{ - print ''.$langs->trans("FeatureNotYetAvailable").''; - print ''.$langs->trans("FeatureIsSupportedInInOutModeOnly").''; -}*/ + else + { + print ''.$langs->trans("FeatureNotYetAvailable").''; + print ''.$langs->trans("FeatureIsSupportedInInOutModeOnly").''; + }*/ print ''; @@ -213,8 +213,8 @@ print ''; echo ' '; /* -* Payed -*/ + * Payed + */ $sql = "SELECT SUM(amount) as mm, date_format(f.datev,'%Y-%m') as dm"; $sql.= " FROM ".MAIN_DB_PREFIX."tva as f";