forked from Wavyzz/dolibarr
Close #7095
This commit is contained in:
@@ -83,7 +83,7 @@ function pt ($db, $sql, $date)
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">'.$obj->dm."</td>\n";
|
print '<td class="nowrap">'.$obj->dm."</td>\n";
|
||||||
$total = $total + $obj->mm;
|
$total = $total + $obj->mm;
|
||||||
@@ -147,14 +147,14 @@ 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);
|
||||||
|
|
||||||
$action = "tva";
|
$action = "tva";
|
||||||
$object = array(&$coll_listsell, &$coll_listbuy);
|
$object = array(&$coll_listsell, &$coll_listbuy);
|
||||||
$parameters["mode"] = $modetax;
|
$parameters["mode"] = $modetax;
|
||||||
$parameters["year"] = $y;
|
$parameters["year"] = $y;
|
||||||
$parameters["month"] = $m;
|
$parameters["month"] = $m;
|
||||||
$parameters["type"] = 'vat';
|
$parameters["type"] = 'vat';
|
||||||
|
|
||||||
// Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array
|
// Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array
|
||||||
$hookmanager->initHooks(array('externalbalance'));
|
$hookmanager->initHooks(array('externalbalance'));
|
||||||
$reshook=$hookmanager->executeHooks('addVatLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('addVatLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
@@ -171,7 +171,7 @@ for ($m = 1 ; $m < 13 ; $m++ )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="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>';
|
print '<td class="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>';
|
||||||
|
|
||||||
@@ -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