Allow optional non zero values in reports 101,102,201,202,203 and 303.
! -> Note
$ -> Affected files
+14-Jun-2010 Tom Moulton/Joe Hunt
+# Bug [0000231] Wrong On Order for Advanced Manufacturing.before final production.
+$ /includes/db/manufacturing_db.inc
+! Allow optional non zero values in reports 101,102,201,202,203 and 303.
+$ /reporting/rep101.php
+ /reporting/rep102.php
+ /reporting/rep201.php
+ /reporting/rep202.php
+ /reporting/rep203.php
+ /reporting/rep303.php
+ /reporting/reports_main.php
+
------------------------------- Release 2.2.10 ----------------------------------
11-Jun-2010 Joe Hunt
! Release 2.2.10
$qoh_stock = array();
load_stock_levels($location);
}
- $stock_qty = $qoh_stock[$stock_id];
- if ($stock_qty == NULL) $stock_qty = 0;
+ if (empty($qoh_stock[$stock_id])) $stock_qty = 0;
+ else $stock_qty = $qoh_stock[$stock_id];
if ($qty <= $stock_qty) return $demand;
$bom = @$bom_list[$stock_id];
if ($bom == NULL) {
function print_customer_balances()
{
- global $path_to_root, $systypes_array;
-
- $from = $_POST['PARAM_0'];
- $to = $_POST['PARAM_1'];
- $fromcust = $_POST['PARAM_2'];
- $currency = $_POST['PARAM_3'];
- $comments = $_POST['PARAM_4'];
- $destination = $_POST['PARAM_5'];
+ global $path_to_root, $systypes_array;
+
+ $from = $_POST['PARAM_0'];
+ $to = $_POST['PARAM_1'];
+ $fromcust = $_POST['PARAM_2'];
+ $currency = $_POST['PARAM_3'];
+ $no_zeros = $_POST['PARAM_4'];
+ $comments = $_POST['PARAM_5'];
+ $destination = $_POST['PARAM_6'];
if ($destination)
include_once($path_to_root . "/reporting/includes/excel_report.inc");
else
$cust = _('All');
else
$cust = get_customer_name($fromcust);
- $dec = user_price_dec();
+ $dec = user_price_dec();
if ($currency == ALL_TEXT)
{
else
$convert = false;
+ if ($no_zeros) $nozeros = _('Yes');
+ else $nozeros = _('No');
+
$cols = array(0, 100, 130, 190, 250, 320, 385, 450, 515);
$headers = array(_('Trans Type'), _('#'), _('Date'), _('Due Date'), _('Charges'), _('Credits'),
$aligns = array('left', 'left', 'left', 'left', 'right', 'right', 'right', 'right');
- $params = array( 0 => $comments,
- 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to),
- 2 => array('text' => _('Customer'), 'from' => $cust, 'to' => ''),
- 3 => array('text' => _('Currency'), 'from' => $currency, 'to' => ''));
+ $params = array( 0 => $comments,
+ 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to),
+ 2 => array('text' => _('Customer'), 'from' => $cust, 'to' => ''),
+ 3 => array('text' => _('Currency'), 'from' => $currency, 'to' => ''),
+ 4 => array('text' => _('Suppress Zeros'), 'from' => $nozeros, 'to' => ''));
- $rep = new FrontReport(_('Customer Balances'), "CustomerBalances", user_pagesize());
+ $rep = new FrontReport(_('Customer Balances'), "CustomerBalances", user_pagesize());
- $rep->Font();
- $rep->Info($params, $cols, $headers, $aligns);
- $rep->Header();
+ $rep->Font();
+ $rep->Info($params, $cols, $headers, $aligns);
+ $rep->Header();
$grandtotal = array(0,0,0,0);
$sql .= "WHERE debtor_no=".db_escape($fromcust);
$sql .= " ORDER BY name";
$result = db_query($sql, "The customers could not be retrieved");
+ $num_lines = 0;
while ($myrow = db_fetch($result))
{
- if (!$convert && $currency != $myrow['curr_code'])
- continue;
+ if (!$convert && $currency != $myrow['curr_code']) continue;
+
+ $bal = get_open_balance($myrow['debtor_no'], $from, $convert);
+ $init[0] = $init[1] = 0.0;
+ $init[0] = round2(abs($bal['charges']), $dec);
+ $init[1] = round2(Abs($bal['credits']), $dec);
+ $init[2] = round2($bal['Allocated'], $dec);
+ $init[3] = round2($bal['OutStanding'], $dec);;
+
+ $res = get_transactions($myrow['debtor_no'], $from, $to);
+ if ($no_zeros && db_num_rows($res) == 0) continue;
+
+ $num_lines++;
$rep->fontSize += 2;
$rep->TextCol(0, 2, $myrow['name']);
if ($convert)
$rep->TextCol(2, 3, $myrow['curr_code']);
$rep->fontSize -= 2;
- $bal = get_open_balance($myrow['debtor_no'], $from, $convert);
- $init[0] = $init[1] = 0.0;
$rep->TextCol(3, 4, _("Open Balance"));
- $init[0] = round2(abs($bal['charges']), $dec);
$rep->AmountCol(4, 5, $init[0], $dec);
- $init[1] = round2(Abs($bal['credits']), $dec);
$rep->AmountCol(5, 6, $init[1], $dec);
- $init[2] = round2($bal['Allocated'], $dec);
$rep->AmountCol(6, 7, $init[2], $dec);
- $init[3] = round2($bal['OutStanding'], $dec);;
$rep->AmountCol(7, 8, $init[3], $dec);
$total = array(0,0,0,0);
for ($i = 0; $i < 4; $i++)
$grandtotal[$i] += $init[$i];
}
$rep->NewLine(1, 2);
- $res = get_transactions($myrow['debtor_no'], $from, $to);
if (db_num_rows($res)==0)
continue;
$rep->Line($rep->row + 4);
while ($trans = db_fetch($res))
{
+ if ($no_zeros && $trans['TotalAmount'] == 0 && $trans['Allocated'] == 0) continue;
$rep->NewLine(1, 2);
$rep->TextCol(0, 1, $systypes_array[$trans['type']]);
$rep->TextCol(1, 2, $trans['reference']);
$rep->TextCol(0, 3, _('Total'));
for ($i = 0; $i < 4; $i++)
$rep->AmountCol($i + 4, $i + 5, $total[$i], $dec);
- $rep->Line($rep->row - 4);
- $rep->NewLine(2);
+ $rep->Line($rep->row - 4);
+ $rep->NewLine(2);
}
$rep->fontSize += 2;
$rep->TextCol(0, 3, _('Grand Total'));
$rep->AmountCol($i + 4, $i + 5, $grandtotal[$i], $dec);
$rep->Line($rep->row - 4);
$rep->NewLine();
- $rep->End();
+ $rep->End();
}
-?>
\ No newline at end of file
+?>
function print_aged_customer_analysis()
{
- global $comp_path, $path_to_root, $systypes_array;
+ global $comp_path, $path_to_root, $systypes_array;
- $to = $_POST['PARAM_0'];
- $fromcust = $_POST['PARAM_1'];
- $currency = $_POST['PARAM_2'];
+ $to = $_POST['PARAM_0'];
+ $fromcust = $_POST['PARAM_1'];
+ $currency = $_POST['PARAM_2'];
$summaryOnly = $_POST['PARAM_3'];
- $graphics = $_POST['PARAM_4'];
- $comments = $_POST['PARAM_5'];
- $destination = $_POST['PARAM_6'];
+ $no_zeros = $_POST['PARAM_4'];
+ $graphics = $_POST['PARAM_5'];
+ $comments = $_POST['PARAM_6'];
+ $destination = $_POST['PARAM_7'];
if ($destination)
include_once($path_to_root . "/reporting/includes/excel_report.inc");
else
$from = _('All');
else
$from = get_customer_name($fromcust);
- $dec = user_price_dec();
+ $dec = user_price_dec();
if ($summaryOnly == 1)
$summary = _('Summary Only');
else
$convert = false;
+ if ($no_zeros) $nozeros = _('Yes');
+ else $nozeros = _('No');
+
$PastDueDays1 = get_company_pref('past_due_days');
$PastDueDays2 = 2 * $PastDueDays1;
$nowdue = "1-" . $PastDueDays1 . " " . _('Days');
$aligns = array('left', 'left', 'left', 'right', 'right', 'right', 'right', 'right');
- $params = array( 0 => $comments,
- 1 => array('text' => _('End Date'), 'from' => $to, 'to' => ''),
- 2 => array('text' => _('Customer'), 'from' => $from, 'to' => ''),
- 3 => array('text' => _('Currency'), 'from' => $currency, 'to' => ''),
- 4 => array('text' => _('Type'), 'from' => $summary,'to' => ''));
+ $params = array( 0 => $comments,
+ 1 => array('text' => _('End Date'), 'from' => $to, 'to' => ''),
+ 2 => array('text' => _('Customer'), 'from' => $from, 'to' => ''),
+ 3 => array('text' => _('Currency'), 'from' => $currency, 'to' => ''),
+ 4 => array('text' => _('Type'), 'from' => $summary,'to' => ''),
+ 5 => array('text' => _('Suppress Zeros'), 'from' => $nozeros, 'to' => ''));
if ($convert)
$headers[2] = _('Currency');
- $rep = new FrontReport(_('Aged Customer Analysis'), "AgedCustomerAnalysis", user_pagesize());
+ $rep = new FrontReport(_('Aged Customer Analysis'), "AgedCustomerAnalysis", user_pagesize());
- $rep->Font();
- $rep->Info($params, $cols, $headers, $aligns);
- $rep->Header();
+ $rep->Font();
+ $rep->Info($params, $cols, $headers, $aligns);
+ $rep->Header();
$total = array(0,0,0,0, 0);
{
if (!$convert && $currency != $myrow['curr_code'])
continue;
- $rep->fontSize += 2;
- $rep->TextCol(0, 2, $myrow['name']);
- if ($convert)
- {
- $rate = get_exchange_rate_from_home_currency($myrow['curr_code'], $to);
- $rep->TextCol(2, 3, $myrow['curr_code']);
- }
- else
- $rate = 1.0;
- $rep->fontSize -= 2;
+
+ if ($convert) $rate = get_exchange_rate_from_home_currency($myrow['curr_code'], $to);
+ else $rate = 1.0;
$custrec = get_customer_details($myrow['debtor_no'], $to);
foreach ($custrec as $i => $value)
$custrec[$i] *= $rate;
- $total[0] += ($custrec["Balance"] - $custrec["Due"]);
- $total[1] += ($custrec["Due"]-$custrec["Overdue1"]);
- $total[2] += ($custrec["Overdue1"]-$custrec["Overdue2"]);
- $total[3] += $custrec["Overdue2"];
- $total[4] += $custrec["Balance"];
$str = array($custrec["Balance"] - $custrec["Due"],
$custrec["Due"]-$custrec["Overdue1"],
$custrec["Overdue1"]-$custrec["Overdue2"],
$custrec["Overdue2"],
$custrec["Balance"]);
+ if ($no_zeros && array_sum($str) == 0) continue;
+
+ $rep->fontSize += 2;
+ $rep->TextCol(0, 2, $myrow['name']);
+ if ($convert) $rep->TextCol(2, 3, $myrow['curr_code']);
+ $rep->fontSize -= 2;
+ $total[0] += ($custrec["Balance"] - $custrec["Due"]);
+ $total[1] += ($custrec["Due"]-$custrec["Overdue1"]);
+ $total[2] += ($custrec["Overdue1"]-$custrec["Overdue2"]);
+ $total[3] += $custrec["Overdue2"];
+ $total[4] += $custrec["Balance"];
for ($i = 0; $i < count($str); $i++)
$rep->AmountCol($i + 3, $i + 4, $str[$i], $dec);
$rep->NewLine(1, 2);
$rep->End();
}
-?>
\ No newline at end of file
+?>
function print_supplier_balances()
{
- global $path_to_root, $systypes_array;
-
- $from = $_POST['PARAM_0'];
- $to = $_POST['PARAM_1'];
- $fromsupp = $_POST['PARAM_2'];
- $currency = $_POST['PARAM_3'];
- $comments = $_POST['PARAM_4'];
- $destination = $_POST['PARAM_5'];
+ global $path_to_root, $systypes_array;
+
+ $from = $_POST['PARAM_0'];
+ $to = $_POST['PARAM_1'];
+ $fromsupp = $_POST['PARAM_2'];
+ $currency = $_POST['PARAM_3'];
+ $no_zeros = $_POST['PARAM_4'];
+ $comments = $_POST['PARAM_5'];
+ $destination = $_POST['PARAM_6'];
if ($destination)
include_once($path_to_root . "/reporting/includes/excel_report.inc");
else
$supp = _('All');
else
$supp = get_supplier_name($fromsupp);
- $dec = user_price_dec();
+ $dec = user_price_dec();
if ($currency == ALL_TEXT)
{
else
$convert = false;
+ if ($no_zeros) $nozeros = _('Yes');
+ else $nozeros = _('No');
+
$cols = array(0, 100, 130, 190, 250, 320, 385, 450, 515);
$headers = array(_('Trans Type'), _('#'), _('Date'), _('Due Date'), _('Charges'),
$aligns = array('left', 'left', 'left', 'left', 'right', 'right', 'right', 'right');
$params = array( 0 => $comments,
- 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to),
- 2 => array('text' => _('Supplier'), 'from' => $supp, 'to' => ''),
- 3 => array( 'text' => _('Currency'),'from' => $currency, 'to' => ''));
+ 1 => array('text' => _('Period'), 'from' => $from, 'to' => $to),
+ 2 => array('text' => _('Supplier'), 'from' => $supp, 'to' => ''),
+ 3 => array( 'text' => _('Currency'),'from' => $currency, 'to' => ''),
+ 4 => array('text' => _('Suppress Zeros'), 'from' => $nozeros, 'to' => ''));
$rep = new FrontReport(_('Supplier Balances'), "SupplierBalances", user_pagesize());
{
if (!$convert && $currency != $myrow['curr_code'])
continue;
- $rep->fontSize += 2;
- $rep->TextCol(0, 2, $myrow['name']);
- if ($convert)
- $rep->TextCol(2, 3, $myrow['curr_code']);
- $rep->fontSize -= 2;
$bal = get_open_balance($myrow['supplier_id'], $from, $convert);
$init[0] = $init[1] = 0.0;
- $rep->TextCol(3, 4, _("Open Balance"));
$init[0] = round2(abs($bal['charges']), $dec);
- $rep->AmountCol(4, 5, $init[0], $dec);
$init[1] = round2(Abs($bal['credits']), $dec);
- $rep->AmountCol(5, 6, $init[1], $dec);
$init[2] = round2($bal['Allocated'], $dec);
- $rep->AmountCol(6, 7, $init[2], $dec);
$init[3] = round2($bal['OutStanding'], $dec);;
- $rep->AmountCol(7, 8, $init[3], $dec);
$total = array(0,0,0,0);
for ($i = 0; $i < 4; $i++)
{
$total[$i] += $init[$i];
$grandtotal[$i] += $init[$i];
}
- $rep->NewLine(1, 2);
$res = getTransactions($myrow['supplier_id'], $from, $to);
- if (db_num_rows($res)==0)
- continue;
+ if ($no_zeros && db_num_rows($res) == 0) continue;
+
+ $rep->fontSize += 2;
+ $rep->TextCol(0, 2, $myrow['name']);
+ if ($convert) $rep->TextCol(2, 3, $myrow['curr_code']);
+ $rep->fontSize -= 2;
+ $rep->TextCol(3, 4, _("Open Balance"));
+ $rep->AmountCol(4, 5, $init[0], $dec);
+ $rep->AmountCol(5, 6, $init[1], $dec);
+ $rep->AmountCol(6, 7, $init[2], $dec);
+ $rep->AmountCol(7, 8, $init[3], $dec);
+ $rep->NewLine(1, 2);
+ if (db_num_rows($res)==0) continue;
+
$rep->Line($rep->row + 4);
while ($trans=db_fetch($res))
{
+ if ($no_zeros && $trans['TotalAmount'] == 0 && $trans['Allocated'] == 0) continue;
$rep->NewLine(1, 2);
$rep->TextCol(0, 1, $systypes_array[$trans['type']]);
$rep->TextCol(1, 2, $trans['reference']);
$rep->End();
}
-?>
\ No newline at end of file
+?>
function print_aged_supplier_analysis()
{
- global $comp_path, $path_to_root, $systypes_array;
+ global $comp_path, $path_to_root, $systypes_array;
- $to = $_POST['PARAM_0'];
- $fromsupp = $_POST['PARAM_1'];
- $currency = $_POST['PARAM_2'];
+ $to = $_POST['PARAM_0'];
+ $fromsupp = $_POST['PARAM_1'];
+ $currency = $_POST['PARAM_2'];
$summaryOnly = $_POST['PARAM_3'];
- $graphics = $_POST['PARAM_4'];
- $comments = $_POST['PARAM_5'];
- $destination = $_POST['PARAM_6'];
+ $no_zeros = $_POST['PARAM_4'];
+ $graphics = $_POST['PARAM_5'];
+ $comments = $_POST['PARAM_6'];
+ $destination = $_POST['PARAM_7'];
if ($destination)
include_once($path_to_root . "/reporting/includes/excel_report.inc");
else
$from = _('All');
else
$from = get_supplier_name($fromsupp);
- $dec = user_price_dec();
+ $dec = user_price_dec();
if ($summaryOnly == 1)
$summary = _('Summary Only');
}
else
$convert = false;
+
+ if ($no_zeros) $nozeros = _('Yes');
+ else $nozeros = _('No');
+
$PastDueDays1 = get_company_pref('past_due_days');
$PastDueDays2 = 2 * $PastDueDays1;
$nowdue = "1-" . $PastDueDays1 . " " . _('Days');
$aligns = array('left', 'left', 'left', 'right', 'right', 'right', 'right', 'right');
- $params = array( 0 => $comments,
- 1 => array('text' => _('End Date'), 'from' => $to, 'to' => ''),
- 2 => array('text' => _('Supplier'), 'from' => $from, 'to' => ''),
- 3 => array('text' => _('Currency'),'from' => $currency,'to' => ''),
- 4 => array('text' => _('Type'), 'from' => $summary,'to' => ''));
+ $params = array( 0 => $comments,
+ 1 => array('text' => _('End Date'), 'from' => $to, 'to' => ''),
+ 2 => array('text' => _('Supplier'), 'from' => $from, 'to' => ''),
+ 3 => array('text' => _('Currency'),'from' => $currency,'to' => ''),
+ 4 => array('text' => _('Type'), 'from' => $summary,'to' => ''),
+ 5 => array('text' => _('Suppress Zeros'), 'from' => $nozeros, 'to' => ''));
if ($convert)
$headers[2] = _('currency');
- $rep = new FrontReport(_('Aged Supplier Analysis'), "AgedSupplierAnalysis", user_pagesize());
+ $rep = new FrontReport(_('Aged Supplier Analysis'), "AgedSupplierAnalysis", user_pagesize());
- $rep->Font();
- $rep->Info($params, $cols, $headers, $aligns);
- $rep->Header();
+ $rep->Font();
+ $rep->Info($params, $cols, $headers, $aligns);
+ $rep->Header();
$total = array();
$total[0] = $total[1] = $total[2] = $total[3] = $total[4] = 0.0;
while ($myrow=db_fetch($result))
{
- if (!$convert && $currency != $myrow['curr_code'])
- continue;
- $rep->fontSize += 2;
- $rep->TextCol(0, 2, $myrow['name']);
- if ($convert)
- {
- $rate = get_exchange_rate_from_home_currency($myrow['curr_code'], $to);
- $rep->TextCol(2, 3, $myrow['curr_code']);
- }
- else
- $rate = 1.0;
- $rep->fontSize -= 2;
+ if (!$convert && $currency != $myrow['curr_code']) continue;
+
+ if ($convert) $rate = get_exchange_rate_from_home_currency($myrow['curr_code'], $to);
+ else $rate = 1.0;
+
$supprec = get_supplier_details($myrow['supplier_id'], $to);
foreach ($supprec as $i => $value)
$supprec[$i] *= $rate;
- $total[0] += ($supprec["Balance"] - $supprec["Due"]);
- $total[1] += ($supprec["Due"]-$supprec["Overdue1"]);
- $total[2] += ($supprec["Overdue1"]-$supprec["Overdue2"]);
- $total[3] += $supprec["Overdue2"];
- $total[4] += $supprec["Balance"];
+
$str = array($supprec["Balance"] - $supprec["Due"],
$supprec["Due"]-$supprec["Overdue1"],
$supprec["Overdue1"]-$supprec["Overdue2"],
$supprec["Overdue2"],
$supprec["Balance"]);
+
+ if ($no_zeros && array_sum($str) == 0) continue;
+
+ $rep->fontSize += 2;
+ $rep->TextCol(0, 2, $myrow['name']);
+ if ($convert) $rep->TextCol(2, 3, $myrow['curr_code']);
+ $rep->fontSize -= 2;
+ $total[0] += ($supprec["Balance"] - $supprec["Due"]);
+ $total[1] += ($supprec["Due"]-$supprec["Overdue1"]);
+ $total[2] += ($supprec["Overdue1"]-$supprec["Overdue2"]);
+ $total[3] += $supprec["Overdue2"];
+ $total[4] += $supprec["Balance"];
for ($i = 0; $i < count($str); $i++)
$rep->AmountCol($i + 3, $i + 4, $str[$i], $dec);
$rep->NewLine(1, 2);
$rep->End();
}
-?>
\ No newline at end of file
+?>
function print_payment_report()
{
- global $path_to_root, $systypes_array;
-
- $to = $_POST['PARAM_0'];
- $fromsupp = $_POST['PARAM_1'];
- $currency = $_POST['PARAM_2'];
- $comments = $_POST['PARAM_3'];
- $destination = $_POST['PARAM_4'];
+ global $path_to_root, $systypes_array;
+
+ $to = $_POST['PARAM_0'];
+ $fromsupp = $_POST['PARAM_1'];
+ $currency = $_POST['PARAM_2'];
+ $no_zeros = $_POST['PARAM_3'];
+ $comments = $_POST['PARAM_4'];
+ $destination = $_POST['PARAM_5'];
if ($destination)
include_once($path_to_root . "/reporting/includes/excel_report.inc");
else
else
$from = get_supplier_name($fromsupp);
- $dec = user_price_dec();
+ $dec = user_price_dec();
if ($currency == ALL_TEXT)
{
else
$convert = false;
+ if ($no_zeros) $nozeros = _('Yes');
+ else $nozeros = _('No');
+
$cols = array(0, 100, 130, 190, 250, 320, 385, 450, 515);
$headers = array(_('Trans Type'), _('#'), _('Due Date'), '', '',
$aligns = array('left', 'left', 'left', 'left', 'right', 'right', 'right', 'right');
$params = array( 0 => $comments,
- 1 => array('text' => _('End Date'), 'from' => $to, 'to' => ''),
- 2 => array('text' => _('Supplier'), 'from' => $from, 'to' => ''),
- 3 => array( 'text' => _('Currency'),'from' => $currency, 'to' => ''));
+ 1 => array('text' => _('End Date'), 'from' => $to, 'to' => ''),
+ 2 => array('text' => _('Supplier'), 'from' => $from, 'to' => ''),
+ 3 => array( 'text' => _('Currency'),'from' => $currency, 'to' => ''),
+ 4 => array('text' => _('Suppress Zeros'), 'from' => $nozeros, 'to' => ''));
$rep = new FrontReport(_('Payment Report'), "PaymentReport", user_pagesize());
while ($myrow=db_fetch($result))
{
- if (!$convert && $currency != $myrow['curr_code'])
- continue;
+ if (!$convert && $currency != $myrow['curr_code']) continue;
+
+ $res = getTransactions($myrow['supplier_id'], $to);
+ if ($no_zeros && db_num_rows($res)==0) continue;
+
$rep->fontSize += 2;
$rep->TextCol(0, 6, $myrow['name'] . " - " . $myrow['terms']);
if ($convert)
$rep->TextCol(6, 7, $myrow['curr_code']);
$rep->fontSize -= 2;
$rep->NewLine(1, 2);
- $res = getTransactions($myrow['supplier_id'], $to);
if (db_num_rows($res)==0)
continue;
$rep->Line($rep->row + 4);
$total[0] = $total[1] = 0.0;
while ($trans=db_fetch($res))
{
- if ($convert)
- $rate = $trans['rate'];
- else
- $rate = 1.0;
+ if ($no_zeros && $trans['TranTotal'] == 0 && $trans['Balance'] == 0) continue;
+
+ if ($convert) $rate = $trans['rate'];
+ else $rate = 1.0;
+
$rep->NewLine(1, 2);
$rep->TextCol(0, 1, $systypes_array[$trans['type']]);
$rep->TextCol(1, 2, $trans['supp_reference']);
$rep->End();
}
-?>
\ No newline at end of file
+?>
function print_stock_check()
{
- global $comp_path, $path_to_root, $pic_height;
-
- $category = $_POST['PARAM_0'];
- $location = $_POST['PARAM_1'];
- $pictures = $_POST['PARAM_2'];
- $check = $_POST['PARAM_3'];
- $shortage = $_POST['PARAM_4'];
- $comments = $_POST['PARAM_5'];
- $destination = $_POST['PARAM_6'];
+ global $comp_path, $path_to_root, $pic_height;
+
+ $category = $_POST['PARAM_0'];
+ $location = $_POST['PARAM_1'];
+ $pictures = $_POST['PARAM_2'];
+ $check = $_POST['PARAM_3'];
+ $shortage = $_POST['PARAM_4'];
+ $no_zeros = $_POST['PARAM_5'];
+ $comments = $_POST['PARAM_6'];
+ $destination = $_POST['PARAM_7'];
if ($destination)
include_once($path_to_root . "/reporting/includes/excel_report.inc");
else
{
$short = _('No');
$available = _('Available');
- }
+ }
+ if ($no_zeros) $nozeros = _('Yes');
+ else $nozeros = _('No');
if ($check)
{
$cols = array(0, 100, 250, 295, 345, 390, 445, 515);
}
- $params = array( 0 => $comments,
- 1 => array('text' => _('Category'), 'from' => $cat, 'to' => ''),
- 2 => array('text' => _('Location'), 'from' => $loc, 'to' => ''),
- 3 => array('text' => _('Only Shortage'), 'from' => $short, 'to' => ''));
+ $params = array( 0 => $comments,
+ 1 => array('text' => _('Category'), 'from' => $cat, 'to' => ''),
+ 2 => array('text' => _('Location'), 'from' => $loc, 'to' => ''),
+ 3 => array('text' => _('Only Shortage'), 'from' => $short, 'to' => ''),
+ 4 => array('text' => _('Suppress Zeros'), 'from' => $nozeros, 'to' => ''));
if ($pictures)
$user_comp = user_company();
else
$user_comp = "";
- $rep = new FrontReport(_('Stock Check Sheets'), "StockCheckSheet", user_pagesize());
+ $rep = new FrontReport(_('Stock Check Sheets'), "StockCheckSheet", user_pagesize());
- $rep->Font();
- $rep->Info($params, $cols, $headers, $aligns);
- $rep->Header();
+ $rep->Font();
+ $rep->Info($params, $cols, $headers, $aligns);
+ $rep->Header();
$res = getTransactions($category, $location);
$catt = '';
$onorder = get_on_porder_qty($trans['stock_id'], $loc_code);
$flag = get_mb_flag($trans['stock_id']);
if ($flag == 'M')
- $onorder += get_on_worder_qty($trans['stock_id'], $loc_code);
+ $onorder += get_on_worder_qty($trans['stock_id'], $loc_code);
+ if ($no_zeros && $trans['QtyOnHand'] == 0 && $demandqty == 0 && $onorder == 0)
+ continue;
if ($shortage && $trans['QtyOnHand'] - $demandqty >= 0)
continue;
if ($catt != $trans['cat_description'])
_('End Date') => 'DATEENDM',
_('Customer') => 'CUSTOMERS_NO_FILTER',
_('Currency Filter') => 'CURRENCY',
+ _('Suppress Zeros') => 'YES_NO',
_('Comments') => 'TEXTBOX',
_('Destination') => 'DESTINATION'));
$reports->addReport(_('Customer'),102,_('&Aged Customer Analysis'),
_('Customer') => 'CUSTOMERS_NO_FILTER',
_('Currency Filter') => 'CURRENCY',
_('Summary Only') => 'YES_NO',
+ _('Suppress Zeros') => 'YES_NO',
_('Graphics') => 'GRAPHIC',
_('Comments') => 'TEXTBOX',
_('Destination') => 'DESTINATION'));
_('End Date') => 'DATEENDM',
_('Supplier') => 'SUPPLIERS_NO_FILTER',
_('Currency Filter') => 'CURRENCY',
+ _('Suppress Zeros') => 'YES_NO',
_('Comments') => 'TEXTBOX',
_('Destination') => 'DESTINATION'));
$reports->addReport(_('Supplier'),202,_('&Aged Supplier Analyses'),
_('Supplier') => 'SUPPLIERS_NO_FILTER',
_('Currency Filter') => 'CURRENCY',
_('Summary Only') => 'YES_NO',
+ _('Suppress Zeros') => 'YES_NO',
_('Graphics') => 'GRAPHIC',
_('Comments') => 'TEXTBOX',
_('Destination') => 'DESTINATION'));
array( _('End Date') => 'DATE',
_('Supplier') => 'SUPPLIERS_NO_FILTER',
_('Currency Filter') => 'CURRENCY',
+ _('Suppress Zeros') => 'YES_NO',
_('Comments') => 'TEXTBOX',
_('Destination') => 'DESTINATION'));
$reports->addReport(_('Supplier'),204,_('Outstanding &GRNs Report'),
_('Show Pictures') => 'YES_NO',
_('Inventory Column') => 'YES_NO',
_('Show Shortage') => 'YES_NO',
+ _('Suppress Zeros') => 'YES_NO',
_('Comments') => 'TEXTBOX',
_('Destination') => 'DESTINATION'));
$reports->addReport(_('Inventory'),304,_('Inventory &Sales Report'),
echo $reports->getDisplay();
end_page();
-?>
\ No newline at end of file
+?>