[Koha-patches] [PATCH] process change to lost status when set from Edit Item screen
Michael Hafen
mdhafen at tech.washk12.org
Tue Dec 23 22:41:52 CET 2008
Got ahead of myself there. Forgot the get_item_status sub. I'll fix
that and resubmit.
On Tue, 2008-12-23 at 14:36 -0700, Michael Hafen wrote:
> Do the apropriate thing if the itemlost status is change on the Edit
> Item screen, as opposed to the lost status being changed on the Item
> Information screen.
> ---
> cataloguing/additem.pl | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl
> index f8780c2..6e06e39 100755
> --- a/cataloguing/additem.pl
> +++ b/cataloguing/additem.pl
> @@ -177,6 +177,17 @@ if ($op eq "additem") {
> if ($exist_itemnumber && $exist_itemnumber != $itemnumber) {
> push @errors,"barcode_not_unique";
> } else {
> + # check if Lost was change.
> + my $exist_lost = get_item_status( $itemnumber );
> + if ( $exist_lost != $addedolditem->{'lost'} ) {
> + if ( $exist_lost == 0 && $addedolditem->{'lost'} == 1 ) {
> + C4::Accounts::chargelostitem($itemnumber)
> + } elsif ( $exist_lost == 1 && $addedolditem->{'lost'} == 0 ) {
> + # FIXME Should check if the previous borrower lost the item,
> + # and pass their info here instead of an empty hash
> + C4::Circulation::FixAccountForLostAndReturned( $addedolditem, {} );
> + }
> + }
> my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = ModItemFromMarc($itemtosave,$biblionumber,$itemnumber);
> $itemnumber="";
> }
--
Michael Hafen
Systems Analyst and Programmer
Washington County School District
Utah, USA
for Koha checkout
http://koha-dev.washk12.org
or
git://koha-dev.washk12.org/koha
More information about the Koha-patches
mailing list