}
if (isset($_GET['NewPayment'])) {
    $_SESSION['page_title'] = _($help_context = "Bank Account Payment Entry");
    create_cart(ST_BANKPAYMENT, 0);
} else {
    if (isset($_GET['NewDeposit'])) {
        $_SESSION['page_title'] = _($help_context = "Bank Account Deposit Entry");
        create_cart(ST_BANKDEPOSIT, 0);
    } else {
        if (isset($_GET['ModifyPayment'])) {
            $_SESSION['page_title'] = _($help_context = "Modify Bank Account Entry") . " #" . $_GET['trans_no'];
            create_cart(ST_BANKPAYMENT, $_GET['trans_no']);
        } else {
            if (isset($_GET['ModifyDeposit'])) {
                $_SESSION['page_title'] = _($help_context = "Modify Bank Deposit Entry") . " #" . $_GET['trans_no'];
                create_cart(ST_BANKDEPOSIT, $_GET['trans_no']);
            }
        }
    }
}
page($_SESSION['page_title'], false, false, '', $js);
//-----------------------------------------------------------------------------------------------
check_db_has_bank_accounts(_("There are no bank accounts defined in the system."));
//----------------------------------------------------------------------------------------
if (list_updated('PersonDetailID')) {
    $br = get_branch(get_post('PersonDetailID'));
    $_POST['person_id'] = $br['debtor_no'];
    $Ajax->activate('person_id');
}
//--------------------------------------------------------------------------------------------------
function line_start_focus()
    $help_context = 'Modifying Sales Order';
    $_SESSION['page_title'] = sprintf(_("Modifying Sales Order # %d"), $_GET['ModifyOrderNumber']);
    create_cart(ST_SALESORDER, $_GET['ModifyOrderNumber']);
} elseif (isset($_GET['ModifyQuotationNumber']) && is_numeric($_GET['ModifyQuotationNumber'])) {
    $help_context = 'Modifying Sales Quotation';
    $_SESSION['page_title'] = sprintf(_("Modifying Sales Quotation # %d"), $_GET['ModifyQuotationNumber']);
    create_cart(ST_SALESQUOTE, $_GET['ModifyQuotationNumber']);
} elseif (isset($_GET['NewOrder'])) {
    $_SESSION['page_title'] = _($help_context = "New Sales Order Entry");
    create_cart(ST_SALESORDER, 0);
} elseif (isset($_GET['NewQuotation'])) {
    $_SESSION['page_title'] = _($help_context = "New Sales Quotation Entry");
    create_cart(ST_SALESQUOTE, 0);
} elseif (isset($_GET['NewQuoteToSalesOrder'])) {
    $_SESSION['page_title'] = _($help_context = "Sales Order Entry");
    create_cart(ST_SALESQUOTE, $_GET['NewQuoteToSalesOrder']);
}
page($_SESSION['page_title'], false, false, "", $js);
//-----------------------------------------------------------------------------
if (list_updated('branch_id')) {
    // when branch is selected via external editor also customer can change
    $br = get_branch(get_post('branch_id'));
    $_POST['customer_id'] = $br['debtor_no'];
    $Ajax->activate('customer_id');
}
if (isset($_GET['AddedID'])) {
    $order_no = $_GET['AddedID'];
    display_notification_centered(sprintf(_("Order # %d has been entered."), $order_no));
    submenu_view(_("&View This Order"), ST_SALESORDER, $order_no);
    submenu_print(_("&Print This Order"), ST_SALESORDER, $order_no, 'prtopt');
    submenu_print(_("&Email This Order"), ST_SALESORDER, $order_no, null, 1);
Example #3
0
    $trans_type = ST_JOURNAL;
    display_notification_centered(_("Journal entry has been updated") . " #{$trans_no}");
    display_note(get_gl_view_str($trans_type, $trans_no, _("&View this Journal Entry")));
    hyperlink_no_params($path_to_root . "/gl/inquiry/journal_inquiry.php", _("Return to Journal &Inquiry"));
    display_footer_exit();
}
//--------------------------------------------------------------------------------------------------
if (isset($_GET['NewJournal'])) {
    create_cart(0, 0);
} elseif (isset($_GET['ModifyGL'])) {
    if (!isset($_GET['trans_type']) || $_GET['trans_type'] != 0) {
        display_error(_("You can edit directly only journal entries created via Journal Entry page."));
        hyperlink_params("{$path_to_root}/gl/gl_journal.php", _("Entry &New Journal Entry"), "NewJournal=Yes");
        display_footer_exit();
    }
    create_cart($_GET['trans_type'], $_GET['trans_no']);
}
function create_cart($type = 0, $trans_no = 0)
{
    global $Refs;
    if (isset($_SESSION['journal_items'])) {
        unset($_SESSION['journal_items']);
    }
    $cart = new items_cart($type);
    $cart->order_id = $trans_no;
    if ($trans_no) {
        $result = get_gl_trans($type, $trans_no);
        if ($result) {
            while ($row = db_fetch($result)) {
                if ($row['amount'] == 0) {
                    continue;
Example #4
0
} else {
    echo "<tr>\n\n\t\t\t\t<td>CREATE TABLE IF NOT EXISTS " . PRFX . "ACL</td>\n\n\t\t\t\t<td><font color=\"green\"><b>OK</b></font></td>\n\n\t\t\t</tr>\n";
}
##################################
# create_employee_type				#
##################################
if (!create_employee_type($db)) {
    echo "<tr>\n\n\t\t\t\t<td>CREATE TABLE IF NOT EXISTS " . PRFX . "EMPLOYEE_TYPE</td>\n\n\t\t\t\t<td><font color=\"red\"><b>Failed:</b></font> " . $db->ErrorMsg() . "</td>\n\n\t\t\t</tr>\n";
    $error_flag = true;
} else {
    echo "<tr>\n\n\t\t\t\t<td>CREATE TABLE IF NOT EXISTS " . PRFX . "EMPLOYEE_TYPE</td>\n\n\t\t\t\t<td><font color=\"green\"><b>OK</b></font></td>\n\n\t\t\t</tr>\n";
}
##################################
# create_cart							#
##################################
if (!create_cart($db)) {
    echo "<tr>\n\n\t\t\t\t<td>CREATE TABLE IF NOT EXISTS " . PRFX . "CART</td>\n\n\t\t\t\t<td><font color=\"red\"><b>Failed:</b></font> " . $db->ErrorMsg() . "</td>\n\n\t\t\t</tr>\n";
    $error_flag = true;
} else {
    echo "<tr>\n\n\t\t\t\t<td>CREATE TABLE IF NOT EXISTS " . PRFX . "CART</td>\n\n\t\t\t\t<td><font color=\"green\"><b>OK</b></font></td>\n\n\t\t\t</tr>\n";
}
##################################
# create_cat								#
##################################
if (!create_cat($db)) {
    echo "<tr>\n\n\t\t\t\t<td>CREATE TABLE IF NOT EXISTS " . PRFX . "CAT</td>\n\n\t\t\t\t<td><font color=\"red\"><b>Failed:</b></font> " . $db->ErrorMsg() . "</td>\n\n\t\t\t</tr>\n";
    $error_flag = true;
} else {
    echo "<tr>\n\n\t\t\t\t<td>CREATE TABLE IF NOT EXISTS " . PRFX . "CAT</td>\n\n\t\t\t\t<td><font color=\"green\"><b>OK</b></font></td>\n\n\t\t\t</tr>\n";
}
##################################
Example #5
0
if ($use_date_picker) {
    $js .= get_js_date_picker();
}
if (isset($_GET['NewDelivery']) && is_numeric($_GET['NewDelivery'])) {
    $_SESSION['page_title'] = tr("Direct Sales Delivery");
    create_cart(13, $_GET['NewDelivery']);
} elseif (isset($_GET['NewInvoice']) && is_numeric($_GET['NewInvoice'])) {
    $_SESSION['page_title'] = tr("Direct Sales Invoice");
    create_cart(10, $_GET['NewInvoice']);
} elseif (isset($_GET['ModifyOrderNumber']) && is_numeric($_GET['ModifyOrderNumber'])) {
    $help_page_title = tr('Modifying Sales Order');
    $_SESSION['page_title'] = sprintf(tr("Modifying Sales Order # %d"), $_GET['ModifyOrderNumber']);
    create_cart(30, $_GET['ModifyOrderNumber']);
} elseif (isset($_GET['NewOrder'])) {
    $_SESSION['page_title'] = tr("New Sales Order Entry");
    create_cart(30, 0);
}
page($_SESSION['page_title'], false, false, "", $js);
//-----------------------------------------------------------------------------
if (isset($_GET['AddedID'])) {
    $order_no = $_GET['AddedID'];
    print_hidden_script(30);
    display_notification_centered(sprintf(tr("Order # %d has been entered."), $order_no));
    display_note(get_trans_view_str(30, $order_no, tr("View This Order")));
    echo '<br>';
    display_note(print_document_link($order_no, tr("Print This Order"), true, 30));
    echo '<br>';
    display_note(print_document_link($order_no, tr("Print as Quote"), true, 30, 1));
    hyperlink_params($path_to_root . "/sales/customer_delivery.php", tr("Make Delivery Against This Order"), "OrderNumber={$order_no}");
    hyperlink_params($_SERVER['PHP_SELF'], tr("Enter a New Order"), "NewOrder=0");
    display_footer_exit();
include_once $path_to_root . "/gl/includes/gl_db_ml.inc";
include_once $path_to_root . "/gl/includes/gl_ui.inc";
/*===============MOODLEARNING====================*/
include_once $path_to_root . "/gl/ml/db/ml_gl_trans.inc";
include_once $path_to_root . "/reporting/includes/reporting.inc";
/*========================================*/
$js = '';
if ($use_popup_windows) {
    $js .= get_js_open_window(800, 500);
}
if ($use_date_picker) {
    $js .= get_js_date_picker();
}
if (isset($_GET['ModifyDisbursement'])) {
    $_SESSION['page_title'] = _($help_context = "Edit Check Voucher");
    create_cart(ST_DISBURSEMENT, $_GET['trans_no']);
}
page($_SESSION['page_title'], false, false, '', $js);
if (isset($_POST['Process'])) {
    $input_error = 0;
    if (!is_date($_POST['date_'])) {
        display_error(_("The entered date is invalid."));
        set_focus('date_');
        $input_error = 1;
    } elseif (!is_date_in_fiscalyear($_POST['date_'])) {
        display_error(_("The entered date is not in fiscal year."));
        set_focus('date_');
        $input_error = 1;
    }
    if ($input_error == 1) {
        unset($_POST['Process']);