Exemplo n.º 1
0
function refund_search_gateway($db, $refund_search_category, $refund_search_term)
{
    // global $smarty;
    $langvals = gateway_xml2php('refund');
    switch ($refund_search_category) {
        case "DATE":
            $refund_gateway_search_term = date_to_timestamp($db, $refund_search_term);
            return $refund_gateway_search_term;
            break;
        case "TYPE":
            switch ($refund_search_term) {
                case $langvals['refund_type_1']:
                    $refund_gateway_search_term = "1";
                    return $refund_gateway_search_term;
                    break;
                case $langvals['refund_type_2']:
                    $refund_gateway_search_term = "2";
                    return $refund_gateway_search_term;
                    break;
                case $langvals['refund_type_3']:
                    $refund_gateway_search_term = "3";
                    return $refund_gateway_search_term;
                    break;
                case $langvals['refund_type_4']:
                    $refund_gateway_search_term = "4";
                    return $refund_gateway_search_term;
                    break;
                case $langvals['refund_type_5']:
                    $refund_gateway_search_term = "5";
                    return $refund_gateway_search_term;
                    break;
                default:
                    $refund_search_gateway = $refund_search_term;
                    return $refund_search_gateway;
                    break;
            }
        case "PAYMENT_METHOD":
            switch ($refund_search_term) {
                case $langvals['refund_payment_method_1']:
                    $refund_gateway_search_term = "1";
                    return $refund_gateway_search_term;
                    break;
                case $langvals['refund_payment_method_2']:
                    $refund_gateway_search_term = "2";
                    return $refund_gateway_search_term;
                    break;
                case $langvals['refund_payment_method_3']:
                    $refund_gateway_search_term = "3";
                    return $refund_gateway_search_term;
                    break;
                case $langvals['refund_payment_method_4']:
                    $refund_gateway_search_term = "4";
                    return $refund_gateway_search_term;
                    break;
                case $langvals['refund_payment_method_5']:
                    $refund_gateway_search_term = "5";
                    return $refund_gateway_search_term;
                    break;
                case $langvals['refund_payment_method_6']:
                    $refund_gateway_search_term = "6";
                    return $refund_gateway_search_term;
                    break;
                case $langvals['refund_payment_method_7']:
                    $refund_gateway_search_term = "7";
                    return $refund_gateway_search_term;
                    break;
                case $langvals['refund_payment_method_8']:
                    $refund_gateway_search_term = "8";
                    return $refund_gateway_search_term;
                    break;
                case $langvals['refund_payment_method_9']:
                    $refund_gateway_search_term = "9";
                    return $refund_gateway_search_term;
                    break;
                case $langvals['refund_payment_method_10']:
                    $refund_gateway_search_term = "10";
                    return $refund_gateway_search_term;
                    break;
                case $langvals['refund_payment_method_11']:
                    $refund_gateway_search_term = "11";
                    return $refund_gateway_search_term;
                    break;
            }
        default:
            $refund_gateway_search_term = "%" . $refund_search_term . "%";
            return $refund_gateway_search_term;
            break;
    }
}
Exemplo n.º 2
0
<?php

// Load the Expense Functions
require_once 'include.php';
// Load the Translations for this Module
if (!xml2php('expense')) {
    $smarty->assign('error_msg', "Error in language file");
}
$expenseID = $VAR['expenseID'];
// Load PHP Language Translations
$langvals = gateway_xml2php('expense');
// Make sure we got an Expense ID number
if (!isset($expenseID) || $expenseID == "") {
    $smarty->assign('results', 'Please go back and select an expense record');
    die;
}
// Delete the expense function call
if (!delete_expense($db, $expenseID)) {
    force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1&type=database');
    exit;
} else {
    force_page('expense', 'search&page_title=' . $langvals['expense_search_title']);
    exit;
}
Exemplo n.º 3
0
<?php

// Load the Supplier classes
require_once 'include.php';
// Load the Translation for this Module
if (!xml2php('supplier')) {
    $smarty->assign('error_msg', "Error in language file");
}
// Load PHP Language Translations
$langvals = gateway_xml2php('supplier');
// Load supplier details
$supplier_details = display_supplier_info($db, $VAR['supplierID']);
// If details submitted run update values, if not set load edit.tpl and populate values
if (isset($VAR['submit'])) {
    if (!update_supplier($db, $VAR)) {
        force_page('supplier', 'edit&error_msg=Falied to Update Supplier Information&supplierID=' . $VAR['supplierID']);
        exit;
    } else {
        force_page('supplier', 'supplier_details&supplierID=' . $VAR['supplierID'] . '&page_title=' . $langvals['supplier_details_title']);
        exit;
    }
} else {
    $smarty->assign('supplier_details', $supplier_details);
    $smarty->display('supplier' . SEP . 'edit.tpl');
}
Exemplo n.º 4
0
<?php

