Bugzilla – Attachment 25895 Details for
Bug 11699
notes entered when receiving are not saved
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11699: Notes entered when receiving are not saved
Bug-11699-Notes-entered-when-receiving-are-not-sav.patch (text/plain), 6.20 KB, created by
Jonathan Druart
on 2014-03-06 13:59:33 UTC
(
hide
)
Description:
Bug 11699: Notes entered when receiving are not saved
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-03-06 13:59:33 UTC
Size:
6.20 KB
patch
obsolete
>From 2e3fd5019117ff6b3ab7be0586297315e196928d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 5 Mar 2014 13:07:53 +0100 >Subject: [PATCH] Bug 11699: Notes entered when receiving are not saved > >Test plan: >1/ Create an order with 2 items >2/ Receive 1 item and enter a note for the order >3/ Verify the note is correctly saved >4/ Receive the second item and enter a note for the order >5/ Verify the note is correctly saved >--- > C4/Acquisition.pm | 11 ++++++----- > acqui/finishreceive.pl | 3 ++- > .../prog/en/modules/acqui/orderreceive.tt | 2 +- > t/db_dependent/Acquisition.t | 19 ++++++++++++++++--- > 4 files changed, 25 insertions(+), 10 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index b848c73..c79529b 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -1435,7 +1435,7 @@ C<$ordernumber>. > sub ModReceiveOrder { > my ( > $biblionumber, $ordernumber, $quantrec, $user, $cost, $ecost, >- $invoiceid, $rrp, $budget_id, $datereceived, $received_items >+ $invoiceid, $rrp, $budget_id, $datereceived, $received_items, $notes > ) > = @_; > >@@ -1466,11 +1466,12 @@ q{SELECT * FROM aqorders WHERE biblionumber=? AND aqorders.ordernumber=?}, > my $sth=$dbh->prepare(" > UPDATE aqorders > SET quantity = ?, >- orderstatus = 'partial' >+ orderstatus = 'partial', >+ notes = ? > WHERE ordernumber = ? > "); > >- $sth->execute($order->{quantity} - $quantrec, $ordernumber); >+ $sth->execute($order->{quantity} - $quantrec, $notes, $ordernumber); > > delete $order->{'ordernumber'}; > $order->{'budget_id'} = ( $budget_id || $order->{'budget_id'} ); >@@ -1493,9 +1494,9 @@ q{SELECT * FROM aqorders WHERE biblionumber=? AND aqorders.ordernumber=?}, > } else { > my $sth=$dbh->prepare("update aqorders > set quantityreceived=?,datereceived=?,invoiceid=?, >- unitprice=?,rrp=?,ecost=?,budget_id=?,orderstatus='complete' >+ unitprice=?,rrp=?,ecost=?,budget_id=?,orderstatus='complete',notes=? > where biblionumber=? and ordernumber=?"); >- $sth->execute($quantrec,$datereceived,$invoiceid,$cost,$rrp,$ecost,$budget_id,$biblionumber,$ordernumber); >+ $sth->execute($quantrec,$datereceived,$invoiceid,$cost,$rrp,$ecost,$budget_id,$notes,$biblionumber,$ordernumber); > } > return ($datereceived, $new_ordernumber); > } >diff --git a/acqui/finishreceive.pl b/acqui/finishreceive.pl >index 71bf90c..f1f9a09 100755 >--- a/acqui/finishreceive.pl >+++ b/acqui/finishreceive.pl >@@ -53,7 +53,7 @@ my $booksellerid = $input->param('booksellerid'); > my $cnt = 0; > my $ecost = $input->param('ecost'); > my $rrp = $input->param('rrp'); >-my $note = $input->param("note"); >+my $notes = $input->param("notes"); > my $bookfund = $input->param("bookfund"); > my $order = GetOrder($ordernumber); > my $new_ordernumber = $ordernumber; >@@ -112,6 +112,7 @@ if ($quantityrec > $origquantityrec ) { > $bookfund, > $datereceived, > \@received_items, >+ $notes, > ); > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >index 47eea31..3f5dc42 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >@@ -329,7 +329,7 @@ > [% ELSE %] > <input type="text" size="20" name="cost" id="cost" value="[% ecost %]" /> > [% END %]</li></ol> >- <label for="note">Notes: </label><textarea name="note" width="40" rows="8" >[% notes %]</textarea> >+ <label for="note">Notes: </label><textarea name="notes" width="40" rows="8" >[% notes %]</textarea> > </fieldset> > > </div> >diff --git a/t/db_dependent/Acquisition.t b/t/db_dependent/Acquisition.t >index 1cb6d4b..1d5e503 100755 >--- a/t/db_dependent/Acquisition.t >+++ b/t/db_dependent/Acquisition.t >@@ -8,7 +8,7 @@ use POSIX qw(strftime); > > use C4::Bookseller qw( GetBookSellerFromId ); > >-use Test::More tests => 63; >+use Test::More tests => 66; > > BEGIN { > use_ok('C4::Acquisition'); >@@ -167,11 +167,16 @@ my ($datereceived, $new_ordernumber) = ModReceiveOrder( > 12, > $invoiceid, > 42, >+ undef, >+ undef, >+ undef, >+ "my notes", > ); > my $order2 = GetOrder( $ordernumber2 ); > is($order2->{'quantityreceived'}, 0, 'Splitting up order did not receive any on original order'); > is($order2->{'quantity'}, 40, '40 items on original order'); > is($order2->{'budget_id'}, $budgetid, 'Budget on original order is unchanged'); >+is($order2->{notes}, "my notes", 'ModReceiveOrder and GetOrder deal with notes'); > > $neworder = GetOrder( $new_ordernumber ); > is($neworder->{'quantity'}, 2, '2 items on new order'); >@@ -194,13 +199,17 @@ my $budgetid2 = C4::Budgets::AddBudget( > 12, > $invoiceid, > 42, >- $budgetid2 >+ $budgetid2, >+ undef, >+ undef, >+ "my other notes", > ); > > my $order3 = GetOrder( $ordernumber3 ); > is($order3->{'quantityreceived'}, 0, 'Splitting up order did not receive any on original order'); > is($order3->{'quantity'}, 2, '2 items on original order'); > is($order3->{'budget_id'}, $budgetid, 'Budget on original order is unchanged'); >+is($order3->{notes}, "my other notes", 'ModReceiveOrder and GetOrder deal with notes'); > > $neworder = GetOrder( $new_ordernumber ); > is($neworder->{'quantity'}, 2, '2 items on new order'); >@@ -216,12 +225,16 @@ is($neworder->{'budget_id'}, $budgetid2, 'Budget on new order is changed'); > 12, > $invoiceid, > 42, >- $budgetid2 >+ $budgetid2, >+ undef, >+ undef, >+ "my third notes", > ); > > $order3 = GetOrder( $ordernumber3 ); > is($order3->{'quantityreceived'}, 2, 'Order not split up'); > is($order3->{'quantity'}, 2, '2 items on order'); > is($order3->{'budget_id'}, $budgetid2, 'Budget has changed'); >+is($order3->{notes}, "my third notes", 'ModReceiveOrder and GetOrder deal with notes'); > > $dbh->rollback; >-- >1.7.10.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 11699
:
25075
|
25076
|
25835
|
25836
|
25895
|
25896
|
25900
|
25901
|
26273
|
26274
|
26289
|
26290