<field reporter:label="User" name="usr" oils_obj:array_position="4" oils_persist:virtual="false" reporter:datatype="link"/>
<field reporter:label="Transaction Finish Date/Time" name="xact_finish" oils_obj:array_position="5" oils_persist:virtual="false" reporter:datatype="timestamp"/>
<field reporter:label="Transaction Start Date/Time" name="xact_start" oils_obj:array_position="6" oils_persist:virtual="false" reporter:datatype="timestamp"/>
- <field reporter:label="Grocery Billing link" name="grocery" oils_obj:array_position="7" oils_persist:virtual="true" reporter:datatype="link"/>
- <field reporter:label="Circulation Billing link" name="circulation" oils_obj:array_position="8" oils_persist:virtual="true" reporter:datatype="link"/>
- <field reporter:label="Billing Line Items" name="billings" oils_obj:array_position="9" oils_persist:virtual="true" reporter:datatype="link"/>
- <field reporter:label="Payment Line Items" name="payments" oils_obj:array_position="10" oils_persist:virtual="true" reporter:datatype="link"/>
- <field reporter:label="Billing Totals" name="billing_total" oils_obj:array_position="11" oils_persist:virtual="true" reporter:datatype="money"/>
- <field reporter:label="Payment Totals" name="payment_total" oils_obj:array_position="12" oils_persist:virtual="true" reporter:datatype="money"/>
+ <field reporter:label="Unrecovered Debt" name="unrecovered" oils_obj:array_position="7" oils_persist:virtual="false" reporter:datatype="bool"/>
+ <field reporter:label="Grocery Billing link" name="grocery" oils_obj:array_position="8" oils_persist:virtual="true" reporter:datatype="link"/>
+ <field reporter:label="Circulation Billing link" name="circulation" oils_obj:array_position="9" oils_persist:virtual="true" reporter:datatype="link"/>
+ <field reporter:label="Billing Line Items" name="billings" oils_obj:array_position="10" oils_persist:virtual="true" reporter:datatype="link"/>
+ <field reporter:label="Payment Line Items" name="payments" oils_obj:array_position="11" oils_persist:virtual="true" reporter:datatype="link"/>
+ <field reporter:label="Billing Totals" name="billing_total" oils_obj:array_position="12" oils_persist:virtual="true" reporter:datatype="money"/>
+ <field reporter:label="Payment Totals" name="payment_total" oils_obj:array_position="13" oils_persist:virtual="true" reporter:datatype="money"/>
</fields>
<links>
<link field="grocery" reltype="might_have" key="id" map="" class="mg"/>
use base qw/money/;
__PACKAGE__->table('money_billable_xact');
__PACKAGE__->columns(Primary => 'id');
-__PACKAGE__->columns(Essential => qw/xact_start usr xact_finish/);
+__PACKAGE__->columns(Essential => qw/xact_start usr xact_finish unrecovered/);
#-------------------------------------------------------------------------------
package money::grocery;
argc => 3,
);
+sub mark_unrecovered {
+ my $self = shift;
+ my $xact = shift;
+
+ my $x = money::billable_xact->retrieve($xact);
+ $x->unrecovered( 't' );
+ return $x->update;
+}
+__PACKAGE__->register_method(
+ method => 'mark_unrecovered',
+ api_name => 'open-ils.storage.money.billable_xact.mark_unrecovered',
+ argc => 1,
+);
+
1;
CREATE UNIQUE INDEX m_c_t_usr_collector_location_once_idx ON money.collections_tracker (usr, collector, location);
CREATE TABLE money.billable_xact (
- id BIGSERIAL PRIMARY KEY,
- usr INT NOT NULL, -- actor.usr.id
- xact_start TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
- xact_finish TIMESTAMP WITH TIME ZONE
+ id BIGSERIAL PRIMARY KEY,
+ usr INT NOT NULL, -- actor.usr.id
+ xact_start TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW(),
+ xact_finish TIMESTAMP WITH TIME ZONE,
+ unrecovered BOOL
);
CREATE INDEX m_b_x_open_xacts_idx ON money.billable_xact (usr);