Ejemplo n.º 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();
}
Ejemplo n.º 2
0
function gl_payment_controls()
{
    global $table_style2;
    $home_currency = get_company_currency();
    start_form(false, true);
    start_table($table_style2, 5, 7);
    echo "<tr><td valign=top>";
    // outer table
    echo "<table>";
    bank_accounts_list_row(tr("From Account:"), 'FromBankAccount', null, true);
    bank_accounts_list_row(tr("To Account:"), 'ToBankAccount', null, true);
    date_row(tr("Transfer Date:"), 'DatePaid');
    $from_currency = get_bank_account_currency($_POST['FromBankAccount']);
    $to_currency = get_bank_account_currency($_POST['ToBankAccount']);
    if ($from_currency != "" && $to_currency != "" && $from_currency != $to_currency) {
        amount_row(tr("Amount:"), 'amount', null, null, $from_currency);
        exchange_rate_display($from_currency, $to_currency, $_POST['DatePaid']);
    } else {
        amount_row(tr("Amount:"), 'amount');
    }
    echo "</table>";
    echo "</td><td valign=top class='tableseparator'>";
    // outer table
    echo "<table>";
    bank_trans_types_list_row(tr("Transfer Type:"), 'TransferType', null);
    ref_row(tr("Reference:"), 'ref', references::get_next(systypes::bank_transfer()));
    textarea_row(tr("Memo:"), 'memo_', null, 40, 4);
    end_table(1);
    echo "</td></tr>";
    end_table(1);
    // outer table
    submit_center('AddPayment', tr("Enter Transfer"));
    end_form();
}
Ejemplo n.º 3
0
function edit_allocations_for_transaction($type, $trans_no)
{
    global $systypes_array;
    $cart = $_SESSION['alloc'];
    display_heading(sprintf(_("Allocation of %s # %d"), $systypes_array[$cart->type], $cart->trans_no));
    display_heading($cart->person_name);
    display_heading2(_("Date:") . " <b>" . $cart->date_ . "</b>");
    display_heading2(_("Total:") . " <b>" . price_format($cart->bank_amount) . ' ' . $cart->currency . "</b>");
    if ($cart->currency != $cart->person_curr) {
        $total = _("Total in clearing currency:") . " <b>" . price_format($cart->amount) . "</b>" . sprintf(" %s (%s %s/%s)", $cart->person_curr, exrate_format($cart->bank_amount / $cart->amount), $cart->currency, $cart->person_curr);
        display_heading2($total);
    }
    echo "<br>";
    start_form();
    div_start('alloc_tbl');
    if (count($cart->allocs) > 0) {
        show_allocatable(true);
        submit_center_first('UpdateDisplay', _("Refresh"), _('Start again allocation of selected amount'), true);
        submit('Process', _("Process"), true, _('Process allocations'), 'default');
        submit_center_last('Cancel', _("Back to Allocations"), _('Abandon allocations and return to selection of allocatable amounts'), 'cancel');
    } else {
        display_note(_("There are no unsettled transactions to allocate."), 0, 1);
        submit_center('Cancel', _("Back to Allocations"), true, _('Abandon allocations and return to selection of allocatable amounts'), 'cancel');
    }
    div_end();
    end_form();
}
Ejemplo n.º 4
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();
}
Ejemplo n.º 5
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();
}
Ejemplo n.º 6
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();
}
Ejemplo n.º 7
0
function show_navigation($start_with)
{
    start_form("", "get");
    if ($start_with > 0) {
        echo get_href("<p>Previous", set_var(get_current_url(), "start", max(0, $start_with - SHOW_ITEMS)));
    } else {
        echo "Previous";
    }
    echo " ";
    echo get_href("Next", set_var(get_current_url(), "start", $start_with + SHOW_ITEMS));
    end_form();
}
function display_reval()
{
    global $Refs;
    start_form();
    start_table(TABLESTYLE2);
    if (!isset($_POST['date'])) {
        $_POST['date'] = Today();
    }
    date_row(_("Date for Revaluation:"), 'date', '', null, 0, 0, 0, null, true);
    ref_row(_("Reference:"), 'ref', '', $Refs->get_next(ST_JOURNAL));
    textarea_row(_("Memo:"), 'memo_', null, 40, 4);
    end_table(1);
    submit_center('submit', _("Revaluate Currencies"), true, false);
    end_form();
}
Ejemplo n.º 9
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();
}
Ejemplo n.º 10
0
function display_controls()
{
    global $table_style2;
    start_form(false, true);
    if (!isset($_POST['supplier_id'])) {
        $_POST['supplier_id'] = get_global_supplier(false);
    }
    if (!isset($_POST['DatePaid'])) {
        $_POST['DatePaid'] = Today();
        if (!is_date_in_fiscalyear($_POST['DatePaid'])) {
            $_POST['DatePaid'] = end_fiscalyear();
        }
    }
    start_table($table_style2, 5, 7);
    echo "<tr><td valign=top>";
    // outer table
    echo "<table>";
    bank_accounts_list_row(tr("From Bank Account:"), 'bank_account', null, true);
    amount_row(tr("Amount of Payment:"), 'amount');
    amount_row(tr("Amount of Discount:"), 'discount');
    date_row(tr("Date Paid") . ":", 'DatePaid');
    echo "</table>";
    echo "</td><td valign=top class='tableseparator'>";
    // outer table
    echo "<table>";
    supplier_list_row(tr("Payment To:"), 'supplier_id', null, false, true);
    set_global_supplier($_POST['supplier_id']);
    $supplier_currency = get_supplier_currency($_POST['supplier_id']);
    $bank_currency = get_bank_account_currency($_POST['bank_account']);
    if ($bank_currency != $supplier_currency) {
        exchange_rate_display($bank_currency, $supplier_currency, $_POST['DatePaid']);
    }
    bank_trans_types_list_row(tr("Payment Type:"), 'PaymentType', null);
    ref_row(tr("Reference:"), 'ref', references::get_next(22));
    text_row(tr("Memo:"), 'memo_', null, 52, 50);
    echo "</table>";
    echo "</td></tr>";
    end_table(1);
    // outer table
    submit_center('ProcessSuppPayment', tr("Enter Payment"));
    if ($bank_currency != $supplier_currency) {
        display_note(tr("The amount and discount are in the bank account's currency."), 2, 0);
    }
    end_form();
}
Ejemplo n.º 11
0
function voiding_controls()
{
    global $table_style2;
    start_form(false, true);
    start_table($table_style2);
    systypes_list_row(tr("Transaction Type:"), "filterType", null, true);
    text_row(tr("Transaction #:"), 'trans_no', null, 12, 12);
    date_row(tr("Voiding Date:"), 'date_');
    textarea_row(tr("Memo:"), 'memo_', null, 30, 4);
    end_table(1);
    if (!isset($_POST['ProcessVoiding'])) {
        submit_center('ProcessVoiding', tr("Void Transaction"));
    } else {
        display_note(tr("Are you sure you want to void this transaction ? This action cannot be undone."), 0, 1);
        submit_center_first('ConfirmVoiding', tr("Proceed"));
        submit_center_last('CancelVoiding', tr("Cancel"));
    }
    end_form();
}
Ejemplo n.º 12
0
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();
}
Ejemplo n.º 13
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();
}
Ejemplo n.º 14
0
function edit_allocations_for_transaction($type, $trans_no)
{
    global $systypes_array;
    start_form();
    display_heading(_("Allocation of") . " " . $systypes_array[$_SESSION['alloc']->type] . " # " . $_SESSION['alloc']->trans_no);
    display_heading($_SESSION['alloc']->person_name);
    display_heading2(_("Date:") . " <b>" . $_SESSION['alloc']->date_ . "</b>");
    display_heading2(_("Total:") . " <b>" . price_format(-$_SESSION['alloc']->amount) . "</b>");
    echo "<br>";
    div_start('alloc_tbl');
    if (count($_SESSION['alloc']->allocs) > 0) {
        show_allocatable(true);
        submit_center_first('UpdateDisplay', _("Refresh"), _('Start again allocation of selected amount'), true);
        submit('Process', _("Process"), true, _('Process allocations'), 'default');
        submit_center_last('Cancel', _("Back to Allocations"), _('Abandon allocations and return to selection of allocatable amounts'), 'cancel');
    } else {
        display_note(_("There are no unsettled transactions to allocate."), 0, 1);
        submit_center('Cancel', _("Back to Allocations"), true, _('Abandon allocations and return to selection of allocatable amounts'), 'cancel');
    }
    div_end();
    end_form();
}
Ejemplo n.º 15
0
function gl_payment_controls()
{
    global $Refs;
    $home_currency = get_company_currency();
    start_form();
    start_outer_table(TABLESTYLE2);
    table_section(1);
    bank_accounts_list_row(_("From Account:"), 'FromBankAccount', null, true);
    bank_balance_row($_POST['FromBankAccount']);
    bank_accounts_list_row(_("To Account:"), 'ToBankAccount', null, true);
    if (!isset($_POST['DatePaid'])) {
        // init page
        $_POST['DatePaid'] = new_doc_date();
        if (!is_date_in_fiscalyear($_POST['DatePaid'])) {
            $_POST['DatePaid'] = end_fiscalyear();
        }
    }
    date_row(_("Transfer Date:"), 'DatePaid', '', true, 0, 0, 0, null, true);
    ref_row(_("Reference:"), 'ref', '', $Refs->get_next(ST_BANKTRANSFER));
    table_section(2);
    $from_currency = get_bank_account_currency($_POST['FromBankAccount']);
    $to_currency = get_bank_account_currency($_POST['ToBankAccount']);
    if ($from_currency != "" && $to_currency != "" && $from_currency != $to_currency) {
        amount_row(_("Amount:"), 'amount', null, null, $from_currency);
        amount_row(_("Bank Charge:"), 'charge', null, null, $from_currency);
        amount_row(_("Incoming Amount:"), 'target_amount', null, '', $to_currency, 2);
    } else {
        amount_row(_("Amount:"), 'amount');
        amount_row(_("Bank Charge:"), 'charge');
    }
    textarea_row(_("Memo:"), 'memo_', null, 40, 4);
    end_outer_table(1);
    // outer table
    submit_center('AddPayment', _("Enter Transfer"), true, '', 'default');
    end_form();
}
Ejemplo n.º 16
0
function display_company_edit($selected_id)
{
    global $def_coy, $db_connections, $tb_pref_counter;
    start_form();
    start_table(TABLESTYLE2);
    if ($selected_id != -1) {
        $conn = $db_connections[$selected_id];
        $_POST['name'] = $conn['name'];
        $_POST['host'] = $conn['host'];
        $_POST['dbuser'] = $conn['dbuser'];
        $_POST['dbpassword'] = $conn['dbpassword'];
        $_POST['dbname'] = $conn['dbname'];
        $_POST['tbpref'] = $conn['tbpref'];
        if ($selected_id == $def_coy) {
            $_POST['def'] = true;
        } else {
            $_POST['def'] = false;
        }
        $_POST['dbcreate'] = false;
        hidden('selected_id', $selected_id);
        hidden('tbpref', $_POST['tbpref']);
        hidden('dbpassword', $_POST['dbpassword']);
    } else {
        $_POST['tbpref'] = $tb_pref_counter . "_";
        // Insert the current settings as default
        $conn = $db_connections[user_company()];
        $_POST['name'] = '';
        $_POST['host'] = $conn['host'];
        $_POST['dbuser'] = $conn['dbuser'];
        $_POST['dbpassword'] = $conn['dbpassword'];
        $_POST['dbname'] = $conn['dbname'];
    }
    text_row_ex(_("Company"), 'name', 50);
    if ($selected_id == -1) {
        text_row_ex(_("Host"), 'host', 30, 60);
        text_row_ex(_("Database User"), 'dbuser', 30);
        text_row_ex(_("Database Password"), 'dbpassword', 30);
        text_row_ex(_("Database Name"), 'dbname', 30);
        yesno_list_row(_("Table Pref"), 'tbpref', 1, $_POST['tbpref'], _("None"), false);
    } 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();
}
Ejemplo n.º 17
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();
function display_credit_items()
{
    start_form();
    hidden('cart_id');
    start_table(TABLESTYLE2, "width=80%", 5);
    echo "<tr><td>";
    // outer table
    start_table(TABLESTYLE, "width=100%");
    start_row();
    label_cells(_("Customer"), $_SESSION['Items']->customer_name, "class='tableheader2'");
    label_cells(_("Branch"), get_branch_name($_SESSION['Items']->Branch), "class='tableheader2'");
    label_cells(_("Currency"), $_SESSION['Items']->customer_currency, "class='tableheader2'");
    end_row();
    start_row();
    //	if (!isset($_POST['ref']))
    //		$_POST['ref'] = $Refs->get_next(11);
    if ($_SESSION['Items']->trans_no == 0) {
        ref_cells(_("Reference"), 'ref', '', null, "class='tableheader2'");
    } else {
        label_cells(_("Reference"), $_SESSION['Items']->reference, "class='tableheader2'");
    }
    label_cells(_("Crediting Invoice"), get_customer_trans_view_str(ST_SALESINVOICE, array_keys($_SESSION['Items']->src_docs)), "class='tableheader2'");
    if (!isset($_POST['ShipperID'])) {
        $_POST['ShipperID'] = $_SESSION['Items']->ship_via;
    }
    label_cell(_("Shipping Company"), "class='tableheader2'");
    shippers_list_cells(null, 'ShipperID', $_POST['ShipperID']);
    //	if (!isset($_POST['sales_type_id']))
    //	  $_POST['sales_type_id'] = $_SESSION['Items']->sales_type;
    //	label_cell(_("Sales Type"), "class='tableheader2'");
    //	sales_types_list_cells(null, 'sales_type_id', $_POST['sales_type_id']);
    end_row();
    end_table();
    echo "</td><td>";
    // outer table
    start_table(TABLESTYLE, "width=100%");
    if ($_SESSION['Items']->custom_num != '') {
        text_row(_("Credit Memo No."), 'custom_num', $_SESSION['Items']->custom_num, null, "class='tableheader2'");
    } else {
        text_row(_("Credit Memo No."), 'custom_num', '', null, "class='tableheader2'");
    }
    //moodlearning
    label_row(_("Invoice Date"), $_SESSION['Items']->src_date, "class='tableheader2'");
    date_row(_("Credit Note Date"), 'CreditDate', '', $_SESSION['Items']->trans_no == 0, 0, 0, 0, "class='tableheader2'");
    end_table();
    echo "</td></tr>";
    end_table(1);
    // outer table
    div_start('credit_items');
    start_table(TABLESTYLE, "width=80%");
    $th = array(_("Item Code"), _("Item Description"), _("Invoiced Quantity"), _("Units"), _("Credited"), _("Credit Quantity"), _("Price"), _("Discount %"), _("Total"));
    //Karen edited Credited
    table_header($th);
    $k = 0;
    //row colour counter
    foreach ($_SESSION['Items']->line_items as $line_no => $ln_itm) {
        if ($ln_itm->quantity == $ln_itm->qty_done) {
            continue;
            // this line was fully credited/removed
        }
        alt_table_row_color($k);
        //	view_stock_status_cell($ln_itm->stock_id); alternative view
        label_cell($ln_itm->stock_id);
        text_cells(null, 'Line' . $line_no . 'Desc', $ln_itm->item_description, 30, 50);
        $dec = get_qty_dec($ln_itm->stock_id);
        qty_cell($ln_itm->quantity, false, $dec);
        label_cell($ln_itm->units);
        label_cell($ln_itm->qty_done);
        //Karen edited
        amount_cells(null, 'Line' . $line_no, number_format2($ln_itm->qty_dispatched, $dec), null, null, $dec);
        $line_total = $ln_itm->qty_dispatched * $ln_itm->price * (1 - $ln_itm->discount_percent);
        amount_cell($ln_itm->price);
        percent_cell($ln_itm->discount_percent * 100);
        amount_cell($line_total);
        end_row();
    }
    if (!check_num('ChargeFreightCost')) {
        $_POST['ChargeFreightCost'] = price_format($_SESSION['Items']->freight_cost);
    }
    $colspan = 8;
    //Karen edited 7
    start_row();
    label_cell(_("Credit Shipping Cost"), "colspan={$colspan} align=right");
    small_amount_cells(null, "ChargeFreightCost", price_format(get_post('ChargeFreightCost', 0)));
    end_row();
    /*moodlearning*/
    start_row();
    label_cell(_("Bulk Discount"), "colspan={$colspan} align=right");
    small_amount_cells(null, "bulk_dis", $_SESSION['Items']->bulk_discount);
    end_row();
    /*           */
    $inv_items_total = $_SESSION['Items']->get_items_total_dispatch();
    $discount = input_num('bulk_dis') / 100;
    $display_sub_total = price_format($inv_items_total + input_num($_POST['ChargeFreightCost']));
    label_row(_("Sub-total"), $display_sub_total, "colspan={$colspan} align=right", "align=right");
    $taxes = $_SESSION['Items']->get_taxes(input_num($_POST['ChargeFreightCost']));
    $tax_total = display_edit_tax_items($taxes, $colspan, $_SESSION['Items']->tax_included);
    /*moodlearning*/
    $total = $inv_items_total + input_num('ChargeFreightCost') + $tax_total;
    $tot = price_format($total - $total * $discount);
    /*             */
    $display_total = price_format($inv_items_total + input_num('ChargeFreightCost') + $tax_total);
    label_row(_("Credit Note Total"), $tot, "colspan={$colspan} align=right", "align=right");
    //moodlearning edit $tot
    end_table();
    div_end();
}
Ejemplo n.º 19
0
if ($use_date_picker) {
    $js .= get_js_date_picker();
}
if (isset($_GET['outstanding_only']) && $_GET['outstanding_only']) {
    $outstanding_only = 1;
    page(tr("Search Outstanding Dimensionss"), false, false, "", $js);
} else {
    $outstanding_only = 0;
    page(tr("Search Dimensions"), false, false, "", $js);
}
//--------------------------------------------------------------------------------------
if (isset($_GET["stock_id"])) {
    $_POST['SelectedStockItem'] = $_GET["stock_id"];
}
//--------------------------------------------------------------------------------------
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();
Ejemplo n.º 20
0
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();
}
Ejemplo n.º 21
0
    $Ajax->addDisable(true, 'OverdueOnly', $disable);
    $Ajax->addDisable(true, 'OpenOnly', $disable);
    $Ajax->addDisable(true, 'SelectedStockItem', $disable);
    if ($disable) {
        set_focus('OrderNumber');
    } else {
        set_focus('StockLocation');
    }
    $Ajax->activate('orders_tbl');
}
//--------------------------------------------------------------------------------------
if (isset($_GET["stock_id"])) {
    $_POST['SelectedStockItem'] = $_GET["stock_id"];
}
//--------------------------------------------------------------------------------------
start_form(false, false, $_SERVER['PHP_SELF'] . "?outstanding_only={$outstanding_only}");
start_table(TABLESTYLE_NOBORDER);
start_row();
ref_cells(_("Reference:"), 'OrderNumber', '', null, '', true);
locations_list_cells(_("at Location:"), 'StockLocation', null, true);
check_cells(_("Only Overdue:"), 'OverdueOnly', null);
if ($outstanding_only == 0) {
    check_cells(_("Only Open:"), 'OpenOnly', null);
}
stock_manufactured_items_list_cells(_("for item:"), 'SelectedStockItem', null, true);
submit_cells('SearchOrders', _("Search"), '', _('Select documents'), 'default');
end_row();
end_table();
//-----------------------------------------------------------------------------
function check_overdue($row)
{
Ejemplo n.º 22
0
//---------------------------------------------------------------------------------------------
if ($id = find_submit('Delete', false)) {
    $extensions = get_company_extensions();
    if ($extensions[$id]['type'] == 'chart' && uninstall_package($extensions[$id]['package'])) {
        unset($extensions[$id]);
        if (update_extensions($extensions)) {
            display_notification(_("Selected chart has been successfully deleted"));
            meta_forward($_SERVER['PHP_SELF']);
        }
    }
}
if ($id = find_submit('Update', false)) {
    install_extension($id);
}
//---------------------------------------------------------------------------------------------
start_form(true);
div_start('ext_tbl');
start_table(TABLESTYLE);
$th = array(_("Chart"), _("Installed"), _("Available"), _("Encoding"), "", "");
table_header($th);
$k = 0;
$mods = get_charts_list();
foreach ($mods as $pkg_name => $ext) {
    $available = @$ext['available'];
    $installed = @$ext['version'];
    $id = @$ext['local_id'];
    $encoding = @$ext['encoding'];
    alt_table_row_color($k);
    //		label_cell(is_array($ext['Descr']) ? $ext['Descr'][0] : $ext['Descr']);
    label_cell($available ? get_package_view_str($pkg_name, $ext['name']) : $ext['name']);
    label_cell($id === null ? _("None") : ($available && $installed ? $installed : _("Unknown")));
Ejemplo n.º 23
0
function edit_allocations_for_transaction($type, $trans_no)
{
    global $table_style;
    start_form(false, true);
    display_heading(sprintf(tr("Allocation of %s # %d"), systypes::name($_SESSION['alloc']->type), $_SESSION['alloc']->trans_no));
    display_heading($_SESSION['alloc']->person_name);
    display_heading2(tr("Date:") . " <b>" . $_SESSION['alloc']->date_ . "</b>");
    display_heading2(tr("Total:") . " <b>" . price_format($_SESSION['alloc']->amount) . "</b>");
    echo "<br>";
    if (count($_SESSION['alloc']->allocs) > 0) {
        start_table($table_style);
        $th = array(tr("Transaction Type"), tr("#"), tr("Date"), tr("Due Date"), tr("Amount"), tr("Other Allocations"), tr("This Allocation"), tr("Left to Allocate"), "", "");
        table_header($th);
        $k = $counter = $total_allocated = 0;
        foreach ($_SESSION['alloc']->allocs as $allocn_item) {
            alt_table_row_color($k);
            label_cell(systypes::name($allocn_item->type));
            label_cell(get_trans_view_str($allocn_item->type, $allocn_item->type_no));
            label_cell($allocn_item->date_, "align=right");
            label_cell($allocn_item->due_date, "align=right");
            amount_cell($allocn_item->amount);
            amount_cell($allocn_item->amount_allocated);
            if (!check_num('amount' . $counter)) {
                $_POST['amount' . $counter] = price_format($allocn_item->current_allocated);
            }
            amount_cells(null, 'amount' . $counter, $_POST['amount' . $counter]);
            $un_allocated = round($allocn_item->amount - $allocn_item->amount_allocated, 6);
            hidden("un_allocated" . $counter, $un_allocated);
            amount_cell($un_allocated);
            label_cell("<a href='#' name=Alloc{$counter} onclick='allocate_all(this.name.substr(5));return true;'>" . tr("All") . "</a>");
            label_cell("<a href='#' name=DeAll{$counter} onclick='allocate_none(this.name.substr(5));return true;'>" . tr("None") . "</a>");
            end_row();
            $total_allocated += input_num('amount' . $counter);
            $counter++;
        }
        label_row(tr("Total Allocated"), price_format($total_allocated), "colspan=6 align=right", "nowrap align=right id='total_allocated'");
        if ($_SESSION['alloc']->amount - $total_allocated < 0) {
            $font1 = "<font color=red>";
            $font2 = "</font>";
        } else {
            $font1 = $font2 = "";
        }
        $left_to_allocate = $_SESSION['alloc']->amount - $total_allocated;
        $left_to_allocate = price_format($left_to_allocate);
        label_row(tr("Left to Allocate"), $font1 . $left_to_allocate . $font2, "colspan=6 align=right ", "nowrap align=right id='left_to_allocate'");
        end_table(1);
        hidden('TotalNumberOfAllocs', $counter);
        //		hidden('left_to_allocate', $left_to_allocate);
        submit_center_first('UpdateDisplay', tr("Update"));
        submit('Process', tr("Process"));
    } else {
        display_note(tr("There are no unsettled transactions to allocate."), 0, 1);
    }
    submit_center_last('Cancel', tr("Back to Allocations"));
    end_form();
}
Ejemplo n.º 24
0
function display_module_edit($selected_id)
{
    global $installed_modules, $table_style2;
    if ($selected_id != -1) {
        $n = $selected_id;
    } else {
        $n = count($installed_modules);
    }
    start_form(true, true);
    echo "\n\t\t<script language='javascript'>\n\t\tfunction updateModule() {\n\t\t\tdocument.forms[0].action='inst_module.php?c=u&id=" . $n . "'\n\t\t\tdocument.forms[0].submit()\n\t\t}\n\t\t</script>";
    start_table($table_style2);
    if ($selected_id != -1) {
        $mod = $installed_modules[$selected_id];
        $_POST['tab'] = $mod['tab'];
        $_POST['name'] = $mod['name'];
        $_POST['path'] = $mod['path'];
        $_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();
}
Ejemplo n.º 25
0
function track_result_row($row)
{
    $a = start_form();
    $a .= "<tr>\n";
    $a .= "<td class=\"cell_value\">" . track_input_text('Ttrack_number', 'Ttrack_number', $row['track_number']) . "</td>\n";
    $a .= "<td class=\"cell_value\">" . track_input_text('Ttitle', 'Ttitle', $row['title']) . "</td>\n";
    $a .= "<td class=\"cell_value\">" . track_input_text('Tduration', 'Tduration', $row['disp_duration']) . "</td>\n";
    $a .= "<td class=\"cell_value\">" . action_button('track_update', ' Update ') . action_button('track_delete', ' Delete ') . "</td>\n";
    $a .= hidden_element('a', 'track_update') . hidden_element('album_id', $row['album_id']) . hidden_element('id', $row['id']) . "\n";
    $a .= "</tr>\n";
    $a .= end_form();
    return $a;
}
Ejemplo n.º 26
0
 //Parent Item selected so display bom or edit component
 $selected_parent = $_POST['stock_id'];
 if (isset($selected_parent) && isset($_POST['Submit'])) {
     if (isset($selected_component)) {
         on_submit($selected_parent, $selected_component);
     } else {
         on_submit($selected_parent);
     }
 }
 //--------------------------------------------------------------------------------------
 display_bom_items($selected_parent);
 if (isset($selected_parent) && isset($selected_component)) {
     hyperlink_params($_SERVER['PHP_SELF'], tr("Add a new Component"), "NewItem={$selected_parent}");
 }
 //--------------------------------------------------------------------------------------
 start_form(false, true, $_SERVER['PHP_SELF'] . "?" . SID . "NewItem=" . $selected_parent);
 start_table($table_style2);
 if (isset($selected_component)) {
     //editing a selected component from the link to the line item
     $sql = "SELECT bom.*,stock_master.description FROM bom,stock_master\n\t\t\tWHERE id='{$selected_component}'\n\t\t\tAND stock_master.stock_id=bom.component";
     $result = db_query($sql, "could not get bom");
     $myrow = db_fetch($result);
     $_POST['loc_code'] = $myrow["loc_code"];
     $_POST['workcentre_added'] = $myrow["workcentre_added"];
     $_POST['quantity'] = qty_format($myrow["quantity"]);
     hidden('selected_parent', $selected_parent);
     hidden('selected_component', $selected_component);
     label_row(tr("Component:"), $myrow["component"] . " - " . $myrow["description"]);
 } else {
     //end of if $selected_component
     hidden('selected_parent', $selected_parent);
Ejemplo n.º 27
0
} else {
    if (!isset($_POST['supplier_id'])) {
        $_POST['supplier_id'] = $_SESSION['PO']->supplier_id;
    }
    if (!isset($_POST['OrderDate'])) {
        $_POST['OrderDate'] = $_SESSION['PO']->orig_order_date;
    }
    if (!isset($_POST['Requisition'])) {
        $_POST['Requisition'] = $_SESSION['PO']->requisition_no;
    }
    if (!isset($_POST['Comments'])) {
        $_POST['Comments'] = $_SESSION['PO']->Comments;
    }
}
//---------------------------------------------------------------------------------------------------
start_form(false, true);
display_po_header($_SESSION['PO']);
echo "<br>";
display_po_items($_SESSION['PO']);
start_table($table_style2);
textarea_row(tr("Memo:"), 'Comments', null, 70, 4);
end_table(1);
if ($_SESSION['PO']->order_has_items()) {
    if ($_SESSION['PO']->order_no) {
        submit_center_first('Commit', tr("Update Order"));
    } else {
        submit_center_first('Commit', tr("Place Order"));
    }
    submit_center_last('CancelOrder', tr("Cancel Order"));
} else {
    submit_center('CancelOrder', tr("Cancel Order"));
Ejemplo n.º 28
0
function display_company_edit($selected_id)
{
    global $def_coy, $db_connections, $tb_pref_counter, $table_style2;
    if ($selected_id != -1) {
        $n = $selected_id;
    } else {
        $n = count($db_connections);
    }
    start_form(true, true);
    echo "\n\t\t<script language='javascript'>\n\t\tfunction updateCompany() {\n\t\t\tif (document.forms[0].uploadfile.value!='' && document.forms[0].dbname.value!='') {\n\t\t\t\tdocument.forms[0].action='create_coy.php?c=u&ul=1&id=" . $n . "&fn=' + document.forms[0].uploadfile.value\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdocument.forms[0].action='create_coy.php?c=u&id=" . $n . "&fn=' + document.forms[0].uploadfile.value\n\t\t\t}\n\t\t\tdocument.forms[0].submit()\n\t\t}\n\t\t</script>";
    start_table($table_style2);
    if ($selected_id != -1) {
        $conn = $db_connections[$selected_id];
        $_POST['name'] = $conn['name'];
        $_POST['host'] = $conn['host'];
        $_POST['dbuser'] = $conn['dbuser'];
        $_POST['dbpassword'] = $conn['dbpassword'];
        $_POST['dbname'] = $conn['dbname'];
        if ($selected_id == $def_coy) {
            $_POST['def'] = true;
        } else {
            $_POST['def'] = false;
        }
        $_POST['dbcreate'] = false;
        hidden('selected_id', $selected_id);
        hidden('dbpassword', $_POST['dbpassword']);
    } else {
        text_row_ex(tr("Company"), 'name', 30);
    }
    text_row_ex(tr("Host"), 'host', 30);
    text_row_ex(tr("Database User"), 'dbuser', 30);
    if ($selected_id == -1) {
        text_row_ex(tr("Database Password"), 'dbpassword', 30);
    }
    text_row_ex(tr("Database Name"), 'dbname', 30);
    yesno_list_row(tr("Default"), 'def', null, "", "", false);
    start_row();
    label_cell(tr("Database Script"));
    label_cell("<input name='uploadfile' type='file'>");
    end_row();
    text_row_ex(tr("New script Admin Password"), 'admpassword', 20);
    end_table();
    display_note(tr("Choose from Database scripts in SQL folder. No Datase is created without a script."), 0, 1);
    echo "<center><input onclick='javascript:updateCompany()' type='button' style='width:150' value='" . tr("Save") . "'>";
    end_form();
}
Ejemplo n.º 29
0
end_row();
if (list_updated('stock_id')) {
    $Ajax->activate('_page_body');
}
end_table();
br();
end_form();
//--------------------------------------------------------------------------------------------------
if (get_post('stock_id') != '') {
    //Parent Item selected so display bom or edit component
    $selected_parent = $_POST['stock_id'];
    if ($Mode == 'ADD_ITEM' || $Mode == 'UPDATE_ITEM') {
        on_submit($selected_parent, $selected_id);
    }
    //--------------------------------------------------------------------------------------
    start_form();
    display_bom_items($selected_parent);
    //--------------------------------------------------------------------------------------
    echo '<br>';
    start_table(TABLESTYLE2);
    if ($selected_id != -1) {
        if ($Mode == 'Edit') {
            //editing a selected component from the link to the line item
            $myrow = get_component_from_bom($selected_id);
            $_POST['loc_code'] = $myrow["loc_code"];
            $_POST['component'] = $myrow["component"];
            // by Tom Moulton
            $_POST['workcentre_added'] = $myrow["workcentre_added"];
            $_POST['quantity'] = number_format2($myrow["quantity"], get_qty_dec($myrow["component"]));
            label_row(_("Component:"), $myrow["component"] . " - " . $myrow["description"]);
        }
Ejemplo n.º 30
0
    $disable = get_post('DeliveryNumber') !== '';
    $Ajax->addDisable(true, 'DeliveryAfterDate', $disable);
    $Ajax->addDisable(true, 'DeliveryToDate', $disable);
    $Ajax->addDisable(true, 'StockLocation', $disable);
    $Ajax->addDisable(true, '_SelectStockFromList_edit', $disable);
    $Ajax->addDisable(true, 'SelectStockFromList', $disable);
    // if search is not empty rewrite table
    if ($disable) {
        $Ajax->addFocus(true, 'DeliveryNumber');
    } else {
        $Ajax->addFocus(true, 'DeliveryAfterDate');
    }
    $Ajax->activate('deliveries_tbl');
}
//-----------------------------------------------------------------------------------
start_form(false, false, $_SERVER['PHP_SELF'] . "?OutstandingOnly=" . $_POST['OutstandingOnly']);
start_table(TABLESTYLE_NOBORDER);
start_row();
ref_cells(_("#:"), 'DeliveryNumber', '', null, '', true);
date_cells(_("from:"), 'DeliveryAfterDate', '', null, -30);
date_cells(_("to:"), 'DeliveryToDate', '', null, 1);
locations_list_cells(_("Location:"), 'StockLocation', null, true);
end_row();
end_table();
start_table(TABLESTYLE_NOBORDER);
start_row();
stock_items_list_cells(_("Item:"), 'SelectStockFromList', null, true);
customer_list_cells(_("Select a customer: "), 'customer_id', null, true, true);
submit_cells('SearchOrders', _("Search"), '', _('Select documents'), 'default');
hidden('OutstandingOnly', $_POST['OutstandingOnly']);
end_row();