From 93011defefd075eb59552e1bc1c5bd4edd4a4759 Mon Sep 17 00:00:00 2001 From: Christophe Croullebois Date: Thu, 18 Apr 2013 12:55:18 +0200 Subject: [PATCH] Bug 7228: can't add items in an order with Modify We have a message if we want to add items and we can't add, substract only. It's ok if we choose to create items on ordering, in this case koha can't add items, just substract and in this case we have to delete manually the items(s) in the catalog. But if via the syspref AcqCreateItem we choose to create items when receiving this limitation is not usefull The patch just checks if the syspref AcqCreateItem is on 'ordering' if not the message is not shown and we can add items Signed-off-by: Mathieu Saby Here is the test I made for signing off : after applying the patch - syspref AcqCreateItem : create items on RECEIVING - in a basket, create an order (quantity = 1) - save the order - reopen the order - change the quantity (2 instead of 1) - save the order => changing quantity was not possible before the patch - syspref AcqCreateItem : create items on CATALOGING - in a basket, create an order (quantity = 1) - save the order - reopen the order - change the quantity (2 instead of 1) - save the order => changing quantity was not possible before the patch - syspref AcqCreateItem : create items on ORDERING - in a basket, create an order (click on "add" to add an item => quantity = 1) - save the order - reopen the order - try to change the quantity (2 instead of 1), without clicking on "add" to create a new item => you cannot (alert message) => the behavior is the same as before the patch Signed-off-by: Katrin Fischer Copied test plan from bug report. Template only change deactivating the Javascript that blocks you from changing the quantity when AcqCreateItem is set to something else than 'ordering'. Passes all tests and QA script. Signed-off-by: Jared Camins-Esakov (cherry picked from commit 3269d358e55ca2d702be9f544749eca59f057206) Signed-off-by: Jared Camins-Esakov --- acqui/neworderempty.pl | 1 + koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index b1c9afaa51..33b061d3a0 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -414,6 +414,7 @@ $template->param( barcode_subfield => $barcode_subfield, import_batch_id => $import_batch_id, subscriptionid => $subscriptionid, + acqcreate => C4::Context->preference("AcqCreateItem") eq "ordering" ? 1 : "", (uc(C4::Context->preference("marcflavour"))) => 1 ); 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 549bf62971..cc554ed62d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt @@ -129,6 +129,7 @@ $(document).ready(function() //We apply the fonction only for modify option [% IF ( quantityrec ) %] + [% IF ( acqcreate ) %] $('#quantity').blur(function() { // if user decreases the quantity @@ -148,6 +149,7 @@ $(document).ready(function() } }); [% END %] + [% END %] //keep a copy of all budgets before removing the inactives disabledBudgetsCopy = $('#budget_id').html(); -- 2.39.5