[open-ils-commits] r10717 - in trunk/Open-ILS: examples src/perlmods/OpenILS/Application/Storage/CDBI src/perlmods/OpenILS/Application/Storage/Publisher src/sql/Pg

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Sep 28 15:24:50 EDT 2008


Author: miker
Date: 2008-09-28 15:24:46 -0400 (Sun, 28 Sep 2008)
New Revision: 10717

Modified:
   trunk/Open-ILS/examples/fm_IDL.xml
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm
   trunk/Open-ILS/src/sql/Pg/080.schema.money.sql
Log:
backend support for marking unrecovered debt

Modified: trunk/Open-ILS/examples/fm_IDL.xml
===================================================================
--- trunk/Open-ILS/examples/fm_IDL.xml	2008-09-28 02:45:06 UTC (rev 10716)
+++ trunk/Open-ILS/examples/fm_IDL.xml	2008-09-28 19:24:46 UTC (rev 10717)
@@ -2503,12 +2503,13 @@
 			<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"/>

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm	2008-09-28 02:45:06 UTC (rev 10716)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm	2008-09-28 19:24:46 UTC (rev 10717)
@@ -17,7 +17,7 @@
 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;

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm	2008-09-28 02:45:06 UTC (rev 10716)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm	2008-09-28 19:24:46 UTC (rev 10717)
@@ -513,5 +513,19 @@
 	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;

Modified: trunk/Open-ILS/src/sql/Pg/080.schema.money.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/080.schema.money.sql	2008-09-28 02:45:06 UTC (rev 10716)
+++ trunk/Open-ILS/src/sql/Pg/080.schema.money.sql	2008-09-28 19:24:46 UTC (rev 10717)
@@ -31,10 +31,11 @@
 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);
 



More information about the open-ils-commits mailing list