Bugzilla – Attachment 23798 Details for
Bug 9416
We should have 2 kinds of notes for each order line
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Add a new note for vendor in each order
0002-Bug-9416-Add-a-new-note-for-vendor-in-each-order.patch (text/plain), 20.38 KB, created by
Mathieu Saby
on 2013-12-24 00:09:07 UTC
(
hide
)
Description:
Add a new note for vendor in each order
Filename:
MIME Type:
Creator:
Mathieu Saby
Created:
2013-12-24 00:09:07 UTC
Size:
20.38 KB
patch
obsolete
>From 5648ab243767bf07858ded6da97b32baa8864e8c Mon Sep 17 00:00:00 2001 >From: Mathieu Saby <mathieu.saby@univ-rennes2.fr> >Date: Fri, 20 Sep 2013 14:28:51 +0200 >Subject: [PATCH] Bug 9416: Add a new note for vendor in each order >Content-Type: text/plain; charset="utf-8" > >This patch adds a new note made for vendor in each order. The existing note is renamed "internal note". >The behavior of the 2 notes are the same >An other patch will display this vendor note in pdf printed basketgroups. > >Changes in database structure: >- new column aqorders.order_vendornote >- column aqorders.notes renamed aqorders.order_internalnote > >To test : >Make a complete acquisiton process (creating the order > looking at the basket > looking the order > receiving) >and try to use the 2 notes (internal note / vendor note) >check the changes made on one page (eg detail of the order) are well saved and visible on an other page (eg receipt page) > >--- > C4/Acquisition.pm | 6 +++--- > Koha/Schema/Result/Aqorder.pm | 11 +++++++++-- > acqui/modordernotes.pl | 17 ++++++++++++----- > acqui/orderreceive.pl | 3 ++- > installer/data/mysql/kohastructure.sql | 3 ++- > installer/data/mysql/updatedatabase.pl | 7 +++++++ > .../prog/en/modules/acqui/addorderiso2709.tt | 4 ++-- > .../intranet-tmpl/prog/en/modules/acqui/basket.tt | 13 +++++++++---- > .../prog/en/modules/acqui/modordernotes.tt | 9 +++++---- > .../prog/en/modules/acqui/neworderempty.tt | 8 ++++++-- > .../prog/en/modules/acqui/orderreceive.tt | 6 ++++-- > .../intranet-tmpl/prog/en/modules/acqui/parcel.tt | 13 +++++++++---- > 12 files changed, 70 insertions(+), 30 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 41f85fb..87834e4 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -310,7 +310,7 @@ sub GetBasketAsCSV { > publicationyear => $bd->{'publicationyear'}, > publishercode => $bd->{'publishercode'}, > collectiontitle => $bd->{'collectiontitle'}, >- notes => $order->{'notes'}, >+ notes => $order->{'order_internalnote'}, > quantity => $order->{'quantity'}, > rrp => $order->{'rrp'}, > deliveryplace => C4::Branch::GetBranchName( $basket->{'deliveryplace'} ), >@@ -381,7 +381,7 @@ sub GetBasketGroupAsCSV { > rrp => $order->{rrp}, > discount => $bookseller->{discount}, > ecost => $order->{ecost}, >- notes => $order->{notes}, >+ notes => $order->{order_internalnote}, > entrydate => $order->{entrydate}, > booksellername => $bookseller->{name}, > bookselleraddress => $bookseller->{address1}, >@@ -1241,7 +1241,7 @@ Else, the upcoming July 1st is used. > > =item defaults entrydate to Now > >-The following keys are used: "biblionumber", "title", "basketno", "quantity", "notes", "rrp", "ecost", "gstrate", "unitprice", "subscription", "sort1", "sort2", "booksellerinvoicenumber", "listprice", "budgetdate", "purchaseordernumber", "branchcode", "booksellerinvoicenumber", "budget_id". >+The following keys are used: "biblionumber", "title", "basketno", "quantity", "order_vendornote", "order_internalnote", "rrp", "ecost", "gstrate", "unitprice", "subscription", "sort1", "sort2", "booksellerinvoicenumber", "listprice", "budgetdate", "purchaseordernumber", "branchcode", "booksellerinvoicenumber", "budget_id". > > =back > >diff --git a/Koha/Schema/Result/Aqorder.pm b/Koha/Schema/Result/Aqorder.pm >index 30c34a7..d98e0f2 100644 >--- a/Koha/Schema/Result/Aqorder.pm >+++ b/Koha/Schema/Result/Aqorder.pm >@@ -106,7 +106,12 @@ __PACKAGE__->table("aqorders"); > datetime_undef_if_invalid: 1 > is_nullable: 1 > >-=head2 notes >+=head2 order_internalnote >+ >+ data_type: 'mediumtext' >+ is_nullable: 1 >+ >+=head2 order_vendornote > > data_type: 'mediumtext' > is_nullable: 1 >@@ -264,7 +269,9 @@ __PACKAGE__->add_columns( > { data_type => "varchar", is_nullable => 1, size => 10 }, > "datecancellationprinted", > { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 }, >- "notes", >+ "order_internalnote", >+ { data_type => "mediumtext", is_nullable => 1 }, >+ "order_vendornote", > { data_type => "mediumtext", is_nullable => 1 }, > "supplierreference", > { data_type => "mediumtext", is_nullable => 1 }, >diff --git a/acqui/modordernotes.pl b/acqui/modordernotes.pl >index ffdc9f6..74ccd18 100755 >--- a/acqui/modordernotes.pl >+++ b/acqui/modordernotes.pl >@@ -47,7 +47,7 @@ my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user( { > my $op = $input->param('op'); > my $ordernumber = $input->param('ordernumber'); > my $referrer = $input->param('referrer') || $input->referer(); >- >+my $type = $input->param('type'); > my $order = GetOrder($ordernumber); > my $basket = GetBasket($order->{basketno}); > my ($bookseller) = GetBookSellerFromId($basket->{booksellerid}); >@@ -55,14 +55,20 @@ my ($bookseller) = GetBookSellerFromId($basket->{booksellerid}); > > if($op and $op eq 'save') { > my $ordernotes = $input->param('ordernotes'); >- $order->{'notes'} = $ordernotes; >+ if ($type eq "vendor") { >+ $order->{'order_vendornote'} = $ordernotes; >+ } else { >+ $order->{'order_internalnote'} = $ordernotes; >+ } > ModOrder($order); > print $input->redirect($referrer); > exit; > } else { >- $template->param( >- ordernotes => $order->{'notes'}, >- ); >+ if ($type eq "vendor") { >+ $template->param(ordernotes => $order->{'order_vendornote'}); >+ } else { >+ $template->param(ordernotes => $order->{'order_internalnote'}); >+ } > } > > if($op) { >@@ -76,6 +82,7 @@ $template->param( > booksellername => $bookseller->{'name'}, > ordernumber => $ordernumber, > referrer => $referrer, >+ type => $type, > ); > > >diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl >index 2a21c14..50920e0 100755 >--- a/acqui/orderreceive.pl >+++ b/acqui/orderreceive.pl >@@ -222,7 +222,8 @@ $template->param( > invoice => $invoice->{invoicenumber}, > datereceived => $datereceived->output(), > datereceived_iso => $datereceived->output('iso'), >- notes => $order->{notes}, >+ order_internalnote => $order->{order_internalnote}, >+ order_vendornote => $order->{order_vendornote}, > suggestionid => $suggestion->{suggestionid}, > surnamesuggestedby => $suggestion->{surnamesuggestedby}, > firstnamesuggestedby => $suggestion->{firstnamesuggestedby}, >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 136104f..5a1a54a 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -2994,7 +2994,8 @@ CREATE TABLE `aqorders` ( -- information related to the basket line items > `quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far > `cancelledby` varchar(10) default NULL, -- not used? always NULL > `datecancellationprinted` date default NULL, -- the date the line item was deleted >- `notes` mediumtext, -- notes related to this order line >+ `order_internalnote` mediumtext, -- notes related to this order line, made for staff >+ `order_vendornote` mediumtext, -- notes related to this order line, made for vendor > `supplierreference` mediumtext, -- not used? always NULL > `purchaseordernumber` mediumtext, -- not used? always NULL > `basketno` int(11) default NULL, -- links this order line to a specific basket (aqbasket.basketno) >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 0220b42..84d5852 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7875,6 +7875,13 @@ $DBversion = "3.15.00.010"; > if(CheckVersion($DBversion)) { > $dbh->do("ALTER TABLE deleteditems DROP COLUMN marc"); > print "Upgrade to $DBversion done (Bug 6331: remove obsolete column in deleteditems.marc)\n"; >+} >+ >+$DBversion = "3.15.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do("ALTER TABLE aqorders CHANGE notes order_internalnote MEDIUMTEXT;"); >+ $dbh->do("ALTER TABLE aqorders ADD COLUMN order_vendornote MEDIUMTEXT AFTER order_internalnote;"); >+ print "Upgrade to $DBversion done (Bug 9416 - We should have 2 kinds of notes for each order line\n"; > SetVersion($DBversion); > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >index 48a21b9..b152856 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt >@@ -205,8 +205,8 @@ > [% END %] > </li> > <li> >- <label for="notes">Notes: </label> >- <textarea id="notes" cols="30" rows="3" name="notes"></textarea> >+ <label for="order_internalnote">Internal note: </label> >+ <textarea id="order_internalnote" cols="30" rows="3" name="order_internalnote"></textarea> > </li> > <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div> > <label for="sort1">Planning value1: </label> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >index c94aa86..5dd6e15 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -476,10 +476,15 @@ > (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% books_loo.suggestionid %]&op=show">suggestion #[% books_loo.suggestionid %]</a>) > [% END %] > </p> >- [% IF ( books_loo.notes ) %] >- <p class="ordernote"><strong>Note: </strong>[% books_loo.notes|html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]">Change note</a>]</p> >+ [% IF ( books_loo.order_internalnote ) %] >+ <p class="ordernote"><strong>Internal note: </strong>[% books_loo.order_internalnote|html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&type=internal">Change internal note</a>]</p> > [% ELSE %] >- <p>[<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]">Add note</a>]</p> >+ [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&type=internal">Add internal note</a>] >+ [% END %] >+ [% IF ( books_loo.order_vendornote ) %] >+ <p class="ordernote"><strong>Vendor note: </strong>[% books_loo.order_vendornote|html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&type=vendor">Change vendor note</a>]</p> >+ [% ELSE %] >+ [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% books_loo.ordernumber %]&type=vendor">Add vendor note</a>] > [% END %] > [% IF (books_loo.transferred_from) %] > [% basket = books_loo.transferred_from.basket %] >@@ -579,7 +584,7 @@ > [% ELSE %] > <em>Deleted bibliographic record, can't find title</em><br /> > [% END %] >- [% IF ( order.notes ) %] [% order.notes %][% END %] >+ [% IF ( order.order_internalnote ) %] [% order.order_internalnote %][% END %] > [% IF ( order.isbn ) %] - [% order.isbn %][% END %] > [% IF ( order.issn ) %] - [% order.issn %][% END %] > [% IF ( order.publishercode ) %], [% order.publishercode %][% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/modordernotes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/modordernotes.tt >index 6fc4867..ee60b0e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/modordernotes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/modordernotes.tt >@@ -1,26 +1,27 @@ > [% INCLUDE 'doc-head-open.inc' %] >-<title>Koha › Acquisition › Change order notes</title> >+<title>Koha › Acquisition › Change order [% IF (type == "vendor") %]vendor[% ELSE %]internal[% END %] note</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> > > <body> > [% INCLUDE 'header.inc' %] > >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisition</a> › <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername|html %]</a> › <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Basket [% basketname|html %] ([% basketno %])</a> › Change order notes</div> >+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisition</a> › <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername|html %]</a> › <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Basket [% basketname|html %] ([% basketno %])</a> › Change order [% IF (type == "vendor") %]vendor[% ELSE %]internal[% END %] note</div> > > <div id="doc" class="yui-t7"> > > <div id="bd"> > <div id="yui-main"> >- <h1>Change order notes (order no. [% ordernumber %])</h1> >+ <h1>Change order [% IF (type == "vendor") %]vendor[% ELSE %]internal[% END %] note (order no. [% ordernumber %])</h1> > <form action="/cgi-bin/koha/acqui/modordernotes.pl" method="post"> > <fieldset class="brief"> >- <label for="ordernotes">Notes:</label> >+ <label for="ordernotes">Note:</label> > <textarea id="ordernotes" name="ordernotes" rows="3" cols="30" class="focus">[% ordernotes %]</textarea> > </fieldset> > <input type="hidden" name="referrer" value="[% referrer %]" /> > <input type="hidden" name="ordernumber" value="[% ordernumber %]" /> > <input type="hidden" name="op" value="save" /> >+ <input type="hidden" name="type" value="[% type %]" /> > <fieldset class="action"> > <input type="submit" value="Save" /> > <a class="cancel" href="[% referrer %]">Cancel</a> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >index c261530..ed02a11 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >@@ -535,8 +535,12 @@ $(document).ready(function() > [% END %] > </li> > <li> >- <label for="notes">Notes: </label> >- <textarea id="notes" cols="30" rows="3" name="notes" >[% IF ( notes ) %][% notes %][% END %]</textarea> >+ <label for="order_internalnote">Internal note: </label> >+ <textarea id="order_internalnote" cols="30" rows="3" name="order_internalnote" >[% IF ( order_internalnote ) %][% order_internalnote %][% END %]</textarea> >+ </li> >+ <li> >+ <label for="order_vendornote">Vendor note: </label> >+ <textarea id="order_vendornote" cols="30" rows="3" name="order_vendornote" >[% IF ( order_vendornote ) %][% order_vendornote %][% END %]</textarea> > </li> > <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div> > <label for="sort1">Statistic 1: </label> >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 cac2132..42cdbb0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >@@ -328,8 +328,10 @@ > <input type="text" size="20" name="cost" id="cost" value="[% unitprice %]" /> > [% 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> >+ [% END %]</li> >+ <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote %]</textarea></li> >+ <li><label for="order_vendornote">Vendor note: </label><textarea name="order_vendornote" width="40" rows="8" >[% order_vendornote %]</textarea></li> >+ </ol> > </fieldset> > > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >index 9d5fae9..a490d2d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >@@ -248,17 +248,22 @@ > <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_order.biblionumber %]">[% loop_order.title |html %]</a> > [% IF ( loop_order.author ) %] by [% loop_order.author %][% END %] > [% IF ( loop_order.isbn ) %] – [% loop_order.isbn %][% END %] >- [% IF ( loop_order.publishercode ) %]<br />Publisher :[% loop_order.publishercode %][% END %] >+ [% IF ( loop_order.publishercode ) %]<br />Publisher:[% loop_order.publishercode %][% END %] > [% IF ( loop_order.suggestionid ) %] > <br/> > Suggested by: [% loop_order.surnamesuggestedby %][% IF ( loop_order.firstnamesuggestedby ) %], [% loop_order.firstnamesuggestedby %] [% END %] > (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loop_order.suggestionid %]&op=show">suggestion #[% loop_order.suggestionid %]</a>) > [% END %] > <br /> >- [% IF ( loop_order.notes ) %] >- <p class="ordernote"><strong>Note: </strong>[% loop_order.notes|html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]">Change note</a>]</p> >+ [% IF ( loop_order.order_internalnote ) %] >+ f<p class="ordernote"><strong>Internal note: </strong>[% loop_order.order_internalnote|html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]&type=internal">Change internal note</a>]</p> > [% ELSE %] >- [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]">Add note</a>] >+ [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]&type=internal">Add internal note</a>] >+ [% END %] >+ [% IF ( loop_order.order_vendornote ) %] >+ <p class="ordernote"><strong>Vendor note: </strong>[% loop_order.order_vendornote|html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]&type=vendor">Change vendor note</a>]</p> >+ [% ELSE %] >+ [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]&type=vendor">Add vendor note</a>] > [% END %] > </td> > <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% loop_order.biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td> >-- >1.7.9.5 >
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 9416
:
21293
|
21964
|
23798
|
25329
|
25335
|
27231
|
27274
|
27299
|
27300
|
27301
|
27302
|
27304
|
27305
|
27306