Go to the documentation of this file.
25 require
'../../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/compta/localtax/class/localtax.class.php';
29 $langs->load(
"compta");
32 $socid =
GETPOST(
'socid',
'int');
34 $socid = $user->socid;
37 $ltt =
GETPOST(
"localTaxType",
'int');
38 $mode =
GETPOST(
'mode',
'alpha');
46 $localtax_static =
new Localtax($db);
48 $url = DOL_URL_ROOT.
'/compta/localtax/card.php?action=create&localTaxType='.$ltt;
50 $url .=
'&socid='.$socid;
54 $param .=
'&mode='.urlencode($mode);
57 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', $_SERVER[
"PHP_SELF"].
'?localTaxType='.$ltt.
'&mode=common'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss'=>
'reposition'));
58 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode', $_SERVER[
"PHP_SELF"].
'?localTaxType='.$ltt.
'&mode=kanban'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss'=>
'reposition'));
59 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewLocalTaxPayment', ($ltt + 1)),
'',
'fa fa-plus-circle', $url,
'', $user->rights->tax->charges->creer);
61 print
load_fiche_titre($langs->transcountry($ltt == 2 ?
"LT2Payments" :
"LT1Payments", $mysoc->country_code), $newcardbutton,
'title_accountancy');
63 $sql =
"SELECT rowid, amount, label, f.datev, f.datep";
64 $sql .=
" FROM ".MAIN_DB_PREFIX.
"localtax as f ";
65 $sql .=
" WHERE f.entity = ".$conf->entity.
" AND localtaxtype = ".((int) $ltt);
66 $sql .=
" ORDER BY datev DESC";
68 $result = $db->query(
$sql);
70 $num = $db->num_rows($result);
74 print
'<div class="div-table-responsive-no-min">';
75 print
'<table class="noborder centpercent">';
76 print
'<tr class="liste_titre">';
77 print
'<td class="nowrap" align="left">'.$langs->trans(
"Ref").
'</td>';
78 print
"<td>".$langs->trans(
"Label").
"</td>";
79 print
"<td>".$langs->trans(
"PeriodEndDate").
"</td>";
80 print
'<td class="nowrap" align="left">'.$langs->trans(
"DatePayment").
'</td>';
81 print
"<td align=\"right\">".$langs->trans(
"PayedByThisPayment").
"</td>";
85 $obj = $db->fetch_object($result);
87 $localtax_static->label = $obj->label;
88 $localtax_static->id = $obj->rowid;
89 $localtax_static->ref = $obj->rowid;
90 $localtax_static->datev = $obj->datev;
91 $localtax_static->datep = $obj->datep;
92 $localtax_static->amount = $obj->amount;
94 $total = $total + $obj->amount;
96 if ($mode ==
'kanban') {
98 print
'<tr><td colspan="12">';
99 print
'<div class="box-flex-container kanban">';
102 print $localtax_static->getKanbanView(
'');
103 if ($i == ($num - 1)) {
108 print
'<tr class="oddeven">';
109 print
"<td>".$localtax_static->getNomUrl(1).
"</td>\n";
110 print
"<td>".dol_trunc($obj->label, 40).
"</td>\n";
111 print
'<td class="left">'.dol_print_date($db->jdate($obj->datev),
'day').
"</td>\n";
112 print
'<td class="left">'.dol_print_date($db->jdate($obj->datep),
'day').
"</td>\n";
114 print
'<td class="right nowraponall"><span class="amount">'.price($obj->amount).
'</span></td>';
119 print
'<tr class="liste_total"><td colspan="4">'.$langs->trans(
"Total").
'</td>';
120 print
'<td class="right"><span class="amount">'.price($total).
'</span></td></tr>';
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
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.
Class to manage local tax.