<field reporter:label="Actual Cost" name="actual_cost" reporter:datatype="money" />
<field reporter:label="Fund" name="fund" reporter:datatype="link" />
<field reporter:label="Amount Paid" name="amount_paid" reporter:datatype="money" />
+ <field reporter:label="Purchase Order Item" name="po_item" reporter:datatype="link" />
</fields>
<links>
<link field="invoice" reltype="has_a" key="id" map="" class="acqinv"/>
<link field="fund_debit" reltype="has_a" key="id" map="" class="acqfdeb"/>
<link field="inv_item_type" reltype="has_a" key="code" map="" class="aiit"/>
<link field="fund" reltype="has_a" key="id" map="" class="acqf"/>
+ <link field="po_item" reltype="has_a" key="id" map="" class="acqpoi"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<actions>
prorate BOOL NOT NULL DEFAULT FALSE
);
-CREATE TABLE acq.invoice_item ( -- for invoice-only debits: taxes/fees/non-bib items/etc
- id SERIAL PRIMARY KEY,
- invoice INT NOT NULL REFERENCES acq.invoice (id) ON UPDATE CASCADE ON DELETE CASCADE,
- purchase_order INT REFERENCES acq.purchase_order (id) ON UPDATE CASCADE ON DELETE SET NULL,
- fund_debit INT REFERENCES acq.fund_debit (id),
- inv_item_type TEXT NOT NULL REFERENCES acq.invoice_item_type (code),
- title TEXT,
- author TEXT,
- note TEXT,
- cost_billed NUMERIC(8,2),
- actual_cost NUMERIC(8,2),
- fund INT REFERENCES acq.fund (id)
- DEFERRABLE INITIALLY DEFERRED,
- amount_paid NUMERIC (8,2)
-);
-
CREATE TABLE acq.po_item (
id SERIAL PRIMARY KEY,
purchase_order INT REFERENCES acq.purchase_order (id)
DEFERRABLE INITIALLY DEFERRED
);
+CREATE TABLE acq.invoice_item ( -- for invoice-only debits: taxes/fees/non-bib items/etc
+ id SERIAL PRIMARY KEY,
+ invoice INT NOT NULL REFERENCES acq.invoice (id) ON UPDATE CASCADE ON DELETE CASCADE,
+ purchase_order INT REFERENCES acq.purchase_order (id) ON UPDATE CASCADE ON DELETE SET NULL,
+ fund_debit INT REFERENCES acq.fund_debit (id),
+ inv_item_type TEXT NOT NULL REFERENCES acq.invoice_item_type (code),
+ title TEXT,
+ author TEXT,
+ note TEXT,
+ cost_billed NUMERIC(8,2),
+ actual_cost NUMERIC(8,2),
+ fund INT REFERENCES acq.fund (id)
+ DEFERRABLE INITIALLY DEFERRED,
+ amount_paid NUMERIC (8,2),
+ po_item INT REFERENCES acq.po_item (id)
+ DEFERRABLE INITIALLY DEFERRED
+);
+
-- Patron requests
CREATE TABLE acq.user_request_type (
id SERIAL PRIMARY KEY,