Bugzilla – Attachment 75014 Details for
Bug 19166
Add the ability to add adjustments to an invoice
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19166: Follow-up - Reformat the new adjustments markup
Bug-19166-Follow-up---Reformat-the-new-adjustments.patch (text/plain), 18.46 KB, created by
Owen Leonard
on 2018-05-03 14:55:52 UTC
(
hide
)
Description:
Bug 19166: Follow-up - Reformat the new adjustments markup
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2018-05-03 14:55:52 UTC
Size:
18.46 KB
patch
obsolete
>From 09e2d91de2f341f8ef1edf33236423ce69f202a1 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 3 May 2018 14:46:30 +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 <fieldset> 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. >--- > koha-tmpl/intranet-tmpl/prog/css/staff-global.css | 4 + > .../intranet-tmpl/prog/en/modules/acqui/invoice.tt | 264 ++++++++++++--------- > 2 files changed, 158 insertions(+), 110 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css >index bf009a6..51143a5 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 a8db249..169df41 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 @@ > </ol> > <input type="hidden" name="op" value="mod" /> > <input type="hidden" name="invoiceid" value="[% invoiceid %]" /> >- </fieldset> >- <fieldset class="action"> >- <input type="submit" value="Save" /> >- [% UNLESS orders_loop.size %] >- <a href="invoice.pl?op=delete&invoiceid=[% invoiceid %]" id="delete">Delete</a> >- [% END %] >+ <fieldset class="action"> >+ <input type="submit" value="Save" /> >+ [% UNLESS orders_loop.size %] >+ <a href="invoice.pl?op=delete&invoiceid=[% invoiceid %]" id="delete">Delete</a> >+ [% END %] >+ </fieldset> > </fieldset> > </form> >- <form action="/cgi-bin/koha/acqui/invoice.pl" method="post" class="validated"> >- <input type="hidden" name="invoiceid" value="[% invoiceid %]" /> >- <table id="invoice_adj_table"> >- <tr> >- <th>Id</th> >- <th>Amount</th> >- <th>Reason</th> >- <th>Note</th> >- <th>Fund</th> >- <th>Encumber while invoice open</th> >- <th> </th> >- </tr> >- [% IF (adjustments.count > 0) %] >- <tr><td colspan="7">Current adjustments</td></tr> >- [% total_adj = 0 %] >- [% FOREACH adjustment IN adjustments %] >- [% total_adj = total_adj + adjustment.adjustment %] >- <tr> >- <td><input type="hidden" name="adjustment_id" value="[% adjustment.adjustment_id %]" />[% adjustment.adjustment_id %]</td> >- <td><input type="text" name="adjustment" id="adjustment_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment | $Price %]" /></td> >- <td> >- [% reasons = AuthorisedValues.Get("ADJ_REASON") %] >- [% IF reasons.0 %] >- <select id="reason_[% adjustment.adjustment_id %]" name="reason"> >- <option value="">No reason</option> >- [% FOREACH reason IN reasons %] >- [% IF ( adjustment.reason == reason.authorised_value ) %] >- <option selected="selected" value="[% reason.authorised_value %]"> >- [% ELSE %] >- <option value="[% reason.authorised_value %]"> >- [% END %] >- [% reason.lib %] >- </option> >- [% END %] >- </select> >- [% ELSE %] >- <p title="Define values in authorised value category ADJ_REASON to enable">None</p> >- <input type="hidden" name="reason" id="reason_[% adjustment.adjustment_id %]" value="" /> >- [% END %] >- </td> >- <td><input type="text" name="note" id="note_new" value="[% adjustment.note %]"/></td> >- <td> >- <select id="budget_id_[% adjustment.adjustment_id %]" name="budget_id"> >- <option value="">No fund</option> >- [% FOREACH budget IN budgets_loop %] >- [% IF ( budget.budget_id == adjustment.budget_id ) %] >- <option selected="selected" value="[% budget.budget_id %]"> >+ >+ <hr /> >+ >+ <h3>Adjustments</h3> >+ >+ <form action="/cgi-bin/koha/acqui/invoice.pl" method="post" class="validated"> >+ <fieldset class="rows"> >+ <input type="hidden" name="invoiceid" value="[% invoiceid %]" /> >+ [% IF (adjustments.count > 0) %] >+ <table id="invoice_adj_table"> >+ <tr> >+ <th>Id</th> >+ <th>Amount</th> >+ <th>Reason</th> >+ <th>Note</th> >+ <th>Fund</th> >+ <th>Encumber while invoice open</th> >+ <th> </th> >+ </tr> >+ [% total_adj = 0 %] >+ [% FOREACH adjustment IN adjustments %] >+ [% total_adj = total_adj + adjustment.adjustment %] >+ <tr> >+ <td><input type="hidden" name="adjustment_id" value="[% adjustment.adjustment_id %]" />[% adjustment.adjustment_id %]</td> >+ <td><input type="text" name="adjustment" id="adjustment_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment | $Price %]" /></td> >+ <td> >+ [% reasons = AuthorisedValues.Get("ADJ_REASON") %] >+ [% IF reasons.0 %] >+ <select id="reason_[% adjustment.adjustment_id %]" name="reason"> >+ <option value="">No reason</option> >+ [% FOREACH reason IN reasons %] >+ [% IF ( adjustment.reason == reason.authorised_value ) %] >+ <option selected="selected" value="[% reason.authorised_value %]"> >+ [% ELSE %] >+ <option value="[% reason.authorised_value %]"> >+ [% END %] >+ [% reason.lib %] >+ </option> >+ [% END %] >+ </select> >+ [% ELSE %] >+ <p title="Define values in authorised value category ADJ_REASON to enable">None</p> >+ <input type="hidden" name="reason" id="reason_[% adjustment.adjustment_id %]" value="" /> >+ [% END %] >+ </td> >+ <td><input type="text" name="note" id="note_[% adjustment.adjustment_id %]" value="[% adjustment.note %]"/></td> >+ <td> >+ <select id="budget_id_[% adjustment.adjustment_id %]" name="budget_id"> >+ <option value="">No fund</option> >+ [% FOREACH budget IN budgets_loop %] >+ [% IF ( budget.budget_id == adjustment.budget_id ) %] >+ <option selected="selected" value="[% budget.budget_id %]"> >+ [% ELSE %] >+ <option value="[% budget.budget_id %]"> >+ [% END %] >+ [% budget.budget_name %] >+ </option> >+ [% END %] >+ </select> >+ </td> >+ [% IF adjustment.encumber_open %] >+ <td> >+ <input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment_id %]" checked="checked" /> >+ </td> > [% ELSE %] >- <option value="[% budget.budget_id %]"> >+ <td> >+ <input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment_id %]" /> >+ </td> > [% END %] >- [% budget.budget_name %] >- </option> >- [% END %] >- </select> >- </td> >- [% IF adjustment.encumber_open %] >- <td> >- <input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment_id %]" checked/> >- </td> >- [% ELSE %] >- <td> >- <input type="checkbox" name="encumber_open" id="encumber_[% adjustment.adjustment_id %]" value="[% adjustment.adjustment_id %]" /> >- </td> >- [% END %] >- <td> >- <a class="btn btn-default btn-xs" href="/cgi-bin/koha/acqui/invoice.pl?op=del_adj&adjustment_id=[% adjustment.adjustment_id %]&invoiceid=[% invoiceid %]"><i class="fa fa-trash"></i> Delete</a> >- </td> >- </tr> >- [% END %] >- [% END %] >- <tr><td colspan="7">Add an adjustment</td></tr> >- <td><input type="hidden" name="adjustment_id" value="new" />New</td> >- <td><input type="text" name="adjustment" id="adjustment_new]" /></td> >- <td> >- [% reasons = AuthorisedValues.Get("ADJ_REASON") %] >- [% IF reasons.0 %] >- <select id="reason_[% adjustment.adjustment_id %]" name="reason"> >- <option value="">No reason</option> >- [% FOREACH reason IN reasons %] >- <option value="[% reason.authorised_value %]"> >- [% reason.lib %] >- </option> >+ <td> >+ <a class="btn btn-default btn-xs delete_adjustment" href="/cgi-bin/koha/acqui/invoice.pl?op=del_adj&adjustment_id=[% adjustment.adjustment_id %]&invoiceid=[% invoiceid %]"><i class="fa fa-trash"></i> Delete</a> >+ </td> >+ </tr> >+ [% END %] >+ </table> >+ [% END %] >+ >+ <p> >+ <a href="#" id="show_invoice_adjustment" class="toggle_invoice_adjustment"><i class="fa fa-plus"></i> Add an adjustment</a> >+ </p> >+ >+ <fieldset id="add_invoice_adjustment" style="display:none"> >+ <h4>Add an adjustment</h4> >+ <input type="hidden" name="adjustment_id" value="new" /> >+ <ol> >+ <li> >+ <label for="adjustment_new">Amount: </label> >+ <input type="text" name="adjustment" id="adjustment_new" /> >+ </li> >+ [% reasons = AuthorisedValues.Get("ADJ_REASON") %] >+ [% IF reasons.0 %] >+ <li> >+ <label for="reason_[% adjustment.adjustment_id %]">Reason: </label> >+ <select id="reason_[% adjustment.adjustment_id %]" name="reason"> >+ <option value="">No reason</option> >+ [% FOREACH reason IN reasons %] >+ <option value="[% reason.authorised_value %]"> >+ [% reason.lib %] >+ </option> >+ [% END %] >+ </select> >+ </li> >+ [% ELSE %] >+ <li> >+ <span class="label">Reason: </span> >+ <span>None</span> >+ <div class="hint">Define values in authorised value category ADJ_REASON to enable</div> >+ </li> >+ [% END %] >+ <li> >+ <label for="note_new">Note: </label> >+ <input type="text" name="note" id="note_new" value=""/> >+ </li> >+ <li> >+ <label for="budget_id_new">Fund: </label> >+ <select id="budget_id_new" name="budget_id"> >+ <option selected="selected" value="">No fund</option> >+ [% FOREACH budget IN budgets_loop %] >+ <option value="[% budget.budget_id %]"> >+ [% budget.budget_name %] >+ </option> > [% END %] >- </select> >- [% ELSE %] >- <p title="Define values in authorised value category ADJ_REASON to enable">None</p> >- [% END %] >- </td> >- <td><input type="text" name="note" id="note_new" value=""/></td> >- <td> >- <select id="budget_id_[% adjustment.adjustment_id %]" name="budget_id"> >- <option selected="selected" value="">No fund</option> >- [% FOREACH budget IN budgets_loop %] >- <option value="[% budget.budget_id %]"> >- [% budget.budget_name %] >- </option> >- [% END %] >- </select> >- </td> >- <td><input type="checkbox" name="encumber_open" id="encumber_new" value="new" /></td> >- <td><input type="hidden" name="delete" value=""></td> >- </tr> >- </table> >- <input type="hidden" name="op" value="mod_adj" /> >- <input type="submit" value="Update adjustments" /> >- </form> >+ </select> >+ </li> >+ <li> >+ <label for="encumber_new">Encumber while invoice open? </label> >+ <input type="checkbox" name="encumber_open" id="encumber_new" value="new" /> >+ <input type="hidden" name="delete" value=""> >+ </li> >+ <li> >+ <span class="label"> </span> >+ <a href="#" id="cancel_invoice_adjustment" class="toggle_invoice_adjustment" style="display:none"><i class="fa fa-remove"></i> Cancel</a> >+ </li> >+ </ol> >+ </fieldset> >+ <fieldset class="action"> >+ <input type="hidden" name="op" value="mod_adj" /> >+ <input type="submit" value="Update adjustments" /> >+ </fieldset> >+ </fieldset> >+ </form> > <p> > <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Go to receipt page</a> > [% IF Koha.Preference('AcqEnableFiles') %]| <a href="/cgi-bin/koha/acqui/invoice-files.pl?invoiceid=[% invoiceid %]">Manage invoice files</a>[% END %] > </p> > <h2>Invoice details</h2> >+ <fieldset> > [% IF orders_loop.size %] > <label for="show_all_details"> > <input type="checkbox" style="vertical-align: middle;" id="show_all_details" /> >@@ -315,6 +351,7 @@ > </tbody> > </table> > [% END %] >+ </fieldset> > </div> > </div> > <div class="yui-b"> >@@ -326,7 +363,7 @@ > [% Asset.js("js/acquisitions-menu.js") %] > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'datatables.inc' %] >- <script type="text/javascript"> >+ <script> > function updateColumnsVisibility(visible) { > if ( visible ) { > $("table .tax_excluded, .tax_included").show(); >@@ -369,6 +406,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 ?") ) ); >+ }); > }); > </script> > [% END %] >-- >2.1.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 19166
:
66475
|
66476
|
67599
|
67600
|
67601
|
67602
|
67890
|
70413
|
70414
|
70415
|
70416
|
72702
|
72703
|
72704
|
72705
|
72744
|
72978
|
73481
|
73482
|
73483
|
73484
|
73485
|
73486
|
73487
|
74742
|
74743
|
74744
|
74745
|
74746
|
74747
|
74748
|
74843
|
74893
|
74894
|
74895
|
74896
|
74897
|
74898
|
74899
|
74900
|
75014
|
75043
|
76994
|
76995
|
76996
|
76997
|
76998
|
76999
|
77000
|
77001
|
77002
|
77003
|
77004
|
77104
|
77105
|
77106
|
77107
|
77108
|
77109
|
77110
|
77111
|
77112
|
77113
|
77114
|
77115
|
77116
|
77117
|
77118
|
77119
|
77120
|
77121
|
77122
|
77123
|
77124
|
77125
|
77126
|
77127
|
77128
|
77129
|
77130
|
77131
|
77132
|
77133
|
77134
|
77329