Bugzilla – Attachment 166417 Details for
Bug 34444
Statistic 1/2 not saving when updating fund after receipt
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34444: [22.11.x] Correct handling of sort1 and sort2 values
Bug-34444-2211x-Correct-handling-of-sort1-and-sort.patch (text/plain), 5.43 KB, created by
Nick Clemens (kidclamp)
on 2024-05-08 13:26:19 UTC
(
hide
)
Description:
Bug 34444: [22.11.x] Correct handling of sort1 and sort2 values
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2024-05-08 13:26:19 UTC
Size:
5.43 KB
patch
obsolete
>From 47f4fe1f95fa8bda106587c945f3428ff46995c6 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 8 May 2024 13:22:58 +0000 >Subject: [PATCH] Bug 34444: [22.11.x] Correct handling of sort1 and sort2 > values > >Removed extraneous sort_1 data elements >Update selectors to use field names for statistics field >Updated code to set the value after finding the correct selector > >To test: >* Make sure you have at least 2 funds with different stat settings, using AV and not >* Create a basket with an order line >* Close it and receive shipment >* Create an invoice and receive the order line >* Finish receiving > >* Click "Modify fund" >* Switch fund, verify the stat fields are updated accordingly >* Change values for statistical values >* Update fund >* Edit fund again, pull downs are correct >* Change values in form and close, do not update >* Click 'Modify fund' - confrim form is filled with the saved values >--- > .../prog/en/modules/acqui/invoice.tt | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt >index b4b5fb9debd..1e7b1870dbf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt >@@ -372,7 +372,7 @@ > </td> > <td> > <span class="order_name" data-order_id="[% order.ordernumber | html %]">[% order.budget_name | html %]</span></br> >- <a href="#" class="modify_fund" data-order_id="[% order.ordernumber | html %]" data-budget_id="[% order.budget_id | html %]" data-sort_1="[% order.sort1 | html %]" data-sort_2="[% order.sort2 | html %]" data-sort1="[% order.sort1 | html %]" data-sort2="[% order.sort2 | html %]">Modify fund</a> >+ <a href="#" class="modify_fund" data-order_id="[% order.ordernumber | html %]" data-budget_id="[% order.budget_id | html %]" data-sort1="[% order.sort1 | html %]" data-sort2="[% order.sort2 | html %]">Modify fund</a> > </td> > </tr> > [% END # /FOREACH order %] >@@ -596,16 +596,16 @@ > $("#update_fund").data('order_id',$(this).data('order_id')); > $("#modify_budget_id").html(disabledBudgetsCopy); > $("#modify_budget_id").val(selected).find('option[value="'+selected+'"]').removeClass('b_inactive'); >- $("#sort1").val(sort1); >- $("#sort2").val(sort2); >+ $("#updateFund").find('[name="sort1"]').val(sort1); >+ $("#updateFund").find('[name="sort2"]').val(sort2); > $("#modify_budget_id").find('.b_inactive').remove(); > $("#modify_budget_id").change(); > $("#updateFund").modal('show'); > }); > $("#update_fund").on('click',function(){ > var new_fund = $("#modify_budget_id").val(); >- var sort1 = $("#sort1").val(); >- var sort2 = $("#sort2").val(); >+ var sort1 = $("#updateFund").find('[name="sort1"]').val(); >+ var sort2 = $("#updateFund").find('[name="sort2"]').val(); > var new_fund_name = $('#modify_budget_id option[value="'+new_fund+'"]').text(); > var order_id = $(this).data('order_id'); > let options = { >@@ -623,6 +623,8 @@ > $("#updateFund").modal('hide'); > $('#updateFund .showallfunds').prop('checked',false); > $('.modify_fund[data-order_id="'+order_id+'"]').data('budget_id',new_fund); >+ $('.modify_fund[data-order_id="'+order_id+'"]').data('sort1',sort1); >+ $('.modify_fund[data-order_id="'+order_id+'"]').data('sort2',sort2); > $('.order_name[data-order_id="'+order_id+'"]').text(new_fund_name); > humanMsg.displayAlert( _("Order updated"), { className: 'humanError' } ); > }) >@@ -633,16 +635,16 @@ > $("#modify_budget_id").change(function(){ > var destination_sort1 = $(this).parents('.modal-body').find('input[name="sort1"]'); > var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat'); >- var sort1 = $(destination_sort1).val() || ""; > if ( destination_sort1.length < 1 ) { > destination_sort1 = $(this).parents('.modal-body').find('select[name="sort1"]'); > } >+ var sort1 = $(destination_sort1).val() || ""; > var destination_sort2 = $(this).parents('.modal-body').find('input[name="sort2"]'); > var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat'); >- var sort2 = $(destination_sort2).val() || ""; > if ( destination_sort2.length < 1 ) { > destination_sort2 = $(this).parents('.modal-body').find('select[name="sort2"]'); > } >+ var sort2 = $(destination_sort2).val() || ""; > getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 ); > getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 ); > }); >-- >2.39.2
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 34444
: 166417 |
166419
|
166481
|
167451