From 5daf2c3c02999a034ee808b05b2ee14e95d552d8 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 24 Aug 2006 17:01:48 +0000 Subject: [PATCH] stripping $ in money blobs to be safe git-svn-id: svn://svn.open-ils.org/ILS/trunk@5655 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Cat.pm | 10 ++++++++++ Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm | 14 ++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm b/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm index a0b610912a..0eec9583e8 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Cat.pm @@ -1031,6 +1031,13 @@ sub update_fleshed_copies { return undef; } +sub fix_copy_price { + my $copy = shift; + my $p = $copy->price || 0; + $p =~ s/\$//og; + $copy->price($p); +} + sub update_copy { my( $editor, $override, $vol, $copy ) = @_; @@ -1041,6 +1048,8 @@ sub update_copy { $copy->editor($editor->requestor->id); $copy->edit_date('now'); + + fix_copy_price($copy); return $editor->event unless $editor->update_asset_copy( $copy, {checkperm=>1, permorg=>$vol->owning_lib}); @@ -1120,6 +1129,7 @@ sub create_copy { $copy->clear_id; $copy->creator($editor->requestor->id); $copy->create_date('now'); + fix_copy_price($copy); $editor->create_asset_copy( $copy, {checkperm=>1, permorg=>$vol->owning_lib}) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm index 8af6fd8b40..d8bac452f9 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Money.pm @@ -79,6 +79,8 @@ sub make_payments { my $transid = $pay->[0]; my $amount = $pay->[1]; + $amount =~ s/\$//og; # just to be safe + ($trans, $evt) = $apputils->fetch_open_billable_transaction($transid); return $evt if $evt; @@ -138,12 +140,6 @@ sub make_payments { if( !$circ || $circ->stop_fines ) { $trans->xact_finish("now"); - - use Data::Dumper; - warn Dumper($trans); - - warn "calling open-ils.storage.direct.money.billable_transaction.update\n"; - my $s = $session->request( "open-ils.storage.direct.money.billable_transaction.update", $trans )->gather(1); @@ -293,8 +289,6 @@ sub create_grocery_bill { $apputils->commit_db_session($session); - - return $transid; } @@ -351,6 +345,10 @@ sub billing_items_create { or return $e->event; } + my $amt = $billing->amount; + $amt =~ s/\$//og; + $billing->amount($amt); + $e->create_money_billing($billing) or return $e->event; $e->commit; -- 2.11.0