$SubTotal = 0;
while ($myrow2=db_fetch($result))
{
+ $data = get_purchase_data($myrow['supplier_id'], $myrow2['item_code']);
+ if ($data !== false)
+ {
+ if ($data['supplier_description'] != "")
+ $myrow2['description'] = $data['supplier_description'];
+ if ($data['suppliers_uom'] != "")
+ $myrow2['units'] = $data['suppliers_uom'];
+ if ($data['conversion_factor'] != 1)
+ {
+ $myrow2['unit_price'] = round($myrow2['unit_price'] / $data['conversion_factor'], user_price_dec());
+ $myrow2['quantiry_ordered'] = round($myrow2['quantiry_ordered'] / $data['conversion_factor'], user_qty_dec());
+ }
+ }
$Net = round(($myrow2["unit_price"] * $myrow2["quantity_ordered"]),
user_price_dec());
$SubTotal += $Net;
$DisplayNet = number_format2($Net,$dec);
//$rep->TextCol(0, 1, $myrow2['item_code'], -2);
$rep->TextCol(0, 2, $myrow2['description'], -2);
- $rep->TextCol(2, 3, $myrow2['delivery_date'], -2);
+ $rep->TextCol(2, 3, sql2date($myrow2['delivery_date']), -2);
$rep->TextCol(3, 4, $DisplayQty, -2);
$rep->TextCol(4, 5, $myrow2['units'], -2);
$rep->TextCol(5, 6, $DisplayPrice, -2);
$rep->TextCol(6, 7, $DisplayNet, -2);
$rep->NewLine(1);
if ($rep->row < $rep->bottomMargin + (15 * $rep->lineHeight))
- $rep->Header2($myrow, $branch, $sales_order, $baccount);
+ $rep->Header2($myrow, $branch, $myrow, $baccount, 8);
}
if ($myrow['comments'] != "")
{