From 126512149a8dc3a82d4e4698c151df08cdee7bb7 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Tue, 24 Mar 2020 21:05:33 +0000 Subject: [PATCH] Bug 23352: (follow-up) Fix 952$g and location auto-population Previously the cost (952$g) used unit price from the acquisition order, but this is not automatically calculated and is sometimes zero. We should use the individual item's budgeted cost instead. This patch ensures the permanent location (952$a) and current location (952$b) are set to the current logged in branch, not the subscription branch Also fixing a typo and amending syspref description to be more user-friendly. Sponsored-by: Brimbank Library, Australia --- C4/Items.pm | 12 +++++------- .../prog/en/modules/admin/preferences/cataloguing.pref | 2 +- .../prog/en/modules/admin/preferences/serials.pref | 2 +- .../prog/en/modules/serials/subscription-add.tt | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index cd7996f21a..ae005b85fa 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1630,8 +1630,7 @@ sub PrepareItemrecordDisplay { $defaultvalue = $defaultvalues->{callnumber}; } } - - if ( ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.holdingbranch' || $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.homebranch' ) + if ( ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.holdingbranch' || $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.homebranch' ) && $defaultvalues && $defaultvalues->{'branchcode'} ) { if ( $itemrecord and $defaultvalues and not $itemrecord->subfield($tag,$subfield) ) { @@ -1650,9 +1649,9 @@ sub PrepareItemrecordDisplay { $defaultvalue = $defaultvalues->{location}; } } - #Set the default items.price from the aqorders.unitprice - if ( $lastOrder->{unitprice} && $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.price' ) { - $defaultvalue = $lastOrder->{unitprice}; + #Set the default items.price from the aq order budgeted price + if ( $lastOrder->{ecost} && $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.price' ) { + $defaultvalue = $lastOrder->{ecost}; } #Set the default items.replacementprice from the aqorders.replacementprice if ( $lastOrder->{replacementprice} && $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.replacementprice' ) { @@ -1692,9 +1691,8 @@ sub PrepareItemrecordDisplay { } } - $defaultvalue = C4::Context->userenv ? C4::Context->userenv->{branch} : undef; if ( $defaultvalues and $defaultvalues->{branchcode} ) { - $defaultvalue = $defaultvalues->{branchcode}; + $defaultvalue = C4::Context->userenv ? C4::Context->userenv->{branch} : $defaultvalues->{branchcode}; } #----- itemtypes diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref index dd81f31020..66d3c410c0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -32,7 +32,7 @@ Cataloging: choices: yes: "Enable" no: "Disable" - - If enabled the 952$d Date Acquired will be populate on page load rather than requiring the user to click in the input field + - If enabled the 952$d Date Acquired field will be populated on page load rather than requiring the user to click in the input field Spine Labels: - - When using the quick spine label printer, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref index 52cd023e6e..17dde7037c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/serials.pref @@ -67,4 +67,4 @@ Serials: choices: yes: Enable no: Disable - - If enabled the 'Create an item record when receiving this serial' checkbox in serials/subscription-add.pl will be ticked by default + - If enabled the 'Create an item record when receiving this serial' checkbox in the subscription add form will be ticked by default diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt index 6df45750bd..f056689979 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt @@ -326,7 +326,7 @@ fieldset.rows table { clear: none; margin: 0; }