Description
Yohann Dufour
2014-06-27 09:03:26 UTC
Created attachment 29329 [details] [review] Bug 12493: moving the subroutines GetContract and GetContracts from C4::Acquisition.pm to C4::Contract.pm This patch includes: - the subroutines GetContract and GetContracts has been moved from C4::Acquisition.pm to C4::Contract.pm and adapted for a general use - adaptation of acqui/basket.pl, acqui/basketheader.pl, acqui/neworderempty.pl, acqui/supplier.pl and admin/aqcontract.pl - the unit tests for the module C4::Contract.pm Test plan: 1) Apply the patch 2) Execute the unit tests by launching: prove t/db_dependent/Contract.t t/Acquisition/ t/db_dependent/Acquisition/ t/db_dependent/Acquisition.t 3) The command has to be a success : t/db_dependent/Contract.t ................................. ok t/Acquisition/CanUserManageBasket.t ....................... ok t/Acquisition/Invoice.t ................................... ok t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t .. ok t/db_dependent/Acquisition/GetOrdersByBiblionumber.t ...... ok t/db_dependent/Acquisition/Invoices.t ..................... ok t/db_dependent/Acquisition/OrderFromSubscription.t ........ ok t/db_dependent/Acquisition/TransferOrder.t ................ 1/11 # Transfering order to basket2 t/db_dependent/Acquisition/TransferOrder.t ................ ok t/db_dependent/Acquisition/close_reopen_basket.t .......... ok t/db_dependent/Acquisition.t .............................. ok All tests successful. Files=10, Tests=284, 15 wallclock secs ( 0.11 usr 0.02 sys + 12.88 cusr 0.77 csys = 13.78 CPU) Result: PASS 4) Log on with a superlibrarian permission 5) Go on the page acqui/supplier.pl (Acquisitions > Button "New vendor") 6) Record a vendor with a nonzero "name" 7) Go on the page admin/aqcontract.pl (click on the "Contracts" item in the menu) 8) Click on the button "New" > "Contract" and record a new one 9) Verify the displayed data are correct about the contract 10) "Edit" the contract with different values and verify the data are updated 11) Click on "Delete" in order to delete the contract, verify the displayed data are correct but cancel the operation 12) Click on "New" > "Basket" and verify there is the created contract in field "Contract", then record a basket by selectioning the created contract 13) Verify the contract name displayed is correct 14) Record an active budget and a fund linked to this budget 15) Go on the new basket (Home > Acquisitions > Search the created vendor) 16) Click on "Add to basket" then "From a new (empty) record" and verify the displayed contract name is correct Created attachment 29353 [details] [review] Bug 12493: unit tests for the module C4::Contract.pm This patch are the unit tests of the previous patch Test plan : Same as the previous patch Created attachment 29494 [details] [review] [SIGNED-OFF] Bug 12493: moving the subroutines GetContract and GetContracts from C4::Acquisition.pm to C4::Contract.pm This patch includes: - the subroutines GetContract and GetContracts has been moved from C4::Acquisition.pm to C4::Contract.pm and adapted for a general use - adaptation of acqui/basket.pl, acqui/basketheader.pl, acqui/neworderempty.pl, acqui/supplier.pl and admin/aqcontract.pl - the unit tests for the module C4::Contract.pm Test plan: 1) Apply the patch 2) Execute the unit tests by launching: prove t/db_dependent/Contract.t t/Acquisition/ t/db_dependent/Acquisition/ t/db_dependent/Acquisition.t 3) The command has to be a success : t/db_dependent/Contract.t ................................. ok t/Acquisition/CanUserManageBasket.t ....................... ok t/Acquisition/Invoice.t ................................... ok t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t .. ok t/db_dependent/Acquisition/GetOrdersByBiblionumber.t ...... ok t/db_dependent/Acquisition/Invoices.t ..................... ok t/db_dependent/Acquisition/OrderFromSubscription.t ........ ok t/db_dependent/Acquisition/TransferOrder.t ................ 1/11 # Transfering order to basket2 t/db_dependent/Acquisition/TransferOrder.t ................ ok t/db_dependent/Acquisition/close_reopen_basket.t .......... ok t/db_dependent/Acquisition.t .............................. ok All tests successful. Files=10, Tests=284, 15 wallclock secs ( 0.11 usr 0.02 sys + 12.88 cusr 0.77 csys = 13.78 CPU) Result: PASS 4) Log on with a superlibrarian permission 5) Go on the page acqui/supplier.pl (Acquisitions > Button "New vendor") 6) Record a vendor with a nonzero "name" 7) Go on the page admin/aqcontract.pl (click on the "Contracts" item in the menu) 8) Click on the button "New" > "Contract" and record a new one 9) Verify the displayed data are correct about the contract 10) "Edit" the contract with different values and verify the data are updated 11) Click on "Delete" in order to delete the contract, verify the displayed data are correct but cancel the operation 12) Click on "New" > "Basket" and verify there is the created contract in field "Contract", then record a basket by selectioning the created contract 13) Verify the contract name displayed is correct 14) Record an active budget and a fund linked to this budget 15) Go on the new basket (Home > Acquisitions > Search the created vendor) 16) Click on "Add to basket" then "From a new (empty) record" and verify the displayed contract name is correct Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Tested with both patches applied. Works as described following test plan, all points (I did 14 first) All test pass No koha-qa errors Created attachment 29495 [details] [review] [SIGNED-OFF] Bug 12493: unit tests for the module C4::Contract.pm This patch are the unit tests of the previous patch Test plan : Same as the previous patch Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comments on previous patch Comment on attachment 29494 [details] [review] [SIGNED-OFF] Bug 12493: moving the subroutines GetContract and GetContracts from C4::Acquisition.pm to C4::Contract.pm Review of attachment 29494 [details] [review]: ----------------------------------------------------------------- ::: C4/Acquisition.pm @@ +363,5 @@ > my @rows; > for my $basket (@$baskets) { > my @orders = GetOrders( $$basket{basketno} ); > + my $contract = GetContract({ > + contractnumber => $$basket{contractnumber} I know this line existed before, but see here for future reference: http://wiki.koha-community.org/wiki/Coding_Guidelines#PERL5:_Disagreements And maybe fix in a follow up? ::: C4/Contract.pm @@ +21,1 @@ > use strict; When using Modern::Perl you can delete the use strict; and use warnings; lines here. Creating a new file like Contract.pm is a good time to perltidy it - there is some mixup between tabs and spaces right at the beginning. I started fixing this, but don't want to touch too many lines, so maybe it's better you do a follow up? Created attachment 29568 [details] [review] [FOLLOW UP] Bug 12493 : moving the subroutines GetContract and GetContracts from C4::Acquisition.pm to C4::Contract.pm Fix in order to respect the coding guidelines Katrin, I've tested my commit with the tools koha-qa.pl but it doesn't detect tabs or spaces, and I've not found the mixup you said. Hi Yohann, you are right, I thought Contract.pm was new, but it isn't - sorry for that and thx for your follow-up! Created attachment 29831 [details] [review] [PASSED QA] Bug 12493: moving the subroutines GetContract and GetContracts from C4::Acquisition.pm to C4::Contract.pm This patch includes: - the subroutines GetContract and GetContracts has been moved from C4::Acquisition.pm to C4::Contract.pm and adapted for a general use - adaptation of acqui/basket.pl, acqui/basketheader.pl, acqui/neworderempty.pl, acqui/supplier.pl and admin/aqcontract.pl - the unit tests for the module C4::Contract.pm Test plan: 1) Apply the patch 2) Execute the unit tests by launching: prove t/db_dependent/Contract.t t/Acquisition/ t/db_dependent/Acquisition/ t/db_dependent/Acquisition.t 3) The command has to be a success : t/db_dependent/Contract.t ................................. ok t/Acquisition/CanUserManageBasket.t ....................... ok t/Acquisition/Invoice.t ................................... ok t/db_dependent/Acquisition/GetBasketsInfosByBookseller.t .. ok t/db_dependent/Acquisition/GetOrdersByBiblionumber.t ...... ok t/db_dependent/Acquisition/Invoices.t ..................... ok t/db_dependent/Acquisition/OrderFromSubscription.t ........ ok t/db_dependent/Acquisition/TransferOrder.t ................ 1/11 # Transfering order to basket2 t/db_dependent/Acquisition/TransferOrder.t ................ ok t/db_dependent/Acquisition/close_reopen_basket.t .......... ok t/db_dependent/Acquisition.t .............................. ok All tests successful. Files=10, Tests=284, 15 wallclock secs ( 0.11 usr 0.02 sys + 12.88 cusr 0.77 csys = 13.78 CPU) Result: PASS 4) Log on with a superlibrarian permission 5) Go on the page acqui/supplier.pl (Acquisitions > Button "New vendor") 6) Record a vendor with a nonzero "name" 7) Go on the page admin/aqcontract.pl (click on the "Contracts" item in the menu) 8) Click on the button "New" > "Contract" and record a new one 9) Verify the displayed data are correct about the contract 10) "Edit" the contract with different values and verify the data are updated 11) Click on "Delete" in order to delete the contract, verify the displayed data are correct but cancel the operation 12) Click on "New" > "Basket" and verify there is the created contract in field "Contract", then record a basket by selectioning the created contract 13) Verify the contract name displayed is correct 14) Record an active budget and a fund linked to this budget 15) Go on the new basket (Home > Acquisitions > Search the created vendor) 16) Click on "Add to basket" then "From a new (empty) record" and verify the displayed contract name is correct Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Tested with both patches applied. Works as described following test plan, all points (I did 14 first) All test pass No koha-qa errors Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 29832 [details] [review] [PASSED QA] Bug 12493: unit tests for the module C4::Contract.pm This patch are the unit tests of the previous patch Test plan : Same as the previous patch Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Comments on previous patch Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 29833 [details] [review] [PASSED QA] Bug 12493 : moving the subroutines GetContract and GetContracts from C4::Acquisition.pm to C4::Contract.pm Fix in order to respect the coding guidelines Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Unit tests pass but *ONLY* with but 12487 applied on top. These two bugs must be pushed simultaneously. Patches pushed to master. Thanks Yohann! |