forked from Wavyzz/dolibarr
Close #7095
This commit is contained in:
@@ -220,22 +220,67 @@ print '</table>';
|
|||||||
|
|
||||||
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("VATPaid"), '', '');
|
print load_fiche_titre($langs->trans("VATPaid"), '', '');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 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.datep,'%Y-%m') as dm";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."tva as f";
|
$sql.= " FROM ".MAIN_DB_PREFIX."tva as f";
|
||||||
$sql.= " WHERE f.entity = ".$conf->entity;
|
$sql.= " WHERE f.entity = ".$conf->entity;
|
||||||
$sql.= " AND f.datev >= '".$db->idate(dol_get_first_day($y,1,false))."'";
|
$sql.= " AND f.datep >= '".$db->idate(dol_get_first_day($y,1,false))."'";
|
||||||
$sql.= " AND f.datev <= '".$db->idate(dol_get_last_day($y,12,false))."'";
|
$sql.= " AND f.datep <= '".$db->idate(dol_get_last_day($y,12,false))."'";
|
||||||
$sql.= " GROUP BY dm ORDER BY dm ASC";
|
$sql.= " GROUP BY dm ORDER BY dm ASC";
|
||||||
|
|
||||||
pt($db, $sql,$langs->trans("Year")." $y");
|
pt($db, $sql,$langs->trans("Year")." $y");
|
||||||
|
|
||||||
|
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (! empty($conf->global->MAIN_FEATURES_LEVEL))
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Recap
|
||||||
|
*/
|
||||||
|
|
||||||
|
print load_fiche_titre($langs->trans("VATRecap"), '', ''); // need to add translation
|
||||||
|
|
||||||
|
$sql1 = "SELECT SUM(amount) as mm, date_format(f.datev,'%Y') as dm";
|
||||||
|
$sql1 .= " FROM " . MAIN_DB_PREFIX . "tva as f";
|
||||||
|
$sql1 .= " WHERE f.entity = " . $conf->entity;
|
||||||
|
$sql1 .= " AND f.datev >= '" . $db->idate(dol_get_first_day($y, 1, false)) . "'";
|
||||||
|
$sql1 .= " AND f.datev <= '" . $db->idate(dol_get_last_day($y, 12, false)) . "'";
|
||||||
|
$sql1 .= " GROUP BY dm ORDER BY dm ASC";
|
||||||
|
|
||||||
|
$result = $db->query($sql1);
|
||||||
|
if ($result) {
|
||||||
|
$obj = $db->fetch_object($result);
|
||||||
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
|
print "<tr>";
|
||||||
|
print '<td align="right">' . $langs->trans("VATDue") . '</td>'; // need to add translation
|
||||||
|
print '<td class="nowrap" align="right">' . price(price2num($total, 1)) . '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
print "<tr>";
|
||||||
|
print '<td align="right">' . $langs->trans("VATPaid") . '</td>';
|
||||||
|
print '<td class="nowrap" align="right">' . price(price2num($obj->mm, 1)) . "</td>\n";
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
$restopay = $total - $obj->mm;
|
||||||
|
print "<tr>";
|
||||||
|
print '<td align="right">' . $langs->trans("VATRestopay") . '</td>'; // need to add translation
|
||||||
|
print '<td class="nowrap" align="right">' . price(price2num($restopay, 1)) . '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '</div></div>';
|
print '</div></div>';
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
Reference in New Issue
Block a user