Ejemplo n.º 1
0
 function initialize($module)
 {
     if (AUTO_UPDATE_PERIOD) {
         require_once DIR_FS_MODULES . 'phreebooks/functions/phreebooks.php';
         gen_auto_update_period();
     }
 }
Ejemplo n.º 2
0
// | 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.                    |
// +-----------------------------------------------------------------+
//  Path: /modules/phreebooks/pages/admin_tools/pre_process.php
//
$security_level = validate_user(SECURITY_ID_GEN_ADMIN_TOOLS);
/**************  include page specific files    *********************/
gen_pull_language($module, 'admin');
require DIR_FS_WORKING . 'functions/phreebooks.php';
require DIR_FS_WORKING . 'classes/gen_ledger.php';
/**************   page specific initialization  *************************/
define('JOURNAL_ID', 2);
// General Journal
if (!defined('CURRENT_ACCOUNTING_PERIOD')) {
    gen_auto_update_period(false);
}
$error = false;
$start_date = $_POST['start_date'] ? gen_db_date($_POST['start_date']) : CURRENT_ACCOUNTING_PERIOD_START;
$end_date = $_POST['end_date'] ? gen_db_date($_POST['end_date']) : CURRENT_ACCOUNTING_PERIOD_END;
// see what fiscal year we are looking at (assume this FY is entered for the first time)
if ($_POST['fy']) {
    $fy = $_POST['fy'];
} else {
    $result = $db->Execute("select fiscal_year from " . TABLE_ACCOUNTING_PERIODS . " where period = " . CURRENT_ACCOUNTING_PERIOD);
    $fy = $result->fields['fiscal_year'];
}
// find the highest posted period to disallow accounting period changes
$result = $db->Execute("select max(period) as period from " . TABLE_JOURNAL_MAIN);
$max_period = $result->fields['period'] > 0 ? $result->fields['period'] : 0;
// find the highest fiscal year and period in the system
Ejemplo n.º 3
0
         if ($latest_version > $installed_version) {
             $messageStack->add_session(sprintf(TEXT_VERSION_CHECK_NEW_VER, $installed_version, $latest_version), 'success');
         }
     }
 }
 // load the latest currency exchange rates
 if (AUTO_UPDATE_CURRENCY && ENABLE_MULTI_CURRENCY) {
     if (web_connected($silent = false)) {
         require DIR_FS_MODULES . 'setup/classes/currency.php';
         require DIR_FS_MODULES . 'setup/language/' . $_SESSION['language'] . '/modules/currency.php';
         $exchange_rates = new currency();
         $exchange_rates->btn_update();
     }
 }
 if (AUTO_UPDATE_PERIOD) {
     gen_auto_update_period();
 }
 gen_add_audit_log(GEN_LOG_LOGIN . $admin_name);
 // check for session timeout to reload to requested page
 $get_params = '';
 if (isset($_SESSION['pb_cat'])) {
     $get_params = 'cat=' . $_SESSION['pb_cat'];
     $get_params .= '&module=' . $_SESSION['pb_module'];
     if (isset($_SESSION['pb_jID'])) {
         $get_params .= '&jID=' . $_SESSION['pb_jID'];
     }
     if (isset($_SESSION['pb_type'])) {
         $get_params .= '&type=' . $_SESSION['pb_type'];
     }
 }
 gen_redirect(html_href_link(FILENAME_DEFAULT, $get_params, 'SSL'));