Bug 32382: Fix alignment on invoice summary page
authorLucas Gass <lucas@bywatersolutions.com>
Fri, 2 Dec 2022 00:18:59 +0000 (00:18 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 31 Jan 2023 12:35:57 +0000 (09:35 -0300)
To test:

1. Apply patch
2. Have some funds from budgets that are both active and inactive
3. Receive a basket and click 'Finish receiving' to get to the invoice page
4. Look at the Fund/Show inactive line and make sure it is aligned right
5. With some inactive funds click 'Show inactive' and make sure they appear in this dropdown
6. Click 'Add an adjustment'. Make sure the Fund/Show inactive line looks correct there as well/
7. Make an adjustment and click 'Update adjustments' make sure the line also looks right in the table that appears.
8. Inside that table make sure you can click the 'Show inactive' checkbox and the inactive budgets appears.

Note: Some of the HTML was ouside of the HTML body, so I moved it into the HTML body so it will be valid.

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt

index 534f07d..62f2af7 100644 (file)
@@ -7,57 +7,14 @@
 [% USE AuthorisedValues %]
 [% Asset.css("css/humanmsg.css") | $raw %]
 
-<span style="display:none;" id="all_fund_dropdown">
-    [% FOREACH budget IN budgets %]
-        [% IF ( budget.b_active ) %]
-            <option value="[% budget.b_id | html %]" data-sort1-authcat="[% budget.b_sort1_authcat | html %]" data-sort2-authcat="[% budget.b_sort2_authcat | html %]">[% budget.b_txt | html %]</option>
-        [% ELSE %]
-            <option value="[% budget.b_id | html %]" class="b_inactive" data-sort1-authcat="[% budget.b_sort1_authcat | html %]" data-sort2-authcat="[% budget.b_sort2_authcat |html %]">[% budget.b_txt | html %] (inactive)</option>
-        [% END %]
-    [% END %]
-</span>
 [% BLOCK fund_dropdown %]
-    <span>
     <label for="[% form_name | html %]">Fund: </label>
     <select id="[% form_id | html %]" name="[% form_name | html %]" class="fund_dropdown" data-selected="[% selected | html %]">
     </select>
-    <label for="showallfunds" style="float:none;width:auto;">&nbsp;Show inactive:</label>
+    <label for="showallfunds">&nbsp;Show inactive:</label>
     <input type="checkbox" class="showallfunds" />
-    </span>
 [% END %]
 
-<div id="updateFund" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="updateReceivedFund" aria-hidden="true">
-    <div class="modal-dialog">
-        <div class="modal-content">
-            <div class="modal-header">
-                <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
-                <h3 id="updateReceivedFund">Update received fund</h3>
-            </div>
-            <div class="modal-body">
-                <p>Updating the fund may change available statistics for the order, please check values before submitting.</p>
-                <fieldset class="rows">
-                <ol>
-                    <li>[% PROCESS fund_dropdown form_id => 'modify_budget_id' form_name => 'modify_budget_id' selected => "" %]</li>
-                    <li>
-                        <label for="sort1">Statistic 1: </label>
-                        <input type="text" name="sort1" />
-                    </li>
-                    <li>
-                        <label for="sort2">Statistic 2: </label>
-                        <input type="text" name="sort2" />
-                    </li>
-                </ol>
-                </fieldset>
-                <a id="update_fund" class="btn btn-default">Update fund</a>
-            </div>
-            <div class="modal-footer">
-                <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
-            </div>
-        </div>
-    </div>
-</div>
-
-
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Invoice &rsaquo; Acquisitions &rsaquo; Koha</title>
 [% INCLUDE 'doc-head-close.inc' %]
                              <th>Note</th>
                              <th>Fund</th>
                              <th>Encumber while invoice open</th>
-                             [% UNLESS readonly %]<th>&nbsp</th>[% END %]
+                             [% UNLESS readonly %]<th>&nbsp;</th>[% END %]
                           </tr>
                           [% total_adj = 0 %]
                           [% FOREACH adjustment IN adjustments %]
     </aside>
 </div> <!-- /.row -->
 
+<div id="updateFund" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="updateReceivedFund" aria-hidden="true">
+    <div class="modal-dialog">
+        <div class="modal-content">
+            <div class="modal-header">
+                <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
+                <h3 id="updateReceivedFund">Update received fund</h3>
+            </div>
+            <div class="modal-body">
+                <p>Updating the fund may change available statistics for the order, please check values before submitting.</p>
+                <fieldset class="rows">
+                <ol>
+                    <li>[% PROCESS fund_dropdown form_id => 'modify_budget_id' form_name => 'modify_budget_id' selected => "" %]</li>
+                    <li>
+                        <label for="sort1">Statistic 1: </label>
+                        <input type="text" name="sort1" />
+                    </li>
+                    <li>
+                        <label for="sort2">Statistic 2: </label>
+                        <input type="text" name="sort2" />
+                    </li>
+                </ol>
+                </fieldset>
+                <a id="update_fund" class="btn btn-default">Update fund</a>
+            </div>
+            <div class="modal-footer">
+                <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
+            </div>
+        </div>
+    </div>
+</div>
+
+<span style="display:none;" id="all_fund_dropdown">
+    [% FOREACH budget IN budgets %]
+        [% IF ( budget.b_active ) %]
+            <option value="[% budget.b_id | html %]" data-sort1-authcat="[% budget.b_sort1_authcat | html %]" data-sort2-authcat="[% budget.b_sort2_authcat | html %]">[% budget.b_txt | html %]</option>
+        [% ELSE %]
+            <option value="[% budget.b_id | html %]" class="b_inactive" data-sort1-authcat="[% budget.b_sort1_authcat | html %]" data-sort2-authcat="[% budget.b_sort2_authcat |html %]">[% budget.b_txt | html %] (inactive)</option>
+        [% END %]
+    [% END %]
+</span>
+
 [% MACRO jsinclude BLOCK %]
     [% Asset.js("js/acquisitions-menu.js") | $raw %]
     [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %]
             $('.b_inactive').remove();
 
             $('.showallfunds').click(function() {
-                var the_dropdown = $(this).parent('span').find('.fund_dropdown');
+                var the_dropdown = $(this).siblings('.fund_dropdown');
                 var selected = the_dropdown.val();
                 if ($(this).is(":checked")) {
                     the_dropdown.html(disabledBudgetsCopy).val(selected);