<?php // grab array of library name ids (login names) $name_id = getNameIDs(); // loop through these for the panel display for ($i = 0; $i < count($name_id); $i++) { // smaller functions used for future flexibility $nameid = $name_id[$i]; $id = getID($name_id[$i]); $url = getURL($name_id[$i]); $name = getName($name_id[$i]); $building = getBuilding($name_id[$i], 'at '); $description = getDescription($name_id[$i]); $notes = getHoursNotes($name_id[$i]); $map = getMapCode($name_id[$i]); $address = getAddress($name_id[$i]); $phone = getPhone($name_id[$i]); $accessurl = getAccessURL($name_id[$i]); $currentdate = date('Y-m-d'); $currenttime = date('H:i:s'); ?> <a name="view-<?php echo $nameid; ?> "></a> <div id="<?php echo $nameid; ?> " class="branch"> <div class="controls visible-phone">
} else { incorrect(); } break; case 'submit': if (argsLen($args, 7)) { submit($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6]); } else { incorrect(); } break; // ----------------- GET EMPLOYEE INFORMATION // ----------------- GET EMPLOYEE INFORMATION case 'getPhone': if (argsLen($args, 1)) { getPhone($args[0]); } else { incorrect(); } break; case 'getCrew': if (argsLen($args, 1)) { getCrew($args[0]); } else { incorrect(); } break; case 'getCrewCycle': if (argsLen($args, 1)) { getCrewCycle($args[0]); } else {
function print_sales_summary_report() { global $path_to_root; $from = $_POST['PARAM_0']; $to = $_POST['PARAM_1']; $tax_id = $_POST['PARAM_2']; $comments = $_POST['PARAM_3']; $orientation = $_POST['PARAM_4']; $destination = $_POST['PARAM_5']; if ($tax_id == 0) { $tid = _('No'); } else { $tid = _('Yes'); } 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'; $dec = user_price_dec(); $rep = new FrontReport(_('Sales Summary Report'), "SalesSummaryReport", user_pagesize(), 9, $orientation); $params = array(0 => $comments, 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to), 2 => array('text' => _('Tax Id Only'), 'from' => $tid, 'to' => '')); $cols = array(0, 130, 180, 270, 350, 400, 500); $headers = array(_('Customer'), _('Total ex. Tax'), _('Tax'), _('Total'), _('Balance'), _('Due')); $aligns = array('left', 'left', 'right', 'right', 'right', 'right'); if ($orientation == 'L') { recalculate_cols($cols); } $rep->Font(); $rep->Info($params, $cols, $headers, $aligns); $rep->NewPage(); $totalnet = 0.0; $totaltax = 0.0; $transactions = getTaxTransactions($from, $to, $tax_id); $rep->TextCol(0, 4, _('Balances in Home Currency')); $rep->NewLine(2); $custno = 0; $tax = $total = 0; $custname = $tax_id = ""; while ($trans = db_fetch($transactions)) { $customer_record = get_customer_details($custno); $customer_crm = getPhone($custno); if ($custno != $trans['debtor_no']) { if ($custno != 0) { $rep->TextCol(0, 1, $custname); //$rep->TextCol(1, 2, $tax_id); $rep->TextCol(1, 2, $custno, $dec); $rep->TextCol(2, 3, $trans['debtor_no'], $dec); $rep->TextCol(3, 4, $customer_crm['phone'], $dec); $rep->AmountCol(4, 5, $tax + $total, $dec); $rep->AmountCol(5, 6, $customer_record["Balance"], $dec); $totalnet += $total; $totaltax += $tax; $total = $tax = 0; $rep->NewLine(); if ($rep->row < $rep->bottomMargin + $rep->lineHeight) { $rep->Line($rep->row - 2); $rep->NewPage(); } } $custno = $trans['debtor_no']; $custname = $trans['cust_name']; $tax_id = $trans['tax_id']; } $taxes = getTaxes($trans['type'], $trans['trans_no']); if ($taxes != null) { if ($taxes['included_in_price']) { $trans['total'] -= $taxes['tax']; } $tax += $taxes['tax']; } $total += $trans['total']; } if ($custno != 0) { $customer_record = get_customer_details($custno); $rep->TextCol(0, 1, $custname); //$rep->TextCol(1, 2, $tax_id); $rep->AmountCol(1, 2, $total, $dec); $rep->AmountCol(2, 3, $tax, $dec); $rep->AmountCol(3, 4, $tax + $total, $dec); $rep->AmountCol(4, 5, $customer_record["Balance"], $dec); $rep->AmountCol(5, 6, $customer_record["Due"], $dec); $totalnet += $total; $totaltax += $tax; $rep->NewLine(); } $rep->Font('bold'); $rep->NewLine(); $rep->Line($rep->row + $rep->lineHeight); $rep->TextCol(0, 1, _("Total")); $rep->AmountCol(1, 2, $totalnet, $dec); $rep->AmountCol(2, 3, $totaltax, $dec); $rep->AmountCol(3, 4, $totaltax + $totalnet, $dec); $rep->Line($rep->row - 5); $rep->Font(); $rep->End(); }