From 3a406617539d840311130b9ddd0cb94c28a655d8 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 24 May 2023 09:44:49 -0300 Subject: [PATCH] Bug 33784: Make buttons more meaningful This patch makes dismissing the modal equivalent to cancelling the receipt and thus returning to parcel.pl. The 'Save' button is renamed to 'Confirm' and is disabled when no items are selected for receiving. Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/acqui/orderreceive.tt | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 7bbffea00be..3e1acca3ae0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt @@ -393,10 +393,15 @@ @@ -873,6 +878,9 @@ $("#quantity").val(qty); var row = $("#order_edit").data('row'); row.quantity_received = qty; + [% IF multiple_orders.split(',').size == 1 %] + $('.modal-save').prop('disabled', qty < 1 ); + [% END %] }) $("#order_edit").on("change", "#tax_rate", function() { @@ -1317,7 +1325,11 @@ }); $("#order_edit").on("hide.bs.modal", function() { + [% IF multiple_orders.split(',').size == 1 %] [%# On the single case, dismissing the modal equals to cancelling %] + location.href = "/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]&sticky_filters=1"; + [% ELSE %] $("#child_orders_table").DataTable().off('preDraw').destroy(); + [% END %] }); }); -- 2.34.1