Using Test::DBIx::Class now, we cannot do what we did in this file with DBD::Mock.
Since the Invoice[s] subroutines are already tested in
t/db_dependent/Acquisition/Invoices.t there is no special needs to have
these ones.
Instead of loosing 2 hours on this file, I would prefer to remove it.
Feel free to provide a counter patch.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Fix the supplier, shipment date, and library filters
on the invoice search. An invoice's library is
(in parallel with order search) defined as the library
of the staff member that approved the basket. Before this
patch, the code was referring to an aqorders.branchcode
column that doesn't exist.
This patch also improves the author, title, ISBN/EAN/ISSN,
publisher, and publication year filters to no longer require
exact matches; substring matches now suffice.
Finally, this patch considers biblio.copyrightdate in addition
to biblioitems.publicationyear for publication date searches, as
the MARC21 frameworks use the former column but not the latter.
This patch also fixes the current test cases for invoices
so that they pass and adds regression tests.
Test plan:
[1] Create two invoices for different vendors.
[2] Do an invoice search and filter on shipment
date. Verify that the expected invoice(s)
are returned.
[3] Do an invoice search and filter on branch
(of the staff member that approved the basket).
Verify that the expected invoice(s) are returned.
[4] Do an invoice search and filter on supplier.
Verify that the expected invoice(s) are returned.
[5] Do invoice searches on author, title, ISBN/EAN/ISSN,
publisher, and publication year and verify that the
results are as expected.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Patch passes all tests, test plan and QA script.
(Adding from Katrin notes early) I agree with
Possible improvements:
- Document the behaviour of the library search as there are
lots of branches all over acquisitions with different meaning.
- Add the shipment date to the results list table
- Change label ISBN/EAN/ISSN to not include EAN for MARC21
installations
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
- List of libraries in basket.pl is now sorted by branch name, not code
- When IndependantBranches is ON, user has only the possibility to set
basket branch to its own branch, or to no branch at all.
- When basket do not belong to any branch, selected branch by default is
connection branch (was 'no branch')
- added id attributes to both added li elements
- change description of 'order_manage_all' permission to make it
clearer.
- remove Test::MockModule dependency
Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
- Add branch info to baskets
- Add a list of borrowers that are allowed to manage a basket (one list
for each basket).
- Add a new subpermission: acquisition => order_manage_all
If user is superlibrarian, or if that user has permission acquisition = 1
(GranularPermissions = OFF), or subpermission acquisition =>
order_manage_all (GranularPermissions = ON), that user is authorised to manage
all baskets.
Depending on syspref AcqViewBaskets:
'all': user can manage all baskets
'branch': user can manage baskets of their branch (the basket branch is
taken into account, not the branch of the basket's creator).
If basket branch is not defined, all users can manage this
basket.
'user': user can manage baskets she created, and baskets in their
user list
There are unit tests in t/Acquisition/CanUserManageBasket.t, which
require Test::MockModule
You can edit basket's branch and users list in basket modification page
(acqui/basket.pl)
Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
There is currently no way to delete unused invoices (for example,
invoices created by mistake), and there really should be, since errors
and absent-mindedness can result in numerous empty invoices over the
course of years.
To test:
1) Apply patch.
2) Create three invoices in the Acquisitions module. For one of them,
receive at least one item. For the other two, do not receive any
items.
3) View one of the invoices that does not have any items on it.
4) Try to delete it. This should succeed.
5) View the invoice that has an item. There should not be any option
to delete it.
6) Do an invoice search that brings up the other invoice with no items
on it. Try to delete it from the results page. This should succeed.
7) Run the unit test:
> prove t/Acquisition/Invoice.t
8) Sign off.
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass. I also did another test:
I cancelled all receipts from an existing invoice and then could
successfully delete it in the last step.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
These tests use DBD::Mock to check if SQL queries are correctly built.
Actually, we only check bound parameters.
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>