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';
43$langs->loadLangs(array(
"compta",
"bills",
"other",
"accountancy",
"loans",
"banks",
"admin",
"dict"));
46$hookmanager->initHooks(array(
'accountancyindex'));
49if ($user->socid > 0) {
55if (!$user->hasRight(
'compta',
'resultat',
'lire') && !$user->hasRight(
'accounting',
'comptarapport',
'lire') && !$user->hasRight(
'accounting',
'mouvements',
'lire') && !$user->hasRight(
'asset',
'read') && !$user->hasRight(
'intracommreport',
'read')) {
68 require_once DOL_DOCUMENT_ROOT.
'/core/class/infobox.class.php';
71 $boxorder =
GETPOST(
'boxorder',
'aZ09');
72 $boxorder .=
GETPOST(
'boxcombo',
'aZ09');
85$help_url =
'EN:Module_Double_Entry_Accounting#Setup|FR:Module_Comptabilité_en_Partie_Double#Configuration';
87llxHeader(
'', $langs->trans(
"AccountancyArea"), $help_url,
'', 0, 0,
'',
'',
'',
'mod-accountancy page-index');
92$boxlist .=
'<div class="twocolumns">';
93$boxlist .=
'<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
94$boxlist .= $resultboxes[
'boxlista'];
96$boxlist .=
'<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
97$boxlist .= $resultboxes[
'boxlistb'];
108 if (!$helpisexpanded) {
109 $showtutorial =
'<div class="right"><a href="#" id="show_hide">';
110 $showtutorial .=
img_picto(
'',
'chevron-down',
'class="show_hide_picto pictofixedwidth"');
111 $showtutorial .= $langs->trans(
"ShowTutorial");
112 $showtutorial .=
'</a></div>';
114 $showtutorial .=
'<script type="text/javascript">
115 jQuery(document).ready(function() {
116 jQuery("#show_hide").click(function () {
117 console.log("We click on show-hide");
118 if ($(".idfaq2").is(":hidden")) {
119 jQuery( ".idfaq2" ).show();
120 jQuery( ".show_hide_picto" ).removeClass("fa-chevron-up").addClass("fa-chevron-down");
122 jQuery( ".idfaq2" ).hide();
123 jQuery( ".show_hide_picto" ).removeClass("fa-chevron-down").addClass("fa-chevron-up");
125 jQuery( ".idfaq" ).toggle({
133 print
load_fiche_titre($langs->trans(
"AccountancyArea"), empty($resultboxes[
'selectboxlist']) ?
'' : $resultboxes[
'selectboxlist'],
'accountancy', 0,
'',
'', $showtutorial);
144 if (!$helpisexpanded && empty($resultboxes[
'boxlista']) && empty($resultboxes[
'boxlistb'])) {
145 print
'<div class="opacitymedium idfaq2"><br>'.$langs->trans(
"ClickOnUseTutorialForHelp", $langs->transnoentities(
"ShowTutorial")).
"</div>\n";
148 print
'<div class="'.($helpisexpanded ?
'' :
'hideobject').
' idfaq">';
150 print
'<span class="opacitymedium">'.$langs->trans(
"AccountancyAreaDescIntro").
"</span><br>\n";
151 if ($user->hasRight(
'accounting',
'chartofaccount')) {
153 print
load_fiche_titre(
'<span class="fa fa-calendar"></span> '.$langs->trans(
"AccountancyAreaDescActionOnce"),
'',
'', 0,
'',
'nomarginbottom').
"\n";
159 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescJournalSetup", $step,
'{s}');
160 $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);
164 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescChartModel", $step,
'{s}');
165 $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);
169 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescChart", $step,
'{s}');
170 $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);
176 $sql =
"SELECT a.rowid, a.pcg_version, a.label, a.active";
177 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_system as a";
178 $sql .=
" WHERE a.rowid = ".((int) $pcgver);
180 $resqlchart = $db->query($sql);
182 $obj = $db->fetch_object($resqlchart);
184 $pcgversion = $obj->pcg_version;
185 $pcglabel = $obj->label;
190 print
' <span class="opacitymedium">('.$langs->trans(
"CurrentChartOfAccount").
': '.$pcgversion.
')</span>';
197 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescFiscalPeriod", $step,
'{s}');
198 $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);
205 print $langs->trans(
"AccountancyAreaDescActionOnceBis");
210 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescDefault", $step,
'{s}');
211 $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);
216 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescBank", $step,
'{s}').
"\n";
217 $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);
222 $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>';
223 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescVat", $step,
'{s}');
224 $s = str_replace(
'{s}', $textlink, $s);
229 $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>';
231 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescContrib", $step,
'{s}');
232 $s = str_replace(
'{s}', $textlink, $s);
238 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescExpenseReport", $step,
'{s}');
239 $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);
245 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescProd", $step,
'{s}');
246 $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);
256 print
load_fiche_titre(
'<span class="fa fa-calendar"></span> '.$langs->trans(
"AccountancyAreaDescActionFreq"),
'',
'', 0,
'',
'nomarginbottom').
"\n";
261 $langs->loadLangs(array(
'bills',
'trips'));
264 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv(
"BillsCustomers"),
'{s}').
"\n";
265 $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);
270 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv(
"BillsSuppliers"),
'{s}').
"\n";
271 $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);
277 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv(
"ExpenseReports"),
'{s}').
"\n";
278 $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);
284 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescWriteRecords", chr(64 + $step), $langs->transnoentitiesnoconv(
"TransferInAccounting").
' - '.$langs->transnoentitiesnoconv(
"RegistrationInAccounting"), $langs->transnoentitiesnoconv(
"WriteBookKeeping")).
"\n";
289 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescAnalyze", chr(64 + $step)).
"<br>\n";
293 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescClosePeriod", chr(64 + $step)).
"<br>\n";
296 if (!empty($resultboxes[
'boxlista']) || !empty($resultboxes[
'boxlistb'])) {
303 print
'<div class="clearboth"></div>';
305 print
load_fiche_titre($langs->trans(
"AccountancyArea"),
'',
'accountancy');
307 print
'<span class="opacitymedium">'.$langs->trans(
"Module10Desc").
"</span>\n";
311 print
load_fiche_titre($langs->trans(
"AccountancyArea"),
'',
'accountancy');
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.
static saveboxorder($dbs, $zone, $boxorder, $userid=0)
Save order of boxes for area and user.
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, $allowothertags=array())
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...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.