$fromsupp = $_POST['PARAM_4'];
$item = $_POST['PARAM_5'];
$comments = $_POST['PARAM_6'];
- $destination = $_POST['PARAM_7'];
+ $orientation = $_POST['PARAM_7'];
+ $destination = $_POST['PARAM_8'];
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();
if ($category == ALL_NUMERIC)
4 => array('text' => _('Supplier'), 'from' => $froms, 'to' => ''),
5 => array('text' => _('Item'), 'from' => $itm, 'to' => ''));
- $rep = new FrontReport(_('Inventory Purchasing Report'), "InventoryPurchasingReport", user_pagesize());
+ $rep = new FrontReport(_('Inventory Purchasing Report'), "InventoryPurchasingReport", user_pagesize(), 9, $orientation);
+ if ($orientation == 'L')
+ recalculate_cols($cols);
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$total = $total_supp = $grandtotal = 0.0;
$total_qty = 0.0;
- $catt = $stock_description = $supplier_name = '';
+ $catt = $stock_description = $stock_id = $supplier_name = '';
while ($trans=db_fetch($res))
{
if ($stock_description != $trans['description'])
$rep->TextCol(0, 1, _('Total'));
$rep->TextCol(1, 4, $stock_description);
$rep->TextCol(4, 5, $supplier_name);
- $rep->TextCol(5, 7, $total_qty);
+ $rep->AmountCol(5, 7, $total_qty, get_qty_dec($stock_id));
$rep->AmountCol(7, 8, $total_supp, $dec);
$rep->Line($rep->row - 2);
$rep->NewLine();
$supplier_name = $trans['supplier_name'];
}
}
+ $stock_id = $trans['stock_id'];
$stock_description = $trans['description'];
}
$rep->TextCol(0, 1, _('Total'));
$rep->TextCol(1, 4, $stock_description);
$rep->TextCol(4, 5, $supplier_name);
- $rep->TextCol(5, 7, $total_qty);
+ $rep->AmountCol(5, 7, $total_qty, get_qty_dec($stock_id));
$rep->AmountCol(7, 8, $total_supp, $dec);
$rep->Line($rep->row - 2);
$rep->NewLine();
if ($fromsupp == ALL_TEXT)
{
$rep->TextCol(1, 2, $trans['description'].($trans['inactive']==1 ? " ("._("Inactive").")" : ""), -1);
- $rep->TextCol(2, 3, $trans['tran_date']);
+ $rep->TextCol(2, 3, sql2date($trans['tran_date']));
$rep->TextCol(3, 4, $trans['supp_reference']);
$rep->TextCol(4, 5, $trans['supplier_name']);
}
else
{
$rep->TextCol(1, 2, $trans['description'].($trans['inactive']==1 ? " ("._("Inactive").")" : ""), -1);
- $rep->TextCol(2, 3, $trans['tran_date']);
+ $rep->TextCol(2, 3, sql2date($trans['tran_date']));
$rep->TextCol(3, 4, $trans['supp_reference']);
}
$rep->AmountCol(5, 6, $trans['qty'], get_qty_dec($trans['stock_id']));
$rep->TextCol(0, 1, _('Total'));
$rep->TextCol(1, 4, $stock_description);
$rep->TextCol(4, 5, $supplier_name);
- $rep->TextCol(5, 7, $total_qty);
+ $rep->AmountCol(5, 7, $total_qty, get_qty_dec($stock_id));
$rep->AmountCol(7, 8, $total_supp, $dec);
$rep->Line($rep->row - 2);
$rep->NewLine();
$rep->TextCol(0, 1, _('Total'));
$rep->TextCol(1, 4, $stock_description);
$rep->TextCol(4, 5, $supplier_name);
- $rep->TextCol(5, 7, $total_qty);
+ $rep->AmountCol(5, 7, $total_qty, get_qty_dec($stock_id));
$rep->AmountCol(7, 8, $total_supp, $dec);
$rep->Line($rep->row - 2);
$rep->NewLine();