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: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected]

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.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to