Esempio n. 1
0
function display_kit_items($selected_kit)
{
    $result = get_item_kit($selected_kit);
    div_start('bom');
    start_table(TABLESTYLE, "width='60%'");
    $th = array(_("Stock Item"), _("Description"), _("Quantity"), _("Units"), '', '');
    table_header($th);
    $k = 0;
    while ($myrow = db_fetch($result)) {
        alt_table_row_color($k);
        label_cell($myrow["stock_id"]);
        label_cell($myrow["comp_name"]);
        qty_cell($myrow["quantity"], false, $myrow["units"] == '' ? 0 : get_qty_dec($myrow["comp_name"]));
        label_cell($myrow["units"] == '' ? _('kit') : $myrow["units"]);
        edit_button_cell("Edit" . $myrow['id'], _("Edit"));
        delete_button_cell("Delete" . $myrow['id'], _("Delete"));
        end_row();
    }
    //END WHILE LIST LOOP
    end_table();
    div_end();
}
Esempio n. 2
0
function display_bom_items($selected_parent)
{
    $result = get_bom($selected_parent);
    div_start('bom');
    start_table(TABLESTYLE, "width=60%");
    $th = array(_("Code"), _("Description"), _("Location"), _("Work Centre"), _("Quantity"), _("Units"), '', '');
    table_header($th);
    $k = 0;
    while ($myrow = db_fetch($result)) {
        alt_table_row_color($k);
        label_cell($myrow["component"]);
        label_cell($myrow["description"]);
        label_cell($myrow["location_name"]);
        label_cell($myrow["WorkCentreDescription"]);
        qty_cell($myrow["quantity"], false, get_qty_dec($myrow["component"]));
        label_cell($myrow["units"]);
        edit_button_cell("Edit" . $myrow['id'], _("Edit"));
        delete_button_cell("Delete" . $myrow['id'], _("Delete"));
        end_row();
    }
    //END WHILE LIST LOOP
    end_table();
    div_end();
}
Esempio n. 3
0
start_table(TABLESTYLE, "width=40%");
$th = array(_("Description"), _("Dissallow Invoices"), '', '');
inactive_control_column($th);
table_header($th);
$k = 0;
while ($myrow = db_fetch($result)) {
    alt_table_row_color($k);
    if ($myrow["dissallow_invoices"] == 0) {
        $disallow_text = _("Invoice OK");
    } else {
        $disallow_text = "<b>" . _("NO INVOICING") . "</b>";
    }
    label_cell($myrow["reason_description"]);
    label_cell($disallow_text);
    inactive_control_cell($myrow["id"], $myrow["inactive"], 'credit_status', 'id');
    edit_button_cell("Edit" . $myrow['id'], _("Edit"));
    delete_button_cell("Delete" . $myrow['id'], _("Delete"));
    end_row();
}
inactive_control_row($th);
end_table();
echo '<br>';
//-----------------------------------------------------------------------------------
start_table(TABLESTYLE2);
if ($selected_id != -1) {
    if ($Mode == 'Edit') {
        //editing an existing status code
        $myrow = get_credit_status($selected_id);
        $_POST['reason_description'] = $myrow["reason_description"];
        $_POST['DisallowInvoices'] = $myrow["dissallow_invoices"];
    }
start_form();
start_table(TABLESTYLE);
$th = array(_("Name"), _("Contact Person"), _("Phone Number"), _("Secondary Phone"), _("Address"), "", "");
inactive_control_column($th);
table_header($th);
$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["phone2"]);
    label_cell($myrow["address"]);
    inactive_control_cell($myrow["shipper_id"], $myrow["inactive"], 'shippers', 'shipper_id');
    edit_button_cell("Edit" . $myrow["shipper_id"], _("Edit"));
    delete_button_cell("Delete" . $myrow["shipper_id"], _("Delete"));
    end_row();
}
inactive_control_row($th);
end_table(1);
//----------------------------------------------------------------------------------------------
start_table(TABLESTYLE2);
if ($selected_id != -1) {
    if ($Mode == 'Edit') {
        //editing an existing Shipper
        $myrow = get_shipper($selected_id);
        $_POST['shipper_name'] = $myrow["shipper_name"];
        $_POST['contact'] = $myrow["contact"];
        $_POST['phone'] = $myrow["phone"];
        $_POST['phone2'] = $myrow["phone2"];
Esempio n. 5
0
        display_note(_("There is no purchasing data set up for the part selected"));
    } else {
        start_table(TABLESTYLE, "width=65%");
        $th = array(_("Supplier"), _("Price"), _("Currency"), _("Supplier's Unit"), _("Conversion Factor"), _("Supplier's Description"), "", "");
        table_header($th);
        $k = $j = 0;
        //row colour counter
        while ($myrow = db_fetch($result)) {
            alt_table_row_color($k);
            label_cell($myrow["supp_name"]);
            amount_decimal_cell($myrow["price"]);
            label_cell($myrow["curr_code"]);
            label_cell($myrow["suppliers_uom"]);
            qty_cell($myrow['conversion_factor'], false, 'max');
            label_cell($myrow["supplier_description"]);
            edit_button_cell("Edit" . $myrow['supplier_id'], _("Edit"));
            delete_button_cell("Delete" . $myrow['supplier_id'], _("Delete"));
            end_row();
            $j++;
            if ($j == 12) {
                $j = 1;
                table_header($th);
            }
            //end of page full new headings
        }
        //end of while loop
        end_table();
    }
    div_end();
}
//-----------------------------------------------------------------------------------------------
Esempio n. 6
0
$result = get_all_item_codes($_POST['stock_id']);
div_start('code_table');
start_table(TABLESTYLE, "width=60%");
$th = array(_("EAN/UPC Code"), _("Quantity"), _("Units"), _("Description"), _("Category"), "", "");
table_header($th);
$k = $j = 0;
//row colour counter
while ($myrow = db_fetch($result)) {
    alt_table_row_color($k);
    label_cell($myrow["item_code"]);
    qty_cell($myrow["quantity"], $dec);
    label_cell($units);
    label_cell($myrow["description"]);
    label_cell($myrow["cat_name"]);
    edit_button_cell("Edit" . $myrow['id'], _("Edit"));
    edit_button_cell("Delete" . $myrow['id'], _("Delete"));
    end_row();
    $j++;
    if ($j == 12) {
        $j = 1;
        table_header($th);
    }
    //end of page full new headings
}
//end of while loop
end_table();
div_end();
//-----------------------------------------------------------------------------------------------
if ($selected_id != '') {
    if ($Mode == 'Edit') {
        $myrow = get_item_code($selected_id);
Esempio n. 7
0
start_form();
start_table(TABLESTYLE);
$th = array(_("Location Code"), _("Location Name"), _("Address"), _("Phone"), _("Secondary Phone"), "", "");
inactive_control_column($th);
table_header($th);
$k = 0;
//row colour counter
while ($myrow = db_fetch($result)) {
    alt_table_row_color($k);
    label_cell($myrow["loc_code"]);
    label_cell($myrow["location_name"]);
    label_cell($myrow["delivery_address"]);
    label_cell($myrow["phone"]);
    label_cell($myrow["phone2"]);
    inactive_control_cell($myrow["loc_code"], $myrow["inactive"], 'locations', 'loc_code');
    edit_button_cell("Edit" . $myrow["loc_code"], _("Edit"));
    delete_button_cell("Delete" . $myrow["loc_code"], _("Delete"));
    end_row();
}
//END WHILE LIST LOOP
inactive_control_row($th);
end_table();
echo '<br>';
start_table(TABLESTYLE2);
$_POST['email'] = "";
if ($selected_id != -1) {
    //editing an existing Location
    if ($Mode == 'Edit') {
        $myrow = get_item_location($selected_id);
        $_POST['loc_code'] = $myrow["loc_code"];
        $_POST['location_name'] = $myrow["location_name"];
Esempio n. 8
0
    $_POST['show_inactive'] = $sav;
}
//-----------------------------------------------------------------------------------
$result = get_all_asset_types(check_value('show_inactive'));
start_form();
start_table(TABLESTYLE, "width=30%");
$th = array(_("Asset Type Name"), _("Depreciation Rate"), "", "");
inactive_control_column($th);
table_header($th);
$k = 0;
while ($myrow = db_fetch($result)) {
    alt_table_row_color($k);
    label_cell($myrow["asset_type_name"]);
    label_cell($myrow["depreciation_rate"]);
    inactive_control_cell($myrow["asset_type_id"], $myrow["inactive"], 'asset_types', 'asset_type_id');
    edit_button_cell("Edit" . $myrow['asset_type_id'], _("Edit"));
    delete_button_cell("Delete" . $myrow['asset_type_id'], _("Delete"));
    end_row();
}
inactive_control_row($th);
end_table(1);
//-----------------------------------------------------------------------------------
start_table(TABLESTYLE2);
if ($selected_id != -1) {
    if ($Mode == 'Edit') {
        //editing an existing status code
        $myrow = get_asset_type($selected_id);
        $_POST['name'] = $myrow["asset_type_name"];
        $_POST['rate'] = $myrow["depreciation_rate"];
        $_POST['asset_account'] = $myrow["asset_account"];
        $_POST['depreciation_account'] = $myrow["depreciation_account"];
Esempio n. 9
0
    }
}
//-------------------------------------------------------------------------------------------------
$result = get_sales_groups(check_value('show_inactive'));
start_form();
start_table(TABLESTYLE, "width=30%");
$th = array(_("ID"), _("Group Name"), "", "");
inactive_control_column($th);
table_header($th);
$k = 0;
while ($myrow = db_fetch($result)) {
    alt_table_row_color($k);
    label_cell($myrow["id"]);
    label_cell($myrow["description"]);
    inactive_control_cell($myrow["id"], $myrow["inactive"], 'groups', 'id');
    edit_button_cell("Edit" . $myrow["id"], _("Edit"));
    delete_button_cell("Delete" . $myrow["id"], _("Delete"));
    end_row();
}
inactive_control_row($th);
end_table(1);
//-------------------------------------------------------------------------------------------------
start_table(TABLESTYLE2);
if ($selected_id != -1) {
    if ($Mode == 'Edit') {
        //editing an existing group
        $myrow = get_sales_group($selected_id);
        $_POST['description'] = $myrow["description"];
    }
    hidden("selected_id", $selected_id);
    label_row(_("ID"), $myrow["id"]);
Esempio n. 10
0
    $selected_id = -1;
    unset($_POST);
}
$result = fetchAuthors();
start_form();
start_table(TABLESTYLE, "width=70%");
$th = array(_('Name'), _('Address'), _('Contact Number'), _('Email Address'), '', '');
table_header($th);
$k = 0;
while ($myrow = db_fetch($result)) {
    alt_table_row_color($k);
    label_cell($myrow[1]);
    label_cell($myrow[2]);
    label_cell($myrow[3]);
    label_cell($myrow[4]);
    edit_button_cell("Edit" . $myrow[0], _("Edit"));
    delete_button_cell("Delete" . $myrow[0], _("Delete"));
    end_row();
}
end_table(1);
start_table(TABLESTYLE2);
if ($selected_id != -1) {
    if ($Mode == 'Edit') {
        $result = fetchAuthors($selected_id);
        while ($myrow = db_fetch($result)) {
            $_POST['fname'] = $myrow['author_fname'];
            $_POST['mname'] = $myrow['author_mname'];
            $_POST['lname'] = $myrow['author_lname'];
            $_POST['bdate'] = sql2date($myrow["author_birthdate"]);
            $_POST['address'] = $myrow['author_address'];
            $_POST['contact_number'] = $myrow['author_contact_number'];
Esempio n. 11
0
//----------------------------------------------------------------------------------
$result = get_all_item_units(check_value('show_inactive'));
start_form();
start_table(TABLESTYLE, "width=40%");
$th = array(_('Unit'), _('Description'), _('Decimals'), "", "");
inactive_control_column($th);
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"] == -1 ? _("User Quantity Decimals") : $myrow["decimals"]);
    inactive_control_cell($myrow["abbr"], $myrow["inactive"], 'item_units', 'abbr');
    edit_button_cell("Edit" . $myrow["abbr"], _("Edit"));
    delete_button_cell("Delete" . $myrow["abbr"], _("Delete"));
    end_row();
}
inactive_control_row($th);
end_table(1);
//----------------------------------------------------------------------------------
start_table(TABLESTYLE2);
if ($selected_id != '') {
    if ($Mode == 'Edit') {
        //editing an existing item category
        $myrow = get_item_unit($selected_id);
        $_POST['abbr'] = $myrow["abbr"];
        $_POST['description'] = $myrow["name"];
        $_POST['decimals'] = $myrow["decimals"];
    }
Esempio n. 12
0
    unset($_POST);
    $_POST['show_inactive'] = $sav;
}
//-------------------------------------------------------------------------------------------------
$result = get_sales_areas(check_value('show_inactive'));
start_form();
start_table(TABLESTYLE, "width=30%");
$th = array(_("Area Name"), "", "");
inactive_control_column($th);
table_header($th);
$k = 0;
while ($myrow = db_fetch($result)) {
    alt_table_row_color($k);
    label_cell($myrow["description"]);
    inactive_control_cell($myrow["area_code"], $myrow["inactive"], 'areas', 'area_code');
    edit_button_cell("Edit" . $myrow["area_code"], _("Edit"));
    delete_button_cell("Delete" . $myrow["area_code"], _("Delete"));
    end_row();
}
inactive_control_row($th);
end_table();
echo '<br>';
//-------------------------------------------------------------------------------------------------
start_table(TABLESTYLE2);
if ($selected_id != -1) {
    if ($Mode == 'Edit') {
        //editing an existing area
        $myrow = get_sales_area($selected_id);
        $_POST['description'] = $myrow["description"];
    }
    hidden("selected_id", $selected_id);
Esempio n. 13
0
start_form();
start_table(TABLESTYLE);
$th = array(_("Description"), _("Type"), _("Due After/Days"), "", "");
inactive_control_column($th);
table_header($th);
$k = 0;
//row colour counter
while ($myrow = db_fetch($result)) {
    alt_table_row_color($k);
    $type = term_type($myrow);
    $days = term_days($myrow);
    label_cell($myrow["terms"]);
    label_cell($pterm_types[$type]);
    label_cell($type == PTT_DAYS ? "{$days} " . _("days") : ($type == PTT_FOLLOWING ? $days : _("N/A")));
    inactive_control_cell($myrow["terms_indicator"], $myrow["inactive"], 'payment_terms', "terms_indicator");
    edit_button_cell("Edit" . $myrow["terms_indicator"], _("Edit"));
    delete_button_cell("Delete" . $myrow["terms_indicator"], _("Delete"));
    end_row();
}
inactive_control_row($th);
end_table(1);
//-------------------------------------------------------------------------------------------------
if (list_updated('type')) {
    $Ajax->activate('edits');
}
div_start('edits');
start_table(TABLESTYLE2);
$day_in_following_month = $days_before_due = 0;
if ($selected_id != -1) {
    if ($Mode == 'Edit') {
        //editing an existing payment terms
Esempio n. 14
0
$result = get_all_item_units(check_value('show_inactive'));
start_form();
start_table(TABLESTYLE, "width=40%");
$th = array(_('Unit'), _('Description'), _('Decimals'), "", "");
inactive_control_column($th);
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"] == -1 ? _("User Quantity Decimals") : $myrow["decimals"]);
    $id = htmlentities($myrow["abbr"]);
    inactive_control_cell($id, $myrow["inactive"], 'item_units', 'abbr');
    edit_button_cell("Edit" . $id, _("Edit"));
    delete_button_cell("Delete" . $id, _("Delete"));
    end_row();
}
inactive_control_row($th);
end_table(1);
//----------------------------------------------------------------------------------
start_table(TABLESTYLE2);
if ($selected_id != '') {
    if ($Mode == 'Edit') {
        //editing an existing item category
        $myrow = get_item_unit($selected_id);
        $_POST['abbr'] = $myrow["abbr"];
        $_POST['description'] = $myrow["name"];
        $_POST['decimals'] = $myrow["decimals"];
    }
Esempio n. 15
0
start_table(TABLESTYLE, "width='60%'");
$th = array(_("Name"), _("Phone"), _("Fax"), _("Email"), _("Provision"), _("Break Pt."), _("Provision") . " 2", "", "");
inactive_control_column($th);
table_header($th);
$k = 0;
while ($myrow = db_fetch($result)) {
    alt_table_row_color($k);
    label_cell($myrow["salesman_name"]);
    label_cell($myrow["salesman_phone"]);
    label_cell($myrow["salesman_fax"]);
    email_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");
    inactive_control_cell($myrow["salesman_code"], $myrow["inactive"], 'salesman', 'salesman_code');
    edit_button_cell("Edit" . $myrow["salesman_code"], _("Edit"));
    delete_button_cell("Delete" . $myrow["salesman_code"], _("Delete"));
    end_row();
}
//END WHILE LIST LOOP
inactive_control_row($th);
end_table();
echo '<br>';
//------------------------------------------------------------------------------------------------
$_POST['salesman_email'] = "";
if ($selected_id != -1) {
    if ($Mode == 'Edit') {
        //editing an existing Sales-person
        $myrow = get_salesman($selected_id);
        $_POST['salesman_name'] = $myrow["salesman_name"];
        $_POST['salesman_phone'] = $myrow["salesman_phone"];
//-----------------------------------------------------------------------------------
echo "<hr/>\n";
$result = get_all_requisition_details(get_post('requisitionid'));
start_form();
start_table(TABLESTYLE, "width=50%");
$th = array(_("Item Code"), _("Item Name"), _("Purpose"), _("Qrder Quantity"), _("Estimate Price"), "", "");
table_header($th);
$k = 0;
while ($myrow = db_fetch($result)) {
    alt_table_row_color($k);
    label_cell($myrow["item_code"]);
    label_cell($myrow["description"]);
    label_cell($myrow["purpose"]);
    label_cell($myrow["order_quantity"]);
    amount_cell($myrow["estimate_price"]);
    edit_button_cell("Edit" . $myrow['requisition_detail_id'], _("Edit"));
    delete_button_cell("Delete" . $myrow['requisition_detail_id'], _("Delete"));
    end_row();
}
end_table(1);
//-----------------------------------------------------------------------------------
start_table(TABLESTYLE2);
if ($selected_id != -1) {
    if ($Mode == 'Edit') {
        //editing an existing status code
        $myrow = get_requisition_detail($selected_id);
        $_POST['item_code'] = $myrow["item_code"];
        $_POST['purpose'] = $myrow["purpose"];
        $_POST['order_quantity'] = $myrow["order_quantity"];
        $_POST['estimate_price'] = $myrow["estimate_price"];
    }
Esempio n. 17
0
table_header($th);
$k = 0;
//row colour counter
while ($myrow = db_fetch($result)) {
    alt_table_row_color($k);
    label_cell($myrow["description"]);
    label_cell($myrow["tax_name"]);
    label_cell($myrow["dflt_units"], "align=center");
    label_cell($stock_types[$myrow["dflt_mb_flag"]]);
    label_cell($myrow["dflt_sales_act"], "align=center");
    label_cell($myrow["dflt_inventory_act"], "align=center");
    label_cell($myrow["dflt_cogs_act"], "align=center");
    label_cell($myrow["dflt_adjustment_act"], "align=center");
    label_cell($myrow["dflt_assembly_act"], "align=center");
    inactive_control_cell($myrow["category_id"], $myrow["inactive"], 'stock_category', 'category_id');
    edit_button_cell("Edit" . $myrow["category_id"], _("Edit"));
    delete_button_cell("Delete" . $myrow["category_id"], _("Delete"));
    end_row();
}
inactive_control_row($th);
end_table();
echo '<br>';
//----------------------------------------------------------------------------------
div_start('details');
start_table(TABLESTYLE2);
if ($selected_id != -1) {
    if ($Mode == 'Edit') {
        //editing an existing item category
        $myrow = get_item_category($selected_id);
        $_POST['category_id'] = $myrow["category_id"];
        $_POST['description'] = $myrow["description"];
Esempio n. 18
0
function display_fiscalyears()
{
    $company_year = get_company_pref('f_year');
    $result = get_all_fiscalyears();
    start_form();
    display_note(_("Warning: Deleting a fiscal year all transactions \n\t\tare removed and converted into relevant balances. This process is irreversible!"), 0, 1, "class='currentfg'");
    start_table(TABLESTYLE);
    $th = array(_("Fiscal Year Begin"), _("Fiscal Year End"), _("Closed"), "", "");
    table_header($th);
    $k = 0;
    $row_cnt = 0;
    $can_close = true;
    while ($myrow = db_fetch($result)) {
        $row_cnt++;
        if ($myrow['id'] == $company_year) {
            start_row("class='stockmankobg'");
        } else {
            alt_table_row_color($k);
        }
        $from = sql2date($myrow["begin"]);
        $to = sql2date($myrow["end"]);
        $closed_text = yesno_value($myrow["closed"]);
        label_cell($from);
        label_cell($to);
        label_cell($closed_text);
        // can only close year if there are no earlier open years; can reopen year that is closed
        if ($can_close || $myrow["closed"] != 0) {
            edit_button_cell("Edit" . $myrow['id'], _("Closed?"));
        } else {
            label_cell('');
        }
        // can only delete first year if it is closed and not current year
        if ($myrow["id"] != $company_year && $row_cnt == 1 && $myrow["closed"] != 0) {
            delete_button_cell("Delete" . $myrow['id'], _("Delete"));
            submit_js_confirm("Delete" . $myrow['id'], sprintf(_("Are you sure you want to delete fiscal year %s - %s? All transactions are deleted and converted into relevant balances. Do you want to continue ?"), $from, $to));
        } else {
            label_cell('');
        }
        end_row();
        if ($myrow["closed"] == 0) {
            $can_close = false;
        }
    }
    end_table();
    end_form();
    display_note(_("The marked fiscal year is the current fiscal year which cannot be deleted."), 0, 0, "class='currentfg'");
}
Esempio n. 19
0
function display_currencies()
{
    $company_currency = get_company_currency();
    $result = get_currencies(check_value('show_inactive'));
    start_table(TABLESTYLE);
    $th = array(_("Abbreviation"), _("Symbol"), _("Currency Name"), _("Hundredths name"), _("Country"), _("Auto update"), "", "");
    inactive_control_column($th);
    table_header($th);
    $k = 0;
    //row colour counter
    while ($myrow = db_fetch($result)) {
        if ($myrow[1] == $company_currency) {
            start_row("class='currencybg'");
        } else {
            alt_table_row_color($k);
        }
        label_cell($myrow["curr_abrev"]);
        label_cell($myrow["curr_symbol"]);
        label_cell($myrow["currency"]);
        label_cell($myrow["hundreds_name"]);
        label_cell($myrow["country"]);
        label_cell($myrow[1] == $company_currency ? '-' : ($myrow["auto_update"] ? _('Yes') : _('No')), "align='center'");
        inactive_control_cell($myrow["curr_abrev"], $myrow["inactive"], 'currencies', 'curr_abrev');
        edit_button_cell("Edit" . $myrow["curr_abrev"], _("Edit"));
        if ($myrow["curr_abrev"] != $company_currency) {
            delete_button_cell("Delete" . $myrow["curr_abrev"], _("Delete"));
        } else {
            label_cell('');
        }
        end_row();
    }
    //END WHILE LIST LOOP
    inactive_control_row($th);
    end_table();
    display_note(_("The marked currency is the home currency which cannot be deleted."), 0, 0, "class='currentfg'");
}
function voucher_details($id)
{
    div_start('voucher_table');
    br();
    if (!isset($_POST['imc']) || list_updated($_POST['imc'])) {
        $imc = get_post('imc');
        $row = get_salesman_trans($imc);
        $_POST['sales'] = $row['salesman_name'];
        $_POST['invoice_no'] = $row['customized_no'];
        $_POST['client'] = $row['br_name'];
        $_POST['provision'] = $row['provision'];
        $_POST['total'] = $row['InvoiceTotal'];
    }
    div_start('detail_table');
    start_outer_table(TABLESTYLE2);
    table_section(1);
    date_row(_("Date:"), 'date');
    text_row(_("IMC: "), 'sales');
    text_row(_("Invoice No."), 'invoice_no');
    text_row(_("Client: "), 'client');
    hidden('gross', $_POST['gross']);
    table_section(2);
    amount_row(_("Commission %: "), 'provision');
    label_row(_("Gross Commission: "), price_format($_POST['netsales']));
    label_row(_("W/Tax: "), price_format($_POST['tax']));
    label_row(_("Net Commission: "), price_format($_POST['total']));
    hidden('netsales', $_POST['netsales']);
    hidden('tax', $_POST['tax']);
    hidden('total', $_POST['total']);
    submit_row('Compute', _("Compute"), '', 'default');
    hidden('br_id', $_POST['br_id']);
    hidden('discount', $_POST['discount']);
    hidden('returns', $_POST['returns']);
    end_outer_table(1);
    div_start('controls');
    if (isset($_POST['Compute'])) {
        submit_center_first('Submit', _("Create Commission Voucher"), '', 'default');
    }
    div_end();
    br();
    start_table(TABLESTYLE, "width=90%");
    $th = array(_('IMC'), _('Invoice #'), _('Date'), _('Client'), '');
    table_header($th);
    $k = 0;
    $res = get_salesman_trans($_POST['imc'], $_POST['customNum']);
    while ($myrow = db_fetch($res)) {
        alt_table_row_color($k);
        if (checkvouchexists($myrow['customized_no']) == 0) {
            if ($myrow['Voided'] == '') {
                label_cell($myrow['salesman_name']);
                label_cell($myrow['customized_no']);
                label_cell($myrow['tran_date']);
                label_cell($myrow['br_name']);
                edit_button_cell("Edit" . $myrow['customized_no'], _("Select"));
            }
        }
        end_row();
    }
    end_table(1);
    div_end();
    div_end();
    br();
}