Commit graph

19 commits

Author SHA1 Message Date
Jared Camins-Esakov
480841965e Bug 10403: add ability to change fund on receipt
Right now there is no way to change the budget or fund when receiving an
item, which is annoying, particularly at the end of the fiscal year when
every item not already received has to be switched to the following
year's budget. This patch adds the ability to change the budget and fund
when receiving.

To test:
1) Apply patch.
2) Create an order for a vendor, choosing a fund to use for that order.
3) Receive the order, leaving the fund unchanged. Make sure the fund
   did not change.
4) Create another order for a vendor, choosing a fund to use for that
   order.
5) Receive the order, this time changing the fund. Make sure the fund
   is changed.
6) Run the unit test:
    > prove t/db_dependent/Acquisition.t
7) Sign off.

(Notes: this patch depends on the Acquisitions.t unit test improvements
in bug 10274; the seemingly-unrelated change in SQLHelper quiets an
irritating warning caused by the NewOrder call in ModReceiveOrder)

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-22 12:57:25 +00:00
Galen Charlton
7c4f526a86 Bug 10723: (follow-up) add more unit tests for SearchOrders()
In particular, verify that the pending filter option works.

To test:

[1] Verify that prove -v t/db_dependent/Acquisition.t passes

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-21 18:49:37 +00:00
Jonathan Druart
4820462185 Bug 10723: Merge GetPendingOrders and SearchOrders routines
In the C4::Acquisition module, 2 routines do the same work. This patch
merges these 2 routines.

Test plan:
test the acqui/orderreceive.pl, acqui/uncertainprice.pl
and serials/acqui-search-result.pl, acqui/parcel.pl scripts.

Note: on acqui/parcel the basket filter is a search on basket name (was
on basket id, which was not relevant).

Signed-off-by: Pierre Angot <tredok.pierre@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pm, no adverse bahaviors noted. All sub calls updated.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-10-21 18:24:32 +00:00
Galen Charlton
41baeafda9 bug 10556: regression test for setting deliverytime when adding vendor
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-07-16 14:55:09 +00:00
Jonathan Druart
eab1812b7d Bug 10274: Execute sql queries into a transaction
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-07-16 14:28:41 +00:00
Jonathan Druart
f72e78f2bd Bug 10274: UT: Acquisition.t needs to create its own data
Try before the patch:
prove t/db_dependent/Acquisition.t

And after, it should produce:
  t/db_dependent/Acquisition.t .. ok
  All tests successful.
  Files=1, Tests=41,  2 wallclock secs ( 0.03 usr  0.00 sys +  0.42 cusr
  0.02 csys =  0.47 CPU)
  Result: PASS

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Tests pass and the bookseller is deleted.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-07-16 14:28:41 +00:00
Galen Charlton
58ccb8342b Bug 9987: remove reference to biblioitemnumber from test case
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-07-02 22:04:03 -07:00
Jonathan Druart
96f8a31200 Bug 10270: GetOrdersByBiblionumber needs better unit tests
prove t/db_dependent/Acquisition/GetOrdersByBiblionumber.t

Signed-off-by:Mathieu Saby <mathieu.saby@univ-rennes2.fr>
I made 2 tests :
$prove -v t/db_dependent/Acquisition/GetOrdersByBiblionumber.t
and
$prove -v t/db_dependent/Acquisition.t
The 2 tests are successful.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-05-18 06:13:16 -04:00
Jonathan Druart
94e00ac835 Bug 7593: Fix unit tests
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-05-14 13:46:02 -04:00
Mathieu Saby
b1a52b2918 Bug 7593: Move orders on the destination record when merging 2 records
Revised patch according to QA comments. No more dependent from bz 9780.

At present, merging records breaks the link order/record, except
if an item of the deleted record is used in the order.
This is a serious issue for libraries creating items on receipt.
This patch moves existing orders from deleted record to destination record.
It creates a new function Acquisitions::GetOrdersByBiblionumber,
that could be used by other patches later.

To test :
Check the problem :
1. Set syspref AcqCreateItem = Create an item when receiving an order
1. Create a basket with one order
2. Put the record used by this order in a list
3. Put an other record in the list
4. Merge the 2 records, keeping as a reference the record NOT used in the order
5. In the order, you will see for that order "Deleted bibliographic information..."
6. Apply the patch
7. Repeat steps 1-4
8. In the order, you will see the title/author of the kept record.
9. Set syspref AcqCreateItem = Create an item when placing an order
10. Repeat steps 1-4 (an item will be created)
11. In the oreder, you will see the title/author of the kept record
    (it is already the case at present. the patch should not alter this behavior)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Test plan, test suite and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-05-12 10:29:57 -04:00
Jared Camins-Esakov
0177dd4b62 Bug 9911: update Acquisitions unit test to look for correct fields
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-23 08:26:31 -04:00
Paul Poulain
bee6c8136f Bug 5335 follow-up fix test
The gst column is now called gstrate.
2012-09-28 11:19:56 +02:00
Julian Maurice
766e2b0106 Bug 5339: Fix t/db_dependant/Acquisition.t 2012-09-20 09:45:39 +02:00
Chris Cormack
d83a71d8e6 Bug 5347 Follow up, fix for broken test 2012-04-19 11:40:02 +02:00
Ian Walls
ff29f978af Bug 5374 [SIGNED-OFF] Followup: adds conditional check to unit test for late orders
If there are no late orders in the database, the 5th unit test for C4/Acquisition.pm
fails, since no date is returned (and today's date is expected)

This patch adds a conditional check around whether any late orders are actually returned
by GetLateOrders. If so, tests proceed, if not, they're skipped.  This seems to quiet
the failures in the automated test suite.

http://bugs.koha-community.org/show_bug.cgi?id=5347

signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
2012-04-18 17:01:24 +02:00
Jonathan Druart
d12a381f49 Bug 5347: Followup change class for message + Unit test 2012-01-20 14:12:28 +01:00
Colin Campbell
0d082204ea Bug5063: C4::Bookseller Changes
Merge unfao changes to C4::Bookseller
Enable warnings in Bookseller.pm
Some cleanups in Bookseller code
Do not export everything by default
Display vendors more rationally
    Was displaying by id make it name as the searchstring is for all
    embedded substrings
Have removed "if mysql" logic as we want to deal with this by
    abstracting the DB interaction and it makes cleaner code until then

Sponsered by UN FAO, Rome

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-03-12 08:42:26 +13:00
Andrew Moore
a5325c4fcc use bind variables in C4::Acquisition::GetPendingOrders
I improved the tests a bit for this module so that they at least skip
if there's not enough data in the database to test with.
I was unable to test the actual execution path through the change I actually made.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-03-19 15:46:23 -05:00
Galen Charlton
156cbf4eb6 DB-dependent tests moved
Moved test cases that depend on the DBMS and having
an initialized Koha database to a subdirectory
of t so that they will not be swept up into
the default 'make test'.  Goal is to have
these DB-dependent tests runnable either via
a special make target or perhaps from the
web installer.

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-01-08 14:07:38 -06:00
Renamed from t/Acquisition.t (Browse further)