28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/accounting.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
34$langs->loadLangs(array(
"compta",
"bills",
"other",
"accountancy",
"loans",
"banks",
"admin",
"dict"));
37$hookmanager->initHooks(array(
'accountancyindex'));
40if ($user->socid > 0) {
43if (!isModEnabled(
'comptabilite') && !isModEnabled(
'accounting') && !isModEnabled(
'asset') && !isModEnabled(
'intracommreport')) {
46if (!$user->hasRight(
'compta',
'resultat',
'lire') && !$user->hasRight(
'accounting',
'comptarapport',
'lire') && !$user->hasRight(
'accounting',
'mouvements',
'lire') && !$user->hasRight(
'asset',
'read') && !$user->hasRight(
'intracommreport',
'read')) {
59 require_once DOL_DOCUMENT_ROOT.
'/core/class/infobox.class.php';
62 $boxorder =
GETPOST(
'boxorder',
'aZ09');
63 $boxorder .=
GETPOST(
'boxcombo',
'aZ09');
76$help_url =
'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilité_en_Partie_Double#Configuration';
78llxHeader(
'', $langs->trans(
"AccountancyArea"), $help_url,
'', 0, 0,
'',
'',
'',
'mod-accountancy page-index');
83$boxlist .=
'<div class="twocolumns">';
84$boxlist .=
'<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
85$boxlist .= $resultboxes[
'boxlista'];
87$boxlist .=
'<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
88$boxlist .= $resultboxes[
'boxlistb'];
93if (isModEnabled(
'accounting')) {
96 $helpisexpanded =
false;
100 if (!$helpisexpanded) {
101 $showtutorial =
'<div class="right"><a href="#" id="show_hide">';
102 $showtutorial .=
img_picto(
'',
'chevron-down');
103 $showtutorial .=
' '.$langs->trans(
"ShowTutorial");
104 $showtutorial .=
'</a></div>';
106 $showtutorial .=
'<script type="text/javascript">
107 jQuery(document).ready(function() {
108 jQuery("#show_hide").click(function () {
109 console.log("We click on show-hide");
110 if ($(".idfaq2").is(":hidden")) {
111 jQuery( ".idfaq2" ).show();
113 jQuery( ".idfaq2" ).hide();
115 jQuery( ".idfaq" ).toggle({
123 print
load_fiche_titre($langs->trans(
"AccountancyArea"), empty($resultboxes[
'selectboxlist']) ?
'' : $resultboxes[
'selectboxlist'],
'accountancy', 0,
'',
'', $showtutorial);
134 if (!$helpisexpanded && empty($resultboxes[
'boxlista']) && empty($resultboxes[
'boxlistb'])) {
135 print
'<div class="opacitymedium idfaq2"><br>'.$langs->trans(
"ClickOnUseTutorialForHelp", $langs->transnoentities(
"ShowTutorial")).
"</div>\n";
138 print
'<div class="'.($helpisexpanded ?
'' :
'hideobject').
' idfaq">';
140 print
'<span class="opacitymedium">'.$langs->trans(
"AccountancyAreaDescIntro").
"</span><br>\n";
141 if ($user->hasRight(
'accounting',
'chartofaccount')) {
143 print
load_fiche_titre(
'<span class="fa fa-calendar"></span> '.$langs->trans(
"AccountancyAreaDescActionOnce"),
'',
'', 0,
'',
'nomarginbottom').
"\n";
149 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescJournalSetup", $step,
'{s}');
150 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/accountancy/admin/journals_list.php?id=35&&leftmenu=accountancy_admin" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"AccountingJournals").
'</strong></a>', $s);
154 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescChartModel", $step,
'{s}');
155 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/accountancy/admin/accountmodel.php?search_country_id='.$mysoc->country_id.
'&leftmenu=accountancy_admin" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"Pcg_version").
'</strong></a>', $s);
159 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescChart", $step,
'{s}');
160 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/accountancy/admin/account.php?leftmenu=accountancy_admin" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"Chartofaccounts").
'</strong></a>', $s);
166 $sql =
"SELECT a.rowid, a.pcg_version, a.label, a.active";
167 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_system as a";
168 $sql .=
" WHERE a.rowid = ".((int) $pcgver);
170 $resqlchart = $db->query($sql);
172 $obj = $db->fetch_object($resqlchart);
174 $pcgversion = $obj->pcg_version;
175 $pcglabel = $obj->label;
180 print
' <span class="opacitymedium">('.$langs->trans(
"CurrentChartOfAccount").
': '.$pcgversion.
')</span>';
187 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescFiscalPeriod", $step,
'{s}');
188 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/accountancy/admin/fiscalyear.php?leftmenu=accountancy_admin" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"FiscalPeriod").
'</strong></a>', $s);
195 print $langs->trans(
"AccountancyAreaDescActionOnceBis");
200 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescDefault", $step,
'{s}');
201 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/accountancy/admin/defaultaccounts.php?leftmenu=accountancy_admin" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"MenuDefaultAccounts").
'</strong></a>', $s);
206 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescBank", $step,
'{s}').
"\n";
207 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php?leftmenu=accountancy_admin" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"MenuBankAccounts").
'</strong></a>', $s);
212 $textlink =
'<a href="'.DOL_URL_ROOT.
'/admin/dict.php?id=10&from=accountancy&leftmenu=accountancy_admin" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"MenuVatAccounts").
'</strong></a>';
213 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescVat", $step,
'{s}');
214 $s = str_replace(
'{s}', $textlink, $s);
218 if (isModEnabled(
'tax')) {
219 $textlink =
'<a href="'.DOL_URL_ROOT.
'/admin/dict.php?id=7&from=accountancy&leftmenu=accountancy_admin" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"MenuTaxAccounts").
'</strong></a>';
221 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescContrib", $step,
'{s}');
222 $s = str_replace(
'{s}', $textlink, $s);
226 if (isModEnabled(
'expensereport')) {
228 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescExpenseReport", $step,
'{s}');
229 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/admin/dict.php?id=17&from=accountancy&leftmenu=accountancy_admin"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"MenuExpenseReportAccounts").
'</strong></a>', $s);
235 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescProd", $step,
'{s}');
236 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/accountancy/admin/productaccount.php?leftmenu=accountancy_admin" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"ProductsBinding").
'</strong></a>', $s);
246 print
load_fiche_titre(
'<span class="fa fa-calendar"></span> '.$langs->trans(
"AccountancyAreaDescActionFreq"),
'',
'', 0,
'',
'nomarginbottom').
"\n";
251 $langs->loadLangs(array(
'bills',
'trips'));
254 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv(
"BillsCustomers"),
'{s}').
"\n";
255 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/accountancy/customer/index.php" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"TransferInAccounting").
' - '.$langs->transnoentitiesnoconv(
"CustomersVentilation").
'</strong></a>', $s);
260 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv(
"BillsSuppliers"),
'{s}').
"\n";
261 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/accountancy/supplier/index.php" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"TransferInAccounting").
' - '.$langs->transnoentitiesnoconv(
"SuppliersVentilation").
'</strong></a>', $s);
265 if (isModEnabled(
'expensereport') || isModEnabled(
'deplacement')) {
267 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv(
"ExpenseReports"),
'{s}').
"\n";
268 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/accountancy/expensereport/index.php" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"TransferInAccounting").
' - '.$langs->transnoentitiesnoconv(
"ExpenseReportsVentilation").
'</strong></a>', $s);
274 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescWriteRecords", chr(64 + $step), $langs->transnoentitiesnoconv(
"TransferInAccounting").
' - '.$langs->transnoentitiesnoconv(
"RegistrationInAccounting"), $langs->transnoentitiesnoconv(
"WriteBookKeeping")).
"\n";
279 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescAnalyze", chr(64 + $step)).
"<br>\n";
283 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescClosePeriod", chr(64 + $step)).
"<br>\n";
286 if (!empty($resultboxes[
'boxlista']) || !empty($resultboxes[
'boxlistb'])) {
293 print
'<div class="clearboth"></div>';
294} elseif (isModEnabled(
'comptabilite')) {
295 print
load_fiche_titre($langs->trans(
"AccountancyArea"),
'',
'accountancy');
297 print
'<span class="opacitymedium">'.$langs->trans(
"Module10Desc").
"</span>\n";
301 print
load_fiche_titre($langs->trans(
"AccountancyArea"),
'',
'accountancy');
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
static saveboxorder($dbs, $zone, $boxorder, $userid=0)
Save order of boxes for area and user.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
getDolGlobalInt($key, $default=0)
Return a 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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.