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);
126 $messagewarning = $langs->trans(
"SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices");
127 $messagewarning .=
' '.$langs->trans(
"WarningExperimentalFeatureInvoiceSituationNeedToUpgradeToProgressiveMode",
'https://partners.dolibarr.org');
132 if (!$helpisexpanded && empty($resultboxes[
'boxlista']) && empty($resultboxes[
'boxlistb'])) {
133 print
'<div class="opacitymedium idfaq2"><br>'.$langs->trans(
"ClickOnUseTutorialForHelp", $langs->transnoentities(
"ShowTutorial")).
"</div>\n";
136 print
'<div class="'.($helpisexpanded ?
'' :
'hideobject').
' idfaq">';
138 print
'<span class="opacitymedium">'.$langs->trans(
"AccountancyAreaDescIntro").
"</span><br>\n";
139 if ($user->hasRight(
'accounting',
'chartofaccount')) {
141 print
load_fiche_titre(
'<span class="fa fa-calendar"></span> '.$langs->trans(
"AccountancyAreaDescActionOnce"),
'',
'', 0,
'',
'nomarginbottom').
"\n";
147 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescJournalSetup", $step,
'{s}');
148 $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);
152 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescChartModel", $step,
'{s}');
153 $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);
157 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescChart", $step,
'{s}');
158 $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);
164 $sql =
"SELECT a.rowid, a.pcg_version, a.label, a.active";
165 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_system as a";
166 $sql .=
" WHERE a.rowid = ".((int) $pcgver);
168 $resqlchart = $db->query($sql);
170 $obj = $db->fetch_object($resqlchart);
172 $pcgversion = $obj->pcg_version;
173 $pcglabel = $obj->label;
178 print
' <span class="opacitymedium">('.$langs->trans(
"CurrentChartOfAccount").
': '.$pcgversion.
')</span>';
185 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescFiscalPeriod", $step,
'{s}');
186 $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);
193 print $langs->trans(
"AccountancyAreaDescActionOnceBis");
198 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescDefault", $step,
'{s}');
199 $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);
204 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescBank", $step,
'{s}').
"\n";
205 $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);
210 $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>';
211 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescVat", $step,
'{s}');
212 $s = str_replace(
'{s}', $textlink, $s);
216 if (isModEnabled(
'tax')) {
217 $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>';
219 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescContrib", $step,
'{s}');
220 $s = str_replace(
'{s}', $textlink, $s);
224 if (isModEnabled(
'expensereport')) {
226 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescExpenseReport", $step,
'{s}');
227 $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);
233 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescProd", $step,
'{s}');
234 $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);
244 print
load_fiche_titre(
'<span class="fa fa-calendar"></span> '.$langs->trans(
"AccountancyAreaDescActionFreq"),
'',
'', 0,
'',
'nomarginbottom').
"\n";
249 $langs->loadLangs(array(
'bills',
'trips'));
252 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv(
"BillsCustomers"),
'{s}').
"\n";
253 $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);
258 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv(
"BillsSuppliers"),
'{s}').
"\n";
259 $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);
263 if (isModEnabled(
'expensereport') || isModEnabled(
'deplacement')) {
265 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv(
"ExpenseReports"),
'{s}').
"\n";
266 $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);
272 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescWriteRecords", chr(64 + $step), $langs->transnoentitiesnoconv(
"TransferInAccounting").
' - '.$langs->transnoentitiesnoconv(
"RegistrationInAccounting"), $langs->transnoentitiesnoconv(
"WriteBookKeeping")).
"\n";
277 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescAnalyze", chr(64 + $step)).
"<br>\n";
281 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescClosePeriod", chr(64 + $step)).
"<br>\n";
284 if (!empty($resultboxes[
'boxlista']) || !empty($resultboxes[
'boxlistb'])) {
291 print
'<div class="clearboth"></div>';
292} elseif (isModEnabled(
'comptabilite')) {
293 print
load_fiche_titre($langs->trans(
"AccountancyArea"),
'',
'accountancy');
295 print
'<span class="opacitymedium">'.$langs->trans(
"Module10Desc").
"</span>\n";
299 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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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.
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 a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.