示例#1
0
function gl_inquiry_controls()
{
    $dim = get_company_pref('use_dimension');
    start_form();
    start_table(TABLESTYLE_NOBORDER);
    start_row();
    gl_all_accounts_list_cells(_("Account:"), 'account', null, false, false, _("All Accounts"));
    date_cells(_("from:"), 'TransFromDate', '', null, -30);
    date_cells(_("to:"), 'TransToDate');
    end_row();
    end_table();
    start_table(TABLESTYLE_NOBORDER);
    start_row();
    if ($dim >= 1) {
        dimensions_list_cells(_("Dimension") . " 1:", 'Dimension', null, true, " ", false, 1);
    }
    if ($dim > 1) {
        dimensions_list_cells(_("Dimension") . " 2:", 'Dimension2', null, true, " ", false, 2);
    }
    small_amount_cells(_("Amount min:"), 'amount_min', null, " ");
    small_amount_cells(_("Amount max:"), 'amount_max', null, " ");
    submit_cells('Show', _("Show"), '', '', 'default');
    end_row();
    end_table();
    echo '<hr>';
    end_form();
}
示例#2
0
function gl_inquiry_controls()
{
    $dim = get_company_pref('use_dimension');
    start_form();
    start_table(TABLESTYLE_NOBORDER);
    $date = today();
    if (!isset($_POST['TransFromDate'])) {
        $_POST['TransFromDate'] = begin_month($date);
    }
    if (!isset($_POST['TransToDate'])) {
        $_POST['TransToDate'] = end_month($date);
    }
    date_cells(_("From:"), 'TransFromDate');
    date_cells(_("To:"), 'TransToDate');
    if ($dim >= 1) {
        dimensions_list_cells(_("Dimension") . " 1:", 'Dimension', null, true, " ", false, 1);
    }
    if ($dim > 1) {
        dimensions_list_cells(_("Dimension") . " 2:", 'Dimension2', null, true, " ", false, 2);
    }
    check_cells(_("No zero values"), 'NoZero', null);
    check_cells(_("Only balances"), 'Balance', null);
    submit_cells('Show', _("Show"), '', '', 'default');
    end_table();
    end_form();
}
示例#3
0
function gl_inquiry_controls()
{
    start_form();
    start_table("class='tablestyle_noborder'");
    date_cells(tr("From:"), 'TransFromDate', null, -30);
    date_cells(tr("To:"), 'TransToDate');
    check_cells(tr("No zero values"), 'NoZero', null);
    submit_cells('Show', tr("Show"));
    end_table();
    end_form();
}
示例#4
0
function tax_inquiry_controls()
{
    start_form();
    start_table(TABLESTYLE_NOBORDER);
    start_row();
    date_cells(_("from:"), 'TransFromDate', '', null, -30);
    date_cells(_("to:"), 'TransToDate');
    submit_cells('Show', _("Show"), '', '', 'default');
    end_row();
    end_table();
    end_form();
}
function viewing_controls()
{
    display_note(_("Only documents can be printed."));
    start_table(TABLESTYLE_NOBORDER);
    start_row();
    systypes_list_cells(_("Type:"), 'filterType', null, true);
    if (!isset($_POST['FromTransNo'])) {
        $_POST['FromTransNo'] = "1";
    }
    if (!isset($_POST['ToTransNo'])) {
        $_POST['ToTransNo'] = "999999";
    }
    ref_cells(_("from #:"), 'FromTransNo');
    ref_cells(_("to #:"), 'ToTransNo');
    submit_cells('ProcessSearch', _("Search"), '', '', 'default');
    end_row();
    end_table(1);
}
function viewing_controls()
{
    display_note(tr("Only documents can be printed."));
    start_form(false, true);
    start_table("class='tablestyle_noborder'");
    start_row();
    systypes_list_cells(tr("Type:"), 'filterType', null, true);
    if (!isset($_POST['FromTransNo'])) {
        $_POST['FromTransNo'] = "1";
    }
    if (!isset($_POST['ToTransNo'])) {
        $_POST['ToTransNo'] = "999999";
    }
    ref_cells(tr("from #:"), 'FromTransNo');
    ref_cells(tr("to #:"), 'ToTransNo');
    submit_cells('ProcessSearch', tr("Search"));
    end_row();
    end_table(1);
    end_form();
}
function inquiry_controls()
{
    global $Ajax;
    $dim = get_company_pref('use_dimension');
    start_table(TABLESTYLE_NOBORDER);
    $date = today();
    if (!isset($_POST['TransFromDate'])) {
        $_POST['TransFromDate'] = begin_month($date);
    }
    if (!isset($_POST['TransToDate'])) {
        $_POST['TransToDate'] = end_month($date);
    }
    date_cells(_("From:"), 'TransFromDate');
    date_cells(_("To:"), 'TransToDate');
    type_list_cells(_("Category: "), 'typeId', null, true);
    $r = set();
    account_list_cells(_(""), 'accountId', $r);
    submit_cells('submit_submit', _("Generate Report"), true, '', 'default');
    //submit_cells('RefreshInquiry', _("Search"),'',_('Refresh Inquiry'), 'default');
    end_table();
}
示例#8
0
function gl_inquiry_controls()
{
    global $table_style2;
    $dim = get_company_pref('use_dimension');
    start_form();
    //start_table($table_style2);
    start_table("class='tablestyle_noborder'");
    start_row();
    gl_all_accounts_list_cells(tr("Account:"), 'account', null);
    date_cells(tr("from:"), 'TransFromDate', null, -30);
    date_cells(tr("to:"), 'TransToDate');
    submit_cells('Show', tr("Show"));
    end_row();
    if ($dim >= 1) {
        dimensions_list_row(tr("Dimension") . " 1", 'Dimension', null, true, " ", false, 1);
    }
    if ($dim > 1) {
        dimensions_list_row(tr("Dimension") . " 2", 'Dimension2', null, true, " ", false, 2);
    }
    end_table();
    end_form();
}
示例#9
0
    if (!isset($_POST['Labour'])) {
        $_POST['Labour'] = price_format(0);
        $_POST['cr_lab_acc'] = $r[0];
    }
    amount_row($wo_cost_types[WO_LABOUR], 'Labour');
    gl_all_accounts_list_row(_("Credit Labour Account"), 'cr_lab_acc', null);
    if (!isset($_POST['Costs'])) {
        $_POST['Costs'] = price_format(0);
        $_POST['cr_acc'] = $r[0];
    }
    amount_row($wo_cost_types[WO_OVERHEAD], 'Costs');
    gl_all_accounts_list_row(_("Credit Overhead Account"), 'cr_acc', null);
}
if (get_post('released')) {
    label_row(_("Released On:"), $_POST['released_date']);
}
textarea_row(_("Memo:"), 'memo_', null, 40, 5);
end_table(1);
if (isset($selected_id)) {
    echo "<table align=center><tr>";
    submit_cells('UPDATE_ITEM', _("Update"), '', _('Save changes to work order'), 'default');
    if (get_post('released')) {
        submit_cells('close', _("Close This Work Order"), '', '', true);
    }
    submit_cells('delete', _("Delete This Work Order"), '', '', true);
    echo "</tr></table>";
} else {
    submit_center('ADD_ITEM', _("Add Workorder"), true, '', 'default');
}
end_form();
end_page();
示例#10
0
}
//-----------------------------------------------------------------------------
if (!processing_active()) {
    handle_new_credit();
} else {
    if (!isset($_POST['customer_id'])) {
        $_POST['customer_id'] = $_SESSION['Items']->customer_id;
    }
    if (!isset($_POST['branch_id'])) {
        $_POST['branch_id'] = $_SESSION['Items']->Branch;
    }
}
//-----------------------------------------------------------------------------
start_form(false, true);
$customer_error = display_credit_header($_SESSION['Items']);
if ($customer_error == "") {
    start_table("{$table_style} width=80%", 10);
    echo "<tr><td>";
    display_credit_items(tr("Credit Note Items"), $_SESSION['Items']);
    credit_options_controls();
    echo "</td></tr>";
    end_table();
} else {
    display_error($customer_error);
}
echo "<br><center><table><tr>";
submit_cells('Update', tr("Update"));
submit_cells('ProcessCredit', tr("Process Credit Note"));
echo "</tr></table>";
end_form();
end_page();
示例#11
0
label_cell($myrow["id"]);
label_cell($myrow["reference"]);
label_cell($myrow["name"]);
label_cell($myrow["type_"]);
label_cell(sql2date($myrow["date_"]));
label_cell(sql2date($myrow["due_date"]));
end_row();
comments_display_row(ST_DIMENSION, $id);
end_table();
if ($myrow["closed"] == true) {
    display_note(_("This dimension is closed."));
}
start_form();
start_table(TABLESTYLE_NOBORDER);
start_row();
if (!isset($_POST['TransFromDate'])) {
    $_POST['TransFromDate'] = begin_fiscalyear();
}
if (!isset($_POST['TransToDate'])) {
    $_POST['TransToDate'] = Today();
}
date_cells(_("from:"), 'TransFromDate');
date_cells(_("to:"), 'TransToDate');
submit_cells('Show', _("Show"), '', false);
end_row();
end_table();
hidden('trans_no', $id);
end_form();
display_dimension_balance($id, $_POST['TransFromDate'], $_POST['TransToDate']);
br(1);
end_page(true, false, false, ST_DIMENSION, $id);
示例#12
0
function inquiry_controls()
{
    $dim = get_company_pref('use_dimension');
    start_table(TABLESTYLE_NOBORDER);
    $date = today();
    if (!isset($_POST['TransFromDate'])) {
        $_POST['TransFromDate'] = begin_month($date);
    }
    if (!isset($_POST['TransToDate'])) {
        $_POST['TransToDate'] = end_month($date);
    }
    date_cells(_("From:"), 'TransFromDate');
    date_cells(_("To:"), 'TransToDate');
    //Compare Combo
    global $sel;
    $sel = array(_("Accumulated"), _("Period Y-1"), _("Budget"));
    echo "<td>" . _("Compare to") . ":</td>\n";
    echo "<td>";
    echo array_selector('Compare', null, $sel);
    echo "</td>\n";
    if ($dim >= 1) {
        dimensions_list_cells(_("Dimension") . " 1:", 'Dimension', null, true, " ", false, 1);
    }
    if ($dim > 1) {
        dimensions_list_cells(_("Dimension") . " 2:", 'Dimension2', null, true, " ", false, 2);
    }
    submit_cells('Show', _("Show"), '', '', 'default');
    end_table();
    hidden('AccGrp');
}
}
//--------------------------------------------------------------------------------------
start_form(false, false, $_SERVER['PHP_SELF'] . "?outstanding_only={$outstanding_only}");
start_table(TABLESTYLE_NOBORDER);
start_row();
ref_cells(_("Reference:"), 'OrderNumber', '', null, '', true);
number_list_cells(_("Type"), 'type_', null, 1, 2, _("All"));
date_cells(_("From:"), 'FromDate', '', null, 0, 0, -5);
date_cells(_("To:"), 'ToDate');
check_cells(_("Only Overdue:"), 'OverdueOnly', null);
if (!$outstanding_only) {
    check_cells(_("Only Open:"), 'OpenOnly', null);
} else {
    $_POST['OpenOnly'] = 1;
}
submit_cells('SearchOrders', _("Search"), '', '', 'default');
end_row();
end_table();
$dim = get_company_pref('use_dimension');
function view_link($row)
{
    return get_dimensions_trans_view_str(ST_DIMENSION, $row["id"]);
}
function sum_dimension($row)
{
    return get_dimension_balance($row['id'], $_POST['FromDate'], $_POST['ToDate']);
}
function is_closed($row)
{
    return $row['closed'] ? _('Yes') : _('No');
}
示例#14
0
//---------------------------------------------------------------------------------------------
if (!@$_GET['popup']) {
    start_form();
}
start_table(TABLESTYLE_NOBORDER);
start_row();
ref_cells(_("#:"), 'order_number', '', null, '', true);
date_cells(_("from:"), 'OrdersAfterDate', '', null, -30);
date_cells(_("to:"), 'OrdersToDate');
locations_list_cells(_("into location:"), 'StockLocation', null, true);
end_row();
end_table();
start_table(TABLESTYLE_NOBORDER);
start_row();
stock_items_list_cells(_("for item:"), 'SelectStockFromList', null, true);
submit_cells('SearchOrders', _("Search"), '', _('Select documents'), 'default');
end_row();
end_table(1);
//---------------------------------------------------------------------------------------------
if (isset($_POST['order_number'])) {
    $order_number = $_POST['order_number'];
}
if (isset($_POST['SelectStockFromList']) && $_POST['SelectStockFromList'] != "" && $_POST['SelectStockFromList'] != ALL_TEXT) {
    $selected_stock_item = $_POST['SelectStockFromList'];
} else {
    unset($selected_stock_item);
}
//---------------------------------------------------------------------------------------------
function trans_view($trans)
{
    return get_trans_view_str(ST_PURCHORDER, $trans["order_no"]);
if (isset($_GET['customer_id'])) {
    $_POST['customer_id'] = $_GET['customer_id'];
}
//------------------------------------------------------------------------------------------------
if (!isset($_POST['customer_id'])) {
    $_POST['customer_id'] = get_global_customer();
}
start_form();
start_table(TABLESTYLE_NOBORDER);
start_row();
customer_list_cells(_("Select a customer: "), 'customer_id', $_POST['customer_id'], true);
date_cells(_("from:"), 'TransAfterDate', '', null, -30);
date_cells(_("to:"), 'TransToDate', '', null, 1);
cust_allocations_list_cells(_("Type:"), 'filterType', null);
check_cells(" " . _("show settled:"), 'showSettled', null);
submit_cells('RefreshInquiry', _("Search"), '', _('Refresh Inquiry'), 'default');
set_global_customer($_POST['customer_id']);
end_row();
end_table();
//------------------------------------------------------------------------------------------------
function check_overdue($row)
{
    return $row['OverDue'] == 1 && abs($row["TotalAmount"]) - $row["Allocated"] != 0;
}
function order_link($row)
{
    return $row['order_'] > 0 ? get_customer_trans_view_str(ST_SALESORDER, $row['order_']) : "";
}
function systype_name($dummy, $type)
{
    global $systypes_array;
    label_row(_(" LOP Amount:"), $lop_amount, null, 30, 30);
    label_row(_(" Monthly Amount:"), $staff_loan, null, 30, 30);
    label_row(_(" Other Deduction:"), $tds, null, 30, 30);
    label_row(_(" Total Deductions"), $total_ded, 'style="color:#f55; background-color:#fed;"', 'style="color:#f55; background-color:#fed;"');
    label_row(_(" "), '', null, 30, 30);
    label_row(_(" Net Salary Payable:"), $total_net, 'style="color:#107B0F; background-color:#B7DBC1;"', 'style="color:#107B0F; background-color:#B7DBC1;"');
    end_outer_table(1);
    if (!db_has_employee_payslip($_POST['year'], $_POST['month'], $_POST['empl_id'])) {
        start_table(TABLESTYLE2);
        echo '<tr>';
        $from = Today();
        $from = add_days($from, 1);
        $bal = get_balance_before_for_bank_account(1, $from);
        //echo $trans_no = kv_get_next_trans_no(99) + 1;
        if ($total_net <= $bal) {
            submit_cells('pay_salary', _("Process Payout"), '', _('Show Results'), 'default');
        } else {
            display_warning(" Your Current Account Balance is lower than the payout!.");
        }
        echo '</tr>';
        end_table();
    } else {
        display_warning(" Paid Already!.");
    }
    div_end();
}
end_form();
if (get_post('RefreshInquiry')) {
    $Ajax->activate('gross_salary');
    $Ajax->activate('leave_days');
    $Ajax->activate('monthly_loan');
示例#17
0
}
//--------------------------------------------------------------------------------------
start_form(false, true, $_SERVER['PHP_SELF'] . "?outstanding_only=" . $outstanding_only . SID);
start_table("class='tablestyle_noborder'");
start_row();
ref_cells(tr("Reference:"), 'OrderNumber', null);
number_list_cells(tr("Type"), 'type_', null, 0, 2);
date_cells(tr("From:"), 'FromDate', null, 0, 0, -5);
date_cells(tr("To:"), 'ToDate');
check_cells(tr("Only Overdue:"), 'OverdueOnly', null);
if (!$outstanding_only) {
    check_cells(tr("Only Open:"), 'OpenOnly', null);
} else {
    $_POST['OpenOnly'] = 1;
}
submit_cells('SearchOrders', tr("Search"));
end_row();
end_table();
end_form();
$dim = get_company_pref('use_dimension');
$sql = "SELECT * FROM dimensions WHERE id > 0";
if ($dim == 1) {
    $sql .= " AND type_=1";
}
if (isset($_POST['OpenOnly'])) {
    $sql .= " AND closed=0";
}
if (isset($_POST['type_']) && $_POST['type_'] > 0) {
    $sql .= " AND type_=" . $_POST['type_'];
}
if (isset($_POST['OrderNumber']) && $_POST['OrderNumber'] != "") {
function voiding_controls()
{
    global $selected_id;
    $not_implemented = array(ST_PURCHORDER, ST_SALESORDER, ST_SALESQUOTE, ST_COSTUPDATE);
    start_form();
    start_table(TABLESTYLE_NOBORDER);
    start_row();
    systypes_list_cells(_("Type:"), 'filterType', null, true, $not_implemented);
    if (list_updated('filterType')) {
        $selected_id = -1;
    }
    if (!isset($_POST['FromTransNo'])) {
        $_POST['FromTransNo'] = "1";
    }
    if (!isset($_POST['ToTransNo'])) {
        $_POST['ToTransNo'] = "999999";
    }
    ref_cells(_("from #:"), 'FromTransNo');
    ref_cells(_("to #:"), 'ToTransNo');
    submit_cells('ProcessSearch', _("Search"), '', '', 'default');
    end_row();
    end_table(1);
    $trans_ref = false;
    $sql = get_sql_for_view_transactions($_POST['filterType'], $_POST['FromTransNo'], $_POST['ToTransNo'], $trans_ref);
    if ($sql == "") {
        return;
    }
    $cols = array(_("#") => array('insert' => true, 'fun' => 'view_link'), _("Reference") => array('fun' => 'ref_view'), _("Date") => array('type' => 'date', 'fun' => 'date_view'), _("GL") => array('insert' => true, 'fun' => 'gl_view'), _("Select") => array('insert' => true, 'fun' => 'select_link'));
    $table =& new_db_pager('transactions', $sql, $cols);
    $table->width = "40%";
    display_db_pager($table);
    start_table(TABLESTYLE2);
    if ($selected_id != -1) {
        hidden('trans_no', $selected_id);
        hidden('selected_id', $selected_id);
    } else {
        hidden('trans_no', '');
        $_POST['memo_'] = '';
    }
    label_row(_("Transaction #:"), $selected_id == -1 ? '' : $selected_id);
    date_row(_("Voiding Date:"), 'date_');
    textarea_row(_("Memo:"), 'memo_', null, 30, 4);
    end_table(1);
    if (!isset($_POST['ProcessVoiding'])) {
        submit_center('ProcessVoiding', _("Void Transaction"), true, '', 'default');
    } else {
        if (!exist_transaction($_POST['filterType'], $_POST['trans_no'])) {
            display_error(_("The entered transaction does not exist or cannot be voided."));
            unset($_POST['trans_no']);
            unset($_POST['memo_']);
            unset($_POST['date_']);
            submit_center('ProcessVoiding', _("Void Transaction"), true, '', 'default');
        } else {
            display_warning(_("Are you sure you want to void this transaction ? This action cannot be undone."), 0, 1);
            br();
            submit_center_first('ConfirmVoiding', _("Proceed"), '', true);
            submit_center_last('CancelVoiding', _("Cancel"), '', 'cancel');
        }
    }
    end_form();
}
示例#19
0
}
//------------------------------------------------------------------------------------
if (isset($_POST['delete']) && strlen($_POST['delete']) > 1) {
    if (can_delete($_POST['NewStockID'])) {
        $stock_id = $_POST['NewStockID'];
        delete_item($stock_id);
        meta_forward($_SERVER['PHP_SELF']);
    }
}
//------------------------------------------------------------------------------------
start_form(true);
if (db_has_stock_items()) {
    start_table("class='tablestyle_noborder'");
    start_row();
    stock_items_list_cells(tr("Select an item:"), 'stock_id', null, null, null, null, 1);
    submit_cells('SelectStockItem', tr("Edit Item"));
    end_row();
    end_table();
}
hyperlink_params($_SERVER['PHP_SELF'], tr("Enter a new item"), "New=1");
echo "<br>";
start_table("{$table_style2} width=40%");
table_section_title(tr("Item"));
//------------------------------------------------------------------------------------
$id = "";
// no stock item for image load
if (!isset($_POST['NewStockID']) || isset($_POST['New'])) {
    /*If the page was called without $_POST['NewStockID'] passed to page then assume a new item is to be entered show a form with a part Code field other wise the form showing the fields with the existing entries against the part will show for editing with only a hidden stock_id field. New is set to flag that the page may have called itself and still be entering a new part, in which case the page needs to know not to go looking up details for an existing part*/
    hidden('New', 'Yes');
    text_row(tr("Item Code:"), 'NewStockID', null, 21, 20);
    $company_record = get_company_prefs();
示例#20
0
    $js .= get_js_date_picker();
}
page(tr("Inventory Item Movement"), false, false, "", $js);
if (isset($_GET['stock_id'])) {
    $_POST['stock_id'] = $_GET['stock_id'];
}
start_form(false, true);
if (!isset($_POST['stock_id'])) {
    $_POST['stock_id'] = get_global_stock_item();
}
start_table("class='tablestyle_noborder'");
stock_items_list_cells(tr("Item:"), 'stock_id', $_POST['stock_id']);
locations_list_cells(tr("From Location:"), 'StockLocation', null);
date_cells(tr("From:"), 'AfterDate', null, -30);
date_cells(tr("To:"), 'BeforeDate');
submit_cells('ShowMoves', tr("Show Movements"));
end_table();
end_form();
set_global_stock_item($_POST['stock_id']);
$before_date = date2sql($_POST['BeforeDate']);
$after_date = date2sql($_POST['AfterDate']);
$sql = "SELECT type, trans_no, tran_date, person_id, qty, reference\n\tFROM stock_moves\n\tWHERE loc_code='" . $_POST['StockLocation'] . "'\n\tAND tran_date >= '" . $after_date . "'\n\tAND tran_date <= '" . $before_date . "'\n\tAND stock_id = '" . $_POST['stock_id'] . "' ORDER BY tran_date,trans_id";
$result = db_query($sql, "could not query stock moves");
check_db_error("The stock movements for the selected criteria could not be retrieved", $sql);
start_table("{$table_style} width=70%");
$th = array(tr("Type"), tr("#"), tr("Reference"), tr("Date"), tr("Detail"), tr("Quantity In"), tr("Quantity Out"), tr("Quantity On Hand"));
table_header($th);
$sql = "SELECT SUM(qty) FROM stock_moves WHERE stock_id='" . $_POST['stock_id'] . "'\n\tAND loc_code='" . $_POST['StockLocation'] . "'\n\tAND tran_date < '" . $after_date . "'";
$before_qty = db_query($sql, "The starting quantity on hand could not be calculated");
$before_qty_row = db_fetch_row($before_qty);
$after_qty = $before_qty = $before_qty_row[0];
示例#21
0
    exit;
}
page("Report Generator REPGEN");
### Output key administration forms, including all updated
### information, if we come here after a submission...
display_heading(DESCRIPT);
switch (substr($id, 0, 1)) {
    case 'B':
        $note = DEL_BLOCK;
        break;
    case 'F':
        $note = DEL_FUNC;
        break;
    default:
        $note = DEL_REPORT;
        break;
}
$h = explode("|", $attr);
$note = sprintf($note, "  " . $h[3] . "  ");
/* longname of report*/
display_notification($note);
start_form(false, false, "repgen_del.php", "edit");
start_table(TABLESTYLE2);
start_row();
submit_cells("delete", DEL_BACK);
submit_cells("back", BACK);
hidden("id", $id);
end_row();
end_table();
end_form();
end_page();
示例#22
0
    unset($_POST['credit_status']);
    unset($_POST['payment_terms']);
    unset($_POST['discount']);
    unset($_POST['pymt_discount']);
    unset($_POST['credit_limit']);
    unset($_POST['sales_type']);
    unset($_POST['customer_id']);
    $_POST['New'] = 1;
}
check_db_has_sales_types(tr("There are no sales types defined. Please define at least one sales type before adding a customer."));
start_form();
if (db_has_customers()) {
    start_table("class = 'tablestyle_noborder'");
    start_row();
    customer_list_cells(tr("Select a customer: "), 'customer_id', null);
    submit_cells('SelectCustomer', tr("Edit Customer"));
    end_row();
    end_table();
} else {
    hidden('customer_id', $_POST['customer_id']);
}
hyperlink_params($_SERVER['PHP_SELF'], tr("Enter a new customer"), "New=1");
echo "<br>";
start_table($table_style2, 7, 6);
echo "<tr valign=top><td>";
// outer table
start_table("class='tablestyle_noborder'");
if (isset($_POST['New'])) {
    hidden('New', 'Yes');
    $_POST['CustName'] = $_POST['address'] = $_POST['tax_id'] = '';
    $_POST['dimension_id'] = 0;
示例#23
0
    handle_new_item();
}
if ($_POST['UpdateItem'] != "") {
    handle_update_item();
}
//-----------------------------------------------------------------------------------------------
if (isset($_GET['trans_no'])) {
    handle_new_order();
}
//-----------------------------------------------------------------------------------------------
display_order_header($_SESSION['issue_items']);
start_form(false, true);
start_table("{$table_style} width=90%", '10');
echo "<tr><td>";
display_adjustment_items(tr("Items to Issue"), $_SESSION['issue_items']);
adjustment_options_controls();
echo "</td></tr>";
end_table();
if (!isset($_POST['Process'])) {
    start_table();
    start_row();
    submit_cells('Update', tr("Update"));
    if ($_SESSION['issue_items']->count_items() >= 1) {
        submit_cells('Process', tr("Process Issue"));
    }
    end_row();
    end_table();
}
end_form();
//------------------------------------------------------------------------------------------------
end_page();
示例#24
0
start_form(true, true);
start_outer_table(TABLESTYLE2);
table_section(1);
table_section_title(_("Create backup"));
textarea_row(_("Comments:"), 'comments', null, 30, 8);
compress_list_row(_("Compression:"), 'comp');
vertical_space("height='20px'");
submit_row('creat', _("Create Backup"), false, "colspan=2 align='center'", '', 'process');
table_section(2);
table_section_title(_("Backup scripts maintenance"));
start_row();
echo "<td style='padding-left:20px' align='left'>" . get_backup_file_combo() . "</td>";
echo "<td style='padding-left:20px' valign='top'>";
start_table();
submit_row('view', _("View Backup"), false, '', '', false);
submit_row('download', _("Download Backup"), false, '', '', false);
submit_row('restore', _("Restore Backup"), false, '', '', 'process');
submit_js_confirm('restore', _("You are about to restore database from backup file.\nDo you want to continue?"));
submit_row('deldump', _("Delete Backup"), false, '', '', true);
// don't use 'delete' name or IE js errors appear
submit_js_confirm('deldump', sprintf(_("You are about to remove selected backup file.\nDo you want to continue ?")));
end_table();
echo "</td>";
end_row();
start_row();
echo "<td style='padding-left:20px' align='left'><input name='uploadfile' type='file'></td>";
submit_cells('upload', _("Upload file"), "style='padding-left:20px'", '', true);
end_row();
end_outer_table();
end_form();
end_page();
示例#25
0
        }
    }
    if ($cancel_delete == 0) {
        $sql = "DELETE FROM suppliers WHERE supplier_id='" . $_POST['supplier_id'] . "'";
        db_query($sql, "check failed");
        unset($_SESSION['supplier_id']);
        meta_forward($_SERVER['PHP_SELF']);
    }
    //end if Delete supplier
}
start_form();
if (db_has_suppliers()) {
    start_table("", 3);
    start_row();
    supplier_list_cells(tr("Select a supplier: "), 'supplier_id', null);
    submit_cells('SelectSupplier', tr("Edit Supplier"));
    end_row();
    end_table();
} else {
    hidden('supplier_id', $_POST['supplier_id']);
}
hyperlink_params($_SERVER['PHP_SELF'], tr("Enter a new supplier"), "New=1");
echo "<br>";
//start_table("class='tablestyle2'", 0, 3);
start_table("class='tablestyle'", 3);
table_section_title(tr("Supplier"));
if (isset($_POST['supplier_id']) && !isset($_POST['New'])) {
    //SupplierID exists - either passed when calling the form or from the form itself
    $myrow = get_supplier($_POST['supplier_id']);
    $_POST['supp_name'] = $myrow["supp_name"];
    $_POST['address'] = $myrow["address"];
示例#26
0
    $_POST['customer_id'] = $_GET['customer_id'];
}
//------------------------------------------------------------------------------------------------
start_form();
if (!isset($_POST['customer_id'])) {
    $_POST['customer_id'] = get_global_customer();
}
start_table("class='tablestyle_noborder'");
customer_list_cells(tr("Select a customer: "), 'customer_id', $_POST['customer_id'], true);
date_cells(tr("From:"), 'TransAfterDate', null, -30);
date_cells(tr("To:"), 'TransToDate', null, 1);
if (!isset($_POST['filterType'])) {
    $_POST['filterType'] = 0;
}
cust_allocations_list_cells(null, 'filterType', $_POST['filterType'], true);
submit_cells('Refresh Inquiry', tr("Search"));
end_table();
end_form();
set_global_customer($_POST['customer_id']);
//------------------------------------------------------------------------------------------------
function display_customer_summary($customer_record)
{
    global $table_style;
    $past1 = get_company_pref('past_due_days');
    $past2 = 2 * $past1;
    if ($customer_record["dissallow_invoices"] != 0) {
        echo "<center><font color=red size=4><b>" . tr("CUSTOMER ACCOUNT IS ON HOLD") . "</font></b></center>";
    }
    $nowdue = "1-" . $past1 . " " . tr('Days');
    $pastdue1 = $past1 + 1 . "-" . $past2 . " " . tr('Days');
    $pastdue2 = tr('Over') . " " . $past2 . " " . tr('Days');
}
if (isset($_POST['UpdateItem'])) {
    handle_update_item();
}
if (isset($_POST['CancelItemChanges'])) {
    line_start_focus();
}
//-----------------------------------------------------------------------------
if (!processing_active()) {
    handle_new_credit(0);
}
//-----------------------------------------------------------------------------
start_form();
hidden('cart_id');
$customer_error = display_credit_header($_SESSION['Items']);
if ($customer_error == "") {
    start_table(TABLESTYLE, "width=80%", 10);
    echo "<tr><td>";
    display_credit_items(_("Credit Note Items"), $_SESSION['Items']);
    credit_options_controls($_SESSION['Items']);
    echo "</td></tr>";
    end_table();
} else {
    display_error($customer_error);
}
echo "<br><center><table><tr>";
submit_cells('Update', _("Update"));
submit_cells('ProcessCredit', _("Process Credit Note"), '', false, 'default');
echo "</tr></table></center>";
end_form();
end_page();
示例#28
0
if (!isset($_POST['stock_id'])) {
    $_POST['stock_id'] = get_global_stock_item();
}
start_table(TABLESTYLE_NOBORDER);
start_row();
if (!@$_GET['popup']) {
    stock_costable_items_list_cells(_("Item:"), 'stock_id', $_POST['stock_id']);
}
end_row();
end_table();
start_table(TABLESTYLE_NOBORDER);
start_row();
locations_list_cells(_("From Location:"), 'StockLocation', null);
date_cells(_("From:"), 'AfterDate', '', null, -30);
date_cells(_("To:"), 'BeforeDate');
submit_cells('ShowMoves', _("Show Movements"), '', _('Refresh Inquiry'), 'default');
end_row();
end_table();
if (!@$_GET['popup']) {
    end_form();
}
set_global_stock_item($_POST['stock_id']);
$before_date = date2sql($_POST['BeforeDate']);
$after_date = date2sql($_POST['AfterDate']);
$result = get_stock_movements($_POST['stock_id'], $_POST['StockLocation'], $_POST['BeforeDate'], $_POST['AfterDate']);
div_start('doc_tbl');
start_table(TABLESTYLE);
$th = array(_("Type"), _("#"), _("Reference"), _("Date"), _("Detail"), _("Quantity In"), _("Quantity Out"), _("Quantity On Hand"));
table_header($th);
$before_qty = get_stock_movements_before($_POST['stock_id'], $_POST['StockLocation'], $_POST['AfterDate']);
$after_qty = $before_qty;
示例#29
0
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%");
    $th = array(tr("Delivery"), tr("Sequence #"), tr("P.O."), tr("Item"), tr("Description"), tr("Received On"), tr("Quantity Received"), tr("Quantity Invoiced"), tr("Uninvoiced Quantity"), tr("Order Price"), tr("Total"));
    table_header($th);
    $i = $k = 0;
    while ($myrow = db_fetch($result)) {
        $grn_already_on_invoice = False;
        foreach ($_SESSION['supp_trans']->grn_items as $entered_grn) {
            if ($entered_grn->id == $myrow["id"]) {
                $grn_already_on_invoice = True;
            }
        }
        if ($grn_already_on_invoice == False) {
            alt_table_row_color($k);
            label_cell(get_trans_view_str(25, $myrow["grn_batch_id"]));
            //text_cells(null, 'grn_item_id', $myrow["id"]);
            submit_cells('grn_item_id', $myrow["id"]);
            label_cell(get_trans_view_str(systypes::po(), $myrow["purch_order_no"]));
            label_cell($myrow["item_code"]);
            label_cell($myrow["description"]);
            label_cell(sql2date($myrow["delivery_date"]));
            qty_cell($myrow["qty_recd"]);
            qty_cell($myrow["quantity_inv"]);
            qty_cell($myrow["qty_recd"] - $myrow["quantity_inv"]);
            amount_cell($myrow["unit_price"]);
            amount_cell(round($myrow["unit_price"] * ($myrow["qty_recd"] - $myrow["quantity_inv"]), user_price_dec()));
            end_row();
            $i++;
            if ($i > 15) {
                $i = 0;
                table_header($th);
            }
        }
    }
    end_table();
}
示例#30
0
function inquiry_controls()
{
    $dim = get_company_pref('use_dimension');
    start_table(TABLESTYLE_NOBORDER);
    date_cells(_("As at:"), 'TransToDate');
    if ($dim >= 1) {
        dimensions_list_cells(_("Dimension") . " 1:", 'Dimension', null, true, " ", false, 1);
    }
    if ($dim > 1) {
        dimensions_list_cells(_("Dimension") . " 2:", 'Dimension2', null, true, " ", false, 2);
    }
    submit_cells('Show', _("Show"), '', '', 'default');
    end_table();
    hidden('TransFromDate');
    hidden('AccGrp');
}