From 5bd7acfbb096a63df1d806c41a6af7b51954beb6 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 16 Jul 2018 13:06:27 +0000 Subject: [PATCH] Bug 19166: (follow-up) Reformat the new adjustments markup This follow-up makes some changes to the way invoice adjustments are displayed and added: - Move this section into a
to set it off visually from the other sections of the page. - Take the "add adjustment" fields out of the table and display them in a standard way. - Hide the "add adjustment" fields by default, shown via "add an adjustment" link. - Add deletion confirmation to adjustment deletions. To test, add, delete, and change invoice adjustments as instructed in the original test plan. Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- .../intranet-tmpl/prog/css/staff-global.css | 4 + .../prog/en/modules/acqui/invoice.tt | 262 ++++++++++-------- 2 files changed, 157 insertions(+), 109 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css index 21169455d8..f5ea1af08e 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css @@ -93,6 +93,10 @@ h1,h2,h3,h4,h5,h6 { margin : .3em 0; } +hr { + clear:both; +} + p { margin: .5em 0 .5em 0; } 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 7295eb185e..16b8d0285f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt @@ -76,125 +76,161 @@ -
-
- - [% UNLESS orders_loop.size %] - Delete - [% END %] +
+ + [% UNLESS orders_loop.size %] + Delete + [% END %] +
-
- - - - - - - - - - - + +
+ +

Adjustments

+ + +
+ [% IF (adjustments.count > 0) %] -
- [% total_adj = 0 %] - [% FOREACH adjustment IN adjustments %] - [% total_adj = total_adj + adjustment.adjustment %] - - - - - - - - - - - - -
IdAmountReasonNoteFundEncumber while invoice open 
Current adjustments
[% adjustment.adjustment_id %] - [% reasons = AuthorisedValues.Get("ADJ_REASON") %] - [% IF reasons.0 %] - - [% ELSE %] -

None

- + + + + + + + + + + + [% total_adj = 0 %] + [% FOREACH adjustment IN adjustments %] + [% total_adj = total_adj + adjustment.adjustment %] + + + + + + + [% IF adjustment.encumber_open %] + + [% ELSE %] + + [% END %] + + [% END %] - - - - [% IF adjustment.encumber_open %] - - [% ELSE %] - - [% END %] - - +
IdAmountReasonNoteFundEncumber while invoice open 
[% adjustment.adjustment_id %] + [% reasons = AuthorisedValues.Get("ADJ_REASON") %] + [% IF reasons.0 %] + + [% ELSE %] +

None

+ + [% END %] +
+ + + + + + + Delete +
- - - - - - - Delete -
[% END %] - [% END %] -
Add an adjustment
New - [% reasons = AuthorisedValues.Get("ADJ_REASON") %] - [% IF reasons.0 %] - - [% ELSE %] -

None

- [% END %] -
- -
- - -
+ +

+ Add an adjustment +

+ + +
+ + +
+ +

Go to receipt page [% IF Koha.Preference('AcqEnableFiles') %]| Manage invoice files[% END %]

Invoice details

+
[% IF orders_loop.size %]
@@ -374,6 +411,13 @@ $("#show_all_details").prop('checked', false); updateColumnsVisibility(false); + $(".toggle_invoice_adjustment").on("click", function(e){ + e.preventDefault(); + $("#show_invoice_adjustment, #cancel_invoice_adjustment, #add_invoice_adjustment").toggle(); + }); + $("a.delete_adjustment").click(function(){ + return ( confirm( _("Are you sure you want to delete this file ?") ) ); + }); }); [% END %] -- 2.39.5