Bugzilla – Attachment 72168 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 and internal note to late orders page
Bug-12502---Add-vendor-and-internal-note-to-late-o.patch (text/plain), 7.00 KB, created by
Charles Farmer
on 2018-02-23 22:53:28 UTC
(
hide
)
Description:
Bug 12502 - Add vendor and internal note to late orders page
Filename:
MIME Type:
Creator:
Charles Farmer
Created:
2018-02-23 22:53:28 UTC
Size:
7.00 KB
patch
obsolete
>From ffcc714400f278636089f39e07124807095cf483 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 and internal note to late orders page > >Followed test plan and patch worked as described. Also ran QA test tools >and all modified files passed. > >Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> >--- > C4/Acquisition.pm | 23 +++++++++++++++++ > acqui/lateorders-export.pl | 2 ++ > acqui/lateorders.pl | 14 ++++++++++ > .../en/includes/csv_headers/acqui/lateorders.tt | 2 +- > .../prog/en/modules/acqui/lateorders.tt | 30 +++++++++++++++++++++- > 5 files changed, 69 insertions(+), 2 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 202ed7e..585527d 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -93,6 +93,8 @@ BEGIN { > &NotifyOrderUsers > > &FillWithDefaultValues >+ >+ &ModNotesOrder > ); > } > >@@ -1371,6 +1373,25 @@ sub ModOrder { > > #------------------------------------------------------------# > >+=head3 ModNotesOrder >+ >+ ModNotesOrder($orders); >+ >+Modifies internal and vendor note off all items in orders >+ >+=cut >+ >+sub ModNotesOrder{ >+ my $orders = shift; >+ my $dbh = C4::Context->dbh; >+ my $sth = $dbh->prepare("UPDATE aqorders SET order_internalnote = ?, order_vendornote = ? WHERE ordernumber = ?"); >+ foreach my $ordernumber (keys %$orders) { >+ $sth->execute($orders->{$ordernumber}->{'i'}, $orders->{$ordernumber}->{'v'}, $ordernumber) if ($orders->{$ordernumber}->{'i'} || $orders->{$ordernumber}->{'v'}); >+ } >+} >+ >+ #------------------------------------------------------------# >+ > =head3 ModItemOrder > > ModItemOrder($itemnumber, $ordernumber); >@@ -2125,6 +2146,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, >diff --git a/acqui/lateorders-export.pl b/acqui/lateorders-export.pl >index c8d86e6..70f73e2 100755 >--- a/acqui/lateorders-export.pl >+++ b/acqui/lateorders-export.pl >@@ -53,6 +53,8 @@ for my $ordernumber ( @ordernumbers ) { > basketno => $order->{basketno}, > claims_count => $order->{claims_count}, > claimed_date => $order->{claimed_date}, >+ internalnote => $order->{internaldate}, >+ vendornote => $order->{vendornote}, > } > ; > } >diff --git a/acqui/lateorders.pl b/acqui/lateorders.pl >index 9febcf6..1f440ca 100755 >--- a/acqui/lateorders.pl >+++ b/acqui/lateorders.pl >@@ -122,6 +122,20 @@ if ($op and $op eq "send_alert"){ > } > } > >+if ($op && $op eq "save"){ >+ my $listorders; >+ my $ordernumber; >+ my @orders = $input->param; >+ >+ foreach my $order (@orders){ >+ if ( $order ne "op"){ >+ my @split = split (/_/,$order); >+ $listorders->{$split[0]}->{$split[1]} = $input->param($order); >+ } >+ } >+ ModNotesOrder($listorders); >+} >+ > my @parameters = ( $delay ); > push @parameters, $estimateddeliverydatefrom_dt > ? $estimateddeliverydatefrom_dt->ymd() >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 29b77d5..f2c55d6 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 -%]ESTIMATED DELIVERY DATE[%- delimiter -%]VENDOR[%- delimiter -%]INFORMATION[%- delimiter -%]TOTAL COST[%- delimiter -%]BASKET[%- delimiter -%]CLAIMS COUNT[%- delimiter -%]CLAIMED DATE[%- END -%] >\ No newline at end of file >+[%- BLOCK -%]ORDER DATE[%- delimiter -%]ESTIMATED DELIVERY DATE[%- delimiter -%]VENDOR[%- delimiter -%]INFORMATION[%- delimiter -%]TOTAL COST[%- delimiter -%]BASKET[%- delimiter -%]CLAIMS COUNT[%- delimiter -%]CLAIMED DATE[%- delimiter -%]INTERNAL NOTE[%- delimiter -%]VENDOR NOTE[%- 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 97797ad..c400e53 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt >@@ -64,6 +64,29 @@ $(document).ready(function() { > location.href = url; > return false; > }); >+ // Update all notes >+ $("#savenotes").click(function(){ >+ 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']"); >+ var vendornote = $(all_nodes[i]).find("input[name='vendornote']"); >+ data.append(order[0].value + "_i",internalnote[0].value); >+ data.append(order[0].value + "_v",vendornote[0].value); >+ } >+ >+ req.open("POST",url); >+ req.send(data); >+ req.onreadystatechange = function () { >+ if (req.readyState == '4' ){ >+ alert(_("all notes is modified correctly")); >+ } >+ } >+ }); > }); > //]]> > </script> >@@ -127,6 +150,8 @@ $(document).ready(function() { > <th>Fund</th> > <th>Claims count</th> > <th class="title-string">Claimed date</th> >+ <th>Internal note</th> >+ <th>Vendor note</th> > </tr> > </thead> > <tbody> >@@ -191,6 +216,8 @@ $(document).ready(function() { > <span title="0000-00-00"></span> > [% END %] > </td> >+ <td><input name="internalnote" id="internalnote" type="text" value="[% lateorder.internalnote %]"></td> >+ <td><input name="vendornote" id="vendornote" type="text" value="[% lateorder.vendornote %]"></td> > </tr> > [% END %] > </tbody> >@@ -198,7 +225,7 @@ $(document).ready(function() { > <tr> > <th colspan="5">Total</th> > <th>[% total %]</th> >- <th colspan="6"> </th> >+ <th colspan="8"> </th> > </tr> > </tfoot> > </table> >@@ -209,6 +236,7 @@ $(document).ready(function() { > [% 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> >-- >2.7.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 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