Added invoice preselection option.
[fa-stable.git] / purchasing / includes / po_class.inc
index 198912c0f33752f5169fe5b25dc2c9b712264d37..6ee90e1183ba0c04a06f254825f255f3b76af2c2 100644 (file)
@@ -1,13 +1,13 @@
 <?php
 /**********************************************************************
     Copyright (C) FrontAccounting, LLC.
-       Released under the terms of the GNU Affero General Public License,
-       AGPL, as published by the Free Software Foundation, either version 
-       of the License, or (at your option) any later version.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
-    See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
 /* Definition of the purch_order class to hold all the information for a purchase order and delivery
 */
@@ -43,9 +43,9 @@ class purch_order
                {
                        $this->line_items[$line_no] = new line_details($line_no, $stock_id, $item_descr, $qty, $price, $uom, $req_del_date, $qty_inv, $qty_recd);
                        $this->lines_on_order++;
-                       Return 1;
+                       return 1;
                }
-               Return 0;
+               return 0;
        }
 
        function update_order_item($line_no, $qty, $price, $req_del_date)
@@ -58,22 +58,12 @@ class purch_order
 
        function remove_from_order($line_no)
        {
-                $this->line_items[$line_no]->Deleted = true;
+               array_splice($this->line_items, $line_no, 1);
        }
        
        function order_has_items() 
        {
-               if (count($this->line_items) > 0)
-               {
-                       foreach ($this->line_items as $ordered_items) 
-                       {
-                               if ($ordered_items->Deleted == false)
-                               {
-                                       return true;
-                               }
-                       }
-               }
-               return false;           
+               return count($this->line_items) != 0;
        }
        
        function clear_items() 
@@ -120,19 +110,18 @@ class purch_order
 class line_details 
 {
 
-       Var $line_no;
-       Var $po_detail_rec;
-       Var $stock_id;
-       Var $item_description;
-       Var $quantity;
-       Var $price;
-       Var $units;
-       Var $req_del_date;
-       Var $qty_inv;
-       Var $qty_received;
-       Var $standard_cost;
-       Var $receive_qty;
-       Var $Deleted;   
+       var $line_no;
+       var $po_detail_rec;
+       var $stock_id;
+       var $item_description;
+       var $quantity;
+       var $price;
+       var $units;
+       var $req_del_date;
+       var $qty_inv;
+       var $qty_received;
+       var $standard_cost;
+       var $receive_qty;
        
        function line_details($line_no, $stock_item, $item_descr, $qty, $prc, $uom, $req_del_date, $qty_inv, $qty_recd)
        {
@@ -149,7 +138,6 @@ class line_details
                $this->qty_inv = $qty_inv;
                $this->receive_qty = 0; /*initialise these last two only */
                $this->standard_cost =0;
-               $this->Deleted = false;
        }
 }