24 require
'../../main.inc.php';
25 require_once DOL_DOCUMENT_ROOT.
'/compta/localtax/class/localtax.class.php';
28 $langs->load(
"compta");
31 $socid =
GETPOST(
'socid',
'int');
32 if ($user->socid) $socid = $user->socid;
34 $ltt =
GETPOST(
"localTaxType",
'int');
43 $localtax_static =
new Localtax($db);
45 $url = DOL_URL_ROOT.
'/compta/localtax/card.php?action=create&localTaxType='.$ltt;
46 if (!empty($socid)) $url .=
'&socid='.$socid;
47 $newcardbutton =
dolGetButtonTitle($langs->trans(
'NewLocalTaxPayment', ($ltt + 1)),
'',
'fa fa-plus-circle', $url,
'', $user->rights->tax->charges->creer);
49 print load_fiche_titre($langs->transcountry($ltt == 2 ?
"LT2Payments" :
"LT1Payments", $mysoc->country_code), $newcardbutton,
'title_accountancy');
51 $sql =
"SELECT rowid, amount, label, f.datev, f.datep";
52 $sql .=
" FROM ".MAIN_DB_PREFIX.
"localtax as f ";
53 $sql .=
" WHERE f.entity = ".$conf->entity.
" AND localtaxtype = ".$db->escape($ltt);
54 $sql .=
" ORDER BY datev DESC";
56 $result = $db->query($sql);
59 $num = $db->num_rows($result);
63 print '<table class="noborder centpercent">';
64 print '<tr class="liste_titre">';
65 print '<td class="nowrap" align="left">'.$langs->trans(
"Ref").
'</td>';
66 print "<td>".$langs->trans(
"Label").
"</td>";
67 print "<td>".$langs->trans(
"PeriodEndDate").
"</td>";
68 print '<td class="nowrap" align="left">'.$langs->trans(
"DatePayment").
'</td>';
69 print "<td align=\"right\">".$langs->trans(
"PayedByThisPayment").
"</td>";
74 $obj = $db->fetch_object($result);
76 print '<tr class="oddeven">';
78 $localtax_static->id = $obj->rowid;
79 $localtax_static->ref = $obj->rowid;
80 print "<td>".$localtax_static->getNomUrl(1).
"</td>\n";
81 print "<td>".dol_trunc($obj->label, 40).
"</td>\n";
82 print '<td class="left">'.dol_print_date($db->jdate($obj->datev),
'day').
"</td>\n";
83 print '<td class="left">'.dol_print_date($db->jdate($obj->datep),
'day').
"</td>\n";
84 $total = $total + $obj->amount;
86 print "<td align=\"right\">".price($obj->amount).
"</td>";
91 print '<tr class="liste_total"><td colspan="4">'.$langs->trans(
"Total").
'</td>';
92 print '<td class="right">'.price($total).
'</td></tr>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
print
Draft customers invoices.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Class to manage local tax.