Bugzilla – Attachment 97427 Details for
Bug 12502
Add columns for note, order number and ISBN to late orders page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12502: Add vendor note, internal note, ordernumber and isbn to late orders page
Bug-12502-Add-vendor-note-internal-note-ordernumbe.patch (text/plain), 10.45 KB, created by
Katrin Fischer
on 2020-01-16 07:20:05 UTC
(
hide
)
Description:
Bug 12502: Add vendor note, internal note, ordernumber and isbn to late orders page
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-01-16 07:20:05 UTC
Size:
10.45 KB
patch
obsolete
>From 16a3d9d1a7bd3917611d91ddfe3d2a1e94f06b67 Mon Sep 17 00:00:00 2001 >From: David Bourgault <david.bourgault@inlibro.com> >Date: Mon, 25 Sep 2017 15:18:38 -0400 >Subject: [PATCH] Bug 12502: Add vendor note, internal note, ordernumber and > isbn to late orders page >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Test plan: > >0) Make sure you have a late order > a) Create a test vendor unless you have one > b) Create a test basket unless you have one > c) Close the basket to mark the order as late >1) Go to the late orders table >Before patch : Orderno, ISBN, vendor notes, internal notes are absent >After patch: fields are present > >2) Edit the vendor note and/or the internal note >3) Press the save notes button >4) Refresh page and cache (CTRL+F5), if notes have been correctly saved, your modifications should be displayed. > >Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > C4/Acquisition.pm | 5 ++- > acqui/lateorders-export.pl | 3 ++ > acqui/lateorders.pl | 23 +++++++++++ > admin/columns_settings.yml | 9 +++++ > .../en/includes/csv_headers/acqui/lateorders.tt | 2 +- > .../prog/en/modules/acqui/lateorders.tt | 47 +++++++++++++++++++++- > 6 files changed, 85 insertions(+), 4 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index f21334b05f..a5aae898ae 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -2163,7 +2163,7 @@ sub GetLateOrders { > my @query_params = (); > my $select = " > SELECT aqbasket.basketno, >- aqorders.ordernumber, >+ aqorders.ordernumber AS ordernumber, > DATE(aqbasket.closedate) AS orderdate, > aqbasket.basketname AS basketname, > aqbasket.basketgroupid AS basketgroupid, >@@ -2172,6 +2172,8 @@ sub GetLateOrders { > aqorders.ecost AS unitpricelib, > aqorders.claims_count AS claims_count, > aqorders.claimed_date AS claimed_date, >+ aqorders.order_internalnote AS internalnote, >+ aqorders.order_vendornote AS vendornote, > aqbudgets.budget_name AS budget, > borrowers.branchcode AS branch, > aqbooksellers.name AS supplier, >@@ -2179,6 +2181,7 @@ sub GetLateOrders { > biblio.author, biblio.title, > biblioitems.publishercode AS publisher, > biblioitems.publicationyear, >+ biblioitems.isbn AS isbn, > ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) AS estimateddeliverydate, > "; > my $from = " >diff --git a/acqui/lateorders-export.pl b/acqui/lateorders-export.pl >index c8d86e6be4..332f65296b 100755 >--- a/acqui/lateorders-export.pl >+++ b/acqui/lateorders-export.pl >@@ -53,6 +53,9 @@ for my $ordernumber ( @ordernumbers ) { > basketno => $order->{basketno}, > claims_count => $order->{claims_count}, > claimed_date => $order->{claimed_date}, >+ internalnote => $order->{internalnote}, >+ vendornote => $order->{vendornote}, >+ isbn => $order->{isbn}, > } > ; > } >diff --git a/acqui/lateorders.pl b/acqui/lateorders.pl >index 9febcf65c9..5232dd7e05 100755 >--- a/acqui/lateorders.pl >+++ b/acqui/lateorders.pl >@@ -53,6 +53,7 @@ use C4::Context; > use C4::Acquisition; > use C4::Letters; > use Koha::DateUtils; >+use Koha::Acquisition::Orders; > > my $input = new CGI; > my ($template, $loggedinuser, $cookie) = get_template_and_user( >@@ -122,6 +123,28 @@ if ($op and $op eq "send_alert"){ > } > } > >+if ($op && $op eq "save"){ >+ my $listorders; >+ my @orders = $input->param; >+ >+ foreach my $order (@orders){ >+ if ( $order ne "op"){ >+ my @split = split (/_/,$order); >+ $listorders->{$split[0]}->{$split[1]} = $input->param($order); >+ } >+ } >+ >+ my $orders_rs = Koha::Acquisition::Orders->search({ ordernumber => [ keys %$listorders ] }); >+ while ( my $order = $orders_rs->next ) { >+ my $internalnote = $listorders->{$order->ordernumber}->{i}; >+ my $vendornote = $listorders->{$order->ordernumber}->{v}; >+ >+ $order->order_internalnote($internalnote) if defined $internalnote; >+ $order->order_vendornote($vendornote) if defined $vendornote; >+ $order->store; >+ } >+} >+ > my @parameters = ( $delay ); > push @parameters, $estimateddeliverydatefrom_dt > ? $estimateddeliverydatefrom_dt->ymd() >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index c1fdf398ca..f09752b423 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -38,6 +38,8 @@ modules: > cannot_be_toggled: 1 > cannot_be_modified: 1 > - >+ columnname: order_line >+ - > columnname: order_date > - > columnname: estimated_delivery_date >@@ -59,6 +61,13 @@ modules: > columnname: claims_count > - > columnname: claimed_date >+ - >+ columnname: internal_note >+ - >+ columnname: vendor_note >+ - >+ columnname: isbn >+ > basket: > orders: > - >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/acqui/lateorders.tt b/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/acqui/lateorders.tt >index 8231efbfc1..f15f54586e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/acqui/lateorders.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/csv_headers/acqui/lateorders.tt >@@ -1,4 +1,4 @@ > [%- USE Koha -%] > [%- SET delimiter = Koha.Preference( 'delimiter' ) || ',' -%] > >-[%- BLOCK -%]ORDER DATE[%- delimiter | html -%]ESTIMATED DELIVERY DATE[%- delimiter | html -%]VENDOR[%- delimiter | html -%]INFORMATION[%- delimiter | html -%]TOTAL COST[%- delimiter | html -%]BASKET[%- delimiter | html -%]CLAIMS COUNT[%- delimiter | html -%]CLAIMED DATE[%- END -%] >+[%- BLOCK -%]ORDER DATE[%- delimiter | html -%]ESTIMATED DELIVERY DATE[%- delimiter | html -%]VENDOR[%- delimiter | html -%]INFORMATION[%- delimiter | html -%]TOTAL COST[%- delimiter | html -%]BASKET[%- delimiter | html -%]CLAIMS COUNT[%- delimiter | html -%]CLAIMED DATE[%- delimiter | html -%]INTERNAL NOTE[%- delimiter | html -%]VENDOR NOTE[%- delimiter | html -%]ISBN[%- END -%] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >index 8773505d17..caa5653c2a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >@@ -56,6 +56,7 @@ > [% ELSE %] > <th></th> > [% END %] >+ <th>Order line</th> > <th class="title-string">Order date</th> > <th class="title-string">Estimated delivery date</th> > <th>Vendor</th> >@@ -67,6 +68,9 @@ > <th>Fund</th> > <th>Claims count</th> > <th class="title-string">Claimed date</th> >+ <th>Internal note</th> >+ <th>Vendor note</th> >+ <th>ISBN</th> > </tr> > </thead> > <tbody> >@@ -76,6 +80,9 @@ > <input type="checkbox" value="[% lateorder.ordernumber | html %]" data-booksellerid="[% lateorder.supplierid | html %]" name="ordernumber"> > </td> > <td> >+ [% lateorder.ordernumber | $raw %] >+ </td> >+ <td> > <span title="[% lateorder.orderdate | html %]">[% lateorder.orderdate | $KohaDates %] ([% lateorder.latesince | html %] days)</span> > </td> > <td> >@@ -131,14 +138,17 @@ > <span title="0000-00-00"></span> > [% END %] > </td> >+ <td><input name="internalnote" id="internalnote" type="text" value="[% lateorder.internalnote | html %]"></td> >+ <td><input name="vendornote" id="vendornote" type="text" value="[% lateorder.vendornote | html %]"></td> >+ <td>[% lateorder.isbn | $raw %]</td> > </tr> > [% END %] > </tbody> > <tfoot> > <tr> >- <th colspan="5">Total</th> >+ <th colspan="6">Total</th> > <th>[% total | html %]</th> >- <th colspan="6"> </th> >+ <th colspan="9"> </th> > </tr> > </tfoot> > </table> >@@ -149,6 +159,7 @@ > [% UNLESS lateorder.budget_lock %] > <input type="submit" value="Claim order" /> > [% END %] >+ <input type="button" value="Save notes" id="savenotes"/> > </p> > </form> > [% ELSE %]<p>There are no late orders.</p> >@@ -252,6 +263,38 @@ > location.href = url; > return false; > }); >+ // Update all notes >+ $("#savenotes").click(function(){ >+ $("#savenotes").after("<span id=\"loading\" style=\"margin:4px;\"><img src=\"[% interface | html %]/[% theme | html %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</span>"); >+ var all_nodes = $(late_orderst.fnGetNodes()); >+ var req = new XMLHttpRequest(); >+ var url = '/cgi-bin/koha/acqui/lateorders.pl'; >+ var data = new FormData(); >+ data.append("op","save"); >+ for (var i = 0; i < all_nodes.length; i++) { >+ var order = $(all_nodes[i]).find("input[name='ordernumber']"); >+ var internalnote = $(all_nodes[i]).find("input[name='internalnote']")[0].value; >+ var vendornote = $(all_nodes[i]).find("input[name='vendornote']")[0].value; >+ var internalnote_key = order[0].value + "_i"; >+ var vendornote_key = order[0].value + "_v"; >+ data.append(internalnote_key, internalnote); >+ data.append(vendornote_key, vendornote); >+ } >+ >+ req.open("POST",url); >+ req.send(data); >+ req.onreadystatechange = function () { >+ $("#loading").remove(); >+ if (req.readyState == '4' ){ >+ if ( req.status == 200 ){ >+ alert(_("Notes successfully saved")); >+ } >+ else { >+ alert(_("Error while saving the notes. Please try again")); >+ } >+ } >+ } >+ }); > }); > </script> > [% END %] >-- >2.11.0
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 12502
:
67349
|
67354
|
67586
|
67587
|
72168
|
72169
|
72170
|
73499
|
73500
|
73501
|
73502
|
73503
|
79231
|
80160
|
80602
|
87236
|
91564
|
95418
|
95419
|
95438
|
95439
|
95440
|
95441
| 97427 |
97428
|
97429
|
97430