<field reporter:label="Total Cost Billed" name="total_cost_billed" reporter:datatype="money"/>
<field reporter:label="Total Actual Cost" name="total_actual_cost" reporter:datatype="money"/>
<field reporter:label="Total Amount Paid" name="total_amount_paid" reporter:datatype="money"/>
+ <field reporter:label="Close Date" name="close_date" reporter:datatype="timestamp"/>
+ <field reporter:label="Closed By" name="closed_by" reporter:datatype="link"/>
</fields>
<links>
<link field="inv_id" reltype="has_a" key="id" map="" class="acqinv"/>
<link field="provider_id" reltype="has_a" key="id" map="" class="acqpro"/>
<link field="shipper_id" reltype="might_have" key="id" map="" class="acqpro"/>
+ <link field="closed_by" reltype="might_have" key="id" map="" class="au"/>
</links>
</class>
<class id="raposv" controller="open-ils.reporter-store" oils_obj:fieldmapper="reporter::acq_purchase_order_summary_view" oils_persist:tablename="reporter.acq_purchase_order_summary_view" reporter:label="Acquisitions Purchase Order Summary">
invoice.payment_method,
raitcb.total_cost_billed AS total_cost_billed,
raitac.total_actual_cost AS total_actual_cost,
- raitap.total_amount_paid AS total_amount_paid
+ raitap.total_amount_paid AS total_amount_paid,
+ invoice.close_date,
+ invoice.closed_by
FROM acq.invoice invoice
JOIN reporter.acq_invoice_total_cost_billed raitcb ON (raitcb.invoice = invoice.id)
JOIN reporter.acq_invoice_total_actual_cost raitac ON (raitac.invoice = invoice.id)
(SELECT COALESCE(SUM(amount), '0.00')
FROM acq.fund_debit afd
WHERE afd.encumbrance = TRUE
- AND afd.id IN (
+ AND (afd.id IN (
SELECT fund_debit
FROM acq.lineitem_detail lid
WHERE lineitem IN (
SELECT fund_debit
FROM acq.invoice_item
WHERE purchase_order = po.id
- )) AS amount_encumbered,
+ ))) AS amount_encumbered,
-- amount_spent
(SELECT COALESCE(SUM(amount), '0.00')
FROM acq.fund_debit afd