dolibarr  7.0.0-beta
Functions
tax.lib.php File Reference

Library for tax module. More...

Go to the source code of this file.

Functions

 tax_prepare_head (ChargeSociales $object)
 Prepare array with list of tabs. More...
 
 vat_by_thirdparty ($db, $y, $date_start, $date_end, $modetax, $direction, $m=0)
 Look for collectable VAT clients in the chosen year (and month) More...
 
 tax_by_date ($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 split results, as the Tax declaration asks to report the amounts for different Tax rates as different lines. More...
 
 vat_by_date ($db, $y, $q, $date_start, $date_end, $modetax, $direction, $m=0)
 Gets VAT to collect for the given year (and given quarter or month) The function gets the VAT in split results, as the VAT declaration asks to report the amounts for different VAT rates as different lines. More...
 

Detailed Description

Library for tax module.

Definition in file tax.lib.php.

Function Documentation

tax_by_date (   $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 split results, as the Tax declaration asks to report the amounts for different Tax rates as different lines.

This function also accounts recurrent invoices.

Parameters
string$typeTax type, either 'vat', 'localtax1' or 'localtax2'
DoliDB$dbDatabase handler object
int$yYear
int$qQuarter
string$date_startStart date
string$date_endEnd date
int$modetax0 or 1 (option vat on debit)
int$direction'sell' (customer invoice) or 'buy' (supplier invoices)
int$mMonth
Returns
array List of quarters with vat

Definition at line 200 of file tax.lib.php.

References $resql, dol_get_first_day(), dol_get_last_day(), dol_print_error(), and dol_syslog().

Referenced by vat_by_date().

tax_prepare_head ( ChargeSociales  $object)

Prepare array with list of tabs.

Parameters
ChargeSociales$objectObject related to tabs
Returns
array Array of tabs to show

Definition at line 37 of file tax.lib.php.

References complete_head_from_modules(), Link\count(), dol_dir_list(), and dol_sanitizeFileName().

vat_by_date (   $db,
  $y,
  $q,
  $date_start,
  $date_end,
  $modetax,
  $direction,
  $m = 0 
)

Gets VAT to collect for the given year (and given quarter or month) The function gets the VAT in split results, as the VAT declaration asks to report the amounts for different VAT rates as different lines.

This function also accounts recurrent invoices.

Parameters
DoliDB$dbDatabase handler object
int$yYear
int$qQuarter
string$date_startStart date
string$date_endEnd date
int$modetax0 or 1 (option vat on debit)
int$direction'sell' (customer invoice) or 'buy' (supplier invoices)
int$mMonth
Returns
array List of quarters with vat

Definition at line 643 of file tax.lib.php.

References tax_by_date().

vat_by_thirdparty (   $db,
  $y,
  $date_start,
  $date_end,
  $modetax,
  $direction,
  $m = 0 
)

Look for collectable VAT clients in the chosen year (and month)

Parameters
DoliDB$dbDatabase handle
int$yYear
string$date_startStart date
string$date_endEnd date
int$modetax0 or 1 (option vat on debit, 1 => $modecompta = 'CREANCES-DETTES')
string$direction'sell' or 'buy'
int$mMonth
Returns
array List of customers third parties with vat, -1 if no accountancy module, -2 if not yet developped, -3 if error

Definition at line 89 of file tax.lib.php.

References $resql, dol_get_first_day(), dol_get_last_day(), dol_print_error(), and dol_syslog().