dolibarr 23.0.3
quadri_detail.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
4 * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
5 * Copyright (C) 2006-2015 Yannick Warnier <ywarnier@beeznest.org>
6 * Copyright (C) 2014 Ferran Marcet <fmarcet@2byte.es>
7 * Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
8 * Copyright (C) 2019 Eric Seigne <eric.seigne@cap-rel.fr>
9 * Copyright (C) 2021-2022 Open-Dsi <support@open-dsi.fr>
10 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <https://www.gnu.org/licenses/>.
24 */
25
32// Load Dolibarr environment
33require '../../main.inc.php';
42require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php';
43require_once DOL_DOCUMENT_ROOT . '/core/lib/tax.lib.php';
44require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
45require_once DOL_DOCUMENT_ROOT . '/compta/tva/class/tva.class.php';
46require_once DOL_DOCUMENT_ROOT . '/compta/localtax/class/localtax.class.php';
47require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
48require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
49require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
50require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
51require_once DOL_DOCUMENT_ROOT . '/fourn/class/paiementfourn.class.php';
52require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
53require_once DOL_DOCUMENT_ROOT . '/expensereport/class/paymentexpensereport.class.php';
54
55// Load translation files required by the page
56$langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "product", "trips", "admin"));
57
58$refresh = (GETPOSTISSET('submit') || GETPOSTISSET('vat_rate_show') || GETPOSTISSET('invoice_type'));
59$invoice_type = GETPOSTISSET('invoice_type') ? GETPOST('invoice_type', 'alpha') : '';
60$vat_rate_show = GETPOSTISSET('vat_rate_show') ? GETPOST('vat_rate_show', 'alphanohtml') : -1;
61
62// Set $date_start_xxx and $date_end_xxx...
63include DOL_DOCUMENT_ROOT.'/compta/tva/initdatesforvat.inc.php';
75'
76@phan-var-force int $date_start
77@phan-var-force int $date_end
78@phan-var-force int $date_start_month
79@phan-var-force int $date_start_year
80@phan-var-force int $date_start_day
81@phan-var-force int $date_end_month
82@phan-var-force int $date_end_year
83@phan-var-force int $date_end_day
84@phan-var-force int $year_current
85';
86
87$min = price2num(GETPOST("min", "alpha"));
88if (empty($min)) {
89 $min = 0;
90}
91
92// Define modetax (0 or 1)
93// 0=normal, 1=option vat for services is on debit, 2=option on payments for products
94$modetax = getDolGlobalInt('TAX_MODE');
95if (GETPOSTISSET("modetax")) {
96 $modetax = GETPOSTINT("modetax");
97}
98if (empty($modetax)) {
99 $modetax = 0;
100}
101
102$object = new Tva($db);
103
104// Security check
105$socid = GETPOSTINT('socid');
106if ($user->socid) {
107 $socid = $user->socid;
108}
109$result = restrictedArea($user, 'tax', '', 'tva', 'charges');
110
111
112/*
113 * View
114 */
115
116$form = new Form($db);
117$company_static = new Societe($db);
118$invoice_customer = new Facture($db);
119$invoice_supplier = new FactureFournisseur($db);
120$expensereport = new ExpenseReport($db);
121$product_static = new Product($db);
122$payment_static = new Paiement($db);
123$paymentfourn_static = new PaiementFourn($db);
124$paymentexpensereport_static = new PaymentExpenseReport($db);
125
126$morequerystring = '';
127$listofparams = array('date_startmonth', 'date_startyear', 'date_startday', 'date_endmonth', 'date_endyear', 'date_endday');
128foreach ($listofparams as $param) {
129 if (GETPOST($param) != '') {
130 $morequerystring .= ($morequerystring ? '&' : '') . $param . '=' . GETPOST($param);
131 }
132}
133
134$title = $langs->trans("VATReport") . " " . dol_print_date($date_start, '', 'tzserver') . " -> " . dol_print_date($date_end, '', 'tzserver');
135llxHeader('', $title, '', '', 0, 0, '', '', $morequerystring);
136
137
138//print load_fiche_titre($langs->trans("VAT"),"");
139
140//$fsearch.='<br>';
141$fsearch = '<!-- hidden fields for form -->';
142$fsearch .= '<input type="hidden" name="token" value="' . newToken() . '">';
143$fsearch .= '<input type="hidden" name="modetax" value="' . $modetax . '">';
144//$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': ';
145//$fsearch.=' <input type="text" name="min" value="'.$min.'">';
146
147
148// Show report header
149$name = $langs->trans("VATReportByRates");
150$calcmode = '';
151if ($modetax == 0) {
152 $calcmode = $langs->trans('OptionVATDefault');
153}
154if ($modetax == 1) {
155 $calcmode = $langs->trans('OptionVATDebitOption');
156}
157if ($modetax == 2) {
158 $calcmode = $langs->trans('OptionPaymentForProductAndServices');
159}
160$calcmode .= ' <span class="opacitymedium">(' . $langs->trans("TaxModuleSetupToModifyRules", DOL_URL_ROOT . '/admin/taxes.php') . ')</span>';
161// Set period
162$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
163$period .= ' - ';
164$period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
165
166$description = $fsearch;
167$builddate = dol_now();
168
169if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice') {
170 $description .= $langs->trans("RulesVATDueProducts");
171}
172if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'payment') {
173 $description .= $langs->trans("RulesVATInProducts");
174}
175if (getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'invoice') {
176 $description .= '<br>' . $langs->trans("RulesVATDueServices");
177}
178if (getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'payment') {
179 $description .= '<br>' . $langs->trans("RulesVATInServices");
180}
181if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
182 if (getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'invoice' && getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice') {
183 $description .= '<br>' . $langs->trans("DepositsAreNotIncluded");
184 } elseif (getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'invoice') { // calculate on sale invoice for service only
185 $description .= '<br>' . $langs->trans("DepositsAreNotIncluded").' (for services)';
186 } elseif (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice') { // calculate on sale invoice for service only
187 $description .= '<br>' . $langs->trans("DepositsAreNotIncluded").' (for products)';
188 }
189}
190if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
191 if (getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'invoice' && getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'invoice') {
192 $description .= '<br>' . $langs->trans("SupplierDepositsAreNotIncluded");
193 } elseif (getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'invoice') { // calculate on supplier invoice for service only
194 $description .= '<br>' . $langs->trans("SupplierDepositsAreNotIncluded").' (for services)';
195 } elseif (getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'invoice') { // calculate on supplier invoice for product only
196 $description .= '<br>' . $langs->trans("SupplierDepositsAreNotIncluded").' (for products)';
197 }
198}
199if (isModEnabled('accounting')) {
200 $description .= '<br>' . $langs->trans("ThisIsAnEstimatedValue");
201}
202
203// Customers invoices
204$elementcust = $langs->trans("CustomersInvoices");
205$productcust = $langs->trans("ProductOrService");
206$amountcust = $langs->trans("AmountHT");
207$vatcust = $langs->trans("VATReceived");
208$namecust = $langs->trans("Name");
209if ($mysoc->tva_assuj) {
210 $vatcust .= ' (' . $langs->trans("VATToPay") . ')';
211}
212
213// Suppliers invoices
214$elementsup = $langs->trans("SuppliersInvoices");
215$productsup = $productcust;
216$amountsup = $amountcust;
217$vatsup = $langs->trans("VATPaid");
218$namesup = $namecust;
219if ($mysoc->tva_assuj) {
220 $vatsup .= ' (' . $langs->trans("ToGetBack") . ')';
221}
222
223$optioncss = GETPOST('optioncss', 'alpha');
224$periodlink = '';
225$exportlink = '';
226
227if ($optioncss != "print") {
228 report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
229}
230
231$vatcust = $langs->trans("VATReceived");
232$vatsup = $langs->trans("VATPaid");
233$vatexpensereport = $langs->trans("VATPaid");
234
235
236// VAT Received and paid
237print '<div class="div-table-responsive">';
238print '<table class="liste noborder centpercent">';
239
240$y = $year_current;
241$i = 0;
242
243$columns = 7;
244$span = $columns;
245if ($modetax != 1) {
246 $span += 2;
247}
248
249// Load arrays of datas
250$x_coll = tax_by_rate('vat', $db, 0, 0, $date_start, $date_end, $modetax, 'sell');
251$x_paye = tax_by_rate('vat', $db, 0, 0, $date_start, $date_end, $modetax, 'buy');
252
253if (!is_array($x_coll) || !is_array($x_paye)) {
254 $langs->load("errors");
255 if ($x_coll == -1) {
256 print '<tr><td colspan="' . $columns . '">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>';
257 } elseif ($x_coll == -2) {
258 print '<tr><td colspan="' . $columns . '">' . $langs->trans("FeatureNotYetAvailable") . '</td></tr>';
259 } else {
260 print '<tr><td colspan="' . $columns . '">' . $langs->trans("Error") . '</td></tr>';
261 }
262} else {
263 $x_both = array();
264 //now, from these two arrays, get another array with one rate per line
265 foreach (array_keys($x_coll) as $my_coll_rate) {
266 $x_both[$my_coll_rate] = array(
267 'coll' => array(),
268 'paye' => array(),
269 );
270 $x_both[$my_coll_rate]['coll']['totalht'] = $x_coll[$my_coll_rate]['totalht'];
271 $x_both[$my_coll_rate]['coll']['vat'] = $x_coll[$my_coll_rate]['vat'];
272 $x_both[$my_coll_rate]['paye']['totalht'] = 0;
273 $x_both[$my_coll_rate]['paye']['vat'] = 0;
274 $x_both[$my_coll_rate]['coll']['links'] = '';
275 $x_both[$my_coll_rate]['coll']['detail'] = array();
276 foreach ($x_coll[$my_coll_rate]['facid'] as $id => $dummy) {
277 $invoice_customer->id = $x_coll[$my_coll_rate]['facid'][$id];
278 $invoice_customer->ref = $x_coll[$my_coll_rate]['facnum'][$id];
279 $invoice_customer->type = $x_coll[$my_coll_rate]['type'][$id];
280
281 //$company_static->fetch($x_coll[$my_coll_rate]['company_id'][$id]);
282 $company_static->id = $x_coll[$my_coll_rate]['company_id'][$id];
283 $company_static->name = $x_coll[$my_coll_rate]['company_name'][$id];
284 $company_static->name_alias = $x_coll[$my_coll_rate]['company_alias'][$id];
285 $company_static->email = $x_coll[$my_coll_rate]['company_email'][$id];
286 $company_static->tva_intra = isset($x_coll[$my_coll_rate]['company_tva_intra'][$id]) ? $x_coll[$my_coll_rate]['company_tva_intra'][$id] : '0';
287 $company_static->client = $x_coll[$my_coll_rate]['company_client'][$id];
288 $company_static->fournisseur = $x_coll[$my_coll_rate]['company_fournisseur'][$id];
289 $company_static->status = $x_coll[$my_coll_rate]['company_status'][$id];
290 $company_static->code_client = $x_coll[$my_coll_rate]['company_customer_code'][$id];
291 $company_static->code_compta_client = $x_coll[$my_coll_rate]['company_customer_accounting_code'][$id];
292 $company_static->code_fournisseur = $x_coll[$my_coll_rate]['company_supplier_code'][$id];
293 $company_static->code_compta_fournisseur = $x_coll[$my_coll_rate]['company_supplier_accounting_code'][$id];
294
295 $x_both[$my_coll_rate]['coll']['detail'][] = array(
296 'id' => $x_coll[$my_coll_rate]['facid'][$id],
297 'descr' => $x_coll[$my_coll_rate]['descr'][$id],
298 'pid' => $x_coll[$my_coll_rate]['pid'][$id],
299 'pref' => $x_coll[$my_coll_rate]['pref'][$id],
300 'ptype' => $x_coll[$my_coll_rate]['ptype'][$id],
301 'payment_id' => $x_coll[$my_coll_rate]['payment_id'][$id],
302 'payment_ref' => $x_coll[$my_coll_rate]['payment_ref'][$id],
303 'payment_amount' => $x_coll[$my_coll_rate]['payment_amount'][$id],
304 'ftotal_ttc' => $x_coll[$my_coll_rate]['ftotal_ttc'][$id],
305 'dtotal_ttc' => $x_coll[$my_coll_rate]['dtotal_ttc'][$id],
306 'dtype' => $x_coll[$my_coll_rate]['dtype'][$id],
307 'datef' => $x_coll[$my_coll_rate]['datef'][$id],
308 'datep' => $x_coll[$my_coll_rate]['datep'][$id],
309
310 'company_link' => $company_static->getNomUrl(1, '', 20),
311
312 'ddate_start' => $x_coll[$my_coll_rate]['ddate_start'][$id],
313 'ddate_end' => $x_coll[$my_coll_rate]['ddate_end'][$id],
314 'totalht' => $x_coll[$my_coll_rate]['totalht_list'][$id],
315 'vat' => $x_coll[$my_coll_rate]['vat_list'][$id],
316 'link' => $invoice_customer->getNomUrl(1, '', 12)
317 );
318 }
319 }
320 // tva paid
321 foreach (array_keys($x_paye) as $my_paye_rate) {
322 $x_both[$my_paye_rate]['paye']['totalht'] = $x_paye[$my_paye_rate]['totalht'];
323 $x_both[$my_paye_rate]['paye']['vat'] = $x_paye[$my_paye_rate]['vat'];
324 if (!isset($x_both[$my_paye_rate]['coll']['totalht'])) {
325 $x_both[$my_paye_rate]['coll']['totalht'] = 0;
326 $x_both[$my_paye_rate]['coll']['vat'] = 0;
327 }
328 $x_both[$my_paye_rate]['paye']['links'] = '';
329 $x_both[$my_paye_rate]['paye']['detail'] = array();
330
331 foreach ($x_paye[$my_paye_rate]['facid'] as $id => $dummy) {
332 // ExpenseReport
333 if ($x_paye[$my_paye_rate]['ptype'][$id] === 'ExpenseReportPayment') {
334 $expensereport->id = $x_paye[$my_paye_rate]['facid'][$id];
335 $expensereport->ref = $x_paye[$my_paye_rate]['facnum'][$id];
336 $expensereport->type = $x_paye[$my_paye_rate]['type'][$id];
337
338 $x_both[$my_paye_rate]['paye']['detail'][] = array(
339 'id' => $x_paye[$my_paye_rate]['facid'][$id],
340 'descr' => $x_paye[$my_paye_rate]['descr'][$id],
341 'pid' => $x_paye[$my_paye_rate]['pid'][$id],
342 'pref' => $x_paye[$my_paye_rate]['pref'][$id],
343 'ptype' => $x_paye[$my_paye_rate]['ptype'][$id],
344 'payment_id' => $x_paye[$my_paye_rate]['payment_id'][$id],
345 'payment_ref' => $x_paye[$my_paye_rate]['payment_ref'][$id],
346 'payment_amount' => $x_paye[$my_paye_rate]['payment_amount'][$id],
347 'ftotal_ttc' => price2num($x_paye[$my_paye_rate]['ftotal_ttc'][$id]),
348 'dtotal_ttc' => price2num($x_paye[$my_paye_rate]['dtotal_ttc'][$id]),
349 'dtype' => $x_paye[$my_paye_rate]['dtype'][$id],
350 'ddate_start' => $x_paye[$my_paye_rate]['ddate_start'][$id],
351 'ddate_end' => $x_paye[$my_paye_rate]['ddate_end'][$id],
352 'totalht' => price2num($x_paye[$my_paye_rate]['totalht_list'][$id]),
353 'vat' => $x_paye[$my_paye_rate]['vat_list'][$id],
354 'link' => $expensereport->getNomUrl(1)
355 );
356 } else {
357 $invoice_supplier->id = $x_paye[$my_paye_rate]['facid'][$id];
358 $invoice_supplier->ref = $x_paye[$my_paye_rate]['facnum'][$id];
359 $invoice_supplier->type = $x_paye[$my_paye_rate]['type'][$id];
360
361 $company_static->id = $x_paye[$my_paye_rate]['company_id'][$id];
362 $company_static->name = $x_paye[$my_paye_rate]['company_name'][$id];
363 $company_static->name_alias = $x_paye[$my_paye_rate]['company_alias'][$id];
364 $company_static->email = $x_paye[$my_paye_rate]['company_email'][$id];
365 $company_static->tva_intra = $x_paye[$my_paye_rate]['company_tva_intra'][$id];
366 $company_static->client = $x_paye[$my_paye_rate]['company_client'][$id];
367 $company_static->fournisseur = $x_paye[$my_paye_rate]['company_fournisseur'][$id];
368 $company_static->status = $x_paye[$my_paye_rate]['company_status'][$id];
369 $company_static->code_client = $x_paye[$my_paye_rate]['company_customer_code'][$id];
370 $company_static->code_compta_client = $x_paye[$my_paye_rate]['company_customer_accounting_code'][$id];
371 $company_static->code_fournisseur = $x_paye[$my_paye_rate]['company_supplier_code'][$id];
372 $company_static->code_compta_fournisseur = $x_paye[$my_paye_rate]['company_supplier_accounting_code'][$id];
373
374 $x_both[$my_paye_rate]['paye']['detail'][] = array(
375 'id' => $x_paye[$my_paye_rate]['facid'][$id],
376 'descr' => $x_paye[$my_paye_rate]['descr'][$id],
377 'pid' => $x_paye[$my_paye_rate]['pid'][$id],
378 'pref' => $x_paye[$my_paye_rate]['pref'][$id],
379 'ptype' => $x_paye[$my_paye_rate]['ptype'][$id],
380 'payment_id' => $x_paye[$my_paye_rate]['payment_id'][$id],
381 'payment_ref' => $x_paye[$my_paye_rate]['payment_ref'][$id],
382 'payment_amount' => $x_paye[$my_paye_rate]['payment_amount'][$id],
383 'ftotal_ttc' => price2num($x_paye[$my_paye_rate]['ftotal_ttc'][$id]),
384 'dtotal_ttc' => price2num($x_paye[$my_paye_rate]['dtotal_ttc'][$id]),
385 'dtype' => $x_paye[$my_paye_rate]['dtype'][$id],
386 'datef' => $x_paye[$my_paye_rate]['datef'][$id],
387 'datep' => $x_paye[$my_paye_rate]['datep'][$id],
388
389 'company_link' => $company_static->getNomUrl(1, '', 20),
390
391 'ddate_start' => $x_paye[$my_paye_rate]['ddate_start'][$id],
392 'ddate_end' => $x_paye[$my_paye_rate]['ddate_end'][$id],
393 'totalht' => price2num($x_paye[$my_paye_rate]['totalht_list'][$id]),
394 'vat' => $x_paye[$my_paye_rate]['vat_list'][$id],
395 'link' => $invoice_supplier->getNomUrl(1, '', 12)
396 );
397 }
398 }
399 }
400 //now we have an array (x_both) indexed by rates for coll and paye
401
402
403 //print table headers for this quadri - incomes first
404
405 $x_coll_sum = 0;
406 $x_coll_ht = 0;
407 $x_paye_sum = 0;
408 $x_paye_ht = 0;
409
410 //print '<tr><td colspan="'.($span+1).'">'..')</td></tr>';
411
412 // Customers invoices
413 print '<tr class="liste_titre">';
414 print '<td class="left">' . $elementcust . '</td>';
415 print '<td class="left">' . $langs->trans("DateInvoice") . '</td>';
416 if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'payment' || getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'payment') {
417 print '<td class="left">' . $langs->trans("DatePayment") . '</td>';
418 } else {
419 print '<td></td>';
420 }
421 print '<td class="left">' . $namecust . '</td>';
422 print '<td class="left">' . $productcust . '</td>';
423 if ($modetax != 1) {
424 print '<td class="right">' . $amountcust . '</td>';
425 print '<td class="right">' . $langs->trans("Payment") . ' (' . $langs->trans("PercentOfInvoice") . ')</td>';
426 }
427 print '<td class="right">' . $langs->trans("AmountHTVATRealReceived") . '</td>';
428 print '<td class="right">' . $vatcust . '</td>';
429 print '</tr>';
430
431 $action = "tvadetail";
432 $parameters["mode"] = $modetax;
433 $parameters["start"] = $date_start;
434 $parameters["end"] = $date_end;
435 $parameters["type"] = 'vat';
436
437 $object = array(&$x_coll, &$x_paye, &$x_both);
438 // Initialize a technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array
439 $hookmanager->initHooks(array('externalbalance'));
440 $reshook = $hookmanager->executeHooks('addVatLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
441
442 foreach (array_keys($x_coll) as $rate) {
443 $subtot_coll_total_ht = 0;
444 $subtot_coll_vat = 0;
445
446 if (is_array($x_both[$rate]['coll']['detail'])) {
447 // VAT Rate
448 print "<tr>";
449 print '<td class="tax_rate" colspan="' . ($span + 1) . '">';
450 print $langs->trans('Rate') . ' : ' . vatrate($rate) . '%';
451 print ' - <a class="reposition" href="' . DOL_URL_ROOT . '/compta/tva/quadri_detail.php?invoice_type=customer';
452 if ($invoice_type != 'customer' || !GETPOSTISSET('vat_rate_show') || GETPOST('vat_rate_show') != $rate) {
453 print '&amp;vat_rate_show=' . urlencode($rate);
454 }
455 print '&amp;date_startyear=' . ((int) $date_start_year) . '&amp;date_startmonth=' . ((int) $date_start_month) . '&amp;date_startday=' . ((int) $date_start_day) . '&amp;date_endyear=' . ((int) $date_end_year) . '&amp;date_endmonth=' . ((int) $date_end_month) . '&amp;date_endday=' . ((int) $date_end_day) . '">';
456 print img_picto('', 'chevron-down', 'class="paddingrightonly"') . $langs->trans('VATReportShowByRateDetails') . '</a>';
457 print '</td>';
458 print '</tr>' . "\n";
459
460 foreach ($x_both[$rate]['coll']['detail'] as $index => $fields) {
461 // Define type
462 // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
463 $type = (isset($fields['dtype']) ? $fields['dtype'] : $fields['ptype']);
464 // Try to enhance type detection using date_start and date_end for free lines where type was not saved.
465 if (!empty($fields['ddate_start'])) {
466 $type = 1;
467 }
468 if (!empty($fields['ddate_end'])) {
469 $type = 1;
470 }
471
472 // Payment
473 $ratiopaymentinvoice = 1;
474 if ($modetax != 1) {
475 if (($type == 0 && getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice')
476 || ($type == 1 && getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'invoice')) {
477 } else {
478 if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) {
479 $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']);
480 }
481 }
482 }
483
484 // Total collected
485 $temp_ht = (float) $fields['totalht'] * $ratiopaymentinvoice;
486
487 // VAT
488 $temp_vat = $fields['vat'] * $ratiopaymentinvoice;
489
490 $subtot_coll_total_ht += $temp_ht;
491 $subtot_coll_vat += $temp_vat;
492 $x_coll_sum += $temp_vat;
493 }
494 }
495
496 if ($invoice_type == 'customer' && $vat_rate_show == $rate) {
497 if (is_array($x_both[$rate]['coll']['detail'])) {
498 foreach ($x_both[$rate]['coll']['detail'] as $index => $fields) {
499 /*$company_static->id = $fields['company_id'];
500 $company_static->name = $fields['company_name'];
501 $company_static->name_alias = $fields['company_alias'];
502 $company_static->email = $fields['company_email'];
503 $company_static->tva_intra = $fields['company_tva_intra'];
504 $company_static->client = $fields['company_client'];
505 $company_static->fournisseur = $fields['company_fournisseur'];
506 $company_static->status = $fields['company_status'];
507 $company_static->code_client = $fields['company_client'];
508 $company_static->code_compta_client = $fields['company_customer_code'];
509 $company_static->code_fournisseur = $fields['company_customer_accounting_code'];
510 $company_static->code_compta_fournisseur = $fields['company_supplier_accounting_code'];*/
511
512 // Define type
513 // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
514 $type = (isset($fields['dtype']) ? $fields['dtype'] : $fields['ptype']);
515 // Try to enhance type detection using date_start and date_end for free lines where type was not saved.
516 if (!empty($fields['ddate_start'])) {
517 $type = 1;
518 }
519 if (!empty($fields['ddate_end'])) {
520 $type = 1;
521 }
522
523
524 print '<tr class="oddeven">';
525
526 // Ref
527 print '<td class="nowrap left">' . $fields['link'] . '</td>';
528
529 // Invoice date
530 print '<td class="left">' . dol_print_date($fields['datef'], 'day') . '</td>';
531
532 // Payment date
533 if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'payment' || getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'payment') {
534 print '<td class="left">' . dol_print_date($fields['datep'], 'day') . '</td>';
535 } else {
536 print '<td></td>';
537 }
538
539 // Company name
540 print '<td class="tdoverflowmax150">';
541 //print $company_static->getNomUrl(1);
542 print $fields['company_link'];
543 print '</td>';
544
545 // Description
546 print '<td class="left">';
547 if ($fields['pid']) {
548 $product_static->id = $fields['pid'];
549 $product_static->ref = $fields['pref'];
550 $product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered
551 print $product_static->getNomUrl(1);
552 if (dol_string_nohtmltag($fields['descr'])) {
553 print ' - ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
554 }
555 } else {
556 if ($type) {
557 $text = img_object($langs->trans('Service'), 'service');
558 } else {
559 $text = img_object($langs->trans('Product'), 'product');
560 }
561 if (preg_match('/^\‍((.*)\‍)$/', $fields['descr'], $reg)) {
562 if ($reg[1] == 'DEPOSIT') {
563 $fields['descr'] = $langs->transnoentitiesnoconv('Deposit');
564 } elseif ($reg[1] == 'CREDIT_NOTE') {
565 $fields['descr'] = $langs->transnoentitiesnoconv('CreditNote');
566 } else {
567 $fields['descr'] = $langs->transnoentitiesnoconv($reg[1]);
568 }
569 }
570 print $text . ' ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
571
572 // Show range
573 print_date_range($fields['ddate_start'], $fields['ddate_end']);
574 }
575 print '</td>';
576
577 // Total HT
578 if ($modetax != 1) {
579 print '<td class="nowrap right">';
580 print price($fields['totalht']);
581 if (price2num($fields['ftotal_ttc'])) {
582 //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
583 $ratiolineinvoice = ($fields['dtotal_ttc'] / $fields['ftotal_ttc']);
584 //print ' ('.round($ratiolineinvoice*100,2).'%)';
585 }
586 print '</td>';
587 }
588
589 // Payment
590 $ratiopaymentinvoice = 1;
591 if ($modetax != 1) {
592 print '<td class="nowrap right">';
593 //print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc'];
594 if ($fields['payment_amount'] && $fields['ftotal_ttc']) {
595 $payment_static->id = $fields['payment_id'];
596 $payment_static->ref = $fields['payment_ref'];
597 print $payment_static->getNomUrl(2, '', '', 0) . ' ';
598 }
599 if (($type == 0 && getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice')
600 || ($type == 1 && getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'invoice')) {
601 print $langs->trans("NA");
602 } else {
603 if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) {
604 $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']);
605 }
606 print price(price2num($fields['payment_amount'], 'MT'));
607 if (isset($fields['payment_amount'])) {
608 print ' (' . round($ratiopaymentinvoice * 100, 2) . '%)';
609 }
610 }
611 print '</td>';
612 }
613
614 // Total collected
615 print '<td class="nowrap right">';
616 $temp_ht = (float) $fields['totalht'] * $ratiopaymentinvoice;
617 print price(price2num($temp_ht, 'MT'), 1);
618 print '</td>';
619
620 // VAT
621 print '<td class="nowrap right">';
622 $temp_vat = $fields['vat'] * $ratiopaymentinvoice;
623 print price(price2num($temp_vat, 'MT'), 1);
624 //print price($fields['vat']);
625 print '</td>';
626 print '</tr>';
627
628 //$subtot_coll_total_ht += $temp_ht;
629 //$subtot_coll_vat += $temp_vat;
630 //$x_coll_sum += $temp_vat;
631 }
632 }
633 }
634 // Total customers for this vat rate
635 print '<tr class="liste_total">';
636 print '<td colspan="4"></td>';
637 print '<td class="right">' . $langs->trans("Total") . ':</td>';
638 if ($modetax != 1) {
639 print '<td class="nowrap right">&nbsp;</td>';
640 print '<td class="right">&nbsp;</td>';
641 }
642 print '<td class="right"><span class="amount">' . price(price2num($subtot_coll_total_ht, 'MT')) . '</span></td>';
643 print '<td class="nowrap right"><span class="amount">' . price(price2num($subtot_coll_vat, 'MT')) . '</span></td>';
644 print '</tr>';
645 }
646
647 if (count($x_coll) == 0) { // Show a total line if nothing shown
648 print '<tr class="liste_total">';
649 print '<td colspan="4"></td>';
650 print '<td class="right">' . $langs->trans("Total") . ':</td>';
651 if ($modetax != 1) {
652 print '<td class="nowrap right">&nbsp;</td>';
653 print '<td class="right">&nbsp;</td>';
654 }
655 print '<td class="right">' . price(price2num(0, 'MT')) . '</td>';
656 print '<td class="nowrap right">' . price(price2num(0, 'MT')) . '</td>';
657 print '</tr>';
658 }
659
660 // Blank line
661 print '<tr><td colspan="' . ($span + 2) . '">&nbsp;</td></tr>';
662
663 // Print table headers for this quadri - expenses
664 print '<tr class="liste_titre liste_titre_topborder">';
665 print '<td class="left">' . $elementsup . '</td>';
666 print '<td class="left">' . $langs->trans("DateInvoice") . '</td>';
667 if (getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'payment' || getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'payment') {
668 print '<td class="left">' . $langs->trans("DatePayment") . '</td>';
669 } else {
670 print '<td></td>';
671 }
672 print '<td class="left">' . $namesup . '</td>';
673 print '<td class="left">' . $productsup . '</td>';
674 if ($modetax != 1) {
675 print '<td class="right">' . $amountsup . '</td>';
676 print '<td class="right">' . $langs->trans("Payment") . ' (' . $langs->trans("PercentOfInvoice") . ')</td>';
677 }
678 print '<td class="right">' . $langs->trans("AmountHTVATRealPaid") . '</td>';
679 print '<td class="right">' . $vatsup . '</td>';
680 print '</tr>' . "\n";
681
682 foreach (array_keys($x_paye) as $rate) {
683 $subtot_paye_total_ht = 0;
684 $subtot_paye_vat = 0;
685
686 if (is_array($x_both[$rate]['paye']['detail'])) { // @phpstan-ignore-line
687 print "<tr>";
688 print '<td class="tax_rate" colspan="' . ($span + 1) . '">';
689 print $langs->trans('Rate') . ' : ' . vatrate($rate) . '%';
690 print ' - <a class="reposition" href="' . DOL_URL_ROOT . '/compta/tva/quadri_detail.php?invoice_type=supplier';
691 if ($invoice_type != 'supplier' || !GETPOSTISSET('vat_rate_show') || GETPOST('vat_rate_show') != $rate) {
692 print '&amp;vat_rate_show=' . urlencode($rate);
693 }
694 print '&amp;date_startyear=' . ((int) $date_start_year) . '&amp;date_startmonth=' . ((int) $date_start_month) . '&amp;date_startday=' . ((int) $date_start_day) . '&amp;date_endyear=' . ((int) $date_end_year) . '&amp;date_endmonth=' . ((int) $date_end_month) . '&amp;date_endday=' . ((int) $date_end_day) . '">';
695 print img_picto('', 'chevron-down', 'class="paddingrightonly"') . $langs->trans('VATReportShowByRateDetails') . '</a>';
696 print '</td>';
697 print '</tr>' . "\n";
698
699 foreach ($x_both[$rate]['paye']['detail'] as $index => $fields) {
700 // Define type
701 // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
702 $type = (isset($fields['dtype']) ? $fields['dtype'] : $fields['ptype']);
703 // Try to enhance type detection using date_start and date_end for free lines where type was not saved.
704 if (!empty($fields['ddate_start'])) {
705 $type = 1;
706 }
707 if (!empty($fields['ddate_end'])) {
708 $type = 1;
709 }
710
711 // Payment
712 $ratiopaymentinvoice = 1;
713 if ($modetax != 1) {
714 if (($type == 0 && getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'invoice')
715 || ($type == 1 && getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'invoice')) {
716 } else {
717 if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) {
718 $ratiopaymentinvoice = ($fields['payment_amount'] / (float) $fields['ftotal_ttc']);
719 }
720 }
721 }
722
723 // VAT paid
724 $temp_ht = (float) $fields['totalht'] * $ratiopaymentinvoice;
725
726 // VAT
727 $temp_vat = $fields['vat'] * $ratiopaymentinvoice;
728
729 $subtot_paye_total_ht += $temp_ht;
730 $subtot_paye_vat += $temp_vat;
731 $x_paye_sum += $temp_vat;
732 }
733
734 if ($invoice_type == 'supplier' && $vat_rate_show == $rate) {
735 foreach ($x_both[$rate]['paye']['detail'] as $index => $fields) {
736 /*$company_static->id = $fields['company_id'];
737 $company_static->name = $fields['company_name'];
738 $company_static->name_alias = $fields['company_alias'];
739 $company_static->email = $fields['company_email'];
740 $company_static->tva_intra = $fields['company_tva_intra'];
741 $company_static->client = $fields['company_client'];
742 $company_static->fournisseur = $fields['company_fournisseur'];
743 $company_static->status = $fields['company_status'];
744 $company_static->code_client = $fields['company_client'];
745 $company_static->code_compta_client = $fields['company_customer_code'];
746 $company_static->code_fournisseur = $fields['company_customer_accounting_code'];
747 $company_static->code_compta_fournisseur = $fields['company_supplier_accounting_code'];*/
748
749 // Define type
750 // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
751 $type = (isset($fields['dtype']) ? $fields['dtype'] : $fields['ptype']);
752 // Try to enhance type detection using date_start and date_end for free lines where type was not saved.
753 if (!empty($fields['ddate_start'])) {
754 $type = 1;
755 }
756 if (!empty($fields['ddate_end'])) {
757 $type = 1;
758 }
759
760 print '<tr class="oddeven">';
761
762 // Ref
763 print '<td class="nowrap left">' . $fields['link'] . '</td>';
764
765 // Invoice date
766 print '<td class="left">' . dol_print_date($fields['datef'], 'day') . '</td>';
767
768 // Payment date
769 if (getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'payment' || getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'payment') {
770 print '<td class="left">' . dol_print_date($fields['datep'], 'day') . '</td>';
771 } else {
772 print '<td></td>';
773 }
774
775 // Company name
776 print '<td class="tdoverflowmax150">';
777 //print $company_static->getNomUrl(1);
778 print $fields['company_link'];
779 print '</td>';
780
781 // Description
782 print '<td class="left">';
783 if ($fields['pid']) {
784 $product_static->id = $fields['pid'];
785 $product_static->ref = $fields['pref'];
786 $product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered
787 print $product_static->getNomUrl(1);
788 if (dol_string_nohtmltag($fields['descr'])) {
789 print ' - ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
790 }
791 } else {
792 if ($type) {
793 $text = img_object($langs->trans('Service'), 'service');
794 } else {
795 $text = img_object($langs->trans('Product'), 'product');
796 }
797 if (preg_match('/^\‍((.*)\‍)$/', $fields['descr'], $reg)) {
798 if ($reg[1] == 'DEPOSIT') {
799 $fields['descr'] = $langs->transnoentitiesnoconv('Deposit');
800 } elseif ($reg[1] == 'CREDIT_NOTE') {
801 $fields['descr'] = $langs->transnoentitiesnoconv('CreditNote');
802 } else {
803 $fields['descr'] = $langs->transnoentitiesnoconv($reg[1]);
804 }
805 }
806 print $text . ' ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
807
808 // Show range
809 print_date_range($fields['ddate_start'], $fields['ddate_end']);
810 }
811 print '</td>';
812
813 // Total HT
814 if ($modetax != 1) {
815 print '<td class="nowrap right">';
816 print price($fields['totalht']);
817 if (price2num($fields['ftotal_ttc'])) {
818 //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
819 $ratiolineinvoice = ((float) $fields['dtotal_ttc'] / (float) $fields['ftotal_ttc']);
820 //print ' ('.round($ratiolineinvoice*100,2).'%)';
821 }
822 print '</td>';
823 }
824
825 // Payment
826 $ratiopaymentinvoice = 1;
827 if ($modetax != 1) {
828 print '<td class="nowrap right">';
829 if ($fields['payment_amount'] && $fields['ftotal_ttc']) {
830 $paymentfourn_static->id = $fields['payment_id'];
831 $paymentfourn_static->ref = $fields['payment_ref'];
832 print $paymentfourn_static->getNomUrl(2, '', '', 0) . ' ';
833 }
834
835 if (($type == 0 && getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'invoice')
836 || ($type == 1 && getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'invoice')) {
837 print $langs->trans("NA");
838 } else {
839 if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) {
840 $ratiopaymentinvoice = ($fields['payment_amount'] / (float) $fields['ftotal_ttc']);
841 }
842 print price(price2num($fields['payment_amount'], 'MT'));
843 if (isset($fields['payment_amount'])) {
844 print ' (' . round($ratiopaymentinvoice * 100, 2) . '%)';
845 }
846 }
847 print '</td>';
848 }
849
850 // VAT paid
851 print '<td class="nowrap right">';
852 $temp_ht = (float) $fields['totalht'] * $ratiopaymentinvoice;
853 print price(price2num($temp_ht, 'MT'), 1);
854 print '</td>';
855
856 // VAT
857 print '<td class="nowrap right">';
858 $temp_vat = $fields['vat'] * $ratiopaymentinvoice;
859 print price(price2num($temp_vat, 'MT'), 1);
860 //print price($fields['vat']);
861 print '</td>';
862 print '</tr>';
863
864 //$subtot_paye_total_ht += $temp_ht;
865 //$subtot_paye_vat += $temp_vat;
866 //$x_paye_sum += $temp_vat;
867 }
868 }
869 }
870
871 // Total suppliers for this vat rate
872 print '<tr class="liste_total">';
873 print '<td colspan="4"></td>';
874 print '<td class="right">' . $langs->trans("Total") . ':</td>';
875 if ($modetax != 1) {
876 print '<td class="nowrap right">&nbsp;</td>';
877 print '<td class="right">&nbsp;</td>';
878 }
879 print '<td class="right"><span class="amount">' . price(price2num($subtot_paye_total_ht, 'MT')) . '</span></td>';
880 print '<td class="nowrap right"><span class="amount">' . price(price2num($subtot_paye_vat, 'MT')) . '</span></td>';
881 print '</tr>';
882 }
883
884 if (count($x_paye) == 0) { // Show a total line if nothing shown
885 print '<tr class="liste_total">';
886 print '<td colspan="4"></td>';
887 print '<td class="right">' . $langs->trans("Total") . ':</td>';
888 if ($modetax != 1) {
889 print '<td class="nowrap right">&nbsp;</td>';
890 print '<td class="right">&nbsp;</td>';
891 }
892 print '<td class="right"><span class="amount">' . price(price2num(0, 'MT')) . '</span></td>';
893 print '<td class="nowrap right"><span class="amount">' . price(price2num(0, 'MT')) . '</span></td>';
894 print '</tr>';
895 }
896
897 print '</table>';
898 print '</div>';
899
900 // Total to pay
901 print '<br><br>';
902 print '<table class="noborder centpercent">';
903 $diff = $x_coll_sum - $x_paye_sum;
904 print '<tr class="liste_total">';
905 print '<td class="liste_total" colspan="' . $span . '">' . $langs->trans("TotalToPay") . '</td>';
906 print '<td class="liste_total nowrap right"><b>' . price(price2num($diff, 'MT')) . "</b></td>\n";
907 print "</tr>\n";
908
909 $i++;
910}
911print '</table>';
912
913llxFooter();
914$db->close();
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:47
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
Class to manage Trips and Expenses.
Class to manage suppliers invoices.
Class to manage invoices.
Class to manage generation of HTML components Only common components must be here.
Class to manage payments for supplier invoices.
Class to manage payments of customer invoices.
Class to manage payments of expense report.
Class to manage products or services.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage VAT - Value-added tax (also known in French as TVA - Taxe sur la valeur ajoutée)
Definition tva.class.php:39
global $mysoc
dol_now($mode='gmt')
Return date for now.
vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0, $html=0)
Return a string with VAT rate label formatted for view output Used into pdf and HTML pages.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
print_date_range($date_start, $date_end, $format='', $outputlangs=null)
Format output for start and end date.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
report_header($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink='', $moreparam=array(), $calcmode='', $varlink='')
Show header of a report.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
tax_by_rate($type, $db, $y, $q, $date_start, $date_end, $modetax, $direction, $m=0)
Gets Tax to collect for the given year (and given quarter or month) The function gets the Tax in spli...
Definition tax.lib.php:669