* Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2014 Florian Henry * Copyright (C) 2014 Marcos García * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ /** * \file htdocs/accountancy/admin/journal.php * \ingroup Accounting Expert * \brief Setup page to configure accounting expert module */ require '../../main.inc.php'; // Class require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("accountancy"); // Security check if (!$user->admin) accessforbidden(); $action = GETPOST('action', 'alpha'); // Other parameters ACCOUNTING_* $list = array ( 'ACCOUNTING_SELL_JOURNAL', 'ACCOUNTING_PURCHASE_JOURNAL', 'ACCOUNTING_SOCIAL_JOURNAL', 'ACCOUNTING_MISCELLANEOUS_JOURNAL', 'ACCOUNTING_EXPENSEREPORT_JOURNAL' ); /* * Actions */ if ($action == 'update') { $error = 0; foreach ( $list as $constname ) { $constvalue = GETPOST($constname, 'alpha'); if (! dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { $error ++; } } if (! $error) { setEventMessage($langs->trans("SetupSaved")); } else { setEventMessage($langs->trans("Error"), 'errors'); } } /* * View */ llxHeader(); $form = new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans('ConfigAccountingExpert'),$linkback,'title_setup'); $head = admin_accounting_prepare_head(null); print '
'; print ''; print ''; dol_fiche_head($head, 'journal', $langs->trans("Configuration"), 0, 'cron'); print ''; print ''; print ''; print "\n"; foreach ( $list as $key ) { $var = ! $var; print ''; // Param $label = $langs->trans($key); print ''; // Value print ''; } print "
' . $langs->trans('Journaux') . '
'; print ''; print '
\n"; print '
'; print ''; print ''; print ''; print "\n"; // Bank account $sql = "SELECT rowid, label, accountancy_journal"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql.= " WHERE entity = ".$conf->entity; $sql.= " AND clos = 0"; $sql.= " ORDER BY label"; $resql = $db->query($sql); if ($resql) { $numr = $db->num_rows($resql); $i = 0; if ($numr > 0) while ($i < $numr) { $objp = $db->fetch_object($resql); $var = ! $var; print ''; // Param print ''; // Value print ''; $i++; } } else dol_print_error($db); $db->free($resql); print "
' . $langs->trans('JournalFinancial') . '
'; print ''; print '
\n"; dol_fiche_end(); print '
'; print '
'; llxFooter(); $db->close();