3
* InvoiceItemTableWidget.class.php
5
* This file contains the definition of the InvoiceItemTableWidget class.
8
* @author John Diamond <jdiamond@solid-state.org>
9
* @copyright John Diamond <jdiamond@solid-state.org>
10
* @license http://www.opensource.org/licenses/gpl-license.php GNU Public License
14
* InvoiceItemTableWidget
17
* @author John Diamond <jdiamond@solid-state.org>
19
class InvoiceItemTableWidget extends TableWidget
22
* @var integer Invoice ID
24
private $invoiceID = null;
27
* Initialize the Table
29
* @param array $params Parameters from the {form_table} tag
31
public function init( $params )
33
parent::init( $params );
35
// Build an InvoiceItem filter
36
$where = isset( $this->invoiceID ) ?
37
sprintf( "invoiceid='%d'", $this->invoiceID ) : null;
39
// Load the InvoiceItem Table
43
$items = load_array_InvoiceItemDBO( $where );
44
foreach( $items as $dbo )
46
// Put the row into the table
48
array( "id" => $dbo->getID(),
49
"text" => $dbo->getText(),
50
"unitamount" => $dbo->getUnitAmount(),
51
"quantity" => $dbo->getQuantity(),
52
"amount" => $dbo->getAmount() );
55
catch( DBNoRowsFoundException $e ) {}
61
* @param integer $id Invoice ID
63
public function setInvoiceID( $id ) { $this->invoiceID = $id; }
b'\\ No newline at end of file'