[Koha-bugs] [Bug 28994] New: Make writeoff_debts.pl use amountoutstanding, not amount

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Sep 10 11:19:45 CEST 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28994

            Bug ID: 28994
           Summary: Make writeoff_debts.pl use amountoutstanding, not
                    amount
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Command-line Utilities
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: magnus at libriotech.no
        QA Contact: testopia at bugs.koha-community.org
                CC: robin at catalyst.net.nz

This script uses "amount" to write off debts, when it should be using
"amountoutstanding":

                # A 'writeoff' is a 'credit'
                my $writeoff = Koha::Account::Line->new(
                    {
                        date              => \'NOW()',
                        amount            => 0 - $line->amount,   <== HERE
                        credit_type_code  => 'WRITEOFF',
                        status            => 'ADDED',
                        amountoutstanding => 0 - $line->amount,   <== HERE
                        manager_id        => undef,
                        borrowernumber    => $line->borrowernumber,
                        interface         => 'intranet',
                        branchcode        => undef,
                    }
                )->store();

                my $writeoff_offset = Koha::Account::Offset->new(
                    {
                        credit_id => $writeoff->accountlines_id,
                        type      => 'WRITEOFF',
                        amount    => $line->amount   <== HERE
                    }
                )->store();

Patch coming.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list