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 "| $date | ";
- print "".$langs->trans("Amount")." | ";
- print " | \n";
+ print '';
+ print '';
+ print '| '.$date.' | ';
+ print ''.$langs->trans("Amount").' | ';
+ print ' | '."\n";
print "
\n";
$var=True;
while ($i < $num)
{
$obj = $db->fetch_object($result);
$var=!$var;
- print "";
- print "| $obj->dm | \n";
+ print '
';
+ print '| '.$obj->dm." | \n";
$total = $total + $obj->mm;
- print "".price($obj->mm)." | | \n";
+ print ''.price($obj->mm)." | | \n";
print "
\n";
$i++;
}
- print "| ".$langs->trans("Total")." : | ".price($total)." | |
";
+ print '| '.$langs->trans("Total")." : | ".price($total)." | |
";
print "
";
$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";
|