<?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
- 3 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
*/
{
$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)
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()
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)
{
$this->qty_inv = $qty_inv;
$this->receive_qty = 0; /*initialise these last two only */
$this->standard_cost =0;
- $this->Deleted = false;
}
}