From 341e5d2fc78168d5560647e3b82dbbef83dc56a7 Mon Sep 17 00:00:00 2001 From: miker Date: Tue, 12 Sep 2006 00:03:54 +0000 Subject: [PATCH] finishing up mbts thingy git-svn-id: svn://svn.open-ils.org/ILS/trunk@6068 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../src/perlmods/OpenILS/Application/Storage/CDBI.pm | 9 +++++---- .../OpenILS/Application/Storage/Publisher/money.pm | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm index 97c66860e8..8603475128 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm @@ -572,8 +572,8 @@ sub modify_from_fieldmapper { actor::org_unit->has_many( checkins => 'action::circulation' => 'checkin_lib' ); money::billable_transaction->has_a( usr => 'actor::user' ); - money::billable_transaction->might_have( circulation => 'action::circulation' ); - money::billable_transaction->might_have( grocery => 'money::grocery' ); + #money::billable_transaction->might_have( circulation => 'action::circulation' ); + #money::billable_transaction->might_have( grocery => 'money::grocery' ); actor::user->has_many( billable_transactions => 'action::circulation' => 'usr' ); @@ -612,6 +612,9 @@ sub modify_from_fieldmapper { metabib::metarecord->has_many( source_records => [ 'metabib::metarecord_source_map' => 'source'] ); biblio::record_entry->has_many( metarecords => [ 'metabib::metarecord_source_map' => 'metarecord'] ); + money::billing->has_a( xact => 'money::billable_transaction' ); + money::payment->has_a( xact => 'money::billable_transaction' ); + money::billable_transaction->has_many( billings => 'money::billing' ); money::billable_transaction->has_many( payments => 'money::payment' ); @@ -634,8 +637,6 @@ sub modify_from_fieldmapper { money::grocery->has_many( payments => 'money::payment' => 'xact' ); #money::grocery->might_have( billable_transaction => 'money::billable_transaction' ); - money::billing->has_a( xact => 'money::billable_transaction' ); - money::payment->has_a( xact => 'money::billable_transaction' ); #money::payment->might_have( cash_payment => 'money::cash_payment' ); #money::payment->might_have( check_payment => 'money::check_payment' ); #money::payment->might_have( credit_card_payment => 'money::credit_card_payment' ); 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 c2818b4faa..cce232bc83 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm @@ -18,7 +18,7 @@ sub _make_mbts { my $to = 0; my $lb = undef; for my $b ($x->billings) { - next if ($U->is_true($b->voided)); + next if ($b->voided); $to += int($b->amount * 100); $lb ||= $b->billing_ts; if ($b->billing_ts ge $lb) { @@ -34,7 +34,7 @@ sub _make_mbts { my $tp = 0; my $lp = undef; for my $p ($x->payments) { - next if ($U->is_true($p->voided)); + next if ($p->voided); $tp += int($p->amount * 100); $lp ||= $p->payment_ts; if ($p->payment_ts ge $lp) { @@ -48,8 +48,8 @@ sub _make_mbts { $s->balance_owed( sprintf('%0.2f', int($to - $tp) / 100) ); - $s->xact_type( 'grocery' ) if ($x->grocery); - $s->xact_type( 'circulation' ) if ($x->circulation); + $s->xact_type( 'grocery' ) if (money::grocery->retrieve($x->id)); + $s->xact_type( 'circulation' ) if (action::circulation->retrieve($x->id)); push @mbts, $s; } @@ -62,7 +62,7 @@ sub search_mbts { my $client = shift; my $search = shift; - my @xacts = money::billable_xact->search_where( $search ); + my @xacts = money::billable_transaction->search_where( $search ); $client->respond( $_ ) for (_make_mbts(@xacts)); return undef; -- 2.43.2