$th = array(_("Description"), _("Template No"), _("Customer"), _("Branch") . "/" . _("Group"), _("Days"), _("Monthly"), _("Begin"), _("End"), _("Last Created"), "", ""); table_header($th); $k = 0; while ($myrow = db_fetch($result)) { $begin = sql2date($myrow["begin"]); $end = sql2date($myrow["end"]); $last_sent = $myrow["last_sent"] == '0000-00-00' ? '' : sql2date($myrow["last_sent"]); alt_table_row_color($k); label_cell($myrow["description"]); label_cell(get_customer_trans_view_str(ST_SALESORDER, $myrow["order_no"])); if ($myrow["debtor_no"] == 0) { label_cell(""); label_cell(get_sales_group_name($myrow["group_no"])); } else { label_cell(get_customer_name($myrow["debtor_no"])); label_cell(get_branch_name($myrow['group_no'])); } label_cell($myrow["days"]); label_cell($myrow['monthly']); label_cell($begin); label_cell($end); label_cell($last_sent); edit_button_cell("Edit" . $myrow["id"], _("Edit")); delete_button_cell("Delete" . $myrow["id"], _("Delete")); end_row(); } end_table(); end_form(); echo '<br>'; //------------------------------------------------------------------------------------------------- start_form();
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($_POST['Update']) || isset($_POST['_Location_update']) || isset($_POST['qty']) || isset($_POST['process_delivery'])) { $Ajax->activate('Items'); } //------------------------------------------------------------------------------ start_form(); hidden('cart_id'); start_table(TABLESTYLE2, "width=90%", 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(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'])) {
function print_order_status_list() { global $path_to_root; include_once $path_to_root . "reporting/includes/pdf_report.inc"; $from = $_REQUEST['PARAM_0']; $to = $_REQUEST['PARAM_1']; $category = $_REQUEST['PARAM_2']; $location = $_REQUEST['PARAM_3']; $backorder = $_REQUEST['PARAM_4']; $comments = $_REQUEST['PARAM_5']; $dec = user_qty_dec(); if ($category == reserved_words::get_all_numeric()) { $category = 0; } if ($location == reserved_words::get_all()) { $location = null; } if ($category == 0) { $cat = tr('All'); } else { $cat = get_category_name($category); } if ($location == null) { $loc = tr('All'); } else { $loc = $location; } if ($backorder == 0) { $back = tr('All Orders'); } else { $back = tr('Back Orders Only'); } $cols = array(0, 60, 150, 260, 325, 385, 450, 515); $headers2 = array(tr('Order'), tr('Customer'), tr('Branch'), tr('Customer Ref'), tr('Ord Date'), tr('Del Date'), tr('Loc')); $aligns = array('left', 'left', 'right', 'right', 'right', 'right', 'right'); $headers = array(tr('Code'), tr('Description'), tr('Ordered'), tr('Invoiced'), tr('Outstanding'), ''); $params = array(0 => $comments, 1 => array('text' => tr('Period'), 'from' => $from, 'to' => $to), 2 => array('text' => tr('Category'), 'from' => $cat, 'to' => ''), 3 => array('text' => tr('Location'), 'from' => $loc, 'to' => ''), 4 => array('text' => tr('Selection'), 'from' => $back, 'to' => '')); $cols2 = $cols; $aligns2 = $aligns; $rep = new FrontReport(tr('Order Status Listing'), "OrderStatusListing.pdf", user_pagesize()); $rep->Font(); $rep->Info($params, $cols, $headers, $aligns, $cols2, $headers2, $aligns2); $rep->Header(); $orderno = 0; $result = GetSalesOrders($from, $to, $category, $location, $backorder); while ($myrow = db_fetch($result)) { if ($rep->row < $rep->bottomMargin + 2 * $rep->lineHeight) { $orderno = 0; $rep->Header(); } $rep->NewLine(0, 2, false, $orderno); if ($orderno != $myrow['order_no']) { if ($orderno != 0) { $rep->Line($rep->row); $rep->NewLine(); } $rep->TextCol(0, 1, $myrow['order_no']); $rep->TextCol(1, 2, get_customer_name($myrow['debtor_no'])); $rep->TextCol(2, 3, get_branch_name($myrow['branch_code'])); $rep->TextCol(3, 4, $myrow['customer_ref']); $rep->TextCol(4, 5, sql2date($myrow['ord_date'])); $rep->TextCol(5, 6, sql2date($myrow['delivery_date'])); $rep->TextCol(6, 7, $myrow['from_stk_loc']); $rep->NewLine(2); $orderno = $myrow['order_no']; } $rep->TextCol(0, 1, $myrow['stk_code']); $rep->TextCol(1, 2, $myrow['description']); $rep->TextCol(2, 3, number_format2($myrow['quantity'], $dec)); $rep->TextCol(3, 4, number_format2($myrow['qty_sent'], $dec)); $rep->TextCol(4, 5, number_format2($myrow['quantity'] - $myrow['qty_sent'], $dec)); if ($myrow['quantity'] - $myrow['qty_sent'] > 0) { $rep->Font('italic'); $rep->TextCol(5, 6, tr('Outstanding')); $rep->Font(); } $rep->NewLine(); if ($rep->row < $rep->bottomMargin + 2 * $rep->lineHeight) { $orderno = 0; $rep->Header(); } } $rep->Line($rep->row); $rep->End(); }
} break; case 13: $edit_page = $path_to_root . '/sales/customer_delivery.php?ModifyDelivery=' . $myrow['trans_no']; break; } $date = sql2date($myrow["tran_date"]); if ($myrow["order_"] > 0) { $preview_order_str = get_customer_trans_view_str(systypes::sales_order(), $myrow["order_"]); } else { $preview_order_str = ""; } $gl_trans_str = get_gl_view_str_cell($myrow["type"], $myrow["trans_no"]); $branch_name = ""; if ($myrow["branch_code"] > 0) { $branch_name = get_branch_name($myrow["branch_code"]); } $preview_trans_str = get_trans_view_str($myrow["type"], $myrow["trans_no"]); label_cell(systypes::name($myrow["type"])); label_cell($preview_trans_str); label_cell($preview_order_str); label_cell($myrow["reference"]); label_cell($date, "nowrap"); label_cell($due_date_str, "nowrap"); if ($_POST['customer_id'] == reserved_words::get_all()) { label_cell($myrow["CustName"]); } label_cell($branch_name); if ($_POST['customer_id'] == reserved_words::get_all()) { label_cell($myrow["CustCurrCode"]); }
function print_order_status_list() { global $path_to_root; $from = $_POST['PARAM_0']; $to = $_POST['PARAM_1']; $category = $_POST['PARAM_2']; $location = $_POST['PARAM_3']; $backorder = $_POST['PARAM_4']; $comments = $_POST['PARAM_5']; $orientation = $_POST['PARAM_6']; $destination = $_POST['PARAM_7']; if ($destination) { include_once $path_to_root . "/reporting/includes/excel_report.inc"; } else { include_once $path_to_root . "/reporting/includes/pdf_report.inc"; } $orientation = $orientation ? 'L' : 'P'; if ($category == ALL_NUMERIC) { $category = 0; } if ($location == ALL_TEXT) { $location = null; } if ($category == 0) { $cat = _('All'); } else { $cat = get_category_name($category); } if ($location == null) { $loc = _('All'); } else { $loc = get_location_name($location); } if ($backorder == 0) { $back = _('All Orders'); } else { $back = _('Back Orders Only'); } $cols = array(0, 60, 150, 260, 325, 385, 450, 515); $headers2 = array(_('Order'), _('Customer'), _('Branch'), _('Customer Ref'), _('Ord Date'), _('Del Date'), _('Loc')); $aligns = array('left', 'left', 'right', 'right', 'right', 'right', 'right'); $headers = array(_('Code'), _('Description'), _('Ordered'), _('Delivered'), _('Outstanding'), ''); $params = array(0 => $comments, 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to), 2 => array('text' => _('Category'), 'from' => $cat, 'to' => ''), 3 => array('text' => _('Location'), 'from' => $loc, 'to' => ''), 4 => array('text' => _('Selection'), 'from' => $back, 'to' => '')); $aligns2 = $aligns; $rep = new FrontReport(_('Order Status Listing'), "OrderStatusListing", user_pagesize(), 9, $orientation); if ($orientation == 'L') { recalculate_cols($cols); } $cols2 = $cols; $rep->Font(); $rep->Info($params, $cols, $headers, $aligns, $cols2, $headers2, $aligns2); $rep->NewPage(); $orderno = 0; $result = GetSalesOrders($from, $to, $category, $location, $backorder); while ($myrow = db_fetch($result)) { $rep->NewLine(0, 2, false, $orderno); if ($orderno != $myrow['order_no']) { if ($orderno != 0) { $rep->Line($rep->row); $rep->NewLine(); } $rep->TextCol(0, 1, $myrow['order_no']); $rep->TextCol(1, 2, get_customer_name($myrow['debtor_no'])); $rep->TextCol(2, 3, get_branch_name($myrow['branch_code'])); $rep->TextCol(3, 4, $myrow['customer_ref']); $rep->DateCol(4, 5, $myrow['ord_date'], true); $rep->DateCol(5, 6, $myrow['delivery_date'], true); $rep->TextCol(6, 7, $myrow['from_stk_loc']); $rep->NewLine(2); $orderno = $myrow['order_no']; } $rep->TextCol(0, 1, $myrow['stk_code']); $rep->TextCol(1, 2, $myrow['description']); $dec = get_qty_dec($myrow['stk_code']); $rep->AmountCol(2, 3, $myrow['quantity'], $dec); $rep->AmountCol(3, 4, $myrow['qty_sent'], $dec); $rep->AmountCol(4, 5, $myrow['quantity'] - $myrow['qty_sent'], $dec); if ($myrow['quantity'] - $myrow['qty_sent'] > 0) { $rep->Font('italic'); $rep->TextCol(5, 6, _('Outstanding')); $rep->Font(); } $rep->NewLine(); } $rep->Line($rep->row); $rep->End(); }
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(); }
$row->phone = false; $row->address = false; $row->amount = false; $row->date = date("d/m/Y"); $row->hour = false; $action = "reserved.php?page=save"; include '../views/reserved/form.php'; get_footer(); break; case 'save': if ($_SESSION['user_type_id'] == 1 || $_SESSION['user_type_id'] == 2) { $where = ""; $branch_name = "Semua Cabang"; } else { $where = " and c.branch_id = '" . $_SESSION['branch_id'] . "'"; $branch_name = get_branch_name($_SESSION['branch_id']); } extract($_POST); $i_name = get_isset($i_name); $i_phone = get_isset($i_phone); $i_address = get_isset($i_address); $i_amount = get_isset($i_amount); $i_date = get_isset($i_date); $i_date = format_back_date($i_date); $i_hour = get_isset($i_hour); $i_h = explode(" ", $i_hour); $hour = explode(":", $i_h[0]); if ($i_h[1] == "PM") { if ($hour[0] == 12) { $new_hour = $hour[0]; } else {
function print_tax_report() { global $path_to_root; include_once $path_to_root . "reporting/includes/pdf_report.inc"; $rep = new FrontReport(tr('Tax Report'), "TaxReport.pdf", user_pagesize()); $from = $_REQUEST['PARAM_0']; $to = $_REQUEST['PARAM_1']; $summaryOnly = $_REQUEST['PARAM_2']; $comments = $_REQUEST['PARAM_3']; $dec = user_price_dec(); if ($summaryOnly == 1) { $summary = tr('Summary Only'); } else { $summary = tr('Detailed Report'); } $res = getTaxTypes(); $taxes = array(); $i = 0; while ($tax = db_fetch($res)) { $taxes[$i++] = $tax['id']; } $idcounter = count($taxes); $totalinvout = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); $totaltaxout = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); $totalinvin = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); $totaltaxin = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); if (!$summaryOnly) { $cols = array(0, 80, 130, 190, 290, 370, 435, 500, 565); $headers = array(tr('Trans Type'), tr('#'), tr('Date'), tr('Name'), tr('Branch Name'), tr('Net'), tr('Tax')); $aligns = array('left', 'left', 'left', 'left', 'left', 'right', 'right'); $params = array(0 => $comments, 1 => array('text' => tr('Period'), 'from' => $from, 'to' => $to), 2 => array('text' => tr('Type'), 'from' => $summary, 'to' => '')); $rep->Font(); $rep->Info($params, $cols, $headers, $aligns); $rep->Header(); } $totalnet = 0.0; $totaltax = 0.0; $transactions = getCustTransactions($from, $to); while ($trans = db_fetch($transactions)) { if (!$summaryOnly) { $rep->TextCol(0, 1, $trans['type_name']); $rep->TextCol(1, 2, $trans['reference']); $rep->TextCol(2, 3, sql2date($trans['tran_date'])); $rep->TextCol(3, 4, $trans['name']); if ($trans["branch_code"] > 0) { $rep->TextCol(4, 5, get_branch_name($trans["branch_code"])); } $rep->TextCol(5, 6, number_format2($trans['NetAmount'], $dec)); $rep->TextCol(6, 7, number_format2($trans['Tax'], $dec)); $rep->NewLine(); if ($rep->row < $rep->bottomMargin + $rep->lineHeight) { $rep->Line($rep->row - 2); $rep->Header(); } } $totalnet += $trans['NetAmount']; $totaltax += $trans['Tax']; } if (!$summaryOnly) { $rep->NewLine(); if ($rep->row < $rep->bottomMargin + $rep->lineHeight) { $rep->Line($rep->row - 2); $rep->Header(); } $rep->Line($rep->row + $rep->lineHeight); $rep->TextCol(3, 5, tr('Total Outputs')); $rep->TextCol(5, 6, number_format2($totalnet, $dec)); $rep->TextCol(6, 7, number_format2($totaltax, $dec)); $rep->Line($rep->row - 5); $rep->Header(); } $totalinnet = 0.0; $totalintax = 0.0; $transactions = getSuppTransactions($from, $to); while ($trans = db_fetch($transactions)) { if (!$summaryOnly) { $rep->TextCol(0, 1, $trans['type_name']); $rep->TextCol(1, 2, $trans['supp_reference']); $rep->TextCol(2, 3, sql2date($trans['tran_date'])); $rep->TextCol(3, 5, $trans['supp_name']); $rep->TextCol(5, 6, number_format2($trans['NetAmount'], $dec)); $rep->TextCol(6, 7, number_format2($trans['Tax'], $dec)); $rep->NewLine(); if ($rep->row < $rep->bottomMargin + $rep->lineHeight) { $rep->Line($rep->row - 2); $rep->Header(); } } $totalinnet += $trans['NetAmount']; $totalintax += $trans['Tax']; } if (!$summaryOnly) { $rep->NewLine(); if ($rep->row < $rep->bottomMargin + $rep->lineHeight) { $rep->Line($rep->row - 2); $rep->Header(); } $rep->Line($rep->row + $rep->lineHeight); $rep->TextCol(3, 5, tr('Total Inputs')); $rep->TextCol(5, 6, number_format2($totalinnet, $dec)); $rep->TextCol(6, 7, number_format2($totalintax, $dec)); $rep->Line($rep->row - 5); } $cols2 = array(0, 100, 200, 300, 400, 500, 600); $headers2 = array(tr('Tax Rate'), tr('Outputs'), tr('Output Tax'), tr('Inputs'), tr('Input Tax')); $aligns2 = array('left', 'right', 'right', 'right', 'right'); $invamount = 0.0; for ($i = 0; $i < $idcounter; $i++) { $amt = getCustInvTax($taxes[$i], $from, $to); $totalinvout[$i] += $amt[0]; $totaltaxout[$i] += $amt[1]; $invamount += $amt[0]; } if ($totalnet != $invamount) { $totalinvout[$idcounter] = $invamount - $totalnet; } for ($i = 0; $i < $idcounter; $i++) { $amt = getSuppInvTax($taxes[$i], $from, $to); $totalinvin[$i] += $amt[0]; $totaltaxin[$i] += $amt[1]; $invamount += $amt[0]; } if ($totalinnet != $invamount) { $totalinvin[$idcounter] = $totalinnet - $invamount; } for ($i = 0; $i < count($cols2) - 2; $i++) { $rep->cols[$i] = $rep->leftMargin + $cols2[$i]; $rep->headers[$i] = $headers2[$i]; $rep->aligns[$i] = $aligns2[$i]; } $rep->Header(); $counter = count($totalinvout); $counter = max($counter, $idcounter); $trow = $rep->row; $i = 0; for ($j = 0; $j < $counter; $j++) { if (isset($taxes[$j]) && $taxes[$j] > 0) { $tx = getTaxInfo($taxes[$j]); $str = $tx['name'] . " " . number_format2($tx['rate'], $dec) . "%"; } else { $str = tr('No tax specified'); } $rep->TextCol($i, $i + 1, $str); $rep->NewLine(); } $i++; $rep->row = $trow; for ($j = 0; $j < $counter; $j++) { $rep->TextCol($i, $i + 1, number_format2($totalinvout[$j], $dec)); $rep->NewLine(); } $i++; $rep->row = $trow; for ($j = 0; $j < $counter; $j++) { $rep->TextCol($i, $i + 1, number_format2($totaltaxout[$j], $dec)); $rep->NewLine(); } $i++; $rep->row = $trow; for ($j = 0; $j < $counter; $j++) { $rep->TextCol($i, $i + 1, number_format2($totalinvin[$j], $dec)); $rep->NewLine(); } $i++; $rep->row = $trow; for ($j = 0; $j < $counter; $j++) { $rep->TextCol($i, $i + 1, number_format2($totaltaxin[$j], $dec)); $rep->NewLine(); } $rep->Line($rep->row - 4); $locale = $path_to_root . "lang/" . $_SESSION['language']->code . "/locale.inc"; if (file_exists($locale)) { $taxinclude = true; include $locale; /* if (function_exists("TaxFunction")) TaxFunction(); */ } $rep->End(); }
$page = isset($_GET['page']) ? $_GET['page'] : "list"; $title = ucfirst("Order"); $_SESSION['menu_active'] = 2; switch ($page) { case 'list': $where_branch = ""; if ($_SESSION['user_type_id'] == 3 || $_SESSION['user_type_id'] == 4 || $_SESSION['user_type_id'] == 5) { $where_branch = " where branch_id = '" . $_SESSION['branch_id'] . "' "; $branch_id = $_SESSION['branch_id']; } else { $first_branch_id = get_first_branch_id(); $branch_id = isset($_GET['branch_id']) ? $_GET['branch_id'] : $first_branch_id; } $first_building_id = get_first_building_id($branch_id); $building_id = isset($_GET['building_id']) ? $_GET['building_id'] : $first_building_id; $branch_name = get_branch_name($branch_id); $building_name = get_building_name($building_id); $building_img = get_building_img($building_id); //get_header2($title); //$query = select(); $action_room = "order.php?page=save_room"; $action_table = "order.php?page=save_table&building_id={$building_id}"; $action_logout = "logout.php"; //$building_next(); //$building_prev(); include '../views/order/list.php'; //get_footer(); break; case 'save_table_location': $id = $_GET['id']; $data_x = $_GET['data_x'];