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(); }
function display_po_receive_items() { global $table_style; start_table("colspan=7 {$table_style} width=90%"); $th = array(tr("Item Code"), tr("Description"), tr("Ordered"), tr("Units"), tr("Received"), tr("Outstanding"), tr("This Delivery"), tr("Price"), tr("Total")); table_header($th); /*show the line items on the order with the quantity being received for modification */ $total = 0; $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 ($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); } qty_cell($ln_itm->quantity); label_cell($ln_itm->units); qty_cell($ln_itm->qty_received); qty_cell($qty_outstanding); if ($qty_outstanding > 0) { qty_cells(null, $ln_itm->line_no, qty_format($ln_itm->receive_qty), "align=right"); } else { qty_cells(null, $ln_itm->line_no, qty_format($ln_itm->receive_qty), "align=right", "disabled"); } amount_cell($ln_itm->price); amount_cell($line_total); end_row(); } } $display_total = number_format2($total, user_price_dec()); label_row(tr("Total value of items received"), $display_total, "colspan=8 align=right", "nowrap align=right"); end_table(); }
$qty = $check['qty']; } $q_class = hook_get_dispatchable_quantity($ln_itm, $_POST['Location'], $_POST['DispatchDate'], $qty); // Skip line if needed if ($q_class === 'skip') { continue; } if (is_array($q_class)) { list($ln_itm->qty_dispatched, $row_classes) = $q_class; $has_marked = true; } } alt_table_row_color($k, $row_classes); view_stock_status_cell($ln_itm->stock_id); if ($ln_itm->descr_editable) { text_cells(null, 'Line' . $line . '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_done, false, $dec); if (isset($_POST['clear_quantity'])) { $ln_itm->qty_dispatched = 0; } $_POST['Line' . $line] = $ln_itm->qty_dispatched; /// clear post so value displayed in the fiel is the 'new' quantity small_qty_cells(null, 'Line' . $line, qty_format($ln_itm->qty_dispatched, $ln_itm->stock_id, $dec), null, null, $dec); $display_discount_percent = percent_format($ln_itm->discount_percent * 100) . "%"; $line_total = $ln_itm->qty_dispatched * $ln_itm->price * (1 - $ln_itm->discount_percent);
include_once $path_to_root . "/includes/db_pager.inc"; include_once $path_to_root . "/includes/session.inc"; include_once $path_to_root . "/sales/includes/sales_ui.inc"; include_once $path_to_root . "/sales/includes/sales_db.inc"; include_once $path_to_root . "/reporting/includes/reporting.inc"; include_once $path_to_root . "/sales/ml/db/voucher_db.php"; $js = ""; if ($use_popup_windows) { $js .= get_js_open_window(900, 500); } page(_($help_context = "Commission Voucher Inquiry"), false, false, "", $js); start_form(); start_table(TABLESTYLE_NOBORDER); start_row(); salesman_list_cells(_("Select IMC: "), 'imc'); text_cells(_("Invoice #"), 'invoice_no'); submit_cells('RefreshInquiry', _("Search"), '', _('Refresh Inquiry'), 'default'); end_row(); end_table(); br(3); //------------------------------------------------------------------------------------------------ function imc_name($row, $type) { return get_salesman_name($row['imc']); } function invoice($row) { return $row['invoice_no']; } //moodlearning function date_view($row)
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(); }
if (isset($_GET['customer_id'])) { $_POST['customer_id'] = $_GET['customer_id']; } //------------------------------------------------------------------------------------------------ if (!@$_GET['popup']) { start_form(); } if (!isset($_POST['customer_id'])) { $_POST['customer_id'] = get_global_customer(); } start_table(TABLESTYLE_NOBORDER); start_row(); if (!@$_GET['popup']) { customer_list_cells(_("Select a customer: "), 'customer_id', null, true, false, false, !@$_GET['popup']); } text_cells(_("#:"), 'customNum'); //Edited by Karen 07/09/2015 date_cells(_("From:"), 'TransAfterDate', '', null, -30); date_cells(_("To:"), 'TransToDate', '', null, 1); if (!isset($_POST['filterType'])) { $_POST['filterType'] = 0; } cust_allocations_list_cells(null, 'filterType', $_POST['filterType'], true); submit_cells('RefreshInquiry', _("Search"), '', _('Refresh Inquiry'), 'default'); end_row(); end_table(); set_global_customer($_POST['customer_id']); //------------------------------------------------------------------------------------------------ function display_customer_summary($customer_record) { $past1 = get_company_pref('past_due_days');
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(); }
label_cells(tr("Image File (.jpg)") . ":", "<input type='file' id='pic' name='pic'>"); $fileimg = $path_to_root . "/image.php?id=1&table=company"; $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=6"); end_row(); text_row_ex(tr("Domicile:"), 'domicile', 25, 55); number_list_row(tr("Use Dimensions:"), 'use_dimension', null, 0, 2); check_row(tr("No Item List"), 'no_item_list', $_POST['no_item_list']); check_row(tr("No Customer List"), 'no_customer_list', $_POST['no_customer_list']); check_row(tr("No Supplier List"), 'no_supplier_list', $_POST['no_supplier_list']); start_row(); end_row(); label_row(tr("Custom Field Name"), tr("Custom Field Value")); start_row(); text_cells(null, 'custom1_name', $_POST['custom1_name'], 25, 25); text_cells(null, 'custom1_value', $_POST['custom1_value'], 30, 30); end_row(); start_row(); text_cells(null, 'custom2_name', $_POST['custom2_name'], 25, 25); text_cells(null, 'custom2_value', $_POST['custom2_value'], 30, 30); end_row(); start_row(); text_cells(null, 'custom3_name', $_POST['custom3_name'], 25, 25); text_cells(null, 'custom3_value', $_POST['custom3_value'], 30, 30); end_row(); end_table(1); submit_center('submit', tr("Update")); end_form(2); //------------------------------------------------------------------------------------------------- end_page();
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_); table_header($th); start_row(); $txt = "<input type='radio' name='sel_typ' value = 'String' " . (empty($sel_typ) ? " checked " : m_c("String", $sel_typ)) . ">String\n"; label_cell($txt); text_cells(null, "value_", isset($value_) ? $value_ : "", 40, 80); end_row(); start_row(); $txt = "<input type='radio' name='sel_typ' value = 'DB' " . m_c("DB", $sel_typ) . ">" . DBFELD . "\n"; label_cell($txt); if (substr($id_new, 0, 1) != 'B') { // This is a report $sql1 = str_replace("0_", TB_PREF, $sql); $res = db_query($sql1); $num = db_num_fields($res); $txt = "<td><select name = 'feld' size='1'>\n"; for ($i = 0; $i < $num; $i++) { $meta = mysql_fetch_field($res, $i); $txt .= "<option value=\"" . $meta->name . "\" " . m_s($meta->name, $feld) . " > " . $meta->name . "</option>\n"; } $txt .= "</select>\n";
if ($use_date_picker) { $js .= get_js_date_picker(); } if ($use_popup_windows) { $js .= get_js_open_window(900, 500); } page(_($help_context = "Disbursement/Journal Voucher Inquiry"), false, false, "", $js); if (isset($_GET['UpdatedID'])) { $trans_no = $_GET['AddedID']; display_notification_centered(_("Check voucher entry has been edited") . " #{$trans_no}"); } start_form(); start_table(TABLESTYLE_NOBORDER); start_row(); booklet_type_row_list(_("Select type: "), 'type'); text_cells(_("Voucher #"), 'voucher_no'); date_cells(_("From:"), 'FromDate', '', null, 0, -1, 0); submit_cells('RefreshInquiry', _("Search"), '', _('Refresh Inquiry'), 'default'); end_row(); end_table(); br(3); //------------------------------------------------------------------------------------------------ function type_name($dummy, $type) { global $systypes_array; return $systypes_array[$type]; } function voucher($row) { $vouch = substr($row['YearDate'], 2) . "-" . str_pad($row['customized_no'], 4, 0, STR_PAD_LEFT); return $vouch;