$vatsup = $langs->trans("VATPaid"); if ($mysoc->tva_assuj) { $vatsup .= ' (' . $langs->trans("ToGetBack") . ')'; } } report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode); $vatcust = $langs->trans("VATReceived"); $vatsup = $langs->trans("VATPaid"); // VAT Received and paid echo '<table class="noborder" width="100%">'; $y = $year_current; $total = 0; $i = 0; // Load arrays of datas $x_coll = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'sell'); $x_paye = vat_by_date($db, 0, 0, $date_start, $date_end, $modetax, 'buy'); if (!is_array($x_coll) || !is_array($x_paye)) { $langs->load("errors"); if ($x_coll == -1) { print '<tr><td colspan="5">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>'; } else { if ($x_coll == -2) { print '<tr><td colspan="5">' . $langs->trans("FeatureNotYetAvailable") . '</td></tr>'; } else { print '<tr><td colspan="5">' . $langs->trans("Error") . '</td></tr>'; } } } else { $x_both = array(); //now, from these two arrays, get another array with one rate per line foreach (array_keys($x_coll) as $my_coll_rate) {
print '<td width="30%">' . $langs->trans("Year") . " " . $y . '</td>'; print '<td align="right">' . $langs->trans("VATToPay") . '</td>'; print '<td align="right">' . $langs->trans("VATToCollect") . '</td>'; print '<td align="right">' . $langs->trans("TotalToPay") . '</td>'; print '<td> </td>' . "\n"; print '</tr>' . "\n"; $y = $year_current; $var = True; $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); $action = "tva"; $object = array(&$coll_listsell, &$coll_listbuy); $parameters["mode"] = $modetax; $parameters["year"] = $y; $parameters["month"] = $m; // Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('externalbalance')); $reshook = $hookmanager->executeHooks('addStatisticLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if (!is_array($coll_listbuy) && $coll_listbuy == -1) { $langs->load("errors"); print '<tr><td colspan="5">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>'; break; } if (!is_array($coll_listbuy) && $coll_listbuy == -2) {