27require
'../../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/compta/localtax/class/localtax.class.php';
40$langs->load(
"compta");
47 $socid = $user->socid;
52$mode =
GETPOST(
'mode',
'alpha');
53$toselect =
GETPOST(
'toselect',
'array:int');
54$arrayofselected = is_array($toselect) ? $toselect : array();
65$url = DOL_URL_ROOT.
'/compta/localtax/card.php?action=create&localTaxType='.$ltt;
67 $url .=
'&socid='.$socid;
71 $param .=
'&mode='.urlencode($mode);
74$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'));
75$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'));
76$newcardbutton .= dolGetButtonTitleSeparator();
77$newcardbutton .= dolGetButtonTitle($langs->trans(
'NewLocalTaxPayment', ($ltt + 1)),
'',
'fa fa-plus-circle', $url,
'', $user->hasRight(
'tax',
'charges',
'creer'));
79print
load_fiche_titre($langs->transcountry($ltt == 2 ?
"LT2Payments" :
"LT1Payments",
$mysoc->country_code), $newcardbutton,
'title_accountancy');
81$sql =
"SELECT rowid, amount, label, f.datev, f.datep";
82$sql .=
" FROM ".MAIN_DB_PREFIX.
"localtax as f ";
83$sql .=
" WHERE f.entity = ".$conf->entity.
" AND localtaxtype = ".((int) $ltt);
84$sql .=
" ORDER BY datev DESC";
86$result =
$db->query($sql);
88 $num =
$db->num_rows($result);
92 print
'<div class="div-table-responsive-no-min">';
93 print
'<table class="noborder centpercent">';
94 print
'<tr class="liste_titre">';
95 print
'<td class="nowrap" align="left">'.$langs->trans(
"Ref").
'</td>';
96 print
"<td>".$langs->trans(
"Label").
"</td>";
97 print
"<td>".$langs->trans(
"PeriodEndDate").
"</td>";
98 print
'<td class="nowrap" align="left">'.$langs->trans(
"DatePayment").
'</td>';
99 print
'<td class="right">'.$langs->trans(
"PayedByThisPayment").
'</td>';
104 $imaxinloop = ($limit ? min($num, $limit) : $num);
105 while ($i < $imaxinloop) {
106 $obj =
$db->fetch_object($result);
108 $localtax_static->label = $obj->label;
109 $localtax_static->id = $obj->rowid;
110 $localtax_static->ref = $obj->rowid;
111 $localtax_static->datev = $obj->datev;
112 $localtax_static->datep = $obj->datep;
113 $localtax_static->amount = $obj->amount;
115 $total += $obj->amount;
117 if ($mode ==
'kanban') {
119 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
120 print
'<div class="box-flex-container kanban">';
123 print $localtax_static->getKanbanView(
'', array(
'selected' => in_array($localtax_static->id, $arrayofselected)));
124 if ($i == ($imaxinloop - 1)) {
129 print
'<tr class="oddeven">';
130 print
"<td>".$localtax_static->getNomUrl(1).
"</td>\n";
131 print
"<td>".dol_trunc($obj->label, 40).
"</td>\n";
132 print
'<td class="left">'.dol_print_date(
$db->jdate($obj->datev),
'day').
"</td>\n";
133 print
'<td class="left">'.dol_print_date(
$db->jdate($obj->datep),
'day').
"</td>\n";
135 print
'<td class="right nowraponall"><span class="amount">'.price($obj->amount).
'</span></td>';
140 print
'<tr class="liste_total"><td colspan="4">'.$langs->trans(
"Total").
'</td>';
141 print
'<td class="right"><span class="amount">'.price($total).
'</span></td></tr>';
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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.
Class to manage local tax.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
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.