function __construct($orderId, $date, $supplierid, $total, $user) { $this->id = $orderId; $this->transactionId = $orderId; $this->date = $date; $this->type = 'Purchase Order'; //$this->description = 'Order for items'; $this->party = Supplier::GetSupplier($supplierid); $this->amount = floatval($total); $this->total = floatval($total); if (is_null($user)) { $this->user = SessionManager::GetUsername(); } else { $this->user = $user; } $this->lineItems = PurchaseOrderLine::GetOrderItems($orderId); $this->description = ''; foreach ($this->lineItems as $item) { $this->description .= $item->quantity . ' x ' . $item->itemName . ', '; } }