[Accounting][VAT] Fix balance should be based on period

[Accounting][VAT] Fix balance should be based on period
This commit is contained in:
PMickael 2018-12-14 16:17:25 +01:00 committed by Laurent Destailleur
parent 539e2c55cd
commit 37daface19

View File

@ -561,12 +561,11 @@ if (! empty($conf->global->MAIN_FEATURES_LEVEL))
print load_fiche_titre($langs->trans("VATBalance"), '', ''); // need to add translation
$sql1 = "SELECT SUM(amount) as mm, date_format(f.datev,'%Y') as dm";
$sql1 = "SELECT SUM(amount) as mm";
$sql1 .= " FROM " . MAIN_DB_PREFIX . "tva as f";
$sql1 .= " WHERE f.entity = " . $conf->entity;
$sql1 .= " AND f.datev >= '" . $db->idate($date_start) . "'";
$sql1 .= " AND f.datev <= '" . $db->idate($date_end) . "'";
$sql1 .= " GROUP BY dm ORDER BY dm ASC";
$result = $db->query($sql1);
if ($result) {