Why accounts related old reports do not work with the latest version of Koha?

New changes in data structure regarding fines and fees available with the release of Koha version 19.11. Koha used
accounttype table to accommodate payment statuses. The table accounttype no more available with Koha version since 19.11. The reports used values in accounttype do not work with the recent version of Koha upgraded from the old one. 
The new two tables are available to accommodate income and expenses (Fines, fees, Refund etc) for libraries are credit_type_code and the debit_type_code. The codes in the two tables can be check at Administration > Accounting. Koha users need to use the codes in  credit_type_code and the debit_type_code tables to generate reports.

Following is a report which generates the overdue paid by patrons in a date range. I have highlighted where the credit_type_code to display payments made by patrons.

SELECT b.cardnumber AS 'Card Number',b.surname AS 'Name',FORMAT(ABS(a.amount), 2) AS 'Amount'
FROM borrowers b
JOIN accountlines a
WHERE b.borrowernumber = a.borrowernumber AND a.credit_type_code = 'payment' AND a.date BETWEEN <<Between (YYYY-MM-dd)|date>> AND <<and (YYYY-MM-DD |date>> AND b.branchcode=<<Enter patrons library|branches>> AND categorycode LIKE <<Enter Category borrowers|categorycode>>

Make changes in the accounts reports created with Koha versions before 19.11. Otherwise, the reports with the old status codes will fail to work.

References

No comments:

Post a Comment