Minor change (show all quotations)
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 8 Sep 2009 09:50:58 +0000 (09:50 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 8 Sep 2009 09:50:58 +0000 (09:50 +0000)
sales/inquiry/sales_orders_view.php

index 9d42b4ad0b8ddba06ffbe74bea3063a02abce21d..c2940d082504d232f8c44d097df3e780217370f9 100644 (file)
@@ -86,9 +86,13 @@ else
 //
 function check_overdue($row)
 {
-       return ($row['type'] == 0
-               && date1_greater_date2(Today(), sql2date($row['ord_date']))
-               && ($row['TotDelivered'] < $row['TotQuantity']));
+       global $trans_type;
+       if ($trans_type == 32)
+               return (date1_greater_date2(Today(), sql2date($row['delivery_date'])));
+       else
+               return ($row['type'] == 0
+                       && date1_greater_date2(Today(), sql2date($row['ord_date']))
+                       && ($row['TotDelivered'] < $row['TotQuantity']));
 }
 
 function view_link($dummy, $order_no)
@@ -219,6 +223,8 @@ locations_list_cells(_("Location:"), 'StockLocation', null, true);
 
 stock_items_list_cells(_("Item:"), 'SelectStockFromList', null, true);
 
+if ($trans_type == 32)
+       check_cells(_("Show All:"), 'show_all');
 submit_cells('SearchOrders', _("Search"),'',_('Select documents'), 'default');
 
 hidden('order_view_mode', $_POST['order_view_mode']);
@@ -274,6 +280,8 @@ else        // ... or select inquiry constraints
                $sql .=  " AND sorder.ord_date >= '$date_after'"
                                ." AND sorder.ord_date <= '$date_before'";
        }
+       if ($trans_type == 32 && !check_value('show_all'))
+               $sql .= " AND sorder.delivery_date >= '".date2sql(Today())."'";
        if ($selected_customer != -1)
                $sql .= " AND sorder.debtor_no='" . $selected_customer . "'";