From c58c3a22866f3fd2b38b7ee6c5e7c0d47601092e Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Mon, 17 Jul 2023 16:01:25 +0000 Subject: [PATCH] Bug 34169: Add decimal class to all relevant input fields in the acquisitions module This is a first step towards more consistency and possibly supporting multiple input formats as well in the future. It marks all input fields for monetary values, such as prices, replacement prices etc. with a class that is linked to a check for number format with the jQuery Validator plugin. To test: For any input field to test, try adding various false entries, like "abc" or "1,00". It should only accept inputs with decimal dot, like: "1.00" 0) Apply patch, restart_all 1) Suggestion * Add a new suggestion in the staff interface * Test: price input field at the bottom of the form. * Accept the suggestion 2) Order form * Create a new basket * Create an order line from an existing record * Test: list price, replacement price, and actual price. * Check the checkbox for uncertain price before you save 3) Uncertain prices * Go to the uncertain prices page for this vendor * Test: price field Note: this form does its own validation, but the change should not change behaviour for now * Resolve the uncertain price * Close order 4) Receive shipment * Test: Shipping cost 5) Receive the order * Test: replacement price, actual price * Check checkbox for price in foreign currency * Test: price in foreign currency * Receive order line 6) Invoice summary * Finish receiving * Test: shipping cost * Test: invoice adjustments: amount in the form for the first entry, amount in the table after adding it 7) Merging invoices * Receive another shipment and create and invoice * Go to invoices and search all * Check the 2 entries for merging * Test: shipping cost 8) Adding orders from a staged/new file * Export some records using the cart or list * Create a new basket * Order from new file * Import your file, ignore item records * Test: price and replacement price + Bonus: also test with items, test plan and file from bug 22802 are really helpful here Signed-off-by: Michaela Sieber Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi (cherry picked from commit c943fddac6ba8b7ab5228b57c59d22adce4becc1) Signed-off-by: Fridolin Somers --- .../prog/en/modules/acqui/addorderiso2709.tt | 381 +++++++++--------- .../prog/en/modules/acqui/invoice.tt | 6 +- .../prog/en/modules/acqui/invoices.tt | 5 +- .../prog/en/modules/acqui/neworderempty.tt | 8 +- .../prog/en/modules/acqui/orderreceive.tt | 230 +++++------ .../prog/en/modules/acqui/parcels.tt | 2 +- .../prog/en/modules/acqui/uncertainprice.tt | 5 +- .../prog/en/modules/suggestion/suggestion.tt | 2 +- 8 files changed, 323 insertions(+), 316 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt index d8d5b484f9..2da5302b56 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt @@ -2,6 +2,7 @@ [% USE Asset %] [% USE KohaDates %] [% USE Branches %] +[% USE Price %] [% INCLUDE 'doc-head-open.inc' %] [% IF ( batch_details ) %] @@ -160,209 +161,211 @@ <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&importid=[% biblio.import_record_id | uri %]" class="previewData btn btn-default btn-xs">Card</a> <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]&breedingid=[% biblio.import_record_id | uri %]&import_batch_id=[% biblio.import_batch_id | uri %]&biblionumber=[% biblio.match_biblionumber | uri %]" class="btn btn-default btn-xs">Add order</a> </span> - <fieldset class="rows order_details"> - <ol> - <li class="status"> - <span class="label">Match:</span> - <span class="match"> - [% IF ( biblio_lis.overlay_status == 'no_match' ) %] - <span>No match</span> - [% ELSIF ( biblio_lis.overlay_status == 'match_applied' ) %] - <span>Match applied</span> - [% ELSIF ( biblio_lis.overlay_status == 'auto_match' ) %] - <span>Match found</span> - [% ELSE %] - [% biblio_lis.overlay_status | html %] - [% END %] - [% IF ( biblio.match_biblionumber ) %] - <span>Matches biblio [% biblio.match_biblionumber | uri %]</span> (score = [% biblio.match_score | html %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.match_biblionumber | uri %]">[% biblio.match_citation | html %]</a> - [% END %] - </span> - </li> - <li class="quantity"> - <label for="quantity_record_[% biblio.import_record_id | html %]" class="required">Quantity: </label> - <input id="quantity_record_[% biblio.import_record_id | html %]" type="text" pattern="[0-9]+" value="[% biblio.quantity.length ? biblio.quantity : 1 | html %]" name="quantity" /> - <span class="required">Required</span> - </li> - <li class="price"> - <label for="price_record_[% biblio.import_record_id | html %]">Price: </label> - <input id="price_record_[% biblio.import_record_id | html %]" type="text" value="[% biblio.price | html %]" name="price" /> - </li> - <li class="replacementprice"> - <label for="replacementprice_record_[% biblio.import_record_id | html %]">Replacement price: </label> - <input id="replacementprice_record_[% biblio.import_record_id | html %]" type="text" value="[% biblio.replacementprice | html %]" name="replacementprice" /> - </li> - <li class="discount"> - <label for="discount_record_[% biblio.import_record_id | html %]">Discount: </label> - <input id="discount_record_[% biblio.import_record_id | html %]" type="text" value="[% biblio.discount | html %]" name="discount" size="6" /> % - <div class="hint">If empty, discount rate from vendor will be used</div> - </li> - <li class="fund"> - [% IF ( close ) %] - <label for="fund_record_[% biblio.import_record_id | html %]">Fund: </label> - <input type="hidden" size="20" name="budget_id" value="[% budget_id | html %]" />[% Budget_name | html %] - [% ELSE %] - <label for="fund_record_[% biblio.import_record_id | html %]">Fund: </label> - <select id="fund_record_[% biblio.import_record_id | html %]" name="budget_id"> - <option value="">Select a fund (will use default if set)</option> - [% FOREACH budget IN budget_loop %] - [% IF ( budget.b_id == biblio.budget_id ) %] - [% 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 %]" selected="selected">[% budget.b_txt | html %]</option> - [% ELSE %] - <option value="[% budget.b_id | html %]" data-sort1-authcat="[% budget.b_sort1_authcat | html %]" data-sort2-authcat="[% budget.b_sort2_authcat | html %]" selected="selected">[% budget.b_txt | html %] (inactive)</option> - [% END %] + <form action="/cgi-bin/koha/acqui/addorderiso2709.pl" class="validated"> + <fieldset class="rows order_details"> + <ol> + <li class="status"> + <span class="label">Match:</span> + <span class="match"> + [% IF ( biblio_lis.overlay_status == 'no_match' ) %] + <span>No match</span> + [% ELSIF ( biblio_lis.overlay_status == 'match_applied' ) %] + <span>Match applied</span> + [% ELSIF ( biblio_lis.overlay_status == 'auto_match' ) %] + <span>Match found</span> [% ELSE %] - [% 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> + [% biblio_lis.overlay_status | html %] + [% END %] + [% IF ( biblio.match_biblionumber ) %] + <span>Matches biblio [% biblio.match_biblionumber | uri %]</span> (score = [% biblio.match_score | html %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.match_biblionumber | uri %]">[% biblio.match_citation | html %]</a> + [% END %] + </span> + </li> + <li class="quantity"> + <label for="quantity_record_[% biblio.import_record_id | html %]" class="required">Quantity: </label> + <input id="quantity_record_[% biblio.import_record_id | html %]" type="text" pattern="[0-9]+" value="[% biblio.quantity.length ? biblio.quantity : 1 | html %]" name="quantity" /> + <span class="required">Required</span> + </li> + <li class="price"> + <label for="price_record_[% biblio.import_record_id | html %]">Price: </label> + <input id="price_record_[% biblio.import_record_id | html %]" class="decimal" type="text" value="[% biblio.price | $Price on_editing => 1 %]" name="price" /> + </li> + <li class="replacementprice"> + <label for="replacementprice_record_[% biblio.import_record_id | html %]">Replacement price: </label> + <input id="replacementprice_record_[% biblio.import_record_id | html %]" class="decimal" type="text" value="[% biblio.replacementprice | $Price on_editing => 1 %]" name="replacementprice" /> + </li> + <li class="discount"> + <label for="discount_record_[% biblio.import_record_id | html %]">Discount: </label> + <input id="discount_record_[% biblio.import_record_id | html %]" type="text" value="[% biblio.discount | html %]" name="discount" size="6" /> % + <div class="hint">If empty, discount rate from vendor will be used</div> + </li> + <li class="fund"> + [% IF ( close ) %] + <label for="fund_record_[% biblio.import_record_id | html %]">Fund: </label> + <input type="hidden" size="20" name="budget_id" value="[% budget_id | html %]" />[% Budget_name | html %] + [% ELSE %] + <label for="fund_record_[% biblio.import_record_id | html %]">Fund: </label> + <select id="fund_record_[% biblio.import_record_id | html %]" name="budget_id"> + <option value="">Select a fund (will use default if set)</option> + [% FOREACH budget IN budget_loop %] + [% IF ( budget.b_id == biblio.budget_id ) %] + [% 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 %]" selected="selected">[% budget.b_txt | html %]</option> + [% ELSE %] + <option value="[% budget.b_id | html %]" data-sort1-authcat="[% budget.b_sort1_authcat | html %]" data-sort2-authcat="[% budget.b_sort2_authcat | html %]" selected="selected">[% budget.b_txt | html %] (inactive)</option> [% END %] + [% ELSE %] + [% 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 %] [% END %] - [% END %] - </select> - <span class="required" style="display:none">Required</span> - [% END %] - </li> - <li class="sort1"> - <label for="sort1_record_[% biblio.import_record_id | html %]">Statistic 1: </label> - <input id="sort1_record_[% biblio.import_record_id | html %]" type="text" size="20" name="sort1" value="[% biblio.sort1 | html %]" /> - </li> - <li class="sort2"> - <label for="sort2_record_[% biblio.import_record_id | html %]">Statistic 2: </label> - <input id="sort2_record_[% biblio.import_record_id | html %]" type="text" size="20" name="sort2" value="[% biblio.sort2 | html %]" /> - </li> - </ol> - [% IF ( biblio.iteminfos.size ) %] - <div class="item_edit_form"> - [% IF biblio.item_error %]Item records could not be processed because the number of item fields was uneven.[% END %] - [% FOREACH item IN biblio.iteminfos %] - <fieldset class="rows"> - <legend>Item record [% item.item_id | html %]</legend> - <ol> - <li> - <label for="homebranch_item_[% item.item_id | html %]">homebranch</label> - <select id="homebranch_item_[% item.item_id | html %]" name="homebranch_[% biblio.import_record_id | html %]"> - [% FOREACH l IN libraries %] - [% IF l.branchcode == item.homebranch %] - <option value="[% l.branchcode | html %]" selected="selected">[% l.branchname | html %]</option> - [% ELSE %] - <option value="[% l.branchcode | html %]">[% l.branchname | html %]</option> + </select> + <span class="required" style="display:none">Required</span> + [% END %] + </li> + <li class="sort1"> + <label for="sort1_record_[% biblio.import_record_id | html %]">Statistic 1: </label> + <input id="sort1_record_[% biblio.import_record_id | html %]" type="text" size="20" name="sort1" value="[% biblio.sort1 | html %]" /> + </li> + <li class="sort2"> + <label for="sort2_record_[% biblio.import_record_id | html %]">Statistic 2: </label> + <input id="sort2_record_[% biblio.import_record_id | html %]" type="text" size="20" name="sort2" value="[% biblio.sort2 | html %]" /> + </li> + </ol> + [% IF ( biblio.iteminfos.size ) %] + <div class="item_edit_form"> + [% IF biblio.item_error %]Item records could not be processed because the number of item fields was uneven.[% END %] + [% FOREACH item IN biblio.iteminfos %] + <fieldset class="rows"> + <legend>Item record [% item.item_id | html %]</legend> + <ol> + <li> + <label for="homebranch_item_[% item.item_id | html %]">homebranch</label> + <select id="homebranch_item_[% item.item_id | html %]" name="homebranch_[% biblio.import_record_id | html %]"> + [% FOREACH l IN libraries %] + [% IF l.branchcode == item.homebranch %] + <option value="[% l.branchcode | html %]" selected="selected">[% l.branchname | html %]</option> + [% ELSE %] + <option value="[% l.branchcode | html %]">[% l.branchname | html %]</option> + [% END %] [% END %] - [% END %] - </select> - </li> + </select> + </li> - <li> - <label for="holdingbranch_item_[% item.item_id | html %]">holdingbranch</label> - <select id="holdingbranch_item_[% item.item_id | html %]" name="holdingbranch_[% biblio.import_record_id | html %]"> - [% FOREACH l IN libraries %] - [% IF l.branchcode == item.holdingbranch %] - <option value="[% l.branchcode | html %]" selected="selected">[% l.branchname | html %]</option> - [% ELSE %] - <option value="[% l.branchcode | html %]">[% l.branchname | html %]</option> + <li> + <label for="holdingbranch_item_[% item.item_id | html %]">holdingbranch</label> + <select id="holdingbranch_item_[% item.item_id | html %]" name="holdingbranch_[% biblio.import_record_id | html %]"> + [% FOREACH l IN libraries %] + [% IF l.branchcode == item.holdingbranch %] + <option value="[% l.branchcode | html %]" selected="selected">[% l.branchname | html %]</option> + [% ELSE %] + <option value="[% l.branchcode | html %]">[% l.branchname | html %]</option> + [% END %] [% END %] - [% END %] - </select> - </li> - <li> - <label for="itype_item_[% item.item_id | html %]">itype</label> - <select id="itype_item_[% item.item_id | html %]" name="itype_[% biblio.import_record_id | html %]"> - [% FOREACH itemtype IN itemtypes %] - [% IF itemtype.itemtype == item.itype %] - <option value="[% itemtype.itemtype | html %]" selected="selected">[% itemtype.description | html %]</option> - [% ELSE %] - <option value="[% itemtype.itemtype | html %]">[% itemtype.description | html %]</option> + </select> + </li> + <li> + <label for="itype_item_[% item.item_id | html %]">itype</label> + <select id="itype_item_[% item.item_id | html %]" name="itype_[% biblio.import_record_id | html %]"> + [% FOREACH itemtype IN itemtypes %] + [% IF itemtype.itemtype == item.itype %] + <option value="[% itemtype.itemtype | html %]" selected="selected">[% itemtype.description | html %]</option> + [% ELSE %] + <option value="[% itemtype.itemtype | html %]">[% itemtype.description | html %]</option> + [% END %] [% END %] - [% END %] - </select> - </li> + </select> + </li> - <li> - <label for="nonpublic_note_item_[% item.item_id | html %]">nonpublic_note</label> - <input type="text" id="nonpublic_note_item_[% item.item_id | html %]" name="nonpublic_note_[% biblio.import_record_id | html %]" value="[% item.nonpublic_note | html %]"> - </li> - <li> - <label for="public_note_item_[% item.item_id | html %]">public_note</label> - <input type="text" id="public_note_item_[% item.item_id | html %]" name="public_note_[% biblio.import_record_id | html %]" value="[% item.public_note | html %]"> - </li> - <li> - <label for="loc_item_[% item.item_id | html %]">loc</label> - <select id="loc_item_[% item.item_id | html %]" name="loc_[% biblio.import_record_id | html %]"> - <option value=""> </option> - [% FOREACH locationloo IN locationloop %] - [% IF ( locationloo.code ) == (item.loc) %] - <option value="[% locationloo.code | html %]" selected="selected">[% locationloo.description | html %]</option> - [% ELSE %] - <option value="[% locationloo.code | html %]">[% locationloo.description | html %]</option> + <li> + <label for="nonpublic_note_item_[% item.item_id | html %]">nonpublic_note</label> + <input type="text" id="nonpublic_note_item_[% item.item_id | html %]" name="nonpublic_note_[% biblio.import_record_id | html %]" value="[% item.nonpublic_note | html %]"> + </li> + <li> + <label for="public_note_item_[% item.item_id | html %]">public_note</label> + <input type="text" id="public_note_item_[% item.item_id | html %]" name="public_note_[% biblio.import_record_id | html %]" value="[% item.public_note | html %]"> + </li> + <li> + <label for="loc_item_[% item.item_id | html %]">loc</label> + <select id="loc_item_[% item.item_id | html %]" name="loc_[% biblio.import_record_id | html %]"> + <option value=""> </option> + [% FOREACH locationloo IN locationloop %] + [% IF ( locationloo.code ) == (item.loc) %] + <option value="[% locationloo.code | html %]" selected="selected">[% locationloo.description | html %]</option> + [% ELSE %] + <option value="[% locationloo.code | html %]">[% locationloo.description | html %]</option> + [% END %] [% END %] - [% END %] - </select> - </li> + </select> + </li> - <li> - <label for="ccode_item_[% item.item_id | html %]">ccode</label> - <select id="ccode_item_[% item.item_id | html %]" name="ccode_[% biblio.import_record_id | html %]"> - <option value=""> </option> - [% FOREACH ccodeloo IN ccodeloop %] - [% IF ( ccodeloo.code ) == (item.ccode) %] - <option value="[% ccodeloo.code | html %]" selected="selected">[% ccodeloo.description | html %]</option> - [% ELSE %] - <option value="[% ccodeloo.code | html %]">[% ccodeloo.description | html %]</option> + <li> + <label for="ccode_item_[% item.item_id | html %]">ccode</label> + <select id="ccode_item_[% item.item_id | html %]" name="ccode_[% biblio.import_record_id | html %]"> + <option value=""> </option> + [% FOREACH ccodeloo IN ccodeloop %] + [% IF ( ccodeloo.code ) == (item.ccode) %] + <option value="[% ccodeloo.code | html %]" selected="selected">[% ccodeloo.description | html %]</option> + [% ELSE %] + <option value="[% ccodeloo.code | html %]">[% ccodeloo.description | html %]</option> + [% END %] [% END %] - [% END %] - </select> - </li> + </select> + </li> - <li> - <label for="notforloan_item_[% item.item_id | html %]">notforloan</label> - <select id="notforloan_item_[% item.item_id | html %]" name="notforloan_[% biblio.import_record_id | html %]"> - <option value=""> </option> - [% FOREACH n IN notforloanloop %] - [% IF n.code == item.notforloan %] - <option value="[% n.code | html %]" selected="selected">[% n.description | html %]</option> - [% ELSE %] - <option value="[% n.code | html %]">[% n.description | html %]</option> + <li> + <label for="notforloan_item_[% item.item_id | html %]">notforloan</label> + <select id="notforloan_item_[% item.item_id | html %]" name="notforloan_[% biblio.import_record_id | html %]"> + <option value=""> </option> + [% FOREACH n IN notforloanloop %] + [% IF n.code == item.notforloan %] + <option value="[% n.code | html %]" selected="selected">[% n.description | html %]</option> + [% ELSE %] + <option value="[% n.code | html %]">[% n.description | html %]</option> + [% END %] [% END %] - [% END %] - </select> - </li> - <li> - <label for="uri_item_[% item.item_id | html %]">uri</label> - <input type="text" id="uri_item_[% item.item_id | html %]" name="uri_[% biblio.import_record_id | html %]" value="[% item.uri | html %]"> - </li> - <li> - <label for="copyno_item_[% item.item_id | html %]">copyno</label> - <input type="text" id="copyno_item_[% item.item_id | html %]" name="copyno_[% biblio.import_record_id | html %]" value="[% item.copyno | html %]"> - </li> - <li> - <label for="budget_code_item_[% item.item_id | html %]">budget_code</label> - <select class="budget_code_item" id="budget_code_item_[% item.item_id | html %]" name="budget_code_[% biblio.import_record_id | html %]"> - <option value="">Select a fund (will use default if set)</option> - [% FOREACH budget_loo IN budget_loop %] - [% IF ( budget_loo.b_id ) == ( item.budget_id ) %]<option value="[% budget_loo.b_id | html %]" selected="selected">[% budget_loo.b_txt | html %]</option> - [% ELSE %]<option value="[% budget_loo.b_id | html %]">[% budget_loo.b_txt | html %]</option> + </select> + </li> + <li> + <label for="uri_item_[% item.item_id | html %]">uri</label> + <input type="text" id="uri_item_[% item.item_id | html %]" name="uri_[% biblio.import_record_id | html %]" value="[% item.uri | html %]"> + </li> + <li> + <label for="copyno_item_[% item.item_id | html %]">copyno</label> + <input type="text" id="copyno_item_[% item.item_id | html %]" name="copyno_[% biblio.import_record_id | html %]" value="[% item.copyno | html %]"> + </li> + <li> + <label for="budget_code_item_[% item.item_id | html %]">budget_code</label> + <select class="budget_code_item" id="budget_code_item_[% item.item_id | html %]" name="budget_code_[% biblio.import_record_id | html %]"> + <option value="">Select a fund (will use default if set)</option> + [% FOREACH budget_loo IN budget_loop %] + [% IF ( budget_loo.b_id ) == ( item.budget_id ) %]<option value="[% budget_loo.b_id | html %]" selected="selected">[% budget_loo.b_txt | html %]</option> + [% ELSE %]<option value="[% budget_loo.b_id | html %]">[% budget_loo.b_txt | html %]</option> + [% END %] [% END %] - [% END %] - </select> - <span class="item_fund required">Required</span> - </li> - <li> - <label for="price_item_[% item.item_id | html %]">price</label> - <input type="text" id="price_item_[% item.item_id | html %]" name="itemprice_[% biblio.import_record_id | html %]" value="[% item.itemprice | html %]"> - </li> - <li> - <label for="replacementprice_item_[% item.item_id | html %]">replacement price</label> - <input type="text" id="replacementprice_item_[% item.item_id | html %]" name="replacementprice_[% biblio.import_record_id | html %]" value="[% item.replacementprice | html %]"> - </li> - <li> - <label for="callnumber_item_[% item.item_id | html %]">callnumber</label> - <input type="text" id="callnumber_item_[% item.item_id | html %]" name="itemcallnumber_[% biblio.import_record_id | html %]" value="[% item.itemcallnumber | html %]"> - </li> - </ol> - </fieldset> - [% END # /FOREACH item %] - </div> <!-- /.item_edit_form --> - [% END %] - </fieldset> <!-- /.rows.order_details --> + </select> + <span class="item_fund required">Required</span> + </li> + <li> + <label for="price_item_[% item.item_id | html %]">price</label> + <input type="text" id="price_item_[% item.item_id | html %]" class="decimal" name="itemprice_[% biblio.import_record_id | html %]" value="[% item.itemprice | $Price on_editing => 1 %]"> + </li> + <li> + <label for="replacementprice_item_[% item.item_id | html %]">replacement price</label> + <input type="text" id="replacementprice_item_[% item.item_id | html %]" class="decimal" name="replacementprice_[% biblio.import_record_id | html %]" value="[% item.replacementprice | $Price on_editing => 1 %]"> + </li> + <li> + <label for="callnumber_item_[% item.item_id | html %]">callnumber</label> + <input type="text" id="callnumber_item_[% item.item_id | html %]" name="itemcallnumber_[% biblio.import_record_id | html %]" value="[% item.itemcallnumber | html %]"> + </li> + </ol> + </fieldset> + [% END # /FOREACH item %] + </div> <!-- /.item_edit_form --> + [% END %] + </fieldset> <!-- /.rows.order_details --> + </form> </td> </tr> [% END # /FOREACH biblio %] 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 4b7632ab82..f1a79029ef 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt @@ -93,7 +93,7 @@ [% IF readonly %] [% shipmentcost | $Price %] [% ELSE %] - <input type="text" size="10" id="shipmentcost" name="shipmentcost" value="[% shipmentcost | $Price on_editing => 1 %]" /> + <input class="decimal" type="text" size="10" id="shipmentcost" name="shipmentcost" value="[% shipmentcost | $Price on_editing => 1 %]" /> [% END %] </li> <li> @@ -168,7 +168,7 @@ [% IF readonly %] [% adjustment.adjustment | $Price %] [% ELSE %] - <input type="text" name="adjustment" id="adjustment_[% adjustment.adjustment_id | html %]" value="[% adjustment.adjustment | $Price on_editing => 1 %]" /> + <input class="decimal" type="text" name="adjustment" id="adjustment_[% adjustment.adjustment_id | html %]" value="[% adjustment.adjustment | $Price on_editing => 1 %]" /> [% END %] </td> <td> @@ -245,7 +245,7 @@ <ol> <li> <label for="adjustment_new">Amount: </label> - <input type="text" name="adjustment" id="adjustment_new" /> + <input class="decimal" type="text" name="adjustment" id="adjustment_new" /> </li> [% reasons = AuthorisedValues.Get("ADJ_REASON") %] [% IF reasons.0 %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt index 2429dd5f19..abe0bf1fd2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt @@ -162,7 +162,7 @@ [% END # /#invoicestabs %] <div id="merge_invoices"> - <form id="merge_invoice_form" action="/cgi-bin/koha/acqui/invoice.pl" method="post"> + <form id="merge_invoice_form" class="validated" action="/cgi-bin/koha/acqui/invoice.pl" method="post"> <fieldset class="rows"> <ol> <li><h2>Merge invoices</h2></li> @@ -181,6 +181,7 @@ </table> </li> + <li> <label for="merge_invoicenumber" class="required">Invoice number:</label> <input type="text" size="10" id="merge_invoicenumber" name="invoicenumber" value="" class="required" required="required" /> @@ -201,7 +202,7 @@ <li> <label for="merge_shipmentcost">Shipment cost:</label> - <input type="text" size="10" id="merge_shipmentcost" name="shipmentcost" value="" /> + <input class="decimal" type="text" size="10" id="merge_shipmentcost" name="shipmentcost" value="" /> </li> <li> <label for="merge_shipment_budgetid">Fund:</label> 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 42f537a592..effff82f58 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt @@ -609,7 +609,7 @@ </li> <li> <label for="listprice">Vendor price: </label> - <input type="text" size="20" name="listprice" id="listprice" value="[% listprice | html %]" onchange="updateCosts()" /> [% IF (listincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %] + <input class="decimal" type="text" size="20" name="listprice" id="listprice" value="[% listprice | html %]" onchange="updateCosts()" /> [% IF (listincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %] </li> <li> <label for="uncertainprice">Uncertain price: </label> @@ -653,11 +653,11 @@ </li> <li> <label for="rrp">Retail price: </label> - <input type="text" size="20" name="rrp" id="rrp" value="[% rrp | html %]" /> (adjusted for [% cur_active | html %], [% IF (listincgst == 1) %]tax inclusive[% ELSE %]tax exclusive[% END %]) + <input class="decimal" type="text" size="20" name="rrp" id="rrp" value="[% rrp | $Price on_editing => 1 %]" /> (adjusted for [% cur_active | html %], [% IF (listincgst == 1) %]tax inclusive[% ELSE %]tax exclusive[% END %]) </li> <li> <label for="replacementprice">Replacement cost: </label> - <input type="text" size="20" name="replacementprice" id="replacementprice" value="[% replacementprice | html | $Price on_editing => 1 %]" /> + <input class="decimal" type="text" size="20" name="replacementprice" id="replacementprice" value="[% replacementprice | html | $Price on_editing => 1 %]" /> </li> <li> <label for="ecost">Budgeted cost: </label> @@ -669,7 +669,7 @@ </li> <li class="ordering_unitprice"> <label for="unitprice">Actual cost: </label> - <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice | html %]" /> + <input class="decimal" type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice | html %]" /> [% IF (invoiceincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %] </li> <li> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt index f169a117e5..724ae61607 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -269,125 +269,127 @@ <div class="col-md-12 col-lg-6"> <div id="accounting-panel" class="page-section"> <h4>Accounting details</h4> - <ol> - <li> - <label for="datereceived">Date received: </label> - <input type="text" size="10" id="datereceived" name="datereceived" class="flatpickr" /> - </li> - <li> - <label for="bookfund" class="required">Fund: </label> - <select id="bookfund" name="bookfund"> - <optgroup label="Current"> - <option id="selected_bookfund" selected="selected"></option> - </optgroup> - [% FOREACH budget_period_id IN budget_loops.keys %] - [% SET budget_period = budget_loops.$budget_period_id %] - [% IF budget_period.active %] - <optgroup label="[% budget_period.description | html %]"> - [% ELSE %] - <optgroup class="inactive_budget" label="[% budget_period.description | html %] (Inactive)"> - [% END %] - [% FOREACH budget_loo IN budget_period.funds %] - [% level_indent_cnt = 0 %] - [% level_indent = "" %] - [% WHILE level_indent_cnt < budget_loo.b_level %] - [% level_indent = level_indent _ " -- " %] - [% level_indent_cnt = level_indent_cnt +1 %] - [% END %] - - [% IF ( budget_loo.b_sel ) %] - [% active_count = 0 #select no other fund %] - <option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"> - [% ELSIF active_count==1 && budget_loo.b_active %] - <option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"> + <form action="/cgi-bin/koha/acqui/orderreceive.pl" class="validated"> + <ol> + <li> + <label for="datereceived">Date received: </label> + <input type="text" size="10" id="datereceived" name="datereceived" class="flatpickr" /> + </li> + <li> + <label for="bookfund" class="required">Fund: </label> + <select id="bookfund" name="bookfund"> + <optgroup label="Current"> + <option id="selected_bookfund" selected="selected"></option> + </optgroup> + [% FOREACH budget_period_id IN budget_loops.keys %] + [% SET budget_period = budget_loops.$budget_period_id %] + [% IF budget_period.active %] + <optgroup label="[% budget_period.description | html %]"> [% ELSE %] - [% bdgclass=budget_loo.b_active? "": "inactive_budget" | html %] - <option value="[% budget_loo.b_id | html %]" class="[% bdgclass | html %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"> + <optgroup class="inactive_budget" label="[% budget_period.description | html %] (Inactive)"> + [% END %] + [% FOREACH budget_loo IN budget_period.funds %] + [% level_indent_cnt = 0 %] + [% level_indent = "" %] + [% WHILE level_indent_cnt < budget_loo.b_level %] + [% level_indent = level_indent _ " -- " %] + [% level_indent_cnt = level_indent_cnt +1 %] + [% END %] + + [% IF ( budget_loo.b_sel ) %] + [% active_count = 0 #select no other fund %] + <option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"> + [% ELSIF active_count==1 && budget_loo.b_active %] + <option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"> + [% ELSE %] + [% bdgclass=budget_loo.b_active? "": "inactive_budget" | html %] + <option value="[% budget_loo.b_id | html %]" class="[% bdgclass | html %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]"> + [% END %] + [% level_indent | html %][% budget_loo.b_txt | html %][% IF !budget_loo.b_active %] (inactive)[% END %] + </option> [% END %] - [% level_indent | html %][% budget_loo.b_txt | html %][% IF !budget_loo.b_active %] (inactive)[% END %] - </option> + </optgroup> [% END %] - </optgroup> - [% END %] - </select> - <span class="required">Required</span> - </li> - <li> - <label> </label> - <span id="current-fund" class="hint"></span> - </li> - <li> - <label for="showallbudgets"> Show inactive:</label> - <input type="checkbox" id="showallbudgets" /> - </li> - <li> - <label for="creator">Ordered by: </label> - <span id="creator"></span> - </li> - <li> - <label for="quantity_to_receive">Quantity ordered: </label> - <input type="text" readonly="readonly" id="quantity_to_receive" name="quantity" /> - </li> - <li> - <label for="quantity">Quantity received: </label> - <input type="text" inputmode="numeric" pattern="[0-9]*" size="20" name="quantityrec" id="quantity" /> - <div id="qtyrecerror" style="display:none"> - <p class="error">Warning, you have entered more items than expected. - Items will not be created.</p> - </div> - </li> - - [% IF ( gst_values ) %] - <li> - <label for="tax_rate">Tax rate: </label> - <select name="tax_rate" id="tax_rate"> - [% FOREACH gst IN gst_values %] - <option value="[% gst.option | html %]">[% gst.option * 100 | html %]%</option> - [% END %] - </select> - </li> - [% END %] - - <li> - <label for="rrp">Retail price: </label> - <span id="rrp"></span> - <li> - <label for="replacementprice">Replacement price:</label> - <input type="text" size="20" name="replacementprice" id="replacementprice" /> - </li> - <li> - <label for="ecost">Budgeted cost: </label> - <span id="ecost"></span> - </li> - <li> - <label for="unitprice">Actual cost:</label> - <input type="text" size="20" name="unitprice" id="unitprice" /> - <span id="unitprice_hint" class="hint"></span> - </li> - <li> - <label style="margin-left: 12em; text-align: left; font-weight: inherit; float:none;"><input type="checkbox" id="change_currency" name="change_currency">Change currency</label> - </li> - <li id="select_currency"> - <label for="invoice_unitprice"></label> - <input type="text" size="20" name="invoice_unitprice" id="invoice_unitprice" value="" /> - [% IF currencies.count %] - <select name="invoice_currency" id="invoice_currency"> - <option value="[% active_currency.currency | html %]" data-rate="[% active_currency.rate | html %]" selected>[% active_currency.currency | html %] ([% active_currency.symbol | html %])</option> - [% FOR currency IN currencies %] - <option value="[% currency.currency | html %]" data-rate="[% currency.rate | html %]">[% currency.currency | html %] ([% currency.symbol | html %])</option> + </select> + <span class="required">Required</span> + </li> + <li> + <label> </label> + <span id="current-fund" class="hint"></span> + </li> + <li> + <label for="showallbudgets"> Show inactive:</label> + <input type="checkbox" id="showallbudgets" /> + </li> + <li> + <label for="creator">Ordered by: </label> + <span id="creator"></span> + </li> + <li> + <label for="quantity_to_receive">Quantity ordered: </label> + <input type="text" readonly="readonly" id="quantity_to_receive" name="quantity" /> + </li> + <li> + <label for="quantity">Quantity received: </label> + <input type="text" inputmode="numeric" pattern="[0-9]*" size="20" name="quantityrec" id="quantity" /> + <div id="qtyrecerror" style="display:none"> + <p class="error">Warning, you have entered more items than expected. + Items will not be created.</p> + </div> + </li> + + [% IF ( gst_values ) %] + <li> + <label for="tax_rate">Tax rate: </label> + <select name="tax_rate" id="tax_rate"> + [% FOREACH gst IN gst_values %] + <option value="[% gst.option | html %]">[% gst.option * 100 | html %]%</option> [% END %] - </select> + </select> + </li> [% END %] - </li> - <li> - <label for="order_internalnote">Internal note: </label> - <textarea name="order_internalnote" id="order_internalnote" width="40" rows="8" ></textarea> - </li> - <li> - <label for="order_vendornote">Vendor note: </label> - <span id="order_vendornote"></span> - </li> - </ol> + + <li> + <label for="rrp">Retail price: </label> + <span id="rrp"></span> + <li> + <label for="replacementprice">Replacement price:</label> + <input class="decimal" type="text" size="20" name="replacementprice" id="replacementprice" /> + </li> + <li> + <label for="ecost">Budgeted cost: </label> + <span id="ecost"></span> + </li> + <li> + <label for="unitprice">Actual cost:</label> + <input class="decimal" type="text" size="20" name="unitprice" id="unitprice" /> + <span id="unitprice_hint" class="hint"></span> + </li> + <li> + <label style="margin-left: 12em; text-align: left; font-weight: inherit; float:none;"><input type="checkbox" id="change_currency" name="change_currency">Change currency</label> + </li> + <li id="select_currency"> + <label for="invoice_unitprice"></label> + <input class="decimal" type="text" size="20" name="invoice_unitprice" id="invoice_unitprice" value="" /> + [% IF currencies.count %] + <select name="invoice_currency" id="invoice_currency"> + <option value="[% active_currency.currency | html %]" data-rate="[% active_currency.rate | html %]" selected>[% active_currency.currency | html %] ([% active_currency.symbol | html %])</option> + [% FOR currency IN currencies %] + <option value="[% currency.currency | html %]" data-rate="[% currency.rate | html %]">[% currency.currency | html %] ([% currency.symbol | html %])</option> + [% END %] + </select> + [% END %] + </li> + <li> + <label for="order_internalnote">Internal note: </label> + <textarea name="order_internalnote" id="order_internalnote" width="40" rows="8" ></textarea> + </li> + <li> + <label for="order_vendornote">Vendor note: </label> + <span id="order_vendornote"></span> + </li> + </ol> + </form> </div> </div> </div> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt index 1139e4ad99..2cdf9433f2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcels.tt @@ -164,7 +164,7 @@ </li> <li> <label for="shipmentcost">Shipping cost: </label> - <input type="text" id="shipmentcost" name="shipmentcost" size="10" /> + <input class="decimal" type="text" id="shipmentcost" name="shipmentcost" size="10" /> </li> <li> <label for="shipmentcost_budgetid">Shipping fund: </label> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt index e840846a76..acd34da334 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt @@ -1,6 +1,7 @@ [% USE raw %] [% USE Asset %] [% USE Koha %] +[% USE Price %] [% PROCESS 'i18n.inc' %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] @@ -134,7 +135,7 @@ <input type="checkbox" name="uncertainprice[% uncertainpriceorder.ordernumber | html %]" value="1" checked="checked" /> </td> <td> - <input class="check_uncertain" data-ordernumber="[% uncertainpriceorder.ordernumber | html %]" type="text" size="10" name="price[% uncertainpriceorder.ordernumber | html %]" value="[% uncertainpriceorder.listprice | html %]" /> + <input class="check_uncertain decimal" data-ordernumber="[% uncertainpriceorder.ordernumber | html %]" type="text" size="10" name="price[% uncertainpriceorder.ordernumber | html %]" value="[% uncertainpriceorder.listprice | $Price on_editing => 1 %]" /> </td> <td> [% IF basket.effective_create_items == 'ordering' %] @@ -154,7 +155,7 @@ </fieldset> <fieldset class="action"><input type="submit" class="btn btn-primary" value="Save" /></fieldset> </form> - [% END %] + [% END %] </main> </div> <!-- /.col-sm-10.col-sm-push-2 --> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt index ff8d301775..3dadf1d456 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -621,7 +621,7 @@ </li> <li> <label for="price">Price:</label> - <input type="text" size="20" name="price" id="price" value="[% price | html %]" /> + <input class="decimal" type="text" size="20" name="price" id="price" value="[% price | $Price on_editing => 1 %]" /> </li> <li> <label for="total">Total: </label> -- 2.39.5