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

Emmi Takkinen <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #185209|0                           |1
        is obsolete|                            |

--- Comment #9 from Emmi Takkinen <[email protected]> ---
Created attachment 188621
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188621&action=edit
Bug 33756: Use aqorders.quantityreceived to calculate total amount spent

We currently use aqorders.quantity to calculate how much funds have
been spent for orders. This leads to situation where sum doesn't
match the amount which has been already spented. This patch changes
this by using quantityreceived column instead of quantity column
to calculate spented funds.

This test plan assumes that you already have budgets and orders in
your database.

To test:
1. Find an existing fund where some of the ordered items have been
received and look up their budget_id. Use this report if needed:
SELECT budget_id, budget_period_id, budget_code
FROM aqbudgets
WHERE budget_id IN(
SELECT budget_id
FROM aqorders
WHERE quantity != quantityreceived
AND quantityreceived > 0)
2. Set syspref CalculateFundValuesIncludingTax as "Exclude".
3. Add following report to your report library:
SELECT SUM(quantity), SUM(quantityreceived),
SUM(unitprice_tax_excluded * quantity) AS "Budget spent by quantity",
SUM(unitprice_tax_excluded * quantityreceived) AS "Budget spent by quantity
received"
FROM aqorders
WHERE budget_id= [budget_id from step 1.]
3. Search your chosen budget from Funds page navigate to address
/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[budget_period_id from step
1.]
and then filter table with budget_code from step 1.
4. Compare funds tables "Base-level spent" and "Total spent" columns
with report results.
=> Note that both column values match value in reports
"Budget spent by quantity" columns value.
5. Apply this patch.
6. Refresh funds table.
=> Note that now column values match value in reports
"Budget spent by quantity received" columns value.

Also prove that t/db_dependent/Budgets.t and
t/db_dependent/Budgets/CloneBudgetHierarchy.t still pass.

Sponsored-by: Koha-Suomi Oy

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
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