Bugzilla – Attachment 66378 Details for
Bug 18999
Acq: Shipping cost not included in total spent on acq home and funds page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18999 - Added regression test
Bug-18999---Added-regression-test.patch (text/plain), 3.63 KB, created by
Alex Buckley
on 2017-08-23 04:03:32 UTC
(
hide
)
Description:
Bug 18999 - Added regression test
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2017-08-23 04:03:32 UTC
Size:
3.63 KB
patch
obsolete
>From c2f0c0903a7055f7c49db121897f411e22846f0c Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Fri, 18 Aug 2017 15:16:55 +0000 >Subject: [PATCH] Bug 18999 - Added regression test > >Added regression test for GetBudgetSpent() and GetBudgetOrdered() into >the t/db_dependent/Budgets.t > >Test plan: >1. Go into your koha-shell > >2. set the PERL5LIB variable > >3. Run t/db_dependent/Budgets.t > >All tests should pass > >Sponsored-by: Catalyst IT >--- > t/db_dependent/Budgets.t | 83 +++++++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 82 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Budgets.t b/t/db_dependent/Budgets.t >index c626528..78fb386 100755 >--- a/t/db_dependent/Budgets.t >+++ b/t/db_dependent/Budgets.t >@@ -1,6 +1,6 @@ > #!/usr/bin/perl > use Modern::Perl; >-use Test::More tests => 142; >+use Test::More tests => 144; > > BEGIN { > use_ok('C4::Budgets') >@@ -394,6 +394,87 @@ is( GetBudgetHierarchySpent( $budget_id1 ), 160, "total spent for budget1 is 160 > is( GetBudgetHierarchySpent( $budget_id11 ), 100, "total spent for budget11 is 100" ); > is( GetBudgetHierarchySpent( $budget_id111 ), 20, "total spent for budget111 is 20" ); > >+# GetBudgetSpent and GetBudgetOrdered >+my $budget_period_amount = 100; >+my $budget_amount = 50; >+ >+my $budget = AddBudgetPeriod( >+ { >+ budget_period_startdate => '2017-08-22', >+ budget_period_enddate => '2018-08-22', >+ budget_period_description => 'Test budget', >+ budget_period_active => 1, >+ budget_period_total => $budget_period_amount, >+ } >+); >+ >+my $fund = AddBudget( >+ { >+ budget_code => 'Test fund', >+ budget_name => 'Test fund', >+ budget_period_id => $budget, >+ budget_parent_id => undef, >+ budget_amount => $budget_amount, >+ } >+); >+ >+my $vendor = Koha::Acquisition::Bookseller->new( >+ { >+ name => "test vendor", >+ address1 => "test address", >+ phone => "0123456", >+ active => 1, >+ deliverytime => 5, >+ } >+)->store; >+ >+my $vendorid = $vendor->id; >+ >+my $basketnumber = C4::Acquisition::NewBasket( $vendorid, 1 ); >+my ( $biblio, $biblioitem ) = C4::Biblio::AddBiblio( MARC::Record->new, '' ); >+ >+my @orders = ( >+ { >+ budget_id => $fund, >+ pending_quantity => 1, >+ spent_quantity => 0, >+ }, >+); >+ >+my $invoiceident = AddInvoice( invoicenumber => 'invoice_test_clone', booksellerid => $vendorid, shipmentdate => '2017-08-22', shipmentcost => 6, shipmentcost_budgetid => $fund ); >+my $test_invoice = GetInvoice( $invoiceident ); >+my $individual_item_price = 10; >+ >+my $order = Koha::Acquisition::Order->new( >+ { >+ basketno => $basketnumber, >+ biblionumber => $biblio, >+ budget_id => $fund, >+ order_internalnote => "internalnote", >+ order_vendornote => "vendor note", >+ quantity => 2, >+ cost_tax_included => $individual_item_price, >+ rrp_tax_included => $individual_item_price, >+ listprice => $individual_item_price, >+ ecost_tax_included => $individual_item_price, >+ discount => 0, >+ uncertainprice => 0, >+ } >+)->insert; >+ >+ModReceiveOrder({ >+ bibionumber => $biblio, >+ order => $order, >+ budget_id => $fund, >+ quantityreceived => 2, >+ invoice => $test_invoice, >+ received_items => [], >+} ); >+ >+is ( GetBudgetSpent( $fund ), 6, "total shipping cost is 6"); >+is ( GetBudgetOrdered( $fund ), '20.000000', "total ordered price is 20"); >+ >+ > # CloneBudgetPeriod > my $budget_period_id_cloned = C4::Budgets::CloneBudgetPeriod( > { >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18999
:
65446
|
65626
|
66378
|
66855
|
67173
|
67316
|
67317
|
67318
|
67319
|
67471
|
67472
|
67473
|
67474