25 require
'../../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/class/fiscalyear.class.php';
29 $action =
GETPOST(
'action',
'aZ09');
32 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
33 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
34 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
36 if (empty($page) || $page == -1) {
39 $offset = $limit * $page;
40 $pageprev = $page - 1;
41 $pagenext = $page + 1;
43 $sortfield =
"f.rowid";
50 $langs->loadLangs(array(
"admin",
"compta"));
56 static $tmpstatut2label = array(
57 '0' =>
'OpenFiscalYear',
58 '1' =>
'CloseFiscalYear'
65 if ($user->socid > 0) {
68 if (!$user->hasRight(
'accounting',
'fiscalyear',
'write')) {
88 $title = $langs->trans(
'AccountingPeriods');
90 $help_url =
"EN:Module_Double_Entry_Accounting";
94 $sql =
"SELECT f.rowid, f.label, f.date_start, f.date_end, f.statut as status, f.entity";
95 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_fiscalyear as f";
96 $sql .=
" WHERE f.entity = ".$conf->entity;
97 $sql .= $db->order($sortfield, $sortorder);
100 $nbtotalofrecords =
'';
102 $result = $db->query(
$sql);
103 $nbtotalofrecords = $db->num_rows($result);
104 if (($page * $limit) > $nbtotalofrecords) {
110 $sql .= $db->plimit($limit + 1, $offset);
112 $result = $db->query(
$sql);
114 $num = $db->num_rows($result);
119 $addbutton .=
dolGetButtonTitle($langs->trans(
'NewFiscalYear'),
'',
'fa fa-plus-circle',
'fiscalyear_card.php?action=create',
'', $user->hasRight(
'accounting',
'fiscalyear',
'write'));
122 $title = $langs->trans(
'AccountingPeriods');
123 print_barre_liste($title, $page, $_SERVER[
"PHP_SELF"], $params, $sortfield, $sortorder,
'', $num, $nbtotalofrecords,
'title_accountancy', 0, $addbutton,
'', $limit, 1);
125 print
'<div class="div-table-responsive">';
126 print
'<table class="tagtable liste centpercent">';
127 print
'<tr class="liste_titre">';
128 print
'<td>'.$langs->trans(
"Ref").
'</td>';
129 print
'<td>'.$langs->trans(
"Label").
'</td>';
130 print
'<td>'.$langs->trans(
"DateStart").
'</td>';
131 print
'<td>'.$langs->trans(
"DateEnd").
'</td>';
132 print
'<td class="center">'.$langs->trans(
"NumberOfAccountancyEntries").
'</td>';
133 print
'<td class="center">'.$langs->trans(
"NumberOfAccountancyMovements").
'</td>';
134 print
'<td class="right">'.$langs->trans(
"Status").
'</td>';
138 while ($i < $num && $i < $max) {
139 $obj = $db->fetch_object($result);
141 $fiscalyearstatic->ref = $obj->rowid;
142 $fiscalyearstatic->id = $obj->rowid;
143 $fiscalyearstatic->date_start = $obj->date_start;
144 $fiscalyearstatic->date_end = $obj->date_end;
145 $fiscalyearstatic->statut = $obj->status;
146 $fiscalyearstatic->status = $obj->status;
148 print
'<tr class="oddeven">';
150 print $fiscalyearstatic->getNomUrl(1);
152 print
'<td class="left">'.$obj->label.
'</td>';
153 print
'<td class="left">'.dol_print_date($db->jdate($obj->date_start),
'day').
'</td>';
154 print
'<td class="left">'.dol_print_date($db->jdate($obj->date_end),
'day').
'</td>';
155 print
'<td class="center">'.$object->getAccountancyEntriesByFiscalYear($obj->date_start, $obj->date_end).
'</td>';
156 print
'<td class="center">'.$object->getAccountancyMovementsByFiscalYear($obj->date_start, $obj->date_end).
'</td>';
157 print
'<td class="right">'.$fiscalyearstatic->LibStatut($obj->status, 5).
'</td>';
162 print
'<tr class="oddeven"><td colspan="7"><span class="opacitymedium">'.$langs->trans(
"None").
'</span></td></tr>';
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage fiscal year.
if(isModEnabled('facture') && $user->hasRight('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') && $user->hasRight('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.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.