function display_po_receive_items()
{
    div_start('grn_items');
    start_table(TABLESTYLE, "colspan=7 width=90%");
    $th = array(_("Item Code"), _("Description"), _("Ordered"), _("Units"), _("Received"), _("Outstanding"), _("This Delivery"), _("Price"), _("Total"));
    table_header($th);
    /*show the line items on the order with the quantity being received for modification */
    $total = 0;
    $k = 0;
    //row colour counter
    if (count($_SESSION['PO']->line_items) > 0) {
        foreach ($_SESSION['PO']->line_items as $ln_itm) {
            alt_table_row_color($k);
            $qty_outstanding = $ln_itm->quantity - $ln_itm->qty_received;
            if (!isset($_POST['Update']) && !isset($_POST['ProcessGoodsReceived']) && $ln_itm->receive_qty == 0) {
                //If no quantites yet input default the balance to be received
                $ln_itm->receive_qty = $qty_outstanding;
            }
            $line_total = $ln_itm->receive_qty * $ln_itm->price;
            $total += $line_total;
            label_cell($ln_itm->stock_id);
            if ($qty_outstanding > 0) {
                text_cells(null, $ln_itm->stock_id . "Desc", $ln_itm->item_description, 30, 50);
            } else {
                label_cell($ln_itm->item_description);
            }
            $dec = get_qty_dec($ln_itm->stock_id);
            qty_cell($ln_itm->quantity, false, $dec);
            label_cell($ln_itm->units);
            qty_cell($ln_itm->qty_received, false, $dec);
            qty_cell($qty_outstanding, false, $dec);
            if ($qty_outstanding > 0) {
                qty_cells(null, $ln_itm->line_no, number_format2($ln_itm->receive_qty, $dec), "align=right", null, $dec);
            } else {
                label_cell(number_format2($ln_itm->receive_qty, $dec), "align=right");
            }
            amount_decimal_cell($ln_itm->price);
            amount_cell($line_total);
            end_row();
        }
    }
    $colspan = count($th) - 1;
    $display_sub_total = price_format($total);
    label_row(_("Sub-total"), $display_sub_total, "colspan={$colspan} align=right", "align=right");
    $taxes = $_SESSION['PO']->get_taxes(input_num('freight_cost'), true);
    $tax_total = display_edit_tax_items($taxes, $colspan, $_SESSION['PO']->tax_included);
    $display_total = price_format($total + input_num('freight_cost') + $tax_total);
    start_row();
    label_cells(_("Amount Total"), $display_total, "colspan={$colspan} align='right'", "align='right'");
    end_row();
    end_table();
    div_end();
}
}
$prefs = get_company_prefs();
if (!isset($_POST['mail_type'])) {
    $_POST['mail_type'] = $prefs['mail_type'];
}
$_POST['smtp_host'] = $prefs['smtp_host'];
$_POST['smtp_port'] = $prefs['smtp_port'];
$_POST['smtp_secure'] = $prefs['smtp_secure'];
$_POST['smtp_username'] = $prefs['smtp_username'];
$_POST['smtp_password'] = $prefs['smtp_password'];
//-------------------------------------------------------------------------------------------------
start_form();
start_table(TABLESTYLE_NOBORDER);
start_row();
$_selector = array_selector('mail_type', $_POST['mail_type'], array('MAIL' => 'PHP\'s mail function', 'SMTP' => 'SMTP server'), array('select_submit' => true));
label_cells(_("Mail type:"), $_selector);
end_row();
end_table();
echo "<hr>";
div_start('details');
if ($_POST['mail_type'] != 'MAIL') {
    start_table(TABLESTYLE2);
    text_row(_("SMTP Host:"), 'smtp_host', $_POST['smtp_host'], 50, 52);
    text_row(_("SMTP Port:"), 'smtp_port', $_POST['smtp_port'], 10, 12);
    //smtp auth row
    echo "<tr><td class='label'>" . _("SMTP Secure:") . "</td><td>";
    echo array_selector('smtp_secure', $_POST['smtp_secure'], array('none' => 'None', 'tls' => 'TLS', 'ssl' => 'SSL'));
    echo "</td></tr>\n";
    text_row(_("Username:"******"Password:"), 'smtp_password', $_POST['smtp_password'], 60, 62);
    end_table(1);
Example #3
0
    $trans_no = $_POST["trans_no"];
}
$supp_trans = new supp_trans(ST_SUPPCREDIT);
read_supp_invoice($trans_no, ST_SUPPCREDIT, $supp_trans);
display_heading("<font color=red>" . _("SUPPLIER CREDIT NOTE") . " # " . $trans_no . "</font>");
echo "<br>";
start_table(TABLESTYLE, "width=95%");
start_row();
label_cells(_("Supplier"), $supp_trans->supplier_name, "class='tableheader2'");
label_cells(_("Reference"), $supp_trans->reference, "class='tableheader2'");
label_cells(_("Supplier's Reference"), $supp_trans->supp_reference, "class='tableheader2'");
end_row();
start_row();
label_cells(_("Invoice Date"), $supp_trans->tran_date, "class='tableheader2'");
label_cells(_("Due Date"), $supp_trans->due_date, "class='tableheader2'");
label_cells(_("Currency"), get_supplier_currency($supp_trans->supplier_id), "class='tableheader2'");
end_row();
comments_display_row(ST_SUPPCREDIT, $trans_no);
end_table(1);
$total_gl = display_gl_items($supp_trans, 3);
$total_grn = display_grn_items($supp_trans, 2);
$display_sub_tot = number_format2($total_gl + $total_grn, user_price_dec());
start_table(TABLESTYLE, "width=95%");
label_row(_("Sub Total"), $display_sub_tot, "align=right", "nowrap align=right width=17%");
$tax_items = get_trans_tax_details(ST_SUPPCREDIT, $trans_no);
display_supp_trans_tax_details($tax_items, 1);
$display_total = number_format2(-($supp_trans->ov_amount + $supp_trans->ov_gst), user_price_dec());
label_row("<font color=red>" . _("TOTAL CREDIT NOTE") . "</font", "<font color=red>{$display_total}</font>", "colspan=1 align=right", "nowrap align=right");
end_table(1);
$voided = is_voided_display(ST_SUPPCREDIT, $trans_no, _("This credit note has been voided."));
if (!$voided) {
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(ST_CUSTDELIVERY);
if ($_SESSION['Items']->trans_no == 0) {
    ref_cells(_("Reference"), 'ref', '', null, "class='tableheader2'");
} else {
    label_cells(_("Reference"), $_SESSION['Items']->reference, "class='tableheader2'");
}
label_cells(_("For Sales Order"), get_customer_trans_view_str(ST_SALESORDER, $_SESSION['Items']->order_no), "class='tableheader2'");
label_cells(_("Sales Type"), $_SESSION['Items']->sales_type_name, "class='tableheader2'");
end_row();
start_row();
if (!isset($_POST['Location'])) {
    $_POST['Location'] = $_SESSION['Items']->Location;
}
label_cell(_("Delivery From"), "class='tableheader2'");
locations_list_cells(null, 'Location', null, false, true);
if (!isset($_POST['ship_via'])) {
    $_POST['ship_via'] = $_SESSION['Items']->ship_via;
}
label_cell(_("Shipping Company"), "class='tableheader2'");
shippers_list_cells(null, 'ship_via', $_POST['ship_via']);
// set this up here cuz it's used to calc qoh
if (!isset($_POST['DispatchDate']) || !is_date($_POST['DispatchDate'])) {
    $_POST['DispatchDate'] = new_doc_date();
$th = array(_("Item Code"), _("Item Description"), _("Quantity"), _("Unit"), _("Price"), _("Discount"), _("Total"), _("Quantity Delivered"));
table_header($th);
$k = 0;
//row colour counter
foreach ($_SESSION['View']->line_items as $stock_item) {
    $line_total = round2($stock_item->quantity * $stock_item->price * (1 - $stock_item->discount_percent), user_price_dec());
    alt_table_row_color($k);
    label_cell($stock_item->stock_id);
    label_cell($stock_item->item_description);
    $dec = get_qty_dec($stock_item->stock_id);
    qty_cell($stock_item->quantity, false, $dec);
    label_cell($stock_item->units);
    amount_cell($stock_item->price);
    amount_cell($stock_item->discount_percent * 100);
    amount_cell($line_total);
    qty_cell($stock_item->qty_done, false, $dec);
    end_row();
}
label_row(_("Shipping"), price_format($_SESSION['View']->freight_cost), "align=right colspan=6", "nowrap align=right", 1);
$sub_tot = $_SESSION['View']->get_items_total() + $_SESSION['View']->freight_cost;
$display_sub_tot = price_format($sub_tot);
label_row(_("Sub Total"), $display_sub_tot, "align=right colspan=6", "nowrap align=right", 1);
$taxes = $_SESSION['View']->get_taxes();
$tax_total = display_edit_tax_items($taxes, 6, $_SESSION['View']->tax_included, 2);
$display_total = price_format($sub_tot + $tax_total);
start_row();
label_cells(_("Amount Total"), $display_total, "colspan=6 align='right'", "align='right'");
label_cell('', "colspan=2");
end_row();
end_table(2);
end_page(true, false, false, $_GET['trans_type'], $_GET['trans_no']);
        $_SESSION['alloc'] = new allocation(ST_CUSTPAYMENT, 0);
        $Ajax->activate('alloc_tbl');
    }
}
//----------------------------------------------------------------------------------------------
$new = !$_SESSION['alloc']->trans_no;
start_form();
hidden('trans_no');
hidden('old_ref', $old_ref);
start_outer_table(TABLESTYLE2, "width='60%'", 5);
table_section(1);
bank_accounts_list_row(_("Into Bank Account:"), 'bank_account', null, true);
if ($new) {
    customer_list_row(_("From Customer:"), 'customer_id', null, false, true);
} else {
    label_cells(_("From Customer:"), $_SESSION['alloc']->person_name, "class='label'");
    hidden('customer_id', $_POST['customer_id']);
}
if (db_customer_has_branches($_POST['customer_id'])) {
    customer_branches_list_row(_("Branch:"), $_POST['customer_id'], 'BranchID', null, false, true, true);
} else {
    hidden('BranchID', ANY_NUMERIC);
}
if (list_updated('customer_id') || $new && list_updated('bank_account')) {
    $_SESSION['alloc']->set_person($_POST['customer_id'], PT_CUSTOMER);
    $_SESSION['alloc']->read();
    $_POST['memo_'] = $_POST['amount'] = $_POST['discount'] = '';
    $Ajax->activate('alloc_tbl');
}
read_customer_data();
set_global_customer($_POST['customer_id']);
Example #7
0
include_once $path_to_root . "/includes/date_functions.inc";
include_once $path_to_root . "/includes/ui.inc";
include_once $path_to_root . "/sales/includes/sales_db.inc";
if (isset($_GET["trans_no"])) {
    $trans_id = $_GET["trans_no"];
}
$receipt = get_customer_trans($trans_id, systypes::cust_payment());
display_heading(sprintf(tr("Customer Payment #%d"), $trans_id));
echo "<br>";
start_table("{$table_style} width=80%");
start_row();
label_cells(tr("From Customer"), $receipt['DebtorName'], "class='tableheader2'");
label_cells(tr("Into Bank Account"), $receipt['bank_account_name'], "class='tableheader2'");
label_cells(tr("Date of Deposit"), sql2date($receipt['tran_date']), "class='tableheader2'");
end_row();
start_row();
label_cells(tr("Payment Currency"), $receipt['curr_code'], "class='tableheader2'");
label_cells(tr("Amount"), price_format($receipt['ov_amount']), "class='tableheader2'");
label_cells(tr("Discount"), price_format($receipt['ov_discount']), "class='tableheader2'");
end_row();
start_row();
label_cells(tr("Payment Type"), $receipt['BankTransType'], "class='tableheader2'");
label_cells(tr("Reference"), $receipt['reference'], "class='tableheader2'", "colspan=4");
end_row();
comments_display_row(systypes::cust_payment(), $trans_id);
end_table(1);
$voided = is_voided_display(systypes::cust_payment(), $trans_id, tr("This customer payment has been voided."));
if (!$voided) {
    display_allocations_from(payment_person_types::customer(), $receipt['debtor_no'], systypes::cust_payment(), $trans_id, -$receipt['Total']);
}
end_page(true);
Example #8
0
    $trans_no = $_GET["trans_no"];
}
display_heading($systypes_array[ST_INVADJUST] . " #{$trans_no}");
br(1);
$adjustment_items = get_stock_adjustment_items($trans_no);
$k = 0;
$header_shown = false;
while ($adjustment = db_fetch($adjustment_items)) {
    if (!$header_shown) {
        $adjustment_type = get_movement_type($adjustment['person_id']);
        start_table(TABLESTYLE2, "width='90%'");
        start_row();
        label_cells(_("At Location"), $adjustment['location_name'], "class='tableheader2'");
        label_cells(_("Reference"), $adjustment['reference'], "class='tableheader2'", "colspan=6");
        label_cells(_("Date"), sql2date($adjustment['tran_date']), "class='tableheader2'");
        label_cells(_("Adjustment Type"), $adjustment_type['name'], "class='tableheader2'");
        end_row();
        comments_display_row(ST_INVADJUST, $trans_no);
        end_table();
        $header_shown = true;
        echo "<br>";
        start_table(TABLESTYLE, "width='90%'");
        $th = array(_("Item"), _("Description"), _("Quantity"), _("Units"), _("Unit Cost"));
        table_header($th);
    }
    alt_table_row_color($k);
    label_cell($adjustment['stock_id']);
    label_cell($adjustment['description']);
    qty_cell($adjustment['qty'], false, get_qty_dec($adjustment['stock_id']));
    label_cell($adjustment['units']);
    amount_decimal_cell($adjustment['standard_cost']);
Example #9
0
echo "<br>";
start_table("{$table_style2} width=80%");
start_row();
label_cells(tr("To Supplier"), $receipt['supplier_name'], "class='tableheader2'");
label_cells(tr("From Bank Account"), $receipt['bank_account_name'], "class='tableheader2'");
label_cells(tr("Date Paid"), sql2date($receipt['tran_date']), "class='tableheader2'");
end_row();
start_row();
if ($show_currencies) {
    label_cells(tr("Payment Currency"), $receipt['bank_curr_code'], "class='tableheader2'");
}
label_cells(tr("Amount"), number_format2(-$receipt['BankAmount'], user_price_dec()), "class='tableheader2'");
label_cells(tr("Payment Type"), $receipt['BankTransType'], "class='tableheader2'");
end_row();
start_row();
if ($show_currencies) {
    label_cells(tr("Supplier's Currency"), $receipt['SupplierCurrCode'], "class='tableheader2'");
}
if ($show_both_amounts) {
    label_cells(tr("Amount"), number_format2(-$receipt['ov_amount'], user_price_dec()), "class='tableheader2'");
}
label_cells(tr("Reference"), $receipt['ref'], "class='tableheader2'");
end_row();
comments_display_row(22, $trans_no);
end_table(1);
$voided = is_voided_display(22, $trans_no, tr("This payment has been voided."));
// now display the allocations for this payment
if (!$voided) {
    display_allocations_from(payment_person_types::supplier(), $receipt['supplier_id'], 22, $trans_no, -$receipt['ov_amount']);
}
end_page(true);
Example #10
0
display_heading2(tr("Invoices/Credits"));
echo "</td></tr>";
echo "<tr valign=top><td>";
start_table("{$table_style} width=95%");
label_row(tr("Customer Name"), $_SESSION['Items']->customer_name, "class='tableheader2'", "colspan=3");
start_row();
label_cells(tr("Customer Order Ref."), $_SESSION['Items']->cust_ref, "class='tableheader2'");
label_cells(tr("Deliver To Branch"), $_SESSION['Items']->deliver_to, "class='tableheader2'");
end_row();
start_row();
label_cells(tr("Ordered On"), $_SESSION['Items']->document_date, "class='tableheader2'");
label_cells(tr("Requested Delivery"), $_SESSION['Items']->due_date, "class='tableheader2'");
end_row();
start_row();
label_cells(tr("Order Currency"), $_SESSION['Items']->customer_currency, "class='tableheader2'");
label_cells(tr("Deliver From Location"), $_SESSION['Items']->location_name, "class='tableheader2'");
end_row();
label_row(tr("Delivery Address"), nl2br($_SESSION['Items']->delivery_address), "class='tableheader2'", "colspan=3");
label_row(tr("Telephone"), $_SESSION['Items']->phone, "class='tableheader2'", "colspan=3");
label_row(tr("E-mail"), "<a href='mailto:" . $_SESSION['Items']->email . "'>" . $_SESSION['Items']->email . "</a>", "class='tableheader2'", "colspan=3");
label_row(tr("Comments"), $_SESSION['Items']->Comments, "class='tableheader2'", "colspan=3");
end_table();
echo "</td><td valign='top'>";
start_table($table_style);
display_heading2(tr("Delivery Notes"));
$th = array(tr("#"), tr("Ref"), tr("Date"), tr("Total"));
table_header($th);
$sql = "SELECT * FROM debtor_trans WHERE type=13 AND order_=" . $_GET['trans_no'];
$result = db_query($sql, "The related delivery notes could not be retreived");
$delivery_total = 0;
$k = 0;
function display_credit_items()
{
    global $table_style, $table_style2;
    start_form(false, true);
    start_table("{$table_style2} width=80%", 5);
    echo "<tr><td>";
    // outer table
    start_table("{$table_style} width=100%");
    start_row();
    label_cells(tr("Customer"), $_SESSION['Items']->customer_name, "class='tableheader2'");
    label_cells(tr("Branch"), get_branch_name($_SESSION['Items']->Branch), "class='tableheader2'");
    label_cells(tr("Currency"), $_SESSION['Items']->customer_currency, "class='tableheader2'");
    end_row();
    start_row();
    //	if (!isset($_POST['ref']))
    //		$_POST['ref'] = references::get_next(11);
    if ($_SESSION['Items']->trans_no == 0) {
        ref_cells(tr("Reference"), 'ref', $_SESSION['Items']->reference, "class='tableheader2'");
    } else {
        label_cells(tr("Reference"), $_SESSION['Items']->reference, "class='tableheader2'");
    }
    //    label_cells(tr("Crediting Invoice"), get_customer_trans_view_str(10, $_SESSION['InvoiceToCredit']), "class='tableheader2'");
    label_cells(tr("Crediting Invoice"), get_customer_trans_view_str(10, array_keys($_SESSION['Items']->src_docs)), "class='tableheader2'");
    if (!isset($_POST['ShipperID'])) {
        $_POST['ShipperID'] = $_SESSION['Items']->ship_via;
    }
    label_cell(tr("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(tr("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("{$table_style} width=100%");
    label_row(tr("Invoice Date"), $_SESSION['Items']->src_date, "class='tableheader2'");
    date_row(tr("Credit Note Date"), 'CreditDate', null, 0, 0, 0, "class='tableheader2'");
    end_table();
    echo "</td></tr>";
    end_table(1);
    // outer table
    start_table("{$table_style} width=80%");
    $th = array(tr("Item Code"), tr("Item Description"), tr("Invoiced Quantity"), tr("Units"), tr("Credit Quantity"), tr("Price"), tr("Discount %"), tr("Total"));
    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
        }
        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);
        qty_cell($ln_itm->quantity);
        label_cell($ln_itm->units);
        amount_cells(null, 'Line' . $line_no, qty_format($ln_itm->qty_dispatched));
        $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);
    }
    start_row();
    label_cell(tr("Credit Shipping Cost"), "colspan=7 align=right");
    amount_cells(null, "ChargeFreightCost", $_POST['ChargeFreightCost'], 6, 6);
    end_row();
    $inv_items_total = $_SESSION['Items']->get_items_total_dispatch();
    $display_sub_total = price_format($inv_items_total + input_num($_POST['ChargeFreightCost']));
    label_row(tr("Sub-total"), $display_sub_total, "colspan=7 align=right", "align=right");
    $taxes = $_SESSION['Items']->get_taxes(input_num($_POST['ChargeFreightCost']));
    $tax_total = display_edit_tax_items($taxes, 7, $_SESSION['Items']->tax_included);
    $display_total = price_format($inv_items_total + input_num('ChargeFreightCost') + $tax_total);
    label_row(tr("Credit Note Total"), $display_total, "colspan=7 align=right", "align=right");
    end_table();
}
Example #12
0
// outer table
start_table(TABLESTYLE, "width=100%");
start_row();
label_cells(_("Reference"), $myrow["reference"], "class='tableheader2'");
label_cells(_("Currency"), $sales_order["curr_code"], "class='tableheader2'");
label_cells(_("Our Order No"), get_customer_trans_view_str(ST_SALESORDER, $sales_order["order_no"]), "class='tableheader2'");
end_row();
start_row();
label_cells(_("Customer Order Ref."), $sales_order["customer_ref"], "class='tableheader2'");
label_cells(_("Shipping Company"), $myrow["shipper_name"], "class='tableheader2'");
label_cells(_("Sales Type"), $myrow["sales_type"], "class='tableheader2'");
end_row();
start_row();
label_cells(_("Dispatch Date"), sql2date($myrow["tran_date"]), "class='tableheader2'", "nowrap");
label_cells(_("Due Date"), sql2date($myrow["due_date"]), "class='tableheader2'", "nowrap");
label_cells(_("Delivery No:"), $custom_row, "class='tableheader2'");
//moodlearning
end_row();
comments_display_row(ST_CUSTDELIVERY, $trans_id);
end_table();
echo "</td></tr>";
end_table(1);
// outer table
$result = get_customer_trans_details(ST_CUSTDELIVERY, $trans_id);
start_table(TABLESTYLE, "width=95%");
if (db_num_rows($result) > 0) {
    $th = array(_("Item Code"), _("Item Description"), _("Quantity"), _("Unit"), _("Price"), _("Discount %"), _("Total"));
    table_header($th);
    $k = 0;
    //row colour counter
    $sub_total = 0;
Example #13
0
$th = array(_("Branch"));
table_header($th);
label_row(null, $branch["br_name"] . "<br>" . nl2br($branch["br_address"]), "nowrap");
end_table();
echo "</td><td>";
// outer table
start_table(TABLESTYLE, "width=100%");
start_row();
label_cells(_("Ref"), $myrow["reference"], "class='tableheader2'");
label_cells(_("Date"), sql2date($myrow["tran_date"]), "class='tableheader2'");
label_cells(_("Currency"), $myrow["curr_code"], "class='tableheader2'");
end_row();
start_row();
label_cells(_("Sales Type"), $myrow["sales_type"], "class='tableheader2'");
label_cells(_("Shipping Company"), $myrow["shipper_name"], "class='tableheader2'");
label_cells(_("Credit Memo No:"), $custom_row, "class='tableheader2'");
//moodlearning
end_row();
comments_display_row(ST_CUSTCREDIT, $trans_id);
end_table();
echo "</td></tr>";
end_table(1);
// outer table
$sub_total = 0;
$result = get_customer_trans_details(ST_CUSTCREDIT, $trans_id);
start_table(TABLESTYLE, "width=95%");
if (db_num_rows($result) > 0) {
    $th = array(_("Item Code"), _("Item Description"), _("Quantity"), _("Unit"), _("Price"), _("Discount %"), _("Total"));
    table_header($th);
    $k = 0;
    //row colour counter
$txt = "<td nowrap colspan=4>X <input type='text' name='x1' size='4' maxlength='4' value='" . (isset($x1) ? $x1 : "") . "' onBlur='num_test(this);'>\n";
$txt .= "&nbsp;&nbsp;Y <input type='text' name='y1' size='4' maxlength='4' value='" . (isset($y1) ? $y1 : "") . "' onBlur='num_test(this);'></td>\n";
echo $txt;
end_row();
if ($report_type != "single") {
    // don't show order-element
    text_row(ALTERNATIVE . " " . ORDER, "ord", isset($ord) ? $ord : "", 2, 2, "onblur='num_test(this);'");
    // <!--   3. Line -->
    //start_row();
    //echo "<td>\n";
    //start_table(TABLESTYLE);
    // <!--   Third table in Table2 -->
    start_row();
    text_cells(NUMBER, "number", isset($number) ? $number : "", 2, 2, "onblur='num_test(this);'");
    $txt = "<select name='sel_center' size='1' >\n                     <option value='l' " . m_s("l", $sel_center) . ">left</option>\n                     <option value='c' " . m_s("c", $sel_center) . ">center</option>\n                     <option value='r' " . m_s("r", $sel_center) . ">right</option>\n                   </select>";
    label_cells(ALIGN, $txt);
    end_row();
}
start_row();
label_cell(OPTIONAL . " " . SUBSTRING . " " . FROM);
text_cells(null, "from", isset($from) ? $from : "", 2, 2, "onblur='num_test(this);'");
text_cells(TO, "to", isset($to) ? $to : "", 2, 2, "onblur='num_test(this);'");
end_row();
// <!--  end of 3. Line -->
end_table();
// <!--  end of inner table  -->
echo "</td>\n";
end_row();
end_table();
start_table(TABLESTYLE, "width=70%");
$th = array(ELEMENT, VALUE_);
    $paymcat = !$_SESSION['Items']->pos['cash_sale'] ? PM_CREDIT : (!$_SESSION['Items']->pos['credit_sale'] ? PM_CASH : PM_ANY);
    label_cells(_("Payment terms:"), sale_payment_list('payment', $paymcat), "class='tableheader2'", "colspan={$colspan}");
} else {
    label_cells(_('Payment:'), $_SESSION['Items']->payment_terms['terms'], "class='tableheader2'", "colspan={$colspan}");
}
end_row();
start_row();
if ($_SESSION['Items']->trans_no == 0) {
    ref_cells(_("Reference"), 'ref', '', null, "class='tableheader2'");
} else {
    label_cells(_("Reference"), $_SESSION['Items']->reference, "class='tableheader2'");
}
//label_cells(_("Delivery Notes:"),
//get_customer_trans_view_str(ST_CUSTDELIVERY, array_keys($_SESSION['Items']->src_docs)), "class='tableheader2'");
label_cells(_("Sales Type"), $_SESSION['Items']->sales_type_name, "class='tableheader2'");
label_cells(_("Currency"), $_SESSION['Items']->customer_currency, "class='tableheader2'");
// 2010-09-03 Joe Hunt
//if ($dim > 0)
//	label_cells(_("Dimension"), get_dimension_string($_SESSION['Items']->dimension_id), "class='tableheader2'");
if ($dim > 0) {
    label_cell(_("Dimension") . ":", "class='tableheader2'");
    $_POST['dimension_id'] = $_SESSION['Items']->dimension_id;
    dimensions_list_cells(null, 'dimension_id', null, true, ' ', false, 1, false);
} else {
    hidden('dimension_id', 0);
}
end_row();
start_row();
if (!isset($_POST['ship_via'])) {
    $_POST['ship_via'] = $_SESSION['Items']->ship_via;
}
Example #16
0
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$page_security = 'SA_OPEN';
$path_to_root = "../..";
include_once $path_to_root . "/includes/session.inc";
include_once $path_to_root . "/includes/packages.inc";
page(_($help_context = "Package Details"), true);
include_once $path_to_root . "/includes/ui.inc";
if (!isset($_GET['id'])) {
    /*Script was not passed the correct parameters */
    display_note(_("The script must be called with a valid package id to review the info for."));
    end_page();
}
$filter = array('Version' => _('Available version'), 'Type' => _('Package type'), 'Name' => _('Package content'), 'Description' => _('Description'), 'Author' => _('Author'), 'Homepage' => _('Home page'), 'Maintenance' => _('Package maintainer'), 'InstallPath' => _('Installation path'), 'Depends' => _('Minimal software versions'), 'RTLDir' => _('Right to left'), 'Encoding' => _('Charset encoding'));
$pkg = get_package_info($_GET['id'], null, $filter);
display_heading(sprintf(_("Content information for package '%s'"), $_GET['id']));
br();
start_table(TABLESTYLE2, "width='80%'");
$th = array(_("Property"), _("Value"));
table_header($th);
foreach ($pkg as $field => $value) {
    if ($value == '') {
        continue;
    }
    start_row();
    label_cells($field, nl2br(htmlentities(is_array($value) ? implode("\n", $value) : $value)), "class='tableheader2'");
    end_row();
}
end_table(1);
end_page(true);
$supp_trans = new supp_trans(ST_SUPPINVOICE);
read_supp_invoice($trans_no, ST_SUPPINVOICE, $supp_trans);
$supplier_curr_code = get_supplier_currency($supp_trans->supplier_id);
display_heading(_("SUPPLIER INVOICE") . " # " . $trans_no);
echo "<br>";
start_table(TABLESTYLE, "width=95%");
start_row();
label_cells(_("Supplier"), $supp_trans->supplier_name, "class='tableheader2'");
label_cells(_("Reference"), $supp_trans->reference, "class='tableheader2'");
label_cells(_("Supplier's Reference"), $supp_trans->supp_reference, "class='tableheader2'");
end_row();
start_row();
label_cells(_("Invoice Date"), $supp_trans->tran_date, "class='tableheader2'");
label_cells(_("Due Date"), $supp_trans->due_date, "class='tableheader2'");
if (!is_company_currency($supplier_curr_code)) {
    label_cells(_("Currency"), $supplier_curr_code, "class='tableheader2'");
}
end_row();
comments_display_row(ST_SUPPINVOICE, $trans_no);
end_table(1);
$total_gl = display_gl_items($supp_trans, 2);
$total_grn = display_grn_items($supp_trans, 2);
$display_sub_tot = number_format2($total_gl + $total_grn, user_price_dec());
start_table(TABLESTYLE, "width=95%");
label_row(_("Sub Total"), $display_sub_tot, "align=right", "nowrap align=right width=15%");
$tax_items = get_trans_tax_details(ST_SUPPINVOICE, $trans_no);
display_supp_trans_tax_details($tax_items, 1);
$display_total = number_format2($supp_trans->ov_amount + $supp_trans->ov_gst, user_price_dec());
label_row(_("TOTAL INVOICE"), $display_total, "colspan=1 align=right", "nowrap align=right");
end_table(1);
$voided = is_voided_display(ST_SUPPINVOICE, $trans_no, _("This invoice has been voided."));
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();
}
Example #19
0
echo "</td><td>";
// outer table
start_table(TABLESTYLE, "width='100%'");
start_row();
label_cells(_("Reference"), $myrow["reference"], "class='tableheader2'");
label_cells(_("Currency"), $sales_order["curr_code"], "class='tableheader2'");
label_cells(_("Our Order No"), get_customer_trans_view_str(ST_SALESORDER, $sales_order["order_no"]), "class='tableheader2'");
end_row();
start_row();
label_cells(_("Customer Order Ref."), $sales_order["customer_ref"], "class='tableheader2'");
label_cells(_("Shipping Company"), $myrow["shipper_name"], "class='tableheader2'");
label_cells(_("Sales Type"), $myrow["sales_type"], "class='tableheader2'");
end_row();
start_row();
label_cells(_("Dispatch Date"), sql2date($myrow["tran_date"]), "class='tableheader2'", "nowrap");
label_cells(_("Due Date"), sql2date($myrow["due_date"]), "class='tableheader2'", "nowrap");
end_row();
comments_display_row(ST_CUSTDELIVERY, $trans_id);
end_table();
echo "</td></tr>";
end_table(1);
// outer table
$result = get_customer_trans_details(ST_CUSTDELIVERY, $trans_id);
start_table(TABLESTYLE, "width='95%'");
if (db_num_rows($result) > 0) {
    $th = array(_("Item Code"), _("Item Description"), _("Quantity"), _("Unit"), _("Price"), _("Discount %"), _("Total"));
    table_header($th);
    $k = 0;
    //row colour counter
    $sub_total = 0;
    while ($myrow2 = db_fetch($result)) {
Example #20
0
$transfer_items = get_stock_transfer($trans_no);
$from_trans = $transfer_items[0];
$to_trans = $transfer_items[1];
display_heading($systypes_array[ST_LOCTRANSFER] . " #{$trans_no}");
echo "<br>";
start_table(TABLESTYLE2, "width=90%");
start_row();
label_cells(_("Item"), $from_trans['stock_id'] . " - " . $from_trans['description'], "class='tableheader2'");
label_cells(_("From Location"), $from_trans['location_name'], "class='tableheader2'");
label_cells(_("To Location"), $to_trans['location_name'], "class='tableheader2'");
end_row();
start_row();
label_cells(_("Reference"), $from_trans['reference'], "class='tableheader2'");
$adjustment_type = get_movement_type($from_trans['person_id']);
label_cells(_("Adjustment Type"), $adjustment_type['name'], "class='tableheader2'");
label_cells(_("Date"), sql2date($from_trans['tran_date']), "class='tableheader2'");
end_row();
comments_display_row(ST_LOCTRANSFER, $trans_no);
end_table(2);
start_table(TABLESTYLE, "width=90%");
$th = array(_("Item"), _("Description"), _("Quantity"), _("Units"));
table_header($th);
$transfer_items = get_stock_moves(ST_LOCTRANSFER, $trans_no);
$k = 0;
while ($item = db_fetch($transfer_items)) {
    if ($item['loc_code'] == $to_trans['loc_code']) {
        alt_table_row_color($k);
        label_cell($item['stock_id']);
        label_cell($item['description']);
        qty_cell($item['qty'], false, get_qty_dec($item['stock_id']));
        label_cell($item['units']);
Example #21
0
        clear_form();
    }
}
if (get_post('_profile_id_update')) {
    $Ajax->activate('_page_body');
}
start_form();
start_table();
print_profiles_list_row(_('Select printing profile') . ':', 'profile_id', null, _('New printing profile'), true);
end_table();
echo '<hr>';
start_table();
if (get_post('profile_id') == '') {
    text_row(_("Printing Profile Name") . ':', 'name', null, 30, 30);
} else {
    label_cells(_("Printing Profile Name") . ':', get_post('profile_id'));
}
end_table(1);
$result = get_print_profile(get_post('profile_id'));
$prints = array();
while ($myrow = db_fetch($result)) {
    $prints[$myrow['report']] = $myrow['printer'];
}
start_table(TABLESTYLE);
$th = array(_("Report Id"), _("Description"), _("Printer"));
table_header($th);
$k = 0;
$unkn = 0;
foreach (get_reports() as $rep => $descr) {
    alt_table_row_color($k);
    label_cell($rep == '' ? '-' : $rep, 'align=center');
    label_cells(_("Payment Currency"), $receipt['bank_curr_code'], "class='tableheader2'");
}
label_cells(_("Amount"), number_format2(-$receipt['bank_amount'], user_price_dec()), "class='tableheader2'");
if ($receipt['ov_discount'] != 0) {
    label_cells(_("Discount"), number_format2(-$receipt['ov_discount'] * $receipt['rate'], user_price_dec()), "class='tableheader2'");
} else {
    label_cells(_("Payment Type"), $bank_transfer_types[$receipt['BankTransType']], "class='tableheader2'");
}
end_row();
start_row();
if ($show_currencies) {
    label_cells(_("Supplier's Currency"), $receipt['curr_code'], "class='tableheader2'");
}
if ($show_both_amounts) {
    label_cells(_("Amount"), number_format2(-$receipt['Total'], user_price_dec()), "class='tableheader2'");
}
label_cells(_("Reference"), $receipt['ref'], "class='tableheader2'");
end_row();
if ($receipt['ov_discount'] != 0) {
    start_row();
    label_cells(_("Payment Type"), $bank_transfer_types[$receipt['BankTransType']], "class='tableheader2'");
    end_row();
}
comments_display_row(ST_SUPPAYMENT, $trans_no);
end_table(1);
$voided = is_voided_display(ST_SUPPAYMENT, $trans_no, _("This payment has been voided."));
// now display the allocations for this payment
if (!$voided) {
    display_allocations_from(PT_SUPPLIER, $receipt['supplier_id'], ST_SUPPAYMENT, $trans_no, -$receipt['Total']);
}
end_page(true, false, false, ST_SUPPAYMENT, $trans_no);
Example #23
0
start_table(TABLESTYLE, "width='100%'");
$th = array(_("Branch"));
table_header($th);
label_row(null, $branch["br_name"] . "<br>" . nl2br($branch["br_address"]), "nowrap");
end_table();
echo "</td><td>";
// outer table
start_table(TABLESTYLE, "width='100%'");
start_row();
label_cells(_("Ref"), $myrow["reference"], "class='tableheader2'");
label_cells(_("Date"), sql2date($myrow["tran_date"]), "class='tableheader2'");
label_cells(_("Currency"), $myrow["curr_code"], "class='tableheader2'");
end_row();
start_row();
label_cells(_("Sales Type"), $myrow["sales_type"], "class='tableheader2'");
label_cells(_("Shipping Company"), $myrow["shipper_name"], "class='tableheader2'");
end_row();
comments_display_row(ST_CUSTCREDIT, $trans_id);
end_table();
echo "</td></tr>";
end_table(1);
// outer table
$sub_total = 0;
$result = get_customer_trans_details(ST_CUSTCREDIT, $trans_id);
start_table(TABLESTYLE, "width='95%'");
if (db_num_rows($result) > 0) {
    $th = array(_("Item Code"), _("Item Description"), _("Quantity"), _("Unit"), _("Price"), _("Discount %"), _("Total"));
    table_header($th);
    $k = 0;
    //row colour counter
    $sub_total = 0;
Example #24
0
            $_SESSION['alloc'] = new allocation(ST_CUSTPAYMENT, 0);
            $Ajax->activate('alloc_tbl');
        }
    }
}
//----------------------------------------------------------------------------------------------
$new = !$_SESSION['alloc']->trans_no;
start_form();
hidden('trans_no');
hidden('old_ref', $old_ref);
start_outer_table(TABLESTYLE2, "width=60%", 5);
table_section(1);
if ($new) {
    customer_list_row(_("From Customer:"), 'customer_id', null, false, true);
} else {
    label_cells(_("From Customer:"), $_POST['customer_name'], "class='label'");
    hidden('customer_id', $_POST['customer_id']);
}
if (list_updated('customer_id') || $new && list_updated('bank_account')) {
    $_SESSION['alloc']->read();
    $_POST['memo_'] = $_POST['amount'] = $_POST['discount'] = '';
    $Ajax->activate('alloc_tbl');
}
if (db_customer_has_branches($_POST['customer_id'])) {
    customer_branches_list_row(_("Branch:"), $_POST['customer_id'], 'BranchID', null, false, true, true);
} else {
    hidden('BranchID', ANY_NUMERIC);
}
read_customer_data();
set_global_customer($_POST['customer_id']);
if (isset($_POST['HoldAccount']) && $_POST['HoldAccount'] != 0) {
Example #25
0
        $_POST['dimension2_id'] = $myrow['dimension2_id'];
        $_POST['selling'] = $myrow['selling'];
        $_POST['depending'] = $myrow['depending'];
        $_POST['barcode'] = $myrow['barcode'];
        $_POST['weight'] = $myrow['weight'];
        label_row(tr("Item Code:"), $_POST['NewStockID']);
        hidden('NewStockID', $_POST['NewStockID']);
    }
}
text_row(tr("Name:"), 'description', null, 52, 50);
textarea_row(tr('Description:'), 'long_description', null, 45, 3);
end_table();
start_table("{$table_style2} width=40%");
// Add image upload for New Item  - by Joe
start_row();
label_cells(tr("Image File (.jpg)") . ":", "<input type='file' id='pic' name='pic'>");
if ($id != "") {
    $fileimg = $path_to_root . "/image.php?id=" . $id;
    $stock_img_link = "<img src='{$fileimg}' width='100px' border='0'>";
    $stock_img_link .= "<br>" . tr("Delete") . "<input type='checkbox' name='deleteImage' value='1'>";
    label_cell($stock_img_link, "valign=top align=center rowspan=1");
}
end_row();
stock_categories_list_row(tr("Category:"), 'category_id', null);
item_tax_types_list_row(tr("Item Tax Type:"), 'tax_type_id', null);
stock_item_types_list_row(tr("Item Type:"), 'mb_flag', null, !isset($_POST['NewStockID']) || isset($_POST['New']));
stock_units_list_row(tr('Units of Measure:'), 'units', null, 1);
//	(!isset($_POST['NewStockID']) || isset($_POST['New'])));
check_row(tr("Selling:"), 'selling');
text_row(tr("Depending:"), 'depending', null, 20, 20);
text_row(tr("Barcode:"), 'barcode', null, 20, 64);
Example #26
0
}
display_heading($systypes_array[ST_BANKTRANSFER] . " #{$trans_no}");
echo "<br>";
start_table(TABLESTYLE, "width=80%");
start_row();
label_cells(_("From Bank Account"), $from_trans['bank_account_name'], "class='tableheader2'");
if ($show_currencies) {
    label_cells(_("Currency"), $from_trans['bank_curr_code'], "class='tableheader2'");
}
label_cells(_("Amount"), number_format2(-$from_trans['amount'], user_price_dec()), "class='tableheader2'", "align=right");
if ($show_currencies) {
    end_row();
    start_row();
}
label_cells(_("To Bank Account"), $to_trans['bank_account_name'], "class='tableheader2'");
if ($show_currencies) {
    label_cells(_("Currency"), $to_trans['bank_curr_code'], "class='tableheader2'");
}
if ($show_both_amounts) {
    label_cells(_("Amount"), number_format2($to_trans['amount'], user_price_dec()), "class='tableheader2'", "align=right");
}
end_row();
start_row();
label_cells(_("Date"), sql2date($from_trans['trans_date']), "class='tableheader2'");
label_cells(_("Transfer Type"), $bank_transfer_types[$from_trans['account_type']], "class='tableheader2'");
label_cells(_("Reference"), $from_trans['ref'], "class='tableheader2'");
end_row();
comments_display_row(ST_BANKTRANSFER, $trans_no);
end_table(1);
is_voided_display(ST_BANKTRANSFER, $trans_no, _("This transfer has been voided."));
end_page(true, false, false, ST_BANKTRANSFER, $trans_no);
Example #27
0
// outer table
start_table(TABLESTYLE, "width=100%");
start_row();
label_cells(_("Reference"), $myrow["reference"], "class='tableheader2'");
label_cells(_("Currency"), $sales_order["curr_code"], "class='tableheader2'");
label_cells(_("Our Order No"), get_customer_trans_view_str(ST_SALESORDER, $sales_order["order_no"]), "class='tableheader2'");
end_row();
start_row();
label_cells(_("Customer Order Ref."), $sales_order["customer_ref"], "class='tableheader2'");
label_cells(_("Shipping Company"), $myrow["shipper_name"], "class='tableheader2'");
label_cells(_("Sales Type"), $myrow["sales_type"], "class='tableheader2'");
end_row();
start_row();
label_cells(_("Invoice Date"), sql2date($myrow["tran_date"]), "class='tableheader2'", "nowrap");
label_cells(_("Due Date"), sql2date($myrow["due_date"]), "class='tableheader2'", "nowrap");
label_cells(_("Deliveries"), get_customer_trans_view_str(ST_CUSTDELIVERY, get_sales_parent_numbers(ST_SALESINVOICE, $trans_id)), "class='tableheader2'");
end_row();
comments_display_row(ST_SALESINVOICE, $trans_id);
end_table();
echo "</td></tr>";
end_table(1);
// outer table
$result = get_customer_trans_details(ST_SALESINVOICE, $trans_id);
start_table(TABLESTYLE, "width=95%");
if (db_num_rows($result) > 0) {
    $th = array(_("Item Code"), _("Item Description"), _("Quantity"), _("Unit"), _("Price"), _("Discount %"), _("Total"));
    table_header($th);
    $k = 0;
    //row colour counter
    $sub_total = 0;
    while ($myrow2 = db_fetch($result)) {
if ($show_currencies) {
    label_cells(_("Currency"), $to_trans['bank_curr_code'], "class='tableheader2'");
}
label_cells(_("Amount"), number_format2($to_trans['amount'], user_price_dec()), "class='tableheader2'", "align=right");
label_cells(_("Date"), sql2date($to_trans['trans_date']), "class='tableheader2'");
end_row();
start_row();
label_cells(_("From"), payment_person_name($to_trans['person_type_id'], $to_trans['person_id']), "class='tableheader2'", "colspan={$colspan1}");
if ($show_currencies) {
    label_cells(_("Settle currency"), $to_trans['settle_curr'], "class='tableheader2'");
    label_cells(_("Settled amount"), number_format2($to_trans['settled_amount'], user_price_dec()), "class='tableheader2'");
}
label_cells(_("Deposit Type"), $bank_transfer_types[$to_trans['account_type']], "class='tableheader2'");
end_row();
start_row();
label_cells(_("Reference"), $to_trans['ref'], "class='tableheader2'", "colspan={$colspan2}");
end_row();
comments_display_row(ST_BANKDEPOSIT, $trans_no);
end_table(1);
is_voided_display(ST_BANKDEPOSIT, $trans_no, _("This deposit has been voided."));
$items = get_gl_trans(ST_BANKDEPOSIT, $trans_no);
if (db_num_rows($items) == 0) {
    display_note(_("There are no items for this deposit."));
} else {
    display_heading2(_("Items for this Deposit"));
    if ($show_currencies) {
        display_heading2(_("Item Amounts are Shown in:") . " " . $company_currency);
    }
    start_table(TABLESTYLE, "width=80%");
    $dim = get_company_pref('use_dimension');
    if ($dim == 2) {
 $dim = get_company_pref('use_dimension');
 if ($dim == 2) {
     $th = array(_("Post"), _("Account/Tax Type"), _("Amount"), _("Dimension"), _("Dimension") . " 2", "", "");
 } elseif ($dim == 1) {
     $th = array(_("Post"), _("Account/Tax Type"), _("Amount"), _("Dimension"), "", "");
 } else {
     $th = array(_("Post"), _("Account/Tax Type"), _("Amount"), "", "");
 }
 table_header($th);
 $k = 0;
 while ($myrow = db_fetch($result)) {
     alt_table_row_color($k);
     label_cell($quick_actions[$myrow['action']]);
     $act_type = strtolower(substr($myrow['action'], 0, 1));
     if ($act_type == 't') {
         label_cells($myrow['tax_name'], '');
     } else {
         label_cell($myrow['dest_id'] . ' ' . $myrow['account_name']);
         if ($act_type == '=') {
             label_cell('');
         } elseif ($act_type == '%') {
             label_cell(number_format2($myrow['amount'], user_exrate_dec()), "nowrap align=right ");
         } else {
             amount_cell($myrow['amount']);
         }
     }
     if ($dim >= 1) {
         label_cell(get_dimension_string($myrow['dimension_id'], true));
     }
     if ($dim > 1) {
         label_cell(get_dimension_string($myrow['dimension2_id'], true));