コード例 #1
0
ファイル: pre_process.php プロジェクト: siwiwit/PhreeBooksERP
// | the License, or 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.                    |
// +-----------------------------------------------------------------+
//  Path: /modules/shipping/pages/popup_tracking/pre_process.php
//
$security_level = validate_user(0, true);
/**************  include page specific files  *********************/
require_once DIR_FS_WORKING . 'defaults.php';
require_once DIR_FS_WORKING . 'functions/shipping.php';
/**************   page specific initialization  *************************/
$close_popup = false;
$methods = load_all_methods('shipping');
$sID = $_GET['sID'] ? $_GET['sID'] : '';
$method = $_GET['method'] ? $_GET['method'] : '';
$ship_date = date('Y-m-d');
if ($method) {
    $subject_module = new $method();
}
/***************   hook for custom actions  ***************************/
$custom_path = DIR_FS_MODULES . 'shipping/custom/pages/popup_tracking/extra_actions.php';
if (file_exists($custom_path)) {
    include $custom_path;
}
/***************   Act on the action request   *************************/
switch ($_REQUEST['action']) {
    case 'save':
        if (!$method) {
コード例 #2
0
ファイル: pre_process.php プロジェクト: siwiwit/PhreeBooksERP
 }
 // verify no item rows have been acted upon (accounts reconciliation)
 $result = $db->Execute("select closed from " . TABLE_JOURNAL_MAIN . " where id = " . $id);
 if ($result->fields['closed'] == '1') {
     $error = $delOrd->fail_message(constant('GENERAL_JOURNAL_' . $delOrd->journal_id . '_ERROR_6'));
 }
 if (!$error) {
     // *************** START TRANSACTION *************************
     $db->transStart();
     if (!$delOrd->unPost('delete')) {
         $error = $messageStack->add(GL_ERROR_NO_POST, 'error');
         $db->transRollback();
         break;
     } else {
         // delete the payments
         $payment_modules = load_all_methods('payment');
         foreach ($delOrd->journal_rows as $value) {
             if ($value['gl_type'] != 'ttl') {
                 continue;
             }
             $pmt_fields = explode(':', $value['description']);
             $pmt_method = $pmt_fields[1];
             // payment method
             $pmt_field_0 = $pmt_fields[2];
             // cardholder name/reference
             $pmt_field_1 = $pmt_fields[3];
             // card number
             $pmt_field_2 = $pmt_fields[4];
             // exp month
             $pmt_field_3 = $pmt_fields[5];
             // exp year
コード例 #3
0
ファイル: pre_process.php プロジェクト: siwiwit/PhreeBooksERP
     $page_title = ORD_TEXT_7_WINDOW_TITLE;
     break;
 case 9:
     // Sales Quote Journal
     define('POPUP_FORM_TYPE', 'cust:quot');
     $page_title = ORD_TEXT_9_WINDOW_TITLE;
     break;
 case 10:
     // Sales Order Journal
     define('POPUP_FORM_TYPE', 'cust:so');
     $page_title = ORD_TEXT_10_WINDOW_TITLE;
     break;
 case 12:
     // Invoice Journal
     if (defined('MODULE_SHIPPING_STATUS')) {
         $shipping_modules = load_all_methods('shipping');
         $heading_array['shipper_code'] = TEXT_CARRIER;
     }
     define('POPUP_FORM_TYPE', 'cust:inv');
     $heading_array['closed'] = TEXT_PAID;
     $page_title = ORD_TEXT_12_WINDOW_TITLE;
     break;
 case 13:
     // Customer Credit Memo Journal
     define('POPUP_FORM_TYPE', 'cust:cm');
     $heading_array['closed'] = TEXT_PAID;
     $page_title = ORD_TEXT_13_WINDOW_TITLE;
     break;
 case 18:
     // Cash Receipts Journal
     define('POPUP_FORM_TYPE', 'bnk:rcpt');
コード例 #4
0
ファイル: pre_process.php プロジェクト: siwiwit/PhreeBooksERP
for ($i = 0; $i < count($tax_rates); $i++) {
    $js_tax_rates .= 'tax_rates[' . $i . '] = new salesTaxes("' . $tax_rates[$i]['id'] . '", "' . $tax_rates[$i]['text'] . '", "' . $tax_rates[$i]['rate'] . '");' . chr(10);
}
// load projects
$proj_list = ord_get_projects();
// generate a project list array parallel to the drop down for the javascript add line item function
$js_proj_list = 'var proj_list = new Array(' . count($proj_list) . ');' . chr(10);
for ($i = 0; $i < count($proj_list); $i++) {
    $js_proj_list .= 'proj_list[' . $i . '] = new dropDownData("' . $proj_list[$i]['id'] . '", "' . $proj_list[$i]['text'] . '");' . chr(10);
}
// see if current user points to a employee for sales rep default
$result = $db->Execute("select account_id from " . TABLE_USERS . " where admin_id = " . $_SESSION['admin_id']);
$default_sales_rep = $result->fields['account_id'] ? $result->fields['account_id'] : '0';
// Load shipping methods
if (defined('MODULE_SHIPPING_STATUS')) {
    $methods = load_all_methods('shipping', true, true);
    $shipping_methods = build_js_methods($methods);
} else {
    $shipping_methods = 'var freightLevels   = new Array(); ' . chr(10);
    $shipping_methods .= 'var freightCarriers = new Array(); ' . chr(10);
    $shipping_methods .= 'var freightDetails  = new Array(); ' . chr(10);
}
// load calendar parameters
$now = new DateTime();
if (JOURNAL_ID == 6) {
    $now->modify('-1 day');
}
$cal_order = array('name' => 'dateOrdered', 'form' => 'orders', 'fieldname' => 'post_date', 'imagename' => 'btn_date_1', 'default' => isset($order->post_date) ? gen_locale_date($order->post_date) : $now->format(DATE_FORMAT), 'params' => array('align' => 'left'));
$cal_terminal = array('name' => 'dateRequired', 'form' => 'orders', 'fieldname' => 'terminal_date', 'imagename' => 'btn_date_2', 'default' => isset($order->terminal_date) ? gen_locale_date($order->terminal_date) : $req_date, 'params' => array('align' => 'left'));
// build the display options based on JOURNAL_ID
$template_options = array();
コード例 #5
0
ファイル: pre_process.php プロジェクト: siwiwit/PhreeBooksERP
// +-----------------------------------------------------------------+
//  Path: /modules/shipping/pages/ship_mgr/pre_process.php
//
$security_level = validate_user(SECURITY_ID_SHIPPING_MANAGER);
/**************  include page specific files    *********************/
require_once DIR_FS_WORKING . 'defaults.php';
/**************   page specific initialization  *************************/
$date = $_GET['search_date'] ? gen_db_date($_GET['search_date']) : date('Y-m-d');
if ($_REQUEST['search_text'] == TEXT_SEARCH) {
    $_REQUEST['search_text'] = '';
}
$module_id = isset($_POST['module_id']) ? $_POST['module_id'] : '';
$row_seq = isset($_POST['rowSeq']) ? $_POST['rowSeq'] : '';
$action = $_REQUEST['action'];
// load methods
$installed_modules = load_all_methods('shipping');
/***************   hook for custom actions  ***************************/
$custom_path = DIR_FS_WORKING . 'custom/pages/ship_mgr/extra_actions.php';
if (file_exists($custom_path)) {
    include $custom_path;
}
/***************   Act on the action request   *************************/
if ($module_id) {
    require_once DIR_FS_WORKING . 'methods/' . $module_id . '/' . $module_id . '.php';
    $shipping = new $module_id();
    switch ($_REQUEST['action']) {
        default:
            if (method_exists($shipping, $action)) {
                $shipping->{$action}();
            }
            break;