From eeef609466ac7215dd03b2188b5975a5d0412603 Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Wed, 23 Jul 2008 20:02:21 -0500 Subject: [PATCH] Remove 'Cash Refund' from manual invoice, as it calls a deprecated function. Change the code for 'forgiven' from 'F' to 'FOR', since 'F' is used for 'Fine' elsewhere in the code. Mark other subroutines as deprecated that utilize the accountoffsets table, since that functionality was lost somewhere in the 2.2 series, and half-using it breaks things. Signed-off-by: Joshua Ferraro --- C4/Accounts.pm | 78 +++++++++++-------- .../prog/en/modules/members/mancredit.tmpl | 2 +- .../prog/en/modules/members/maninvoice.tmpl | 1 - 3 files changed, 47 insertions(+), 34 deletions(-) diff --git a/C4/Accounts.pm b/C4/Accounts.pm index e4a745a131..3a57154b69 100644 --- a/C4/Accounts.pm +++ b/C4/Accounts.pm @@ -73,7 +73,7 @@ will be credited to the next one. #' sub recordpayment { - #here we update both the accountoffsets and the account lines + #here we update the account lines my ( $borrowernumber, $data ) = @_; my $dbh = C4::Context->dbh; my $newamtos = 0; @@ -109,13 +109,13 @@ sub recordpayment { ); $usth->execute( $newamtos, $borrowernumber, $thisacct ); $usth->finish; - $usth = $dbh->prepare( - "INSERT INTO accountoffsets - (borrowernumber, accountno, offsetaccount, offsetamount) - VALUES (?,?,?,?)" - ); - $usth->execute( $borrowernumber, $accdata->{'accountno'}, - $nextaccntno, $newamtos ); +# $usth = $dbh->prepare( +# "INSERT INTO accountoffsets +# (borrowernumber, accountno, offsetaccount, offsetamount) +# VALUES (?,?,?,?)" +# ); +# $usth->execute( $borrowernumber, $accdata->{'accountno'}, +# $nextaccntno, $newamtos ); $usth->finish; } @@ -176,12 +176,12 @@ sub makepayment { ); # print $updquery; - $dbh->do( " - INSERT INTO accountoffsets - (borrowernumber, accountno, offsetaccount, - offsetamount) - VALUES ($borrowernumber, $accountno, $nextaccntno, $newamtos) - " ); +# $dbh->do( " +# INSERT INTO accountoffsets +# (borrowernumber, accountno, offsetaccount, +# offsetamount) +# VALUES ($borrowernumber, $accountno, $nextaccntno, $newamtos) +# " ); # create new line my $payment = 0 - $amount; @@ -287,7 +287,17 @@ should be the empty string. =cut #' -# FIXME - Okay, so what does this function do, really? +# FIXME: In Koha 3.0 , the only account adjustment 'types' passed to this function +# are : +# 'C' = CREDIT +# 'FOR' = FORGIVEN (Formerly 'F', but 'F' is taken to mean 'FINE' elsewhere) +# 'N' = New Card fee +# 'F' = Fine +# 'A' = Account Management fee +# 'M' = Sundry +# 'L' = Lost Item +# + sub manualinvoice { my ( $borrowernumber, $itemnum, $desc, $type, $amount, $user ) = @_; my $dbh = C4::Context->dbh; @@ -297,16 +307,16 @@ sub manualinvoice { my $accountno = getnextacctno($borrowernumber); my $amountleft = $amount; - if ( $type eq 'CS' - || $type eq 'CB' - || $type eq 'CW' - || $type eq 'CF' - || $type eq 'CL' ) - { - my $amount2 = $amount * -1; # FIXME - $amount2 = -$amount - $amountleft = - fixcredit( $borrowernumber, $amount2, $itemnum, $type, $user ); - } +# if ( $type eq 'CS' +# || $type eq 'CB' +# || $type eq 'CW' +# || $type eq 'CF' +# || $type eq 'CL' ) +# { +# my $amount2 = $amount * -1; # FIXME - $amount2 = -$amount +# $amountleft = +# fixcredit( $borrowernumber, $amount2, $itemnum, $type, $user ); +# } if ( $type eq 'N' ) { $desc .= " New Card"; } @@ -324,10 +334,10 @@ sub manualinvoice { $desc = " Lost Item"; } - if ( $type eq 'REF' ) { - $desc .= " Cash Refund"; - $amountleft = refund( '', $borrowernumber, $amount ); - } +# if ( $type eq 'REF' ) { +# $desc .= " Cash Refund"; +# $amountleft = refund( '', $borrowernumber, $amount ); +# } if ( ( $type eq 'L' ) or ( $type eq 'F' ) or ( $type eq 'A' ) @@ -355,15 +365,16 @@ sub manualinvoice { return 0; } -=head2 fixcredit +=head2 fixcredit #### DEPRECATED $amountleft = &fixcredit($borrowernumber, $data, $barcode, $type, $user); This function is only used internally, not exported. - FIXME - Figure out what this function does, and write it down. =cut +# This function is deprecated in 3.0 + sub fixcredit { #here we update both the accountoffsets and the account lines @@ -466,7 +477,10 @@ sub fixcredit { =head2 refund -# FIXME - Figure out what this function does, and write it down. +#FIXME : DEPRECATED SUB + This subroutine tracks payments and/or credits against fines/charges + using the accountoffsets table, which is not used consistently in + Koha's fines management, and so is not used in 3.0 =cut diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tmpl index a72e320340..aa0e0bfd23 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tmpl @@ -32,7 +32,7 @@ Manual Credit
  1. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tmpl index d59f85e32c..c84b21220a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tmpl @@ -40,7 +40,6 @@ -
  2. -- 2.39.5