From 4f155e7361953f62d5d04c607e0aa305021a9019 Mon Sep 17 00:00:00 2001 From: miker Date: Sun, 28 Sep 2008 19:24:46 +0000 Subject: [PATCH] backend support for marking unrecovered debt git-svn-id: svn://svn.open-ils.org/ILS/trunk@10717 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/examples/fm_IDL.xml | 13 +++++++------ .../OpenILS/Application/Storage/CDBI/money.pm | 2 +- .../OpenILS/Application/Storage/Publisher/money.pm | 14 ++++++++++++++ Open-ILS/src/sql/Pg/080.schema.money.sql | 9 +++++---- 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 310fdd18a4..fd7274b114 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -2503,12 +2503,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - - - - - - + + + + + + + diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm index e458bc7b01..5e32636251 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm @@ -17,7 +17,7 @@ package money::billable_transaction; 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; diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm index b8cbe080a2..b049a0aae0 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm @@ -513,5 +513,19 @@ __PACKAGE__->register_method( 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; diff --git a/Open-ILS/src/sql/Pg/080.schema.money.sql b/Open-ILS/src/sql/Pg/080.schema.money.sql index b0da2dac4b..acebaca30e 100644 --- a/Open-ILS/src/sql/Pg/080.schema.money.sql +++ b/Open-ILS/src/sql/Pg/080.schema.money.sql @@ -31,10 +31,11 @@ CREATE TABLE money.collections_tracker ( 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); -- 2.43.2