Ejemplo n.º 1
0
function safe_exit()
{
    global $path_to_root;
    hyperlink_no_params("", _("Enter a new work order"));
    hyperlink_no_params("search_work_orders.php", _("Select an existing work order"));
    display_footer_exit();
}
Ejemplo n.º 2
0
function safe_exit()
{
    global $path_to_root;
    hyperlink_no_params("", _("Enter a &new dimension"));
    echo "<br>";
    hyperlink_no_params($path_to_root . "/dimensions/inquiry/search_dimensions.php", _("&Select an existing dimension"));
    display_footer_exit();
}
Ejemplo n.º 3
0
function safe_exit()
{
    global $path_to_root;
    hyperlink_no_params("", tr("Enter a new dimension"));
    echo "<br>";
    hyperlink_no_params($path_to_root . "/dimensions/inquiry/search_dimensions.php", tr("Select an existing dimension"));
    echo "<br><br>";
    end_page();
    exit;
}
Ejemplo n.º 4
0
function safe_exit()
{
    global $path_to_root;
    hyperlink_no_params("", tr("Enter a new work order"));
    hyperlink_no_params("search_work_orders.php", tr("Select an existing work order"));
    echo "<br>";
    end_form();
    end_page();
    exit;
}
Ejemplo n.º 5
0
//-----------------------------------------------------------------------------------------------
if (isset($_GET['AddedID'])) {
    $trans_no = $_GET['AddedID'];
    $trans_type = ST_JOURNAL;
    display_notification_centered(_("Journal entry has been entered") . " #{$trans_no}");
    display_note(get_gl_view_str($trans_type, $trans_no, _("&View this Journal Entry")));
    reset_focus();
    hyperlink_params($_SERVER['PHP_SELF'], _("Enter &New Journal Entry"), "NewJournal=Yes");
    hyperlink_params("{$path_to_root}/admin/attachments.php", _("Add an Attachment"), "filterType={$trans_type}&trans_no={$trans_no}");
    display_footer_exit();
} elseif (isset($_GET['UpdatedID'])) {
    $trans_no = $_GET['UpdatedID'];
    $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)
{
Ejemplo n.º 6
0
$k = 0;
//row colour counter
while ($myrow = db_fetch($result)) {
    alt_table_row_color($k);
    label_cell($myrow["shipper_name"]);
    label_cell($myrow["contact"]);
    label_cell($myrow["phone"]);
    label_cell($myrow["address"]);
    label_cell($myrow["shipper_defcost"]);
    edit_link_cell("selected_id=" . $myrow[0]);
    delete_link_cell("selected_id=" . $myrow[0] . "&delete=1");
    end_row();
}
end_table();
//----------------------------------------------------------------------------------------------
hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Shipping Company"));
start_form();
start_table($table_style2);
if (isset($selected_id)) {
    //editing an existing Shipper
    $sql = "SELECT * FROM shippers WHERE shipper_id={$selected_id}";
    $result = db_query($sql, "could not get shipper");
    $myrow = db_fetch($result);
    $_POST['shipper_name'] = $myrow["shipper_name"];
    $_POST['contact'] = $myrow["contact"];
    $_POST['phone'] = $myrow["phone"];
    $_POST['address'] = $myrow["address"];
    $_POST['shipper_defcost'] = $myrow["shipper_defcost"];
    hidden('selected_id', $selected_id);
}
text_row_ex(tr("Name:"), 'shipper_name', 40);
Ejemplo n.º 7
0
        if (input_num('this_quantity_inv') >= $_POST['qty_recd'] - $_POST['prev_quantity_inv']) {
            $complete = True;
        } else {
            $complete = False;
        }
        $_SESSION['supp_trans']->add_grn_to_trans($_POST['GRNNumber'], $_POST['po_detail_item'], $_POST['item_code'], $_POST['item_description'], $_POST['qty_recd'], $_POST['prev_quantity_inv'], input_num('this_quantity_inv'), $_POST['order_price'], input_num('ChgPrice'), $complete, $_POST['std_cost_unit'], "");
    }
}
//-----------------------------------------------------------------------------------------
if (isset($_GET['Delete'])) {
    $_SESSION['supp_trans']->remove_grn_from_trans($_GET['Delete']);
}
//-----------------------------------------------------------------------------------------
display_grn_items($_SESSION['supp_trans'], 1);
echo "<br>";
hyperlink_no_params("{$path_to_root}/purchasing/supplier_invoice.php", tr("Back to Supplier Invoice Entry"));
echo "<hr>";
//-----------------------------------------------------------------------------------------
function display_grn_items_for_selection()
{
    global $table_style;
    $result = get_grn_items(0, $_SESSION['supp_trans']->supplier_id, true);
    if (db_num_rows($result) == 0) {
        display_note(tr("There are no outstanding items received from this supplier that have not been invoiced by them."), 0, 1);
        end_page();
        exit;
    }
    /*Set up a table to show the outstanding GRN items for selection */
    start_form(false, true);
    display_heading2(tr("Items Received Yet to be Invoiced"));
    start_table("{$table_style} colspan=7 width=95%");
Ejemplo n.º 8
0
    $js .= get_js_open_window(800, 500);
}
if ($use_date_picker) {
    $js .= get_js_date_picker();
}
page(_($help_context = "Inventory Location Transfers"), false, false, "", $js);
//-----------------------------------------------------------------------------------------------
check_db_has_costable_items(_("There are no inventory items defined in the system (Purchased or manufactured items)."));
check_db_has_movement_types(_("There are no inventory movement types defined in the system. Please define at least one inventory adjustment type."));
//-----------------------------------------------------------------------------------------------
if (isset($_GET['AddedID'])) {
    $trans_no = $_GET['AddedID'];
    $trans_type = ST_LOCTRANSFER;
    display_notification_centered(_("Inventory transfer has been processed"));
    display_note(get_trans_view_str($trans_type, $trans_no, _("&View this transfer")));
    hyperlink_no_params($_SERVER['PHP_SELF'], _("Enter &Another Inventory Transfer"));
    display_footer_exit();
}
//--------------------------------------------------------------------------------------------------
function line_start_focus()
{
    global $Ajax;
    $Ajax->activate('items_table');
    set_focus('_stock_id_edit');
}
//-----------------------------------------------------------------------------------------------
function handle_new_order()
{
    if (isset($_SESSION['transfer_items'])) {
        $_SESSION['transfer_items']->clear_items();
        unset($_SESSION['transfer_items']);
Ejemplo n.º 9
0
    alt_table_row_color($k);
    label_cell($myrow["salesman_name"]);
    label_cell($myrow["salesman_phone"]);
    label_cell($myrow["salesman_fax"]);
    label_cell($myrow["salesman_email"]);
    label_cell(percent_format($myrow["provision"]) . " %", "nowrap align=right");
    amount_cell($myrow["break_pt"]);
    label_cell(percent_format($myrow["provision2"]) . " %", "nowrap align=right");
    edit_link_cell(SID . "selected_id=" . $myrow["salesman_code"]);
    delete_link_cell(SID . "selected_id=" . $myrow["salesman_code"] . "&delete=1");
    end_row();
}
//END WHILE LIST LOOP
end_table();
//------------------------------------------------------------------------------------------------
hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Sales Person"));
//------------------------------------------------------------------------------------------------
start_form();
if (isset($selected_id)) {
    //editing an existing Sales-person
    $sql = "SELECT *  FROM salesman WHERE salesman_code='{$selected_id}'";
    $result = db_query($sql, "could not get sales person");
    $myrow = db_fetch($result);
    $_POST['salesman_name'] = $myrow["salesman_name"];
    $_POST['salesman_phone'] = $myrow["salesman_phone"];
    $_POST['salesman_fax'] = $myrow["salesman_fax"];
    $_POST['salesman_email'] = $myrow["salesman_email"];
    $_POST['provision'] = percent_format($myrow["provision"]);
    $_POST['break_pt'] = price_format($myrow["break_pt"]);
    $_POST['provision2'] = percent_format($myrow["provision2"]);
    hidden('selected_id', $selected_id);
Ejemplo n.º 10
0
    if ($myrow["days_before_due"] == 0) {
        $after_text = tr("N/A");
    } else {
        $after_text = $myrow["days_before_due"] . " " . tr("days");
    }
    alt_table_row_color($k);
    label_cell($myrow["terms"]);
    label_cell($full_text);
    label_cell($after_text);
    edit_link_cell("selected_id=" . $myrow["terms_indicator"]);
    delete_link_cell("selected_id=" . $myrow["terms_indicator"] . "&delete=1");
    end_row();
}
//END WHILE LIST LOOP
end_table();
hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Payment Term"));
//-------------------------------------------------------------------------------------------------
start_form();
start_table($table_style2);
$day_in_following_month = $days_before_due = 0;
if (isset($selected_id)) {
    //editing an existing payment terms
    $sql = "SELECT * FROM payment_terms\n\t\tWHERE terms_indicator='{$selected_id}'";
    $result = db_query($sql, "could not get payment term");
    $myrow = db_fetch($result);
    $_POST['terms'] = $myrow["terms"];
    $days_before_due = $myrow["days_before_due"];
    $day_in_following_month = $myrow["day_in_following_month"];
    hidden('selected_id', $selected_id);
}
text_row(tr("Terms Description:"), 'terms', null, 40, 40);
Ejemplo n.º 11
0
    }
}
//---------------------------------------------------------------------------------------------
if (isset($_GET['delete'])) {
    handle_delete();
}
//---------------------------------------------------------------------------------------------
echo "<center>";
start_form(false, true);
if (!isset($_POST['curr_abrev'])) {
    $_POST['curr_abrev'] = get_global_curr_code();
}
echo tr("Select a currency :") . "  ";
currencies_list('curr_abrev', $_POST['curr_abrev'], true);
// if currency sel has changed, clear the form
if ($_POST['curr_abrev'] != get_global_curr_code()) {
    clear_data();
    $selected_id = "";
}
set_global_curr_code($_POST['curr_abrev']);
if (is_company_currency($_POST['curr_abrev'])) {
    display_note(tr("The selected currency is the company currency."), 2);
    display_note(tr("The company currency is the base currency so exchange rates cannot be set for it."), 1);
} else {
    display_rates($_POST['curr_abrev']);
    hyperlink_no_params($_SERVER['PHP_SELF'], tr("Enter a New Exchange Rate"));
    br(1);
    display_rate_edit();
}
end_form();
end_page();
Ejemplo n.º 12
0
    label_cell($myrow["name"]);
    if ($myrow["tax_shipping"]) {
        label_cell(tr("Yes"));
    } else {
        label_cell(tr("No"));
    }
    /*for ($i=0; $i< 5; $i++)
    		if ($myrow["type" . $i] != reserved_words::get_all_numeric())
    			echo "<td>" . $myrow["type" . $i] . "</td>";*/
    edit_link_cell("selected_id=" . $myrow["id"]);
    delete_link_cell("selected_id=" . $myrow["id"] . "&delete=1");
    end_row();
}
end_table();
//-----------------------------------------------------------------------------------
hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Tax Group"));
start_form();
start_table($table_style2);
if ($selected_id != -1) {
    //editing an existing status code
    if (!isset($_POST['name'])) {
        $group = get_tax_group($selected_id);
        $_POST['name'] = $group["name"];
        $_POST['tax_shipping'] = $group["tax_shipping"];
        $items = get_tax_group_items($selected_id);
        $i = 0;
        while ($tax_item = db_fetch($items)) {
            $_POST['tax_type_id' . $i] = $tax_item["tax_type_id"];
            $_POST['rate' . $i] = percent_format($tax_item["rate"]);
            $i++;
        }
Ejemplo n.º 13
0
        $_POST['filename'] = $mod['filename'];
        hidden('selected_id', $selected_id);
        hidden('filename', $_POST['filename']);
    }
    tab_list_row(tr("Menu Tab"), 'tab', null);
    text_row_ex(tr("Name"), 'name', 30);
    text_row_ex(tr("Folder"), 'path', 20);
    label_row(tr("Module File"), "<input name='uploadfile' type='file'>");
    label_row(tr("SQL File"), "<input name='uploadfile2' type='file'>");
    end_table(0);
    display_note(tr("Select your module PHP file from your local harddisk."), 0, 1);
    echo "<center><input onclick='javascript:updateModule()' type='button' style='width:150' value='" . tr("Save") . "'>";
    end_form();
}
//---------------------------------------------------------------------------------------------
if (isset($_GET['c'])) {
    if ($_GET['c'] == 'df') {
        handle_delete();
    }
    if ($_GET['c'] == 'u') {
        if (handle_submit()) {
            //meta_forward($_SERVER['PHP_SELF']);
        }
    }
}
//---------------------------------------------------------------------------------------------
display_modules();
hyperlink_no_params($_SERVER['PHP_SELF'], tr("Create a new module"));
display_module_edit($selected_id);
//---------------------------------------------------------------------------------------------
end_page();
Ejemplo n.º 14
0
    alt_table_row_color($k);
    if ($myrow["balance_sheet"] == 0) {
        $bs_text = tr("No");
    } else {
        $bs_text = tr("Yes");
    }
    label_cell($myrow["cid"]);
    label_cell($myrow['class_name']);
    label_cell($bs_text);
    edit_link_cell("selected_id=" . $myrow["cid"]);
    delete_link_cell("selected_id=" . $myrow["cid"] . "&delete=1");
    end_row();
}
end_table();
//-----------------------------------------------------------------------------------
hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Account Class"));
start_form();
start_table($table_style2);
if ($selected_id != -1) {
    //editing an existing status code
    $myrow = get_account_class($selected_id);
    $_POST['id'] = $myrow["cid"];
    $_POST['name'] = $myrow["class_name"];
    $_POST['Balance'] = $myrow["balance_sheet"];
    hidden('selected_id', $selected_id);
    label_row(tr("Class ID:"), $_POST['id']);
} else {
    text_row_ex(tr("Class ID:"), 'id', 3);
}
text_row_ex(tr("Class Name:"), 'name', 50);
yesno_list_row(tr("Balance Sheet:"), 'Balance', null, "", "", false);
Ejemplo n.º 15
0
$th = array(tr("Location Code"), tr("Location Name"), "", "");
table_header($th);
$k = 0;
//row colour counter
while ($myrow = db_fetch_row($result)) {
    alt_table_row_color($k);
    label_cell($myrow[0]);
    label_cell($myrow[1]);
    edit_link_cell("selected_id={$myrow['0']}");
    delete_link_cell("selected_id={$myrow['0']}&delete=1");
    end_row();
}
//END WHILE LIST LOOP
//end of ifs and buts!
end_table();
hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Location"));
start_form();
start_table($table_style2);
if (isset($selected_id)) {
    //editing an existing Location
    $myrow = get_item_location($selected_id);
    $_POST['loc_code'] = $myrow["loc_code"];
    $_POST['location_name'] = $myrow["location_name"];
    $_POST['delivery_address'] = $myrow["delivery_address"];
    $_POST['contact'] = $myrow["contact"];
    $_POST['phone'] = $myrow["phone"];
    $_POST['fax'] = $myrow["fax"];
    $_POST['email'] = $myrow["email"];
    hidden("selected_id", $selected_id);
    hidden("loc_code", $_POST['loc_code']);
    label_row(tr("Location Code:"), $_POST['loc_code']);
Ejemplo n.º 16
0
$th = array(tr('Unit'), tr('Description'), tr('Decimals'), "", "");
table_header($th);
$k = 0;
//row colour counter
while ($myrow = db_fetch($result)) {
    alt_table_row_color($k);
    label_cell($myrow["abbr"]);
    label_cell($myrow["name"]);
    label_cell($myrow["decimals"]);
    edit_link_cell(SID . "selected_id={$myrow['0']}");
    delete_link_cell(SID . "selected_id={$myrow['0']}&delete=yes");
    end_row();
}
end_table();
//----------------------------------------------------------------------------------
hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Unit of Measure"));
start_form();
start_table("class='tablestyle_noborder'");
if (isset($selected_id)) {
    //editing an existing item category
    $myrow = get_item_unit($selected_id);
    $_POST['abbr'] = $myrow["abbr"];
    $_POST['description'] = $myrow["name"];
    $_POST['decimals'] = $myrow["decimals"];
    hidden('selected_id', $selected_id);
}
if (isset($selected_id) && item_unit_used($selected_id)) {
    label_row(tr("Unit Abbreviation:"), $_POST['abbr']);
    hidden('abbr', $_POST['abbr']);
} else {
    text_row(tr("Unit Abbreviation:"), 'abbr', null, 20, 20);
Ejemplo n.º 17
0
}
if ($use_date_picker) {
    $js .= get_js_date_picker();
}
page(_($help_context = "Item Adjustments Note"), false, false, "", $js);
//-----------------------------------------------------------------------------------------------
check_db_has_costable_items(_("There are no inventory items defined in the system which can be adjusted (Purchased or Manufactured)."));
check_db_has_movement_types(_("There are no inventory movement types defined in the system. Please define at least one inventory adjustment type."));
//-----------------------------------------------------------------------------------------------
if (isset($_GET['AddedID'])) {
    $trans_no = $_GET['AddedID'];
    $trans_type = ST_INVADJUST;
    display_notification_centered(_("Items adjustment has been processed"));
    display_note(get_trans_view_str($trans_type, $trans_no, _("&View this adjustment")));
    display_note(get_gl_view_str($trans_type, $trans_no, _("View the GL &Postings for this Adjustment")), 1, 0);
    hyperlink_no_params($_SERVER['PHP_SELF'], _("Enter &Another Adjustment"));
    hyperlink_params("{$path_to_root}/admin/attachments.php", _("Add an Attachment"), "filterType={$trans_type}&trans_no={$trans_no}");
    display_footer_exit();
}
//--------------------------------------------------------------------------------------------------
function line_start_focus()
{
    global $Ajax;
    $Ajax->activate('items_table');
    set_focus('_stock_id_edit');
}
//-----------------------------------------------------------------------------------------------
function handle_new_order()
{
    if (isset($_SESSION['adj_items'])) {
        $_SESSION['adj_items']->clear_items();
Ejemplo n.º 18
0
            set_focus('name');
        }
        if (!isset($installed_extensions)) {
            $installed_extensions = array();
            update_extensions($installed_extensions);
        }
        subpage_title(_('Company Settings'));
        start_table(TABLESTYLE);
        text_row_ex(_("Company Name:"), 'name', 30);
        text_row_ex(_("Admin Login:"******"Admin Password:"******"Reenter Password:"******"Select Chart of Accounts:"), 'coa');
        languages_list_row(_("Select Default Language:"), 'lang');
        end_table(1);
        submit_center_first('back', _('<< Back'));
        submit_center_last('set_admin', _('Continue >>'));
        break;
    case '6':
        // final screen
        subpage_title(_('SerbizHub Suite ERP has been installed successsfully.'));
        display_note(_('Please do not forget to remove install wizard folder.'));
        session_unset();
        session_destroy();
        hyperlink_no_params($path_to_root . '/index.php', _('Click here to start.'));
        break;
}
hidden('Tests');
hidden('Page');
end_form(1);
end_page(false, false, true);
Ejemplo n.º 19
0
        set_focus('released');
        return false;
    }
    // make sure item has components
    if (!has_bom($myrow['stock_id'])) {
        display_error(tr("This Work Order cannot be released. The selected item to manufacture does not have a bom."));
        set_focus('stock_id');
        return false;
    }
    return true;
}
//------------------------------------------------------------------------------------
if (isset($_POST['release'])) {
    release_work_order($selected_id, $_POST['released_date'], $_POST['memo_']);
    display_note(tr("The work order has been released to manufacturing."));
    hyperlink_no_params("search_work_orders.php", tr("Select another work order"));
    end_page();
    exit;
}
//------------------------------------------------------------------------------------
start_form();
$myrow = get_work_order($selected_id);
$_POST['released'] = $myrow["released"];
$_POST['memo_'] = "";
if (can_process($myrow)) {
    start_table($table_style2);
    label_row(tr("Work Order #:"), $selected_id);
    label_row(tr("Work Order Reference:"), $myrow["wo_ref"]);
    date_row(tr("Released Date") . ":", 'released_date');
    textarea_row(tr("Memo:"), 'memo_', $_POST['memo_'], 40, 5);
    end_table(1);
Ejemplo n.º 20
0
}
//-----------------------------------------------------------------------------------
$result = get_all_movement_type();
start_table("{$table_style} width=30%");
$th = array(tr("Description"), "", "");
table_header($th);
$k = 0;
while ($myrow = db_fetch($result)) {
    alt_table_row_color($k);
    label_cell($myrow["name"]);
    edit_link_cell("selected_id=" . $myrow["id"]);
    delete_link_cell("selected_id=" . $myrow["id"] . "&delete=1");
    end_row();
}
end_table();
//-----------------------------------------------------------------------------------
hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Inventory Movement Type"));
start_form();
start_table();
if (isset($selected_id)) {
    //editing an existing status code
    $myrow = get_movement_type($selected_id);
    $_POST['name'] = $myrow["name"];
    hidden('selected_id', $selected_id);
}
text_row(tr("Description:"), 'name', null, 50, 50);
end_table(1);
submit_add_or_update_center(!isset($selected_id));
end_form();
//------------------------------------------------------------------------------------
end_page();
Ejemplo n.º 21
0
    $js .= get_js_open_window(900, 500);
}
if ($use_date_picker) {
    $js .= get_js_date_picker();
}
page(tr("Receive Purchase Order Items"), false, false, "", $js);
//---------------------------------------------------------------------------------------------------------------
if (isset($_GET['AddedID'])) {
    $grn = $_GET['AddedID'];
    $trans_type = 25;
    display_notification_centered(tr("Purchase Order Delivery has been processed"));
    display_note(get_trans_view_str($trans_type, $grn, tr("View this Delivery")));
    //echo "<BR>";
    //echo get_gl_view_str(25, $grn, tr("View the GL Journal Entries for this Delivery"));
    //	echo "<br>";
    hyperlink_no_params("{$path_to_root}/purchasing/inquiry/po_search.php", tr("Select a different purchase order for receiving items against"));
    display_footer_exit();
}
//--------------------------------------------------------------------------------------------------
if ((!isset($_GET['PONumber']) || $_GET['PONumber'] == 0) && !isset($_SESSION['PO'])) {
    die(tr("This page can only be opened if a purchase order has been selected. Please select a purchase order first."));
}
//--------------------------------------------------------------------------------------------------
function display_po_receive_items()
{
    global $table_style;
    start_table("colspan=7 {$table_style} width=90%");
    $th = array(tr("Item Code"), tr("Description"), tr("Ordered"), tr("Units"), tr("Received"), tr("Outstanding"), tr("This Delivery"), tr("Price"), tr("Total"));
    table_header($th);
    /*show the line items on the order with the quantity being received for modification */
    $total = 0;
Ejemplo n.º 22
0
function process_receive_po()
{
    global $path_to_root, $Ajax;
    if (!can_process()) {
        return;
    }
    if (check_po_changed()) {
        display_error(_("This order has been changed or invoiced since this delivery was started to be actioned. Processing halted. To enter a delivery against this purchase order, it must be re-selected and re-read again to update the changes made by the other user."));
        hyperlink_no_params("{$path_to_root}/purchasing/inquiry/po_search.php", _("Select a different purchase order for receiving goods against"));
        hyperlink_params("{$path_to_root}/purchasing/po_receive_items.php", _("Re-Read the updated purchase order for receiving goods against"), "PONumber=" . $_SESSION['PO']->order_no);
        unset($_SESSION['PO']->line_items);
        unset($_SESSION['PO']);
        unset($_POST['ProcessGoodsReceived']);
        $Ajax->activate('_page_body');
        display_footer_exit();
    }
    $grn =& $_SESSION['PO'];
    $grn->orig_order_date = $_POST['DefaultReceivedDate'];
    $grn->reference = $_POST['ref'];
    $grn->Location = $_POST['Location'];
    $grn->ex_rate = input_num('_ex_rate', null);
    $grn_no = add_grn($grn);
    new_doc_date($_POST['DefaultReceivedDate']);
    unset($_SESSION['PO']->line_items);
    unset($_SESSION['PO']);
    meta_forward($_SERVER['PHP_SELF'], "AddedID={$grn_no}");
}
Ejemplo n.º 23
0
    } else {
        label_row(_("Host"), $_POST['host']);
        label_row(_("Database User"), $_POST['dbuser']);
        label_row(_("Database Name"), $_POST['dbname']);
        label_row(_("Table Pref"), $_POST['tbpref']);
    }
    yesno_list_row(_("Default"), 'def', null, "", "", false);
    if ($selected_id == -1) {
        coa_list_row(_("Database Script"), 'coa');
        text_row_ex(_("New script Admin Password"), 'admpassword', 20);
    }
    end_table(1);
    submit_center('save', _("Save"));
    end_form();
}
//---------------------------------------------------------------------------------------------
if (isset($_GET['c']) && $_GET['c'] == 'df') {
    handle_delete();
    $selected_id = -1;
}
if (get_post('save')) {
    if (handle_submit()) {
        $selected_id = -1;
    }
}
//---------------------------------------------------------------------------------------------
display_companies();
hyperlink_no_params($_SERVER['PHP_SELF'], _("Create a new company"));
display_company_edit($selected_id);
//---------------------------------------------------------------------------------------------
end_page();
Ejemplo n.º 24
0
                    break;
                }
            }
            unset($inv);
        } else {
            display_error(_("Invalid purchase invoice number."));
        }
    }
}
if (isset($_GET['AddedID'])) {
    $payment_id = $_GET['AddedID'];
    display_notification_centered(_("Payment has been sucessfully entered"));
    submenu_print(_("&Print This Remittance"), ST_SUPPAYMENT, $payment_id . "-" . ST_SUPPAYMENT, 'prtopt');
    submenu_print(_("&Email This Remittance"), ST_SUPPAYMENT, $payment_id . "-" . ST_SUPPAYMENT, null, 1);
    display_note(get_gl_view_str(ST_SUPPAYMENT, $payment_id, _("View the GL &Journal Entries for this Payment")));
    hyperlink_no_params($path_to_root . "/purchasing/inquiry/supplier_allocation_inquiry.php?supplier_id=", _("Select Another &Supplier Transaction for Payment"));
    //    hyperlink_params($path_to_root . "/purchasing/allocations/supplier_allocate.php", _("&Allocate this Payment"), "trans_no=$payment_id&trans_type=22");
    hyperlink_params($_SERVER['PHP_SELF'], _("Enter Another Supplier &Payment"), "supplier_id=" . $_POST['supplier_id']);
    display_footer_exit();
}
//----------------------------------------------------------------------------------------
function check_inputs()
{
    global $Refs;
    if (!get_post('supplier_id')) {
        display_error(_("There is no supplier selected."));
        set_focus('supplier_id');
        return false;
    }
    if ($_POST['amount'] == "") {
        $_POST['amount'] = price_format(0);
Ejemplo n.º 25
0
    $payment_no = $_GET['AddedID'];
    display_notification_centered(_("The customer payment has been successfully entered."));
    submenu_print(_("&Print This Receipt"), ST_CUSTPAYMENT, $payment_no . "-" . ST_CUSTPAYMENT, 'prtopt');
    display_note(get_gl_view_str(ST_CUSTPAYMENT, $payment_no, _("&View the GL Journal Entries for this Customer Payment")));
    //	hyperlink_params($path_to_root . "/sales/allocations/customer_allocate.php", _("&Allocate this Customer Payment"), "trans_no=$payment_no&trans_type=12");
    hyperlink_no_params($path_to_root . "/sales/inquiry/customer_allocation_inquiry.php?customer_id=", _("Select Another &Customer Transaction for Payment"));
    hyperlink_no_params($path_to_root . "/sales/customer_payments.php", _("Enter Another &Customer Payment"));
    display_footer_exit();
} elseif (isset($_GET['UpdatedID'])) {
    $payment_no = $_GET['UpdatedID'];
    display_notification_centered(_("The customer payment has been successfully updated."));
    submenu_print(_("&Print This Receipt"), ST_CUSTPAYMENT, $payment_no . "-" . ST_CUSTPAYMENT, 'prtopt');
    display_note(get_gl_view_str(ST_CUSTPAYMENT, $payment_no, _("&View the GL Journal Entries for this Customer Payment")));
    //	hyperlink_params($path_to_root . "/sales/allocations/customer_allocate.php", _("&Allocate this Customer Payment"), "trans_no=$payment_no&trans_type=12");
    hyperlink_no_params($path_to_root . "/sales/inquiry/customer_inquiry.php?", _("Select Another Customer Payment for &Edition"));
    hyperlink_no_params($path_to_root . "/sales/customer_payments.php", _("Enter Another &Customer Payment"));
    display_footer_exit();
}
//----------------------------------------------------------------------------------------------
function can_process()
{
    global $Refs;
    if (!get_post('customer_id')) {
        display_error(_("There is no customer selected."));
        set_focus('customer_id');
        return false;
    }
    if (!get_post('BranchID')) {
        display_error(_("This customer has no branch defined."));
        set_focus('BranchID');
        return false;
Ejemplo n.º 26
0
    if (get_sales_parent_numbers(ST_SALESINVOICE, $_GET['ModifyInvoice']) == 0) {
        // 1.xx compatibility hack
        echo "<center><br><b>" . _("There are no delivery notes for this invoice.<br>\n\t\tMost likely this invoice was created in Front Accounting version prior to 2.0\n\t\tand therefore can not be modified.") . "</b></center>";
        display_footer_exit();
    }
    processing_start();
    $_SESSION['Items'] = new Cart(ST_SALESINVOICE, $_GET['ModifyInvoice']);
    if ($_SESSION['Items']->count_items() == 0) {
        echo "<center><br><b>" . _("All quantities on this invoice has been credited. There is nothing to modify on this invoice") . "</b></center>";
        display_footer_exit();
    }
    copy_from_cart();
} elseif (!processing_active()) {
    /* This page can only be called with a delivery for invoicing or invoice no for edit */
    display_error(_("This page can only be opened after delivery selection. Please select delivery to invoicing first."));
    hyperlink_no_params("{$path_to_root}/sales/inquiry/sales_deliveries_view.php", _("Select Delivery to Invoice"));
    end_page();
    exit;
} elseif (!isset($_POST['process_invoice']) && !check_quantities()) {
    display_error(_("Selected quantity cannot be less than quantity credited nor more than quantity not invoiced yet."));
}
if (isset($_POST['Update'])) {
    $Ajax->activate('Items');
}
if (isset($_POST['_InvoiceDate_changed'])) {
    $_POST['due_date'] = get_invoice_duedate($_SESSION['Items']->payment, $_POST['InvoiceDate']);
    $Ajax->activate('due_date');
}
if (list_updated('payment')) {
    $_SESSION['Items']->payment = get_post('payment');
    $_POST['due_date'] = get_invoice_duedate($_SESSION['Items']->payment, $_POST['InvoiceDate']);
Ejemplo n.º 27
0
//---------------------------------------------------------------------------------------------------
check_db_has_suppliers(tr("There are no suppliers defined in the system."));
check_db_has_purchasable_items(tr("There are no purchasable inventory items defined in the system."));
//---------------------------------------------------------------------------------------------------------------
if (isset($_GET['AddedID'])) {
    $order_no = $_GET['AddedID'];
    $trans_type = systypes::po();
    if (!isset($_GET['Updated'])) {
        display_notification_centered(tr("Purchase Order has been entered"));
    } else {
        display_notification_centered(tr("Purchase Order has been updated") . " #{$order_no}");
    }
    display_note(get_trans_view_str($trans_type, $order_no, tr("View this order")));
    hyperlink_params($path_to_root . "/purchasing/po_receive_items.php", tr("Receive Items on this Purchase Order"), "PONumber={$order_no}");
    hyperlink_params($_SERVER['PHP_SELF'], tr("Enter Another Purchase Order"), "NewOrder=yes");
    hyperlink_no_params($path_to_root . "/purchasing/inquiry/po_search.php", tr("Select An Outstanding Purchase Order"));
    display_footer_exit();
}
//--------------------------------------------------------------------------------------------------
function copy_to_po()
{
    $_SESSION['PO']->supplier_id = $_POST['supplier_id'];
    $_SESSION['PO']->orig_order_date = $_POST['OrderDate'];
    $_SESSION['PO']->reference = $_POST['ref'];
    $_SESSION['PO']->requisition_no = $_POST['Requisition'];
    $_SESSION['PO']->Comments = $_POST['Comments'];
    $_SESSION['PO']->Location = $_POST['StkLocation'];
    $_SESSION['PO']->delivery_address = $_POST['delivery_address'];
}
//--------------------------------------------------------------------------------------------------
function copy_from_po()
Ejemplo n.º 28
0
$result = get_all_work_centres();
start_table("{$table_style} width=50%");
$th = array(tr("Name"), tr("description"), "", "");
table_header($th);
$k = 0;
while ($myrow = db_fetch($result)) {
    alt_table_row_color($k);
    label_cell($myrow["name"]);
    label_cell($myrow["description"]);
    edit_link_cell("selected_id=" . $myrow["id"]);
    delete_link_cell("selected_id=" . $myrow["id"] . "&delete=1");
    end_row();
}
end_table();
//-----------------------------------------------------------------------------------
hyperlink_no_params($_SERVER['PHP_SELF'], tr("New Work Centre"));
start_form();
start_table($table_style2);
if (isset($selected_id)) {
    //editing an existing status code
    $myrow = get_work_centre($selected_id);
    $_POST['name'] = $myrow["name"];
    $_POST['description'] = $myrow["description"];
    hidden('selected_id', $selected_id);
}
text_row_ex(tr("Name:"), 'name', 40);
text_row_ex(tr("Description:"), 'description', 50);
end_table(1);
submit_add_or_update_center(!isset($selected_id));
end_form();
//------------------------------------------------------------------------------------
Ejemplo n.º 29
0
include_once $path_to_root . "/includes/db/inventory_db.inc";
include_once $path_to_root . "/includes/manufacturing.inc";
include_once $path_to_root . "/manufacturing/includes/manufacturing_db.inc";
include_once $path_to_root . "/manufacturing/includes/manufacturing_ui.inc";
$js = "";
if ($use_date_picker) {
    $js .= get_js_date_picker();
}
page(tr("Produce or Unassemble Finished Items From Work Order"), false, false, "", $js);
if (isset($_GET['trans_no']) && $_GET['trans_no'] != "") {
    $_POST['selected_id'] = $_GET['trans_no'];
}
//--------------------------------------------------------------------------------------------------
if (isset($_GET['AddedID'])) {
    display_note(tr("The manufacturing process has been entered."));
    hyperlink_no_params("search_work_orders.php", tr("Select another Work Order to Process"));
    end_page();
    exit;
}
//--------------------------------------------------------------------------------------------------
$wo_details = get_work_order($_POST['selected_id']);
if (strlen($wo_details[0]) == 0) {
    display_error(tr("The order number sent is not valid."));
    exit;
}
//--------------------------------------------------------------------------------------------------
function can_process()
{
    global $wo_details;
    if (!references::is_valid($_POST['ref'])) {
        display_error(tr("You must enter a reference."));
 function hyperlink_no_params_td($target, $label)
 {
     echo "<td>";
     hyperlink_no_params($target, $label);
     echo "</td>\n";
 }