Bugzilla – Attachment 56930 Details for
Bug 13321
Fix tax and prices calculation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13321 - (QA Followup) Restore standing order functionality
Bug-13321---QA-Followup-Restore-standing-order-fun.patch (text/plain), 4.08 KB, created by
Nick Clemens
on 2016-10-27 14:57:10 UTC
(
hide
)
Description:
Bug 13321 - (QA Followup) Restore standing order functionality
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2016-10-27 14:57:10 UTC
Size:
4.08 KB
patch
obsolete
>From 5366d8a020ef40da9b83b018b16d1e1aace5ab34 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 27 Oct 2016 00:51:42 +0000 >Subject: [PATCH] Bug 13321 - (QA Followup) Restore standing order > functionality > >Some lines deleted during rebase, restored and updated, tests repaired >--- > C4/Acquisition.pm | 10 +++++++-- > t/db_dependent/Acquisition/StandingOrders.t | 33 ++++++++++++++++++++--------- > 2 files changed, 31 insertions(+), 12 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 355c914..3ccdca1 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -1380,8 +1380,14 @@ sub ModReceiveOrder { > ); > } > >+ my $result_set = $dbh->selectrow_arrayref( >+ q{SELECT aqbasket.is_standing >+ FROM aqbasket >+ WHERE basketno=?},{ Slice => {} }, $order->{basketno}); >+ my $is_standing = $result_set->[0]; # we assume we have a unique basket >+ > my $new_ordernumber = $order->{ordernumber}; >- if ( $order->{quantity} > $quantrec ) { >+ if ( $is_standing || $order->{quantity} > $quantrec ) { > # Split order line in two parts: the first is the original order line > # without received items (the quantity is decreased), > # the second part is a new order line with quantity=quantityrec >@@ -1395,7 +1401,7 @@ sub ModReceiveOrder { > my $sth = $dbh->prepare($query); > > $sth->execute( >- $order->{quantity} - $quantrec, >+ ( $is_standing ? 1 : ($order->{quantity} - $quantrec) ), > ( defined $order->{order_internalnote} ? $order->{order_internalnote} : () ), > $order->{ordernumber} > ); >diff --git a/t/db_dependent/Acquisition/StandingOrders.t b/t/db_dependent/Acquisition/StandingOrders.t >index 32f1b46..d067747 100644 >--- a/t/db_dependent/Acquisition/StandingOrders.t >+++ b/t/db_dependent/Acquisition/StandingOrders.t >@@ -56,13 +56,26 @@ is( $basket->{is_standing}, 1, 'basket correctly created as standing order baske > > my ( $biblionumber, $biblioitemnumber ) = C4::Biblio::AddBiblio( MARC::Record->new, '' ); > >+ > my $ordernumber = Koha::Acquisition::Order->new( > { >- basketno => $basketno, >- biblionumber => $biblionumber, >- budget_id => $budget->{budget_id}, >- currency => 'USD', >- quantity => 0, >+ basketno => $basketno, >+ biblionumber => $biblionumber, >+ budget_id => $budget->{budget_id}, >+ currency => 'USD', >+ quantity => 0, >+ rrp => 42, >+ rrp_tax_included => 42, >+ rrp_tax_excluded => 42, >+ ecost => 22, >+ ecost_tax_included => 22, >+ ecost_tax_excluded => 22, >+ unitprice => 12, >+ unitprice_tax_included => 12, >+ unitprice_tax_excluded => 12, >+ tax_rate => 0, >+ tax_rate_on_ordering => 0, >+ tax_rate_on_receiving => 0, > } > )->insert->{ordernumber}; > >@@ -85,21 +98,21 @@ my $invoiceid = AddInvoice( > unknown => "unknown" > ); > >+my $order = Koha::Acquisition::Order->fetch( { ordernumber => $ordernumber } ); >+ > my ( $datereceived, $new_ordernumber ) = ModReceiveOrder( > { > biblionumber => $biblionumber, >- ordernumber => $ordernumber, >+ order => $order, > quantityreceived => 2, >- cost => 12, >- ecost => 22, > invoiceid => $invoiceid, >- rrp => 42, > } > ); > > isnt( $ordernumber, $new_ordernumber, "standing order split on receive" ); > >-my $order = Koha::Acquisition::Order->fetch( { ordernumber => $ordernumber } ); >+#order has been updated, refetch >+$order = Koha::Acquisition::Order->fetch( { ordernumber => $ordernumber } ); > my $neworder = Koha::Acquisition::Order->fetch( { ordernumber => $new_ordernumber } ); > > is( $order->{orderstatus}, 'partial', 'original order set to partially received' ); >-- >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 13321
:
33789
|
33790
|
33791
|
33792
|
33793
|
34432
|
35152
|
35165
|
47489
|
47490
|
47491
|
47492
|
47493
|
47494
|
48867
|
48868
|
48869
|
48870
|
48871
|
48872
|
51080
|
51081
|
51082
|
51083
|
51084
|
51085
|
51643
|
51644
|
51645
|
51646
|
51647
|
51648
|
51649
|
52046
|
55168
|
55415
|
55416
|
55417
|
55418
|
55419
|
55420
|
55421
|
55422
|
55423
|
55427
|
56408
|
56422
|
56423
|
56424
|
56425
|
56426
|
56427
|
56428
|
56429
|
56430
|
56431
|
56432
|
56898
|
56899
|
56900
|
56901
|
56902
|
56903
|
56904
|
56905
|
56906
|
56907
|
56908
|
56909
| 56930 |
56959