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';
60 $zone =
GETPOST(
'areacode',
'int');
61 $userid =
GETPOST(
'userid',
'int');
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);
80if (isModEnabled(
'accounting')) {
85 $helpisexpanded = empty($resultboxes[
'boxactivated']) || (empty($resultboxes[
'boxlista']) && empty($resultboxes[
'boxlistb']));
88 if (!$helpisexpanded) {
89 $showtutorial =
'<div class="right"><a href="#" id="show_hide">';
90 $showtutorial .=
img_picto(
'',
'chevron-down');
91 $showtutorial .=
' '.$langs->trans(
"ShowTutorial");
92 $showtutorial .=
'</a></div>';
94 $showtutorial .=
'<script type="text/javascript">
95 jQuery(document).ready(function() {
96 jQuery("#show_hide").click(function () {
97 jQuery( "#idfaq" ).toggle({
105 print
load_fiche_titre($langs->trans(
"AccountancyArea"), $resultboxes[
'selectboxlist'],
'accountancy', 0,
'',
'', $showtutorial);
108 print
info_admin($langs->trans(
"SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices"));
112 print
'<div class="'.($helpisexpanded ?
'' :
'hideobject').
'" id="idfaq">';
114 print
'<span class="opacitymedium">'.$langs->trans(
"AccountancyAreaDescIntro").
"</span><br>\n";
115 if ($user->hasRight(
'accounting',
'chartofaccount')) {
117 print
load_fiche_titre(
'<span class="fa fa-calendar"></span> '.$langs->trans(
"AccountancyAreaDescActionOnce"),
'',
'').
"\n";
123 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescJournalSetup", $step,
'{s}');
124 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/accountancy/admin/journals_list.php?id=35" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"AccountingJournals").
'</strong></a>', $s);
128 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescChartModel", $step,
'{s}');
129 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/accountancy/admin/accountmodel.php?search_country_id='.$mysoc->country_id.
'" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"Pcg_version").
'</strong></a>', $s);
133 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescChart", $step,
'{s}');
134 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/accountancy/admin/account.php" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"Chartofaccounts").
'</strong></a>', $s);
140 $sql =
"SELECT a.rowid, a.pcg_version, a.label, a.active";
141 $sql .=
" FROM ".MAIN_DB_PREFIX.
"accounting_system as a";
142 $sql .=
" WHERE a.rowid = ".((int) $pcgver);
144 $resqlchart = $db->query($sql);
146 $obj = $db->fetch_object($resqlchart);
148 $pcgversion = $obj->pcg_version;
149 $pcglabel = $obj->label;
154 print
' <span class="opacitymedium">('.$langs->trans(
"CurrentChartOfAccount").
': '.$pcgversion.
')</span>';
159 print $langs->trans(
"AccountancyAreaDescActionOnceBis");
165 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescFiscalPeriod", $step,
'{s}');
166 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/accountancy/admin/fiscalyear.php" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"FiscalPeriod").
'</strong></a>', $s);
172 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescDefault", $step,
'{s}');
173 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/accountancy/admin/defaultaccounts.php" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"MenuDefaultAccounts").
'</strong></a>', $s);
178 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescBank", $step,
'{s}').
"\n";
179 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/compta/bank/list.php" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"MenuBankAccounts").
'</strong></a>', $s);
184 $textlink =
'<a href="'.DOL_URL_ROOT.
'/admin/dict.php?id=10&from=accountancy" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"MenuVatAccounts").
'</strong></a>';
185 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescVat", $step,
'{s}');
186 $s = str_replace(
'{s}', $textlink, $s);
190 if (isModEnabled(
'tax')) {
191 $textlink =
'<a href="'.DOL_URL_ROOT.
'/admin/dict.php?id=7&from=accountancy" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"MenuTaxAccounts").
'</strong></a>';
193 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescContrib", $step,
'{s}');
194 $s = str_replace(
'{s}', $textlink, $s);
198 if (isModEnabled(
'expensereport')) {
200 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescExpenseReport", $step,
'{s}');
201 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"MenuExpenseReportAccounts").
'</strong></a>', $s);
207 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescProd", $step,
'{s}');
208 $s = str_replace(
'{s}',
'<a href="'.DOL_URL_ROOT.
'/accountancy/admin/productaccount.php" target="setupaccountancy"><strong>'.$langs->transnoentitiesnoconv(
"Setup").
' - '.$langs->transnoentitiesnoconv(
"ProductsBinding").
'</strong></a>', $s);
218 print
load_fiche_titre(
'<span class="fa fa-calendar"></span> '.$langs->trans(
"AccountancyAreaDescActionFreq"),
'',
'');
223 $langs->loadLangs(array(
'bills',
'trips'));
226 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv(
"BillsCustomers"),
'{s}').
"\n";
227 $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);
232 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv(
"BillsSuppliers"),
'{s}').
"\n";
233 $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);
237 if (isModEnabled(
'expensereport') || isModEnabled(
'deplacement')) {
239 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv(
"ExpenseReports"),
'{s}').
"\n";
240 $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);
246 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescWriteRecords", chr(64 + $step), $langs->transnoentitiesnoconv(
"TransferInAccounting").
' - '.$langs->transnoentitiesnoconv(
"RegistrationInAccounting"), $langs->transnoentitiesnoconv(
"WriteBookKeeping")).
"\n";
251 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescAnalyze", chr(64 + $step)).
"<br>\n";
255 $s =
img_picto(
'',
'puce').
' '.$langs->trans(
"AccountancyAreaDescClosePeriod", chr(64 + $step)).
"<br>\n";
265 print
'<div class="clearboth"></div>';
267 print
'<div class="fichecenter fichecenterbis">';
272 $boxlist =
'<div class="twocolumns">';
274 $boxlist .=
'<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
276 $boxlist .= $resultboxes[
'boxlista'];
278 $boxlist .=
'</div>';
280 $boxlist .=
'<div class="secondcolumn fichehalfright boxhalfright" id="boxhalfright">';
282 $boxlist .= $resultboxes[
'boxlistb'];
284 $boxlist .=
'</div>';
287 $boxlist .=
'</div>';
293} elseif (isModEnabled(
'comptabilite')) {
294 print
load_fiche_titre($langs->trans(
"AccountancyArea"),
'',
'accountancy');
296 print
'<span class="opacitymedium">'.$langs->trans(
"Module10Desc").
"</span>\n";
300 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($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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.