Bugzilla – Attachment 114623 Details for
Bug 15348
Change/Edit estimated delivery date per order line
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15348: Add estimated delivery date field to individual orders
Bug-15348-Add-estimated-delivery-date-field-to-ind.patch (text/plain), 8.40 KB, created by
Aleisha Amohia
on 2020-12-22 21:22:00 UTC
(
hide
)
Description:
Bug 15348: Add estimated delivery date field to individual orders
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2020-12-22 21:22:00 UTC
Size:
8.40 KB
patch
obsolete
>From 5a38e26edb6133431471d317f716c40a4b50d0a8 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 16 Dec 2020 18:57:42 +1300 >Subject: [PATCH] Bug 15348: Add estimated delivery date field to individual > orders >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch allows you to specify an estimated delivery date per order. > >Work to do: >- Make the Late Orders page check the estimated delivery date field >- Make the Late Orders export functionality handle this >- Edit the estimated delivery date from Late Orders page > >Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ) >--- > acqui/addorder.pl | 5 ++++- > acqui/basket.pl | 3 ++- > acqui/neworderempty.pl | 3 ++- > .../bug_15348-add_aqorders.estimated_delivery_date.perl | 9 +++++++++ > installer/data/mysql/kohastructure.sql | 1 + > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 4 ++++ > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt | 7 +++++++ > 7 files changed, 29 insertions(+), 3 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_15348-add_aqorders.estimated_delivery_date.perl > >diff --git a/acqui/addorder.pl b/acqui/addorder.pl >index b9915e6aec..c91a9d60fb 100755 >--- a/acqui/addorder.pl >+++ b/acqui/addorder.pl >@@ -126,9 +126,10 @@ use C4::Biblio; # AddBiblio TransformKohaToMarc > use C4::Budgets; > use C4::Items; > use C4::Output; >+use C4::Barcodes; >+use Koha::DateUtils; > use Koha::Acquisition::Currencies; > use Koha::Acquisition::Orders; >-use C4::Barcodes; > > ### "-------------------- addorder.pl ----------" > >@@ -290,6 +291,8 @@ if ( $basket->{is_standing} || $orderinfo->{quantity} ne '0' ) { > } > ); > >+ $orderinfo->{estimated_delivery_date} = dt_from_string($orderinfo->{estimated_delivery_date}); >+ > # if we already have $ordernumber, then it's an ordermodif > my $order = Koha::Acquisition::Order->new($orderinfo); > if ( $orderinfo->{ordernumber} ) { >diff --git a/acqui/basket.pl b/acqui/basket.pl >index f77d86b88c..c88643452d 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -501,12 +501,13 @@ sub get_order_infos { > $line{order_object} = $order; > } > >- > my $suggestion = GetSuggestionInfoFromBiblionumber($line{biblionumber}); > $line{suggestionid} = $$suggestion{suggestionid}; > $line{surnamesuggestedby} = $$suggestion{surnamesuggestedby}; > $line{firstnamesuggestedby} = $$suggestion{firstnamesuggestedby}; > >+ $line{estimated_delivery_date} = $order->{estimated_delivery_date}; >+ > foreach my $key (qw(transferred_from transferred_to)) { > if ($line{$key}) { > my $order = GetOrder($line{$key}); >diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl >index 75624751fe..3cc77eaad4 100755 >--- a/acqui/neworderempty.pl >+++ b/acqui/neworderempty.pl >@@ -474,7 +474,8 @@ $template->param( > acqcreate => $basketobj->effective_create_items eq "ordering" ? 1 : "", > users_ids => join(':', @order_user_ids), > users => \@order_users, >- (uc(C4::Context->preference("marcflavour"))) => 1 >+ (uc(C4::Context->preference("marcflavour"))) => 1, >+ estimated_delivery_date => $data->{estimated_delivery_date}, > ); > > output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/installer/data/mysql/atomicupdate/bug_15348-add_aqorders.estimated_delivery_date.perl b/installer/data/mysql/atomicupdate/bug_15348-add_aqorders.estimated_delivery_date.perl >new file mode 100644 >index 0000000000..81b7297774 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_15348-add_aqorders.estimated_delivery_date.perl >@@ -0,0 +1,9 @@ >+use Date::Calc qw( Add_Delta_Days ); >+$DBversion = 'XXX'; >+if( CheckVersion( $DBversion ) ) { >+ unless( column_exists( 'aqorders', 'estimated_delivery_date' ) ) { >+ $dbh->do(q{ ALTER TABLE aqorders ADD estimated_delivery_date date default null AFTER suppliers_report }); >+ >+ NewVersion( $DBversion, 15348, "Add new column aqorders.estimated_delivery_date and pre-fill with calculated dates" ); >+ } >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index ef3bff04b0..49cd889934 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -3319,6 +3319,7 @@ CREATE TABLE `aqorders` ( -- information related to the basket line items > suppliers_reference_number varchar(35) default NULL, -- Suppliers unique edifact quote ref > suppliers_reference_qualifier varchar(3) default NULL, -- Type of number above usually 'QLI' > `suppliers_report` MEDIUMTEXT COLLATE utf8mb4_unicode_ci, -- reports received from suppliers >+ `estimated_delivery_date` date default null, > PRIMARY KEY (`ordernumber`), > KEY `basketno` (`basketno`), > KEY `biblionumber` (`biblionumber`), >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 ddd8df99ae..9025c6d97b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -412,6 +412,7 @@ > <th>GST</th> > <th>Fund</th> > <th>Supplier report</th> >+ <th>Estimated delivery date</th> > [% IF ( active ) %] > [% UNLESS ( closedate ) %] > <th class="NoSort">Modify</th> >@@ -439,6 +440,7 @@ > <th>[% foot_loo.tax_value | $Price %]</th> > <th> </th> > <th> </th> >+ <th>[% foot_loo.estimated_delivery_date | $KohaDates | html %]</th> > [% IF ( active ) %] > [% UNLESS ( closedate ) %] > <th> </th> >@@ -464,6 +466,7 @@ > <th>[% total_tax_value | $Price %]</th> > <th> </th> > <th> </th> >+ <th>[% estimated_delivery_date | $KohaDates | html %]</th> > [% IF ( active ) %] > [% UNLESS ( closedate ) %] > <th> </th> >@@ -548,6 +551,7 @@ > <td class="number [% IF books_loo.tax_value.search(zero_regex) %]error[% END %]">[% books_loo.tax_value | $Price %]</td> > <td>[% books_loo.budget_name | html %]</td> > <td>[% books_loo.suppliers_report | html %]</td> >+ <td>[% books_loo.estimated_delivery_date | $KohaDates | html %]</td> > [% IF ( active ) %] > [% UNLESS ( closedate ) %] > <td> >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 37d4f99cce..69329405d8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt >@@ -448,6 +448,11 @@ > <label for="order_vendornote">Vendor note: </label> > <textarea id="order_vendornote" cols="30" rows="3" name="order_vendornote" >[% IF ( order_vendornote ) %][% order_vendornote | html %][% END %]</textarea> > </li> >+ <li> >+ <label for="estimated_delivery_date">Estimated delivery date: </label> >+ <input type="text" id="estimated_delivery_date" size="10" name="estimated_delivery_date" class="datepicker" value="[% estimated_delivery_date | html %]"/> >+ <div class="hint">[% INCLUDE 'date-format.inc' %]</div> >+ </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> > <input id="sort1" type="text" id="sort1" size="20" name="sort1" value="[% sort1 | html %]" /> >@@ -647,6 +652,8 @@ > getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 ); > }); > $("#budget_id").change(); >+ >+ $("#estimated_delivery_date").datepicker(); > }); > > function UserSearchPopup(f) { >-- >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 15348
:
114430
|
114583
|
114623
|
115121
|
115122
|
115123
|
115124
|
116517
|
118788
|
118789
|
119297
|
119298
|
119299
|
120653
|
120654
|
120655
|
120656
|
136560
|
136561
|
136562
|
136563
|
137057
|
137058
|
137061
|
137098
|
137099
|
137740
|
137741
|
137742
|
137743
|
138110
|
138491
|
138529
|
138530
|
138531
|
138532
|
138533
|
138534
|
138535
|
138536
|
138537
|
138538
|
138539
|
138540
|
139245
|
139274
|
139301
|
139329
|
139330
|
139331
|
139332
|
139333
|
139334
|
139335
|
139336
|
139337
|
139338
|
139339
|
139340
|
139341
|
139342
|
139343
|
139351
|
139352
|
139353
|
139354
|
139355
|
139356
|
139357
|
139358
|
139359
|
139360
|
139361
|
139362
|
139363
|
139364
|
139365
|
139831
|
139832
|
139833
|
139834
|
139835
|
139836
|
139837
|
139838
|
139839
|
139840
|
139841
|
139842
|
139843
|
139844
|
139845
|
140708
|
140735
|
143896
|
143900
|
143903
|
143904