dolibarr 21.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 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';
34require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php';
35require_once DOL_DOCUMENT_ROOT . '/core/lib/tax.lib.php';
36require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
37require_once DOL_DOCUMENT_ROOT . '/compta/tva/class/tva.class.php';
38require_once DOL_DOCUMENT_ROOT . '/compta/localtax/class/localtax.class.php';
39require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
40require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
41require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
42require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
43require_once DOL_DOCUMENT_ROOT . '/fourn/class/paiementfourn.class.php';
44require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php';
45require_once DOL_DOCUMENT_ROOT . '/expensereport/class/paymentexpensereport.class.php';
46
56// Load translation files required by the page
57$langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "product", "trips", "admin"));
58
59$refresh = (GETPOSTISSET('submit') || GETPOSTISSET('vat_rate_show') || GETPOSTISSET('invoice_type'));
60$invoice_type = GETPOSTISSET('invoice_type') ? GETPOST('invoice_type', 'alpha') : '';
61$vat_rate_show = GETPOSTISSET('vat_rate_show') ? GETPOST('vat_rate_show', 'alphanohtml') : -1;
62
63// Set $date_start_xxx and $date_end_xxx...
64include DOL_DOCUMENT_ROOT . '/compta/tva/initdatesforvat.inc.php';
65// Variables provided by include:
66'
67@phan-var-force int $date_start
68@phan-var-force int $date_end
69@phan-var-force string $date_start_month
70@phan-var-force string $date_start_year
71@phan-var-force string $date_start_day
72@phan-var-force string $date_end_month
73@phan-var-force string $date_end_year
74@phan-var-force string $date_end_day
75';
76
77$min = price2num(GETPOST("min", "alpha"));
78if (empty($min)) {
79 $min = 0;
80}
81
82// Define modetax (0 or 1)
83// 0=normal, 1=option vat for services is on debit, 2=option on payments for products
84$modetax = getDolGlobalInt('TAX_MODE');
85if (GETPOSTISSET("modetax")) {
86 $modetax = GETPOSTINT("modetax");
87}
88if (empty($modetax)) {
89 $modetax = 0;
90}
91
92$object = new Tva($db);
93
94// Security check
95$socid = GETPOSTINT('socid');
96if ($user->socid) {
97 $socid = $user->socid;
98}
99$result = restrictedArea($user, 'tax', '', 'tva', 'charges');
100
101
102/*
103 * View
104 */
105
106$form = new Form($db);
107$company_static = new Societe($db);
108$invoice_customer = new Facture($db);
109$invoice_supplier = new FactureFournisseur($db);
110$expensereport = new ExpenseReport($db);
111$product_static = new Product($db);
112$payment_static = new Paiement($db);
113$paymentfourn_static = new PaiementFourn($db);
114$paymentexpensereport_static = new PaymentExpenseReport($db);
115
116$morequerystring = '';
117$listofparams = array('date_startmonth', 'date_startyear', 'date_startday', 'date_endmonth', 'date_endyear', 'date_endday');
118foreach ($listofparams as $param) {
119 if (GETPOST($param) != '') {
120 $morequerystring .= ($morequerystring ? '&' : '') . $param . '=' . GETPOST($param);
121 }
122}
123
124$title = $langs->trans("VATReport") . " " . dol_print_date($date_start, '', 'tzserver') . " -> " . dol_print_date($date_end, '', 'tzserver');
125llxHeader('', $title, '', '', 0, 0, '', '', $morequerystring);
126
127
128//print load_fiche_titre($langs->trans("VAT"),"");
129
130//$fsearch.='<br>';
131$fsearch = '<!-- hidden fields for form -->';
132$fsearch .= '<input type="hidden" name="token" value="' . newToken() . '">';
133$fsearch .= '<input type="hidden" name="modetax" value="' . $modetax . '">';
134//$fsearch.=' '.$langs->trans("SalesTurnoverMinimum").': ';
135//$fsearch.=' <input type="text" name="min" value="'.$min.'">';
136
137
138// Show report header
139$name = $langs->trans("VATReportByRates");
140$calcmode = '';
141if ($modetax == 0) {
142 $calcmode = $langs->trans('OptionVATDefault');
143}
144if ($modetax == 1) {
145 $calcmode = $langs->trans('OptionVATDebitOption');
146}
147if ($modetax == 2) {
148 $calcmode = $langs->trans('OptionPaymentForProductAndServices');
149}
150$calcmode .= ' <span class="opacitymedium">(' . $langs->trans("TaxModuleSetupToModifyRules", DOL_URL_ROOT . '/admin/taxes.php') . ')</span>';
151// Set period
152$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
153$period .= ' - ';
154$period .= $form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 0, '', '', '', '', 1, '', '', 'tzserver');
155$prevyear = $date_start_year;
156$q = 0;
157$prevquarter = $q;
158if ($prevquarter > 1) {
159 $prevquarter--;
160} else {
161 $prevquarter = 4;
162 $prevyear--;
163}
164$nextyear = $date_start_year;
165$nextquarter = $q;
166if ($nextquarter < 4) {
167 $nextquarter++;
168} else {
169 $nextquarter = 1;
170 $nextyear++;
171}
172$description = $fsearch;
173$builddate = dol_now();
174
175if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice') {
176 $description .= $langs->trans("RulesVATDueProducts");
177}
178if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'payment') {
179 $description .= $langs->trans("RulesVATInProducts");
180}
181if (getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'invoice') {
182 $description .= '<br>' . $langs->trans("RulesVATDueServices");
183}
184if (getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'payment') {
185 $description .= '<br>' . $langs->trans("RulesVATInServices");
186}
187if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
188 if (getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'invoice' && getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice') {
189 $description .= '<br>' . $langs->trans("DepositsAreNotIncluded");
190 } elseif (getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'invoice') { // calculate on sale invoice for service only
191 $description .= '<br>' . $langs->trans("DepositsAreNotIncluded").' (for services)';
192 } elseif (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice') { // calculate on sale invoice for service only
193 $description .= '<br>' . $langs->trans("DepositsAreNotIncluded").' (for products)';
194 }
195}
196if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
197 if (getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'invoice' && getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'invoice') {
198 $description .= '<br>' . $langs->trans("SupplierDepositsAreNotIncluded");
199 } elseif (getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'invoice') { // calculate on supplier invoice for service only
200 $description .= '<br>' . $langs->trans("SupplierDepositsAreNotIncluded").' (for services)';
201 } elseif (getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'invoice') { // calculate on supplier invoice for product only
202 $description .= '<br>' . $langs->trans("SupplierDepositsAreNotIncluded").' (for products)';
203 }
204}
205if (isModEnabled('accounting')) {
206 $description .= '<br>' . $langs->trans("ThisIsAnEstimatedValue");
207}
208
209// Customers invoices
210$elementcust = $langs->trans("CustomersInvoices");
211$productcust = $langs->trans("ProductOrService");
212$amountcust = $langs->trans("AmountHT");
213$vatcust = $langs->trans("VATReceived");
214$namecust = $langs->trans("Name");
215if ($mysoc->tva_assuj) {
216 $vatcust .= ' (' . $langs->trans("VATToPay") . ')';
217}
218
219// Suppliers invoices
220$elementsup = $langs->trans("SuppliersInvoices");
221$productsup = $productcust;
222$amountsup = $amountcust;
223$vatsup = $langs->trans("VATPaid");
224$namesup = $namecust;
225if ($mysoc->tva_assuj) {
226 $vatsup .= ' (' . $langs->trans("ToGetBack") . ')';
227}
228
229$optioncss = GETPOST('optioncss', 'alpha');
230$periodlink = '';
231$exportlink = '';
232
233if ($optioncss != "print") {
234 report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink, array(), $calcmode);
235}
236
237$vatcust = $langs->trans("VATReceived");
238$vatsup = $langs->trans("VATPaid");
239$vatexpensereport = $langs->trans("VATPaid");
240
241
242// VAT Received and paid
243print '<div class="div-table-responsive">';
244print '<table class="liste noborder centpercent">';
245
246$y = $year_current;
247$i = 0;
248
249$columns = 7;
250$span = $columns;
251if ($modetax != 1) {
252 $span += 2;
253}
254
255// Load arrays of datas
256$x_coll = tax_by_rate('vat', $db, 0, 0, $date_start, $date_end, $modetax, 'sell');
257$x_paye = tax_by_rate('vat', $db, 0, 0, $date_start, $date_end, $modetax, 'buy');
258
259if (!is_array($x_coll) || !is_array($x_paye)) {
260 $langs->load("errors");
261 if ($x_coll == -1) {
262 print '<tr><td colspan="' . $columns . '">' . $langs->trans("ErrorNoAccountancyModuleLoaded") . '</td></tr>';
263 } elseif ($x_coll == -2) {
264 print '<tr><td colspan="' . $columns . '">' . $langs->trans("FeatureNotYetAvailable") . '</td></tr>';
265 } else {
266 print '<tr><td colspan="' . $columns . '">' . $langs->trans("Error") . '</td></tr>';
267 }
268} else {
269 $x_both = array();
270 //now, from these two arrays, get another array with one rate per line
271 foreach (array_keys($x_coll) as $my_coll_rate) {
272 $x_both[$my_coll_rate] = array(
273 'coll' => array(),
274 'paye' => array(),
275 );
276 $x_both[$my_coll_rate]['coll']['totalht'] = $x_coll[$my_coll_rate]['totalht'];
277 $x_both[$my_coll_rate]['coll']['vat'] = $x_coll[$my_coll_rate]['vat'];
278 $x_both[$my_coll_rate]['paye']['totalht'] = 0;
279 $x_both[$my_coll_rate]['paye']['vat'] = 0;
280 $x_both[$my_coll_rate]['coll']['links'] = '';
281 $x_both[$my_coll_rate]['coll']['detail'] = array();
282 foreach ($x_coll[$my_coll_rate]['facid'] as $id => $dummy) {
283 $invoice_customer->id = $x_coll[$my_coll_rate]['facid'][$id];
284 $invoice_customer->ref = $x_coll[$my_coll_rate]['facnum'][$id];
285 $invoice_customer->type = $x_coll[$my_coll_rate]['type'][$id];
286
287 //$company_static->fetch($x_coll[$my_coll_rate]['company_id'][$id]);
288 $company_static->id = $x_coll[$my_coll_rate]['company_id'][$id];
289 $company_static->name = $x_coll[$my_coll_rate]['company_name'][$id];
290 $company_static->name_alias = $x_coll[$my_coll_rate]['company_alias'][$id];
291 $company_static->email = $x_coll[$my_coll_rate]['company_email'][$id];
292 $company_static->tva_intra = isset($x_coll[$my_coll_rate]['tva_intra'][$id]) ? $x_coll[$my_coll_rate]['tva_intra'][$id] : '0'; // @phan-suppress-current-line PhanTypeArraySuspiciousNull,PhanTypeInvalidDimOffset
293 $company_static->client = $x_coll[$my_coll_rate]['company_client'][$id];
294 $company_static->fournisseur = $x_coll[$my_coll_rate]['company_fournisseur'][$id];
295 $company_static->status = $x_coll[$my_coll_rate]['company_status'][$id];
296 $company_static->code_client = $x_coll[$my_coll_rate]['company_customer_code'][$id];
297 $company_static->code_compta_client = $x_coll[$my_coll_rate]['company_customer_accounting_code'][$id];
298 $company_static->code_fournisseur = $x_coll[$my_coll_rate]['company_supplier_code'][$id];
299 $company_static->code_compta_fournisseur = $x_coll[$my_coll_rate]['company_supplier_accounting_code'][$id];
300
301 $x_both[$my_coll_rate]['coll']['detail'][] = array(
302 'id' => $x_coll[$my_coll_rate]['facid'][$id],
303 'descr' => $x_coll[$my_coll_rate]['descr'][$id],
304 'pid' => $x_coll[$my_coll_rate]['pid'][$id],
305 'pref' => $x_coll[$my_coll_rate]['pref'][$id],
306 'ptype' => $x_coll[$my_coll_rate]['ptype'][$id],
307 'payment_id' => $x_coll[$my_coll_rate]['payment_id'][$id],
308 'payment_ref' => $x_coll[$my_coll_rate]['payment_ref'][$id],
309 'payment_amount' => $x_coll[$my_coll_rate]['payment_amount'][$id],
310 'ftotal_ttc' => $x_coll[$my_coll_rate]['ftotal_ttc'][$id],
311 'dtotal_ttc' => $x_coll[$my_coll_rate]['dtotal_ttc'][$id],
312 'dtype' => $x_coll[$my_coll_rate]['dtype'][$id],
313 'datef' => $x_coll[$my_coll_rate]['datef'][$id],
314 'datep' => $x_coll[$my_coll_rate]['datep'][$id],
315
316 'company_link' => $company_static->getNomUrl(1, '', 20),
317
318 'ddate_start' => $x_coll[$my_coll_rate]['ddate_start'][$id],
319 'ddate_end' => $x_coll[$my_coll_rate]['ddate_end'][$id],
320 'totalht' => $x_coll[$my_coll_rate]['totalht_list'][$id],
321 'vat' => $x_coll[$my_coll_rate]['vat_list'][$id],
322 'link' => $invoice_customer->getNomUrl(1, '', 12)
323 );
324 }
325 }
326 // tva paid
327 foreach (array_keys($x_paye) as $my_paye_rate) {
328 $x_both[$my_paye_rate]['paye']['totalht'] = $x_paye[$my_paye_rate]['totalht'];
329 $x_both[$my_paye_rate]['paye']['vat'] = $x_paye[$my_paye_rate]['vat'];
330 if (!isset($x_both[$my_paye_rate]['coll']['totalht'])) {
331 $x_both[$my_paye_rate]['coll']['totalht'] = 0;
332 $x_both[$my_paye_rate]['coll']['vat'] = 0;
333 }
334 $x_both[$my_paye_rate]['paye']['links'] = '';
335 $x_both[$my_paye_rate]['paye']['detail'] = array();
336
337 foreach ($x_paye[$my_paye_rate]['facid'] as $id => $dummy) {
338 // ExpenseReport
339 if ($x_paye[$my_paye_rate]['ptype'][$id] === 'ExpenseReportPayment') {
340 $expensereport->id = $x_paye[$my_paye_rate]['facid'][$id];
341 $expensereport->ref = $x_paye[$my_paye_rate]['facnum'][$id];
342 $expensereport->type = $x_paye[$my_paye_rate]['type'][$id];
343
344 $x_both[$my_paye_rate]['paye']['detail'][] = array(
345 'id' => $x_paye[$my_paye_rate]['facid'][$id],
346 'descr' => $x_paye[$my_paye_rate]['descr'][$id],
347 'pid' => $x_paye[$my_paye_rate]['pid'][$id],
348 'pref' => $x_paye[$my_paye_rate]['pref'][$id],
349 'ptype' => $x_paye[$my_paye_rate]['ptype'][$id],
350 'payment_id' => $x_paye[$my_paye_rate]['payment_id'][$id],
351 'payment_ref' => $x_paye[$my_paye_rate]['payment_ref'][$id],
352 'payment_amount' => $x_paye[$my_paye_rate]['payment_amount'][$id],
353 'ftotal_ttc' => price2num($x_paye[$my_paye_rate]['ftotal_ttc'][$id]),
354 'dtotal_ttc' => price2num($x_paye[$my_paye_rate]['dtotal_ttc'][$id]),
355 'dtype' => $x_paye[$my_paye_rate]['dtype'][$id],
356 'ddate_start' => $x_paye[$my_paye_rate]['ddate_start'][$id],
357 'ddate_end' => $x_paye[$my_paye_rate]['ddate_end'][$id],
358 'totalht' => price2num($x_paye[$my_paye_rate]['totalht_list'][$id]),
359 'vat' => $x_paye[$my_paye_rate]['vat_list'][$id],
360 'link' => $expensereport->getNomUrl(1)
361 );
362 } else {
363 $invoice_supplier->id = $x_paye[$my_paye_rate]['facid'][$id];
364 $invoice_supplier->ref = $x_paye[$my_paye_rate]['facnum'][$id];
365 $invoice_supplier->type = $x_paye[$my_paye_rate]['type'][$id];
366
367 $company_static->id = $x_paye[$my_paye_rate]['company_id'][$id];
368 $company_static->name = $x_paye[$my_paye_rate]['company_name'][$id];
369 $company_static->name_alias = $x_paye[$my_paye_rate]['company_alias'][$id];
370 $company_static->email = $x_paye[$my_paye_rate]['company_email'][$id];
371 $company_static->tva_intra = $x_paye[$my_paye_rate]['tva_intra'][$id];
372 $company_static->client = $x_paye[$my_paye_rate]['company_client'][$id];
373 $company_static->fournisseur = $x_paye[$my_paye_rate]['company_fournisseur'][$id];
374 $company_static->status = $x_paye[$my_paye_rate]['company_status'][$id];
375 $company_static->code_client = $x_paye[$my_paye_rate]['company_customer_code'][$id];
376 $company_static->code_compta_client = $x_paye[$my_paye_rate]['company_customer_accounting_code'][$id];
377 $company_static->code_fournisseur = $x_paye[$my_paye_rate]['company_supplier_code'][$id];
378 $company_static->code_compta_fournisseur = $x_paye[$my_paye_rate]['company_supplier_accounting_code'][$id];
379
380 $x_both[$my_paye_rate]['paye']['detail'][] = array(
381 'id' => $x_paye[$my_paye_rate]['facid'][$id],
382 'descr' => $x_paye[$my_paye_rate]['descr'][$id],
383 'pid' => $x_paye[$my_paye_rate]['pid'][$id],
384 'pref' => $x_paye[$my_paye_rate]['pref'][$id],
385 'ptype' => $x_paye[$my_paye_rate]['ptype'][$id],
386 'payment_id' => $x_paye[$my_paye_rate]['payment_id'][$id],
387 'payment_ref' => $x_paye[$my_paye_rate]['payment_ref'][$id],
388 'payment_amount' => $x_paye[$my_paye_rate]['payment_amount'][$id],
389 'ftotal_ttc' => price2num($x_paye[$my_paye_rate]['ftotal_ttc'][$id]),
390 'dtotal_ttc' => price2num($x_paye[$my_paye_rate]['dtotal_ttc'][$id]),
391 'dtype' => $x_paye[$my_paye_rate]['dtype'][$id],
392 'datef' => $x_paye[$my_paye_rate]['datef'][$id],
393 'datep' => $x_paye[$my_paye_rate]['datep'][$id],
394
395 'company_link' => $company_static->getNomUrl(1, '', 20),
396
397 'ddate_start' => $x_paye[$my_paye_rate]['ddate_start'][$id],
398 'ddate_end' => $x_paye[$my_paye_rate]['ddate_end'][$id],
399 'totalht' => price2num($x_paye[$my_paye_rate]['totalht_list'][$id]),
400 'vat' => $x_paye[$my_paye_rate]['vat_list'][$id],
401 'link' => $invoice_supplier->getNomUrl(1, '', 12)
402 );
403 }
404 }
405 }
406 //now we have an array (x_both) indexed by rates for coll and paye
407
408
409 //print table headers for this quadri - incomes first
410
411 $x_coll_sum = 0;
412 $x_coll_ht = 0;
413 $x_paye_sum = 0;
414 $x_paye_ht = 0;
415
416 //print '<tr><td colspan="'.($span+1).'">'..')</td></tr>';
417
418 // Customers invoices
419 print '<tr class="liste_titre">';
420 print '<td class="left">' . $elementcust . '</td>';
421 print '<td class="left">' . $langs->trans("DateInvoice") . '</td>';
422 if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'payment' || getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'payment') {
423 print '<td class="left">' . $langs->trans("DatePayment") . '</td>';
424 } else {
425 print '<td></td>';
426 }
427 print '<td class="left">' . $namecust . '</td>';
428 print '<td class="left">' . $productcust . '</td>';
429 if ($modetax != 1) {
430 print '<td class="right">' . $amountcust . '</td>';
431 print '<td class="right">' . $langs->trans("Payment") . ' (' . $langs->trans("PercentOfInvoice") . ')</td>';
432 }
433 print '<td class="right">' . $langs->trans("AmountHTVATRealReceived") . '</td>';
434 print '<td class="right">' . $vatcust . '</td>';
435 print '</tr>';
436
437 $action = "tvadetail";
438 $parameters["mode"] = $modetax;
439 $parameters["start"] = $date_start;
440 $parameters["end"] = $date_end;
441 $parameters["type"] = 'vat';
442
443 $object = array(&$x_coll, &$x_paye, &$x_both);
444 // Initialize a technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array
445 $hookmanager->initHooks(array('externalbalance'));
446 $reshook = $hookmanager->executeHooks('addVatLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
447
448 foreach (array_keys($x_coll) as $rate) {
449 $subtot_coll_total_ht = 0;
450 $subtot_coll_vat = 0;
451
452 if (is_array($x_both[$rate]['coll']['detail'])) {
453 // VAT Rate
454 print "<tr>";
455 print '<td class="tax_rate" colspan="' . ($span + 1) . '">';
456 print $langs->trans('Rate') . ' : ' . vatrate($rate) . '%';
457 print ' - <a class="reposition" href="' . DOL_URL_ROOT . '/compta/tva/quadri_detail.php?invoice_type=customer';
458 if ($invoice_type != 'customer' || !GETPOSTISSET('vat_rate_show') || GETPOST('vat_rate_show') != $rate) {
459 print '&amp;vat_rate_show=' . urlencode($rate);
460 }
461 print '&amp;date_startyear=' . urlencode($date_start_year) . '&amp;date_startmonth=' . urlencode($date_start_month) . '&amp;date_startday=' . urlencode($date_start_day) . '&amp;date_endyear=' . urlencode($date_end_year) . '&amp;date_endmonth=' . urlencode($date_end_month) . '&amp;date_endday=' . urlencode($date_end_day) . '">' . img_picto('', 'chevron-down', 'class="paddingrightonly"') . $langs->trans('VATReportShowByRateDetails') . '</a>';
462 print '</td>';
463 print '</tr>' . "\n";
464
465 foreach ($x_both[$rate]['coll']['detail'] as $index => $fields) {
466 // Define type
467 // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
468 $type = (isset($fields['dtype']) ? $fields['dtype'] : $fields['ptype']);
469 // Try to enhance type detection using date_start and date_end for free lines where type
470 // was not saved.
471 if (!empty($fields['ddate_start'])) {
472 $type = 1;
473 }
474 if (!empty($fields['ddate_end'])) {
475 $type = 1;
476 }
477
478 // Payment
479 $ratiopaymentinvoice = 1;
480 if ($modetax != 1) {
481 if (($type == 0 && getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice')
482 || ($type == 1 && getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'invoice')) {
483 } else {
484 if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) {
485 $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']);
486 }
487 }
488 }
489
490 // Total collected
491 $temp_ht = (float) $fields['totalht'] * $ratiopaymentinvoice;
492
493 // VAT
494 $temp_vat = $fields['vat'] * $ratiopaymentinvoice;
495
496 $subtot_coll_total_ht += $temp_ht;
497 $subtot_coll_vat += $temp_vat;
498 $x_coll_sum += $temp_vat;
499 }
500 }
501
502 if ($invoice_type == 'customer' && $vat_rate_show == $rate) {
503 if (is_array($x_both[$rate]['coll']['detail'])) {
504 foreach ($x_both[$rate]['coll']['detail'] as $index => $fields) {
505 /*$company_static->id = $fields['company_id'];
506 $company_static->name = $fields['company_name'];
507 $company_static->name_alias = $fields['company_alias'];
508 $company_static->email = $fields['company_email'];
509 $company_static->tva_intra = $fields['tva_intra'];
510 $company_static->client = $fields['company_client'];
511 $company_static->fournisseur = $fields['company_fournisseur'];
512 $company_static->status = $fields['company_status'];
513 $company_static->code_client = $fields['company_client'];
514 $company_static->code_compta_client = $fields['company_customer_code'];
515 $company_static->code_fournisseur = $fields['company_customer_accounting_code'];
516 $company_static->code_compta_fournisseur = $fields['company_supplier_accounting_code'];*/
517
518 // Define type
519 // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
520 $type = (isset($fields['dtype']) ? $fields['dtype'] : $fields['ptype']);
521 // Try to enhance type detection using date_start and date_end for free lines where type
522 // was not saved.
523 if (!empty($fields['ddate_start'])) {
524 $type = 1;
525 }
526 if (!empty($fields['ddate_end'])) {
527 $type = 1;
528 }
529
530
531 print '<tr class="oddeven">';
532
533 // Ref
534 print '<td class="nowrap left">' . $fields['link'] . '</td>';
535
536 // Invoice date
537 print '<td class="left">' . dol_print_date($fields['datef'], 'day') . '</td>';
538
539 // Payment date
540 if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'payment' || getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'payment') {
541 print '<td class="left">' . dol_print_date($fields['datep'], 'day') . '</td>';
542 } else {
543 print '<td></td>';
544 }
545
546 // Company name
547 print '<td class="tdmaxoverflow150">';
548 //print $company_static->getNomUrl(1);
549 print $fields['company_link'];
550 print '</td>';
551
552 // Description
553 print '<td class="left">';
554 if ($fields['pid']) {
555 $product_static->id = $fields['pid'];
556 $product_static->ref = $fields['pref'];
557 $product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered
558 print $product_static->getNomUrl(1);
559 if (dol_string_nohtmltag($fields['descr'])) {
560 print ' - ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
561 }
562 } else {
563 if ($type) {
564 $text = img_object($langs->trans('Service'), 'service');
565 } else {
566 $text = img_object($langs->trans('Product'), 'product');
567 }
568 if (preg_match('/^\‍((.*)\‍)$/', $fields['descr'], $reg)) {
569 if ($reg[1] == 'DEPOSIT') {
570 $fields['descr'] = $langs->transnoentitiesnoconv('Deposit');
571 } elseif ($reg[1] == 'CREDIT_NOTE') {
572 $fields['descr'] = $langs->transnoentitiesnoconv('CreditNote');
573 } else {
574 $fields['descr'] = $langs->transnoentitiesnoconv($reg[1]);
575 }
576 }
577 print $text . ' ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
578
579 // Show range
580 print_date_range($fields['ddate_start'], $fields['ddate_end']);
581 }
582 print '</td>';
583
584 // Total HT
585 if ($modetax != 1) {
586 print '<td class="nowrap right">';
587 print price($fields['totalht']);
588 if (price2num($fields['ftotal_ttc'])) {
589 //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
590 $ratiolineinvoice = ($fields['dtotal_ttc'] / $fields['ftotal_ttc']);
591 //print ' ('.round($ratiolineinvoice*100,2).'%)';
592 }
593 print '</td>';
594 }
595
596 // Payment
597 $ratiopaymentinvoice = 1;
598 if ($modetax != 1) {
599 print '<td class="nowrap right">';
600 //print $fields['totalht']."-".$fields['payment_amount']."-".$fields['ftotal_ttc'];
601 if ($fields['payment_amount'] && $fields['ftotal_ttc']) {
602 $payment_static->id = $fields['payment_id'];
603 $payment_static->ref = $fields['payment_ref'];
604 print $payment_static->getNomUrl(2, '', '', 0) . ' ';
605 }
606 if (($type == 0 && getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice')
607 || ($type == 1 && getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'invoice')) {
608 print $langs->trans("NA");
609 } else {
610 if (isset($fields['payment_amount']) && price2num($fields['ftotal_ttc'])) {
611 $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']);
612 }
613 print price(price2num($fields['payment_amount'], 'MT'));
614 if (isset($fields['payment_amount'])) {
615 print ' (' . round($ratiopaymentinvoice * 100, 2) . '%)';
616 }
617 }
618 print '</td>';
619 }
620
621 // Total collected
622 print '<td class="nowrap right">';
623 $temp_ht = (float) $fields['totalht'] * $ratiopaymentinvoice;
624 print price(price2num($temp_ht, 'MT'), 1);
625 print '</td>';
626
627 // VAT
628 print '<td class="nowrap right">';
629 $temp_vat = $fields['vat'] * $ratiopaymentinvoice;
630 print price(price2num($temp_vat, 'MT'), 1);
631 //print price($fields['vat']);
632 print '</td>';
633 print '</tr>';
634
635 //$subtot_coll_total_ht += $temp_ht;
636 //$subtot_coll_vat += $temp_vat;
637 //$x_coll_sum += $temp_vat;
638 }
639 }
640 }
641 // Total customers for this vat rate
642 print '<tr class="liste_total">';
643 print '<td colspan="4"></td>';
644 print '<td class="right">' . $langs->trans("Total") . ':</td>';
645 if ($modetax != 1) {
646 print '<td class="nowrap right">&nbsp;</td>';
647 print '<td class="right">&nbsp;</td>';
648 }
649 print '<td class="right"><span class="amount">' . price(price2num($subtot_coll_total_ht, 'MT')) . '</span></td>';
650 print '<td class="nowrap right"><span class="amount">' . price(price2num($subtot_coll_vat, 'MT')) . '</span></td>';
651 print '</tr>';
652 }
653
654 if (count($x_coll) == 0) { // Show a total line if nothing shown
655 print '<tr class="liste_total">';
656 print '<td colspan="4"></td>';
657 print '<td class="right">' . $langs->trans("Total") . ':</td>';
658 if ($modetax != 1) {
659 print '<td class="nowrap right">&nbsp;</td>';
660 print '<td class="right">&nbsp;</td>';
661 }
662 print '<td class="right">' . price(price2num(0, 'MT')) . '</td>';
663 print '<td class="nowrap right">' . price(price2num(0, 'MT')) . '</td>';
664 print '</tr>';
665 }
666
667 // Blank line
668 print '<tr><td colspan="' . ($span + 2) . '">&nbsp;</td></tr>';
669
670 // Print table headers for this quadri - expenses
671 print '<tr class="liste_titre liste_titre_topborder">';
672 print '<td class="left">' . $elementsup . '</td>';
673 print '<td class="left">' . $langs->trans("DateInvoice") . '</td>';
674 if (getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'payment' || getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'payment') {
675 print '<td class="left">' . $langs->trans("DatePayment") . '</td>';
676 } else {
677 print '<td></td>';
678 }
679 print '<td class="left">' . $namesup . '</td>';
680 print '<td class="left">' . $productsup . '</td>';
681 if ($modetax != 1) {
682 print '<td class="right">' . $amountsup . '</td>';
683 print '<td class="right">' . $langs->trans("Payment") . ' (' . $langs->trans("PercentOfInvoice") . ')</td>';
684 }
685 print '<td class="right">' . $langs->trans("AmountHTVATRealPaid") . '</td>';
686 print '<td class="right">' . $vatsup . '</td>';
687 print '</tr>' . "\n";
688
689 foreach (array_keys($x_paye) as $rate) {
690 $subtot_paye_total_ht = 0;
691 $subtot_paye_vat = 0;
692
693 if (is_array($x_both[$rate]['paye']['detail'])) { // @phpstan-ignore-line
694 print "<tr>";
695 print '<td class="tax_rate" colspan="' . ($span + 1) . '">';
696 print $langs->trans('Rate') . ' : ' . vatrate($rate) . '%';
697 print ' - <a class="reposition" href="' . DOL_URL_ROOT . '/compta/tva/quadri_detail.php?invoice_type=supplier';
698 if ($invoice_type != 'supplier' || !GETPOSTISSET('vat_rate_show') || GETPOST('vat_rate_show') != $rate) {
699 print '&amp;vat_rate_show=' . urlencode($rate);
700 }
701 print '&amp;date_startyear=' . urlencode($date_start_year) . '&amp;date_startmonth=' . urlencode($date_start_month) . '&amp;date_startday=' . urlencode($date_start_day) . '&amp;date_endyear=' . urlencode($date_end_year) . '&amp;date_endmonth=' . urlencode($date_end_month) . '&amp;date_endday=' . urlencode($date_end_day) . '">' . img_picto('', 'chevron-down', 'class="paddingrightonly"') . $langs->trans('VATReportShowByRateDetails') . '</a>';
702 print '</td>';
703 print '</tr>' . "\n";
704
705 foreach ($x_both[$rate]['paye']['detail'] as $index => $fields) {
706 // Define type
707 // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
708 $type = (isset($fields['dtype']) ? $fields['dtype'] : $fields['ptype']);
709 // Try to enhance type detection using date_start and date_end for free lines where type
710 // was not saved.
711 if (!empty($fields['ddate_start'])) {
712 $type = 1;
713 }
714 if (!empty($fields['ddate_end'])) {
715 $type = 1;
716 }
717
718 // Payment
719 $ratiopaymentinvoice = 1;
720 if ($modetax != 1) {
721 if (($type == 0 && getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'invoice')
722 || ($type == 1 && getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'invoice')) {
723 } else {
724 if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) {
725 $ratiopaymentinvoice = ($fields['payment_amount'] / (float) $fields['ftotal_ttc']);
726 }
727 }
728 }
729
730 // VAT paid
731 $temp_ht = (float) $fields['totalht'] * $ratiopaymentinvoice;
732
733 // VAT
734 $temp_vat = $fields['vat'] * $ratiopaymentinvoice;
735
736 $subtot_paye_total_ht += $temp_ht;
737 $subtot_paye_vat += $temp_vat;
738 $x_paye_sum += $temp_vat;
739 }
740
741 if ($invoice_type == 'supplier' && $vat_rate_show == $rate) {
742 foreach ($x_both[$rate]['paye']['detail'] as $index => $fields) {
743 /*$company_static->id = $fields['company_id'];
744 $company_static->name = $fields['company_name'];
745 $company_static->name_alias = $fields['company_alias'];
746 $company_static->email = $fields['company_email'];
747 $company_static->tva_intra = $fields['tva_intra'];
748 $company_static->client = $fields['company_client'];
749 $company_static->fournisseur = $fields['company_fournisseur'];
750 $company_static->status = $fields['company_status'];
751 $company_static->code_client = $fields['company_client'];
752 $company_static->code_compta_client = $fields['company_customer_code'];
753 $company_static->code_fournisseur = $fields['company_customer_accounting_code'];
754 $company_static->code_compta_fournisseur = $fields['company_supplier_accounting_code'];*/
755
756 // Define type
757 // We MUST use dtype (type in line). We can use something else, only if dtype is really unknown.
758 $type = (isset($fields['dtype']) ? $fields['dtype'] : $fields['ptype']);
759 // Try to enhance type detection using date_start and date_end for free lines where type
760 // was not saved.
761 if (!empty($fields['ddate_start'])) {
762 $type = 1;
763 }
764 if (!empty($fields['ddate_end'])) {
765 $type = 1;
766 }
767
768 print '<tr class="oddeven">';
769
770 // Ref
771 print '<td class="nowrap left">' . $fields['link'] . '</td>';
772
773 // Invoice date
774 print '<td class="left">' . dol_print_date($fields['datef'], 'day') . '</td>';
775
776 // Payment date
777 if (getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'payment' || getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'payment') {
778 print '<td class="left">' . dol_print_date($fields['datep'], 'day') . '</td>';
779 } else {
780 print '<td></td>';
781 }
782
783 // Company name
784 print '<td class="tdmaxoverflow150">';
785 //print $company_static->getNomUrl(1);
786 print $fields['company_link'];
787 print '</td>';
788
789 // Description
790 print '<td class="left">';
791 if ($fields['pid']) {
792 $product_static->id = $fields['pid'];
793 $product_static->ref = $fields['pref'];
794 $product_static->type = $fields['dtype']; // We force with the type of line to have type how line is registered
795 print $product_static->getNomUrl(1);
796 if (dol_string_nohtmltag($fields['descr'])) {
797 print ' - ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
798 }
799 } else {
800 if ($type) {
801 $text = img_object($langs->trans('Service'), 'service');
802 } else {
803 $text = img_object($langs->trans('Product'), 'product');
804 }
805 if (preg_match('/^\‍((.*)\‍)$/', $fields['descr'], $reg)) {
806 if ($reg[1] == 'DEPOSIT') {
807 $fields['descr'] = $langs->transnoentitiesnoconv('Deposit');
808 } elseif ($reg[1] == 'CREDIT_NOTE') {
809 $fields['descr'] = $langs->transnoentitiesnoconv('CreditNote');
810 } else {
811 $fields['descr'] = $langs->transnoentitiesnoconv($reg[1]);
812 }
813 }
814 print $text . ' ' . dol_trunc(dol_string_nohtmltag($fields['descr']), 24);
815
816 // Show range
817 print_date_range($fields['ddate_start'], $fields['ddate_end']);
818 }
819 print '</td>';
820
821 // Total HT
822 if ($modetax != 1) {
823 print '<td class="nowrap right">';
824 print price($fields['totalht']);
825 if (price2num($fields['ftotal_ttc'])) {
826 //print $fields['dtotal_ttc']."/".$fields['ftotal_ttc']." - ";
827 $ratiolineinvoice = ((float) $fields['dtotal_ttc'] / (float) $fields['ftotal_ttc']);
828 //print ' ('.round($ratiolineinvoice*100,2).'%)';
829 }
830 print '</td>';
831 }
832
833 // Payment
834 $ratiopaymentinvoice = 1;
835 if ($modetax != 1) {
836 print '<td class="nowrap right">';
837 if ($fields['payment_amount'] && $fields['ftotal_ttc']) {
838 $paymentfourn_static->id = $fields['payment_id'];
839 $paymentfourn_static->ref = $fields['payment_ref'];
840 print $paymentfourn_static->getNomUrl(2, '', '', 0) . ' ';
841 }
842
843 if (($type == 0 && getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'invoice')
844 || ($type == 1 && getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'invoice')) {
845 print $langs->trans("NA");
846 } else {
847 if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) {
848 $ratiopaymentinvoice = ($fields['payment_amount'] / (float) $fields['ftotal_ttc']);
849 }
850 print price(price2num($fields['payment_amount'], 'MT'));
851 if (isset($fields['payment_amount'])) {
852 print ' (' . round($ratiopaymentinvoice * 100, 2) . '%)';
853 }
854 }
855 print '</td>';
856 }
857
858 // VAT paid
859 print '<td class="nowrap right">';
860 $temp_ht = (float) $fields['totalht'] * $ratiopaymentinvoice;
861 print price(price2num($temp_ht, 'MT'), 1);
862 print '</td>';
863
864 // VAT
865 print '<td class="nowrap right">';
866 $temp_vat = $fields['vat'] * $ratiopaymentinvoice;
867 print price(price2num($temp_vat, 'MT'), 1);
868 //print price($fields['vat']);
869 print '</td>';
870 print '</tr>';
871
872 //$subtot_paye_total_ht += $temp_ht;
873 //$subtot_paye_vat += $temp_vat;
874 //$x_paye_sum += $temp_vat;
875 }
876 }
877 }
878
879 // Total suppliers for this vat rate
880 print '<tr class="liste_total">';
881 print '<td colspan="4"></td>';
882 print '<td class="right">' . $langs->trans("Total") . ':</td>';
883 if ($modetax != 1) {
884 print '<td class="nowrap right">&nbsp;</td>';
885 print '<td class="right">&nbsp;</td>';
886 }
887 print '<td class="right"><span class="amount">' . price(price2num($subtot_paye_total_ht, 'MT')) . '</span></td>';
888 print '<td class="nowrap right"><span class="amount">' . price(price2num($subtot_paye_vat, 'MT')) . '</span></td>';
889 print '</tr>';
890 }
891
892 if (count($x_paye) == 0) { // Show a total line if nothing shown
893 print '<tr class="liste_total">';
894 print '<td colspan="4"></td>';
895 print '<td class="right">' . $langs->trans("Total") . ':</td>';
896 if ($modetax != 1) {
897 print '<td class="nowrap right">&nbsp;</td>';
898 print '<td class="right">&nbsp;</td>';
899 }
900 print '<td class="right"><span class="amount">' . price(price2num(0, 'MT')) . '</span></td>';
901 print '<td class="nowrap right"><span class="amount">' . price(price2num(0, 'MT')) . '</span></td>';
902 print '</tr>';
903 }
904
905 print '</table>';
906 print '</div>';
907
908 // Total to pay
909 print '<br><br>';
910 print '<table class="noborder centpercent">';
911 $diff = $x_coll_sum - $x_paye_sum;
912 print '<tr class="liste_total">';
913 print '<td class="liste_total" colspan="' . $span . '">' . $langs->trans("TotalToPay") . ($q ? ', ' . $langs->trans("Quadri") . ' ' . $q : '') . '</td>';
914 print '<td class="liste_total nowrap right"><b>' . price(price2num($diff, 'MT')) . "</b></td>\n";
915 print "</tr>\n";
916
917 $i++;
918}
919print '</table>';
920
921llxFooter();
922$db->close();
$id
Definition account.php:48
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:87
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:71
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:38
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.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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_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.
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:695