// Load the Refund Functions
require_once 'include.php';
// Load the Translation for this Module
if (!xml2php('refund')) {
    $smarty->assign('error_msg', "Error in language file");
}
// Load PHP Language Translations
$langvals = gateway_xml2php('refund');
$last_record_id = last_record_id_lookup($db);
$new_record_id = $last_record_id + 1;
// If details submitted insert record, if non submitted load new.tpl and populate values
if (isset($VAR['submit']) || isset($VAR['submitandnew'])) {
    if ($run != insert_new_refund($db, $VAR)) {
        $smarty->assign('error_msg', 'Falied to insert Refund');
        $smarty->display('core' . SEP . 'error.tpl');
        echo "refund insert error";
    } else {
        if (isset($VAR['submitandnew'])) {
            // Submit New Refund and reload page
            force_page('refund', 'new&page_title=');
            exit;
        } else {
            // Submit and load Refund View Details
            force_page('refund', 'refund_details&refundID=' . $new_record_id . '&page_title=' . $langvals['refund_details_title']);
            exit;
        }
    }
} else {
    $smarty->assign('new_record_id', $new_record_id);
Exemplo n.º 5
0
<?php

// Load the Refund Functions
require_once 'include.php';
// Load the Translation for this Module
if (!xml2php('invoice')) {
    $smarty->assign('error_msg', "Error in language file");
}
$langvals = gateway_xml2php(invoice);
$wo_id = $VAR['wo_id'];
$customer_id = $VAR['customer_id'];
$invoice_id = $VAR['invoice_id'];
$labourID = $VAR['labourID'];
$partsID = $VAR['partsID'];
// Labour Delete Record
if (isset($VAR['deleteType']) && $VAR['deleteType'] == "labourRecord") {
    // Delete the labour record Function call
    if (!delete_labour_record($db, $labourID)) {
        force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1&type=database');
        exit;
    } else {
        force_page('invoice', 'new&invoice_id=' . $invoice_id . '&wo_id=' . $wo_id . '&page_title=' . $langvals['invoice_invoice'] . '&customer_id=' . $customer_id);
        exit;
    }
}
// Parts Delete Record
if (isset($VAR['deleteType']) && $VAR['deleteType'] == "partsRecord") {
    // Delete the labour record Function call
    if (!delete_parts_record($db, $partsID)) {
        force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1&type=database');
        exit;
Exemplo n.º 6
0
function supplier_search_gateway($db, $supplier_search_category, $supplier_search_term)
{
    // global $smarty;
    $langvals = gateway_xml2php('supplier');
    switch ($supplier_search_category) {
        case "TYPE":
            switch ($supplier_search_term) {
                case $langvals['supplier_type_1']:
                    $supplier_gateway_search_term = "1";
                    return $supplier_gateway_search_term;
                    break;
                case $langvals['supplier_type_2']:
                    $supplier_gateway_search_term = "2";
                    return $supplier_gateway_search_term;
                    break;
                case $langvals['supplier_type_3']:
                    $supplier_gateway_search_term = "3";
                    return $supplier_gateway_search_term;
                    break;
                case $langvals['supplier_type_4']:
                    $supplier_gateway_search_term = "4";
                    return $supplier_gateway_search_term;
                    break;
                case $langvals['supplier_type_5']:
                    $supplier_gateway_search_term = "5";
                    return $supplier_gateway_search_term;
                    break;
                case $langvals['supplier_type_6']:
                    $supplier_gateway_search_term = "6";
                    return $supplier_gateway_search_term;
                    break;
                case $langvals['supplier_type_7']:
                    $supplier_gateway_search_term = "7";
                    return $supplier_gateway_search_term;
                    break;
                case $langvals['supplier_type_8']:
                    $supplier_gateway_search_term = "8";
                    return $supplier_gateway_search_term;
                    break;
                case $langvals['supplier_type_9']:
                    $supplier_gateway_search_term = "9";
                    return $supplier_gateway_search_term;
                    break;
                case $langvals['supplier_type_10']:
                    $supplier_gateway_search_term = "10";
                    return $supplier_gateway_search_term;
                    break;
                case $langvals['supplier_type_11']:
                    $supplier_gateway_search_term = "11";
                    return $supplier_gateway_search_term;
                    break;
            }
        default:
            $supplier_gateway_search_term = "%" . $supplier_search_term . "%";
            return $supplier_gateway_search_term;
            break;
    }
}
Exemplo n.º 7
0
<?php

// BOF shared variables for invoicing
require_once 'include.php';
header('Content-type: text/html; charset=utf-8');
if (!xml2php("invoice")) {
    $smarty->assign('error_msg', "Error in language file");
}
// Load PHP Language Translations
$langvals = gateway_xml2php('invoice');
$invoice_id = $VAR['invoice_id'];
$customer_id = $VAR['customer_id'];
$print_type = $VAR['print_type'];
/* Generic error control */
if (empty($invoice_id)) {
    /* If no work order ID then we dont belong here */
    force_page('core', 'error&error_msg=Invoice Not found: Invoice ID: ' . $invoice_id . '&menu=1');
}
// Customer Section
/* check if we have a customer id and if so get details */
if ($customer_id == "" || $customer_id == "0") {
    force_page('core', 'error&error_msg=No Customer ID&menu=1');
    exit;
} else {
    $q = "SELECT * FROM " . PRFX . "TABLE_CUSTOMER WHERE CUSTOMER_ID=" . $db->qstr($customer_id);
    if (!($rs = $db->execute($q))) {
        force_page('core', 'error&error_msg=MySQL Error: ' . $db->ErrorMsg() . '&menu=1');
        exit;
    }
    $customer_details = $rs->GetAssoc();
    if (empty($customer_details)) {
Exemplo n.º 8
0
function expense_search_gateway($db, $expense_search_category, $expense_search_term)
{
    // global $smarty;
    $langvals = gateway_xml2php('expense');
    switch ($expense_search_category) {
        case "DATE":
            $expense_gateway_search_term = date_to_timestamp($db, $expense_search_term);
            return $expense_gateway_search_term;
            break;
        case "TYPE":
            switch ($expense_search_term) {
                case $langvals['expense_type_1']:
                    $expense_gateway_search_term = "1";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_2']:
                    $expense_gateway_search_term = "2";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_3']:
                    $expense_gateway_search_term = "3";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_4']:
                    $expense_gateway_search_term = "4";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_5']:
                    $expense_gateway_search_term = "5";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_6']:
                    $expense_gateway_search_term = "6";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_7']:
                    $expense_gateway_search_term = "7";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_8']:
                    $expense_gateway_search_term = "8";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_9']:
                    $expense_gateway_search_term = "9";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_10']:
                    $expense_gateway_search_term = "10";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_11']:
                    $expense_gateway_search_term = "11";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_12']:
                    $expense_gateway_search_term = "12";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_13']:
                    $expense_gateway_search_term = "13";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_14']:
                    $expense_gateway_search_term = "14";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_15']:
                    $expense_gateway_search_term = "15";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_16']:
                    $expense_gateway_search_term = "16";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_17']:
                    $expense_gateway_search_term = "17";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_18']:
                    $expense_gateway_search_term = "18";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_19']:
                    $expense_gateway_search_term = "19";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_20']:
                    $expense_gateway_search_term = "20";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_type_21']:
                    $expense_gateway_search_term = "21";
                    return $expense_gateway_search_term;
                    break;
                default:
                    $expense_search_gateway = $expense_search_term;
                    return $expense_search_gateway;
                    break;
            }
        case "PAYMENT_METHOD":
            switch ($expense_search_term) {
                case $langvals['expense_payment_method_1']:
                    $expense_gateway_search_term = "1";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_payment_method_2']:
                    $expense_gateway_search_term = "2";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_payment_method_3']:
                    $expense_gateway_search_term = "3";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_payment_method_4']:
                    $expense_gateway_search_term = "4";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_payment_method_5']:
                    $expense_gateway_search_term = "5";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_payment_method_6']:
                    $expense_gateway_search_term = "6";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_payment_method_7']:
                    $expense_gateway_search_term = "7";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_payment_method_8']:
                    $expense_gateway_search_term = "8";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_payment_method_9']:
                    $expense_gateway_search_term = "9";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_payment_method_10']:
                    $expense_gateway_search_term = "10";
                    return $expense_gateway_search_term;
                    break;
                case $langvals['expense_payment_method_11']:
                    $expense_gateway_search_term = "11";
                    return $expense_gateway_search_term;
                    break;
            }
        default:
            $expense_gateway_search_term = "%" . $expense_search_term . "%";
            return $expense_gateway_search_term;
            break;
    }
}