diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index e74103e13e6..9b85376c704 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -488,7 +488,7 @@ if ($_GET["action"] == 'create') */ $sql = "SELECT p.rowid,p.label,p.ref,p.price FROM llx_product as p "; $sql .= " WHERE envente = 1"; - $sql .= " ORDER BY p.nbvente DESC LIMIT 20"; + $sql .= " ORDER BY p.nbvente DESC"; if ( $db->query($sql) ) { $opt = ""; diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 0ff6e75cdec..d5feb9e243e 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -1,5 +1,6 @@ + * Copyright (C) 2004 Éric 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 @@ -67,7 +68,7 @@ function pt ($db, $sql, $date) { $total = 0 ; print "

"; print ""; - print ""; + print ""; print ""; print "\n"; print "\n"; @@ -76,15 +77,15 @@ function pt ($db, $sql, $date) { $obj = $db->fetch_object( $i); $var=!$var; print ""; - print "\n"; + print "\n"; $total = $total + $obj->amount; - print "\n"; + print "\n"; print "\n"; $i++; } - print ""; + print ""; print "
$date$dateMontant 
$obj->dm$obj->dm".price($obj->amount)."".$total."".price($obj->amount)."".$total."
Total :".price($total)."euros HT
Total :".price($total)."euros HT
"; $db->free(); @@ -101,7 +102,11 @@ llxHeader(); $tva = new Tva($db); -print_titre( "TVA Solde : " . price($tva->solde($year)) . " euros"); +$textprevyear="Année précédente (" . ($year-1) . ")"; +// On n'affiche pas "Année suivante" si c'est dans le futur ! +if($year < strftime("%Y",time())) + $textnextyear=" - Année suivante (" . ($year+1) . ")"; +print_titre( "
TVA Solde : " . price($tva->solde($year)) . " euros $textprevyear $textnextyear
"); if ($year == 0 ) { $year_current = strftime("%Y",time()); @@ -111,6 +116,7 @@ if ($year == 0 ) { $year_current = $year; $year_start = $year; } + echo ''; echo ''; echo ''; @@ -133,30 +139,30 @@ for ($y = $year_current ; $y >= $year_start ; $y=$y-1 ) { for ($m = 1 ; $m < 13 ; $m++ ) { $var=!$var; print ""; - print ''; + print ''; $x_coll = tva_coll($db, $y, $m); - print ""; + print ""; $x_paye = tva_paye($db, $y, $m); - print ""; + print ""; $diff = $x_coll - $x_paye; $total = $total + $diff; $subtotal = $subtotal + $diff; - print "\n"; + print "\n"; print "\n"; print "\n"; $i++; if ($i > 2) { - print ''; + print ''; $i = 0; $subtotal = 0; } } - print ''; + print ''; print "\n"; print "
TVA collectéeTva Réglée
'.strftime("%b %Y",mktime(0,0,0,$m,1,$y)).''.strftime("%b %Y",mktime(0,0,0,$m,1,$y)).'".price($x_coll)."".price($x_coll)."".price($x_paye)."".price($x_paye)."".price($diff)."".price($diff)." 
Sous total :'.price($subtotal).''.price($subtotal * 0.8).'
Sous total :'.price($subtotal).''.price($subtotal * 0.8).'
Total :'.price($total).'
Total :'.price($total).' 
";