Changed the Quantity routines to use the Item Units decimals if any. A lot of files.
[fa-stable.git] / purchasing / view / view_grn.php
1 <?php
2
3 $page_security = 2;
4 $path_to_root="../..";
5 include($path_to_root . "/purchasing/includes/po_class.inc");
6
7 include($path_to_root . "/includes/session.inc");
8 page(_("View Purchase Order Delivery"), true);
9
10 include($path_to_root . "/purchasing/includes/purchasing_ui.inc");
11
12 if (!isset($_GET['trans_no']))
13 {
14         die ("<BR>" . _("This page must be called with a Purchase Order Delivery number to review."));
15 }
16
17 $purchase_order = new purch_order;
18 read_grn($_GET["trans_no"], $purchase_order);
19
20 display_heading(_("Purchase Order Delivery") . " #" . $_GET['trans_no']);
21 echo "<BR>";
22 display_grn_summary($purchase_order);
23
24 display_heading2(_("Line Details"));
25
26 start_table("colspan=9 $table_style width=90%");
27 $th = array(_("Item Code"), _("Item Description"), _("Delivery Date"), _("Quantity"),
28         _("Unit"), _("Price"), _("Line Total"), _("Quantity Invoiced"));
29
30 table_header($th);
31
32 $total = 0;
33 $k = 0;  //row colour counter
34
35 foreach ($purchase_order->line_items as $stock_item)
36 {
37
38         $line_total = $stock_item->qty_received * $stock_item->price;
39
40         alt_table_row_color($k);
41
42         label_cell($stock_item->stock_id);
43         label_cell($stock_item->item_description);
44         label_cell($stock_item->req_del_date, "nowrap align=right");
45         $dec = get_qty_dec($stock_item->stock_id);
46         qty_cell($stock_item->qty_received, false, $dec);
47         label_cell($stock_item->units);
48         amount_cell($stock_item->price);
49         amount_cell($line_total);
50         qty_cell($stock_item->qty_inv, false, $dec);
51         end_row();
52
53         $total += $line_total;
54 }
55
56 $display_total = number_format2($total,user_price_dec());
57 label_row(_("Total Excluding Tax/Shipping"),  $display_total,
58         "colspan=6", "nowrap align=right");
59
60 end_table(1);
61
62 is_voided_display(25, $_GET['trans_no'], _("This delivery has been voided."));
63
64 end_page(true);
65
66 ?>