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(); }
//----------------------------------------------------------------------------------------- if (isset($_POST['grn_item_id']) && $_POST['grn_item_id'] != "") { $myrow = get_grn_item_detail($_POST['grn_item_id']); echo "<br>"; display_heading2(tr("Delivery Item Selected For Adding To A Supplier Invoice")); start_table("{$table_style} width=80%"); $th = array(tr("Sequence #"), tr("Item"), tr("Description"), tr("Quantity Outstanding"), tr("Quantity to Invoice"), tr("Order Price"), tr("Actual Price")); table_header($th); start_row(); label_cell($_POST['grn_item_id']); label_cell($myrow['item_code']); label_cell($myrow['description']); qty_cell($myrow['QtyOstdg']); qty_cells(null, 'this_quantity_inv', qty_format($myrow['QtyOstdg'])); amount_cell($myrow['unit_price']); small_amount_cells(null, 'ChgPrice', price_format($myrow['unit_price'])); end_row(); end_table(1); submit_center('AddGRNToTrans', tr("Add to Invoice")); hidden('GRNNumber', $_POST['grn_item_id']); hidden('item_code', $myrow['item_code']); hidden('item_description', $myrow['description']); hidden('qty_recd', $myrow['qty_recd']); hidden('prev_quantity_inv', $myrow['quantity_inv']); hidden('order_price', $myrow['unit_price']); hidden('std_cost_unit', $myrow['std_cost_unit']); hidden('po_detail_item', $myrow['po_detail_item']); } //---------------------------------------------------------------------------------------- end_form(); end_page();
$_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); amount_cell($ln_itm->price); label_cell($ln_itm->tax_type_name); label_cell($display_discount_percent, "nowrap align=right"); amount_cell($line_total); end_row(); } $_POST['ChargeFreightCost'] = get_post('ChargeFreightCost', price_format($_SESSION['Items']->freight_cost)); $colspan = 9; start_row(); label_cell(_("Shipping Cost"), "colspan={$colspan} align=right"); small_amount_cells(null, 'ChargeFreightCost', $_SESSION['Items']->freight_cost); end_row(); $inv_items_total = $_SESSION['Items']->get_items_total_dispatch(); $display_sub_total = price_format($inv_items_total + input_num('ChargeFreightCost')); label_row(_("Sub-total"), $display_sub_total, "colspan={$colspan} align=right", "align=right"); $taxes = $_SESSION['Items']->get_taxes(input_num('ChargeFreightCost')); $tax_total = display_edit_tax_items($taxes, $colspan, $_SESSION['Items']->tax_included); $display_total = price_format($inv_items_total + input_num('ChargeFreightCost') + $tax_total); label_row(_("Amount Total"), $display_total, "colspan={$colspan} align=right", "align=right"); end_table(1); if ($has_marked) { display_note(_("Marked items have insufficient quantities in stock as on day of delivery."), 0, 1, "class='stockmankofg'"); } start_table(TABLESTYLE2); policy_list_row(_("Action For Balance"), "bo_policy", null); textarea_row(_("Memo"), 'Comments', null, 50, 4);
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(); }
$_POST['ChargeFreightCost'] = price_format(0); } else { $_POST['ChargeFreightCost'] = price_format($_SESSION['Items']->freight_cost); } if (!check_num('ChargeFreightCost')) { $_POST['ChargeFreightCost'] = price_format(0); } } $accumulate_shipping = get_company_pref('accumulate_shipping'); if ($is_batch_invoice && $accumulate_shipping) { set_delivery_shipping_sum(array_keys($_SESSION['Items']->src_docs)); } $colspan = 9; start_row(); label_cell(_("Shipping Cost"), "colspan={$colspan} align=right"); small_amount_cells(null, 'ChargeFreightCost', null); if ($is_batch_invoice) { label_cell('', 'colspan=2'); } end_row(); $inv_items_total = $_SESSION['Items']->get_items_total_dispatch(); $display_sub_total = price_format($inv_items_total + input_num('ChargeFreightCost')); label_row(_("Sub-total"), $display_sub_total, "colspan={$colspan} align=right", "align=right", $is_batch_invoice ? 2 : 0); $taxes = $_SESSION['Items']->get_taxes(input_num('ChargeFreightCost')); $tax_total = display_edit_tax_items($taxes, $colspan, $_SESSION['Items']->tax_included, $is_batch_invoice ? 2 : 0); $display_total = price_format($inv_items_total + input_num('ChargeFreightCost') + $tax_total); label_row(_("Invoice Total"), $display_total, "colspan={$colspan} align=right", "align=right", $is_batch_invoice ? 2 : 0); end_table(1); div_end(); start_table(TABLESTYLE2); textarea_row(_("Memo"), 'Comments', null, 50, 4);
} hidden('selected_id', $selected_id); } text_row_ex(tr("Description:"), 'name', 40); yesno_list_row(tr("Tax Shipping:"), 'tax_shipping', null, "", "", true); end_table(); display_note(tr("Select the taxes that are included in this group."), 1); start_table($table_style2); $th = array(tr("Tax"), tr("Default Rate (%)"), tr("Rate (%)")); table_header($th); for ($i = 0; $i < 5; $i++) { start_row(); if (!isset($_POST['tax_type_id' . $i])) { $_POST['tax_type_id' . $i] = 0; } tax_types_list_cells(null, 'tax_type_id' . $i, $_POST['tax_type_id' . $i], true, tr("None"), true); if ($_POST['tax_type_id' . $i] != 0 && $_POST['tax_type_id' . $i] != reserved_words::get_all_numeric()) { $default_rate = get_tax_type_default_rate($_POST['tax_type_id' . $i]); label_cell(percent_format($default_rate), "nowrap align=right"); if (!isset($_POST['rate' . $i]) || $_POST['rate' . $i] == "") { $_POST['rate' . $i] = percent_format($default_rate); } small_amount_cells(null, 'rate' . $i, $_POST['rate' . $i], null, null, user_percent_dec()); } end_row(); } end_table(1); submit_add_or_update_center(!isset($selected_id)); end_form(); //------------------------------------------------------------------------------------ end_page();
$display_sub_total = price_format($inv_items_total + input_num('ChargeFreightCost')); label_row(_("Sub-total"), $display_sub_total, "colspan={$colspan} align=right", "align=right", $is_batch_invoice ? 2 : 0); start_row(); label_cell(_("Shipping Cost"), "colspan={$colspan} align=right"); small_amount_cells(null, 'ChargeFreightCost', null); if ($is_batch_invoice) { label_cell('', 'colspan=2'); } end_row(); /*==============================MOODLEARNING=====================================*/ start_row(); //$discount = price_foram$_SESSION['Items']->invoice_total; $blk = $inv_items_total + input_num('ChargeFreightCost') - $_SESSION['Items']->invoice_total; $ect = $blk / ($inv_items_total + input_num('ChargeFreightCost')) * 100; label_cell(_("Bulk Discount %"), "colspan={$colspan} align=right"); small_amount_cells(null, 'bulk_dis', $_SESSION['Items']->bulk_discount); //hidden('discount', $_POST['discount']); //label_cell(price_format((input_num('bulk_dis') / 100) * $total, 0), 'colspan=2'); end_row(); /*================================================================================*/ $taxes = $_SESSION['Items']->get_taxes(input_num('ChargeFreightCost')); $tax_total = display_edit_tax_items($taxes, $colspan, $_SESSION['Items']->tax_included, $is_batch_invoice ? 2 : 0); $ds = input_num('bulk_dis') / 100; //moodlearning $tots = $inv_items_total + input_num('ChargeFreightCost') + $tax_total; //moodlearning $display_total = price_format($tots - $tots * $ds); //moodlearning label_row(_("Invoice Total"), $display_total, "colspan={$colspan} align=right", "align=right", $is_batch_invoice ? 2 : 0); end_table(1); div_end();
qty_cell($ln_itm->qty_done); small_qty_cells(null, 'Line' . $line, qty_format($ln_itm->qty_dispatched)); $display_discount_percent = percent_format($ln_itm->discount_percent * 100) . "%"; $line_total = $ln_itm->qty_dispatched * $ln_itm->price * (1 - $ln_itm->discount_percent); amount_cell($ln_itm->price); label_cell($ln_itm->tax_type_name); label_cell($display_discount_percent, "nowrap align=right"); amount_cell($line_total); end_row(); } $_POST['ChargeFreightCost'] = price_format($_SESSION['Items']->freight_cost); if (!check_num('ChargeFreightCost')) { $_POST['ChargeFreightCost'] = price_format(0); } start_row(); small_amount_cells(tr("Shipping Cost"), 'ChargeFreightCost', $_SESSION['Items']->freight_cost, "colspan=11 align=right"); $inv_items_total = $_SESSION['Items']->get_items_total_dispatch(); $display_sub_total = price_format($inv_items_total + input_num('ChargeFreightCost')); label_row(tr("Sub-total"), $display_sub_total, "colspan=11 align=right", "align=right"); $taxes = $_SESSION['Items']->get_taxes(input_num('ChargeFreightCost')); $tax_total = display_edit_tax_items($taxes, 11, $_SESSION['Items']->tax_included); $display_total = price_format($inv_items_total + input_num('ChargeFreightCost') + $tax_total); label_row(tr("Amount Total"), $display_total, "colspan=11 align=right", "align=right"); end_table(1); if ($has_marked) { display_note(tr("Marked items have insufficient quantities in stock as on day of delivery."), 0, 1, "class='red'"); } start_table($table_style2); policy_list_row(tr("Action For Balance"), "bo_policy", null); textarea_row(tr("Memo"), 'Comments', null, 50, 4); end_table(1);
/*Don't re-calculate freight if some of the order has already been delivered - depending on the business logic required this condition may not be required. It seems unfair to charge the customer twice for freight if the order was not fully delivered the first time ?? */ if (!isset($_POST['ChargeFreightCost']) || $_POST['ChargeFreightCost'] == "") { if ($_SESSION['Items']->any_already_delivered() == 1) { $_POST['ChargeFreightCost'] = price_format(0); } else { $_POST['ChargeFreightCost'] = price_format($_SESSION['Items']->freight_cost); } if (!check_num('ChargeFreightCost')) { $_POST['ChargeFreightCost'] = price_format(0); } } start_row(); small_amount_cells(tr("Shipping Cost"), 'ChargeFreightCost', null, "colspan=11 align=right"); if ($is_batch_invoice) { label_cell('', 'colspan=2'); } end_row(); $inv_items_total = $_SESSION['Items']->get_items_total_dispatch(); $display_sub_total = price_format($inv_items_total + input_num('ChargeFreightCost')); label_row(tr("Sub-total"), $display_sub_total, "colspan=11 align=right", "align=right", $is_batch_invoice ? 2 : 0); $taxes = $_SESSION['Items']->get_taxes(input_num('ChargeFreightCost')); $tax_total = display_edit_tax_items($taxes, 11, $_SESSION['Items']->tax_included, $is_batch_invoice ? 2 : 0); $display_total = price_format($inv_items_total + input_num('ChargeFreightCost') + $tax_total); label_row(tr("Invoice Total"), $display_total, "colspan=11 align=right", "align=right", $is_batch_invoice ? 2 : 0); end_table(1); start_table($table_style2); textarea_row(tr("Memo"), 'Comments', null, 50, 4); end_table(1);