View | Details | Raw Unified | Return to bug 9122
Collapse All | Expand All

(-)a/C4/Accounts.pm (-7 / +6 lines)
Lines 768-780 sub makepartialpayment { Link Here
768
    return;
768
    return;
769
}
769
}
770
770
771
=head2 WriteOff
771
=head2 WriteOffFee
772
772
773
  WriteOff( $borrowernumber, $accountnum, $itemnum, $accounttype, $amount, $branch );
773
  WriteOff( $borrowernumber, $accountline_id, $itemnum, $accounttype, $amount, $branch );
774
774
775
Write off a fine for a patron.
775
Write off a fine for a patron.
776
C<$borrowernumber> is the patron's borrower number.
776
C<$borrowernumber> is the patron's borrower number.
777
C<$accountnum> is the accountnumber of the fee to write off.
777
C<$accountline_id> is the accountline_id of the fee to write off.
778
C<$itemnum> is the itemnumber of of item whose fine is being written off.
778
C<$itemnum> is the itemnumber of of item whose fine is being written off.
779
C<$accounttype> is the account type of the fine being written off.
779
C<$accounttype> is the account type of the fine being written off.
780
C<$amount> is a floating-point number, giving the amount that is being written off.
780
C<$amount> is a floating-point number, giving the amount that is being written off.
Lines 783-789 C<$branch> is the branchcode of the library where the writeoff occurred. Link Here
783
=cut
783
=cut
784
784
785
sub WriteOffFee {
785
sub WriteOffFee {
786
    my ( $borrowernumber, $accountnum, $itemnum, $accounttype, $amount, $branch ) = @_;
786
    my ( $borrowernumber, $accountline_id, $itemnum, $accounttype, $amount, $branch ) = @_;
787
    $branch ||= C4::Context->userenv->{branch};
787
    $branch ||= C4::Context->userenv->{branch};
788
    my $manager_id = 0;
788
    my $manager_id = 0;
789
    $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv;
789
    $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv;
Lines 796-805 sub WriteOffFee { Link Here
796
796
797
    $query = "
797
    $query = "
798
        UPDATE accountlines SET amountoutstanding = 0
798
        UPDATE accountlines SET amountoutstanding = 0
799
        WHERE accountno = ? AND borrowernumber = ?
799
        WHERE accountlines_id = ? AND borrowernumber = ?
800
    ";
800
    ";
801
    $sth = $dbh->prepare( $query );
801
    $sth = $dbh->prepare( $query );
802
    $sth->execute( $accountnum, $borrowernumber );
802
    $sth->execute( $accountline_id, $borrowernumber );
803
803
804
    $query ="
804
    $query ="
805
        INSERT INTO accountlines
805
        INSERT INTO accountlines
806
- 

Return to bug 9122