@@ -, +, @@ --- acqui/neworderempty.pl | 6 +++++- .../en/modules/admin/preferences/acquisitions.pref | 3 +++ 2 files changed, 8 insertions(+), 1 deletions(-) --- a/acqui/neworderempty.pl +++ a/acqui/neworderempty.pl @@ -122,6 +122,7 @@ our ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user( ); our $marcflavour = C4::Context->preference('marcflavour'); +my $defaultvalues= C4::Context->preference('AcqNewOrderEmptyDefaults')||''; if(!$basketno) { my $order = GetOrder($ordernumber); @@ -261,7 +262,7 @@ foreach my $r (@{$budgets}) { b_id => $r->{budget_id}, b_txt => $r->{budget_name}, b_active => $r->{budget_period_active}, - b_sel => ( $r->{budget_id} == $budget_id ) ? 1 : 0, + b_sel => ( $r->{budget_id} == $budget_id || (!$budget_id && $defaultvalues=~/fund=$r->{budget_code}/i )) ? 1 : 0, }; } @@ -320,6 +321,9 @@ if (C4::Context->preference('AcqCreateItem') eq 'ordering' && !$ordernumber) { # Get the item types list, but only if item_level_itype is YES. Otherwise, it will be in the item, no need to display it in the biblio my @itemtypes; @itemtypes = C4::ItemType->all unless C4::Context->preference('item-level_itypes'); +foreach(@itemtypes) { + $_->{selected}=1 if !$biblionumber && $defaultvalues=~/itemtype=$_->{itemtype}/i; +} # Find the items.barcode subfield for barcode validations my (undef, $barcode_subfield) = GetMarcFromKohaField('items.barcode', ''); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/acquisitions.pref @@ -35,6 +35,9 @@ Acquisitions: - Default tax rates are - pref: gist - (enter in numeric form, 0.12 for 12%. First is the default. If you want more than 1 value, please separate with |) + - + - pref: AcqNewOrderEmptyDefaults + - " (Optionally define default values for item type and/or fund by entering an item code or fund code prefixed by itemtype= or fund=. Example: fund=FND,itemtype=BKS. The defaults you specify here will be used on the neworderempty form.)" Printing: - --