Feature 5388: Print Invoices (documents) list gets too long. Fixed by default 180...
[fa-stable.git] / purchasing / view / view_grn.php
index d06e8ebffd5fb3e969ec47e16eed127fe02f3dff..b2d95bb8e26390226249069d414976456536ef51 100644 (file)
@@ -16,7 +16,7 @@ include($path_to_root . "/purchasing/includes/po_class.inc");
 include($path_to_root . "/includes/session.inc");
 
 $js = "";
-if ($use_popup_windows)
+if ($SysPrefs->use_popup_windows)
        $js .= get_js_open_window(900, 500);
 page(_($help_context = "View Purchase Order Delivery"), true, false, "", $js);
 
@@ -37,20 +37,30 @@ display_grn_summary($purchase_order);
 display_heading2(_("Line Details"));
 
 start_table(TABLESTYLE, "width='90%'");
-$th = array(_("Item Code"), _("Item Description"), _("Delivery Date"), _("Quantity"),
+$th = array(_("Item Code"), _("Item Description"), _("Required by"), _("Quantity"),
        _("Unit"), _("Price"), _("Line Total"), _("Quantity Invoiced"));
 
 table_header($th);
 
 $total = 0;
 $k = 0;  //row colour counter
+$overdue_items = false;
 
 foreach ($purchase_order->line_items as $stock_item)
 {
 
        $line_total = $stock_item->qty_received * $stock_item->price;
 
-       alt_table_row_color($k);
+       // if overdue and outstanding quantities, then highlight as so
+       if (date1_greater_date2($purchase_order->orig_order_date, $stock_item->req_del_date))
+       {
+       start_row("class='overduebg'");
+       $overdue_items = true;
+       }
+       else
+       {
+               alt_table_row_color($k);
+       }
 
        label_cell($stock_item->stock_id);
        label_cell($stock_item->item_description);
@@ -83,8 +93,10 @@ end_row();
 
 end_table(1);
 
+if ($overdue_items)
+       display_note(_("Marked items were delivered overdue."), 0, 0, "class='overduefg'");
+
 is_voided_display(ST_SUPPRECEIVE, $_GET['trans_no'], _("This delivery has been voided."));
 
 end_page(true, false, false, ST_SUPPRECEIVE, $_GET['trans_no']);
 
-?>