New: Add patch from Guillaume Baron
This commit is contained in:
parent
c5e25f8d2c
commit
74f663decd
@ -33,11 +33,11 @@ $langs->load("other");
|
|||||||
$year=$_GET["year"];
|
$year=$_GET["year"];
|
||||||
if ($year == 0 )
|
if ($year == 0 )
|
||||||
{
|
{
|
||||||
$year_current = strftime("%Y",time());
|
$year_current = strftime("%Y",time());
|
||||||
$year_start = $year_current;
|
$year_start = $year_current;
|
||||||
} else {
|
} else {
|
||||||
$year_current = $year;
|
$year_current = $year;
|
||||||
$year_start = $year;
|
$year_start = $year;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
@ -62,27 +62,27 @@ function pt ($db, $sql, $date)
|
|||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$total = 0;
|
$total = 0;
|
||||||
print "<table class=\"noborder\" width=\"100%\">";
|
print '<table class="noborder" width="100%">';
|
||||||
print "<tr class=\"liste_titre\">";
|
print '<tr class="liste_titre">';
|
||||||
print "<td nowrap width=\"60%\">$date</td>";
|
print '<td nowrap="nowrap" width="60%">'.$date.'</td>';
|
||||||
print "<td align=\"right\">".$langs->trans("Amount")."</td>";
|
print '<td align="right">'.$langs->trans("Amount").'</td>';
|
||||||
print "<td> </td>\n";
|
print '<td> </td>'."\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$var=True;
|
$var=True;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print '<tr '.$bc[$var].'>';
|
||||||
print "<td nowrap>$obj->dm</td>\n";
|
print '<td nowrap="nowrap">'.$obj->dm."</td>\n";
|
||||||
$total = $total + $obj->mm;
|
$total = $total + $obj->mm;
|
||||||
|
|
||||||
print "<td nowrap align=\"right\">".price($obj->mm)."</td><td > </td>\n";
|
print '<td nowrap="nowrap" align="right">'.price($obj->mm)."</td><td > </td>\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print "<tr class=\"liste_total\"><td align=\"right\">".$langs->trans("Total")." :</td><td nowrap align=\"right\"><b>".price($total)."</b></td><td> </td></tr>";
|
print '<tr class="liste_total"><td align="right">'.$langs->trans("Total")." :</td><td nowrap=\"nowrap\" align=\"right\"><b>".price($total)."</b></td><td> </td></tr>";
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
@ -141,71 +141,71 @@ $total=0; $subtotalcoll=0; $subtotalpaye=0; $subtotal=0;
|
|||||||
$i=0;
|
$i=0;
|
||||||
for ($m = 1 ; $m < 13 ; $m++ )
|
for ($m = 1 ; $m < 13 ; $m++ )
|
||||||
{
|
{
|
||||||
$coll_listsell = vat_by_date($db, $y, 0, 0, 0, $modetax, 'sell', $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_listbuy = vat_by_date($db, $y, 0, 0, 0, $modetax, 'buy', $m);
|
||||||
|
|
||||||
if (! is_array($coll_listbuy) && $coll_listbuy == -1)
|
if (! is_array($coll_listbuy) && $coll_listbuy == -1)
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
print '<tr><td colspan="5">'.$langs->trans("ErrorNoAccountancyModuleLoaded").'</td></tr>';
|
print '<tr><td colspan="5">'.$langs->trans("ErrorNoAccountancyModuleLoaded").'</td></tr>';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (! is_array($coll_listbuy) && $coll_listbuy == -2)
|
if (! is_array($coll_listbuy) && $coll_listbuy == -2)
|
||||||
{
|
{
|
||||||
print '<tr><td colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
|
print '<tr><td colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print "<tr $bc[$var]>";
|
print "<tr $bc[$var]>";
|
||||||
print '<td nowrap>'.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").'</td>';
|
print '<td nowrap><a href="quadri_detail.php?leftmenu=tax_vat&month='.$m.'&year='.$y.'">'.dol_print_date(dol_mktime(0,0,0,$m,1,$y),"%b %Y").'</a></td>';
|
||||||
|
|
||||||
$x_coll = 0;
|
$x_coll = 0;
|
||||||
foreach($coll_listsell as $vatrate=>$val)
|
foreach($coll_listsell as $vatrate=>$val)
|
||||||
{
|
{
|
||||||
$x_coll+=$val['vat'];
|
$x_coll+=$val['vat'];
|
||||||
}
|
}
|
||||||
$subtotalcoll = $subtotalcoll + $x_coll;
|
$subtotalcoll = $subtotalcoll + $x_coll;
|
||||||
print "<td nowrap align=\"right\">".price($x_coll)."</td>";
|
print "<td nowrap align=\"right\">".price($x_coll)."</td>";
|
||||||
|
|
||||||
$x_paye = 0;
|
$x_paye = 0;
|
||||||
foreach($coll_listbuy as $vatrate=>$val)
|
foreach($coll_listbuy as $vatrate=>$val)
|
||||||
{
|
{
|
||||||
$x_paye+=$val['vat'];
|
$x_paye+=$val['vat'];
|
||||||
}
|
}
|
||||||
$subtotalpaye = $subtotalpaye + $x_paye;
|
$subtotalpaye = $subtotalpaye + $x_paye;
|
||||||
print "<td nowrap align=\"right\">".price($x_paye)."</td>";
|
print "<td nowrap align=\"right\">".price($x_paye)."</td>";
|
||||||
|
|
||||||
$diff = $x_coll - $x_paye;
|
$diff = $x_coll - $x_paye;
|
||||||
$total = $total + $diff;
|
$total = $total + $diff;
|
||||||
$subtotal = $subtotal + $diff;
|
$subtotal = $subtotal + $diff;
|
||||||
|
|
||||||
print "<td nowrap align=\"right\">".price($diff)."</td>\n";
|
print "<td nowrap align=\"right\">".price($diff)."</td>\n";
|
||||||
print "<td> </td>\n";
|
print "<td> </td>\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
if ($i > 2) {
|
if ($i > 2) {
|
||||||
print '<tr class="liste_total">';
|
print '<tr class="liste_total">';
|
||||||
print '<td align="right">'.$langs->trans("SubTotal").':</td>';
|
print '<td align="right"><a href="quadri_detail.php?leftmenu=tax_vat&q='.($m/3).'&year='.$y.'">'.$langs->trans("SubTotal").'</a>:</td>';
|
||||||
print '<td nowrap align="right">'.price($subtotalcoll).'</td>';
|
print '<td nowrap="nowrap" align="right">'.price($subtotalcoll).'</td>';
|
||||||
print '<td nowrap align="right">'.price($subtotalpaye).'</td>';
|
print '<td nowrap="nowrap" align="right">'.price($subtotalpaye).'</td>';
|
||||||
print '<td nowrap align="right">'.price($subtotal).'</td>';
|
print '<td nowrap="nowrap" align="right">'.price($subtotal).'</td>';
|
||||||
print '<td> </td></tr>';
|
print '<td> </td></tr>';
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$subtotalcoll=0; $subtotalpaye=0; $subtotal=0;
|
$subtotalcoll=0; $subtotalpaye=0; $subtotal=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print '<tr class="liste_total"><td align="right" colspan="3">'.$langs->trans("TotalToPay").':</td><td nowrap align="right">'.price($total).'</td>';
|
print '<tr class="liste_total"><td align="right" colspan="3">'.$langs->trans("TotalToPay").':</td><td nowrap align="right">'.price($total).'</td>';
|
||||||
print "<td> </td>\n";
|
print "<td> </td>\n";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
/*}
|
/*}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<tr><td colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
|
print '<tr><td colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
|
||||||
print '<tr><td colspan="5">'.$langs->trans("FeatureIsSupportedInInOutModeOnly").'</td></tr>';
|
print '<tr><td colspan="5">'.$langs->trans("FeatureIsSupportedInInOutModeOnly").'</td></tr>';
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
@ -213,8 +213,8 @@ print '</table>';
|
|||||||
echo '</td><td> </td><td valign="top" width="50%">';
|
echo '</td><td> </td><td valign="top" width="50%">';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Payed
|
* Payed
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "SELECT SUM(amount) as mm, date_format(f.datev,'%Y-%m') as dm";
|
$sql = "SELECT SUM(amount) as mm, date_format(f.datev,'%Y-%m') as dm";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."tva as f";
|
$sql.= " FROM ".MAIN_DB_PREFIX."tva as f";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user