*** empty log message ***
[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         qty_cell($stock_item->qty_received);
46         label_cell($stock_item->units);
47         amount_cell($stock_item->price);
48         amount_cell($line_total);
49         qty_cell($stock_item->qty_inv);
50         end_row();
51
52         $total += $line_total;
53 }
54
55 $display_total = number_format2($total,user_price_dec());
56 label_row(_("Total Excluding Tax/Shipping"),  $display_total, 
57         "colspan=6", "nowrap align=right");
58
59 end_table(1);
60
61 is_voided_display(25, $_GET['trans_no'], _("This delivery has been voided."));
62
63 end_page(true);
64
65 ?>