Lines 1849-1865
sub AddReturn {
Link Here
|
1849 |
my $stat_type = 'return'; |
1849 |
my $stat_type = 'return'; |
1850 |
|
1850 |
|
1851 |
# get information on item |
1851 |
# get information on item |
1852 |
my $item = GetItem( undef, $barcode ) |
1852 |
my $item = GetItem( undef, $barcode ); |
1853 |
or die "GetItem( undef, $barcode ) failed"; |
1853 |
unless ($item) { |
|
|
1854 |
return ( 0, { BadBarcode => $barcode } ); # no barcode means no item or borrower. bail out. |
1855 |
} |
1856 |
|
1854 |
my $itemnumber = $item->{ itemnumber }; |
1857 |
my $itemnumber = $item->{ itemnumber }; |
1855 |
my $biblio = GetBiblioData( $item->{ biblionumber } ); |
1858 |
my $biblio = GetBiblioData( $item->{ biblionumber } ); |
1856 |
my $itemtype = ( C4::Context->preference("item-level_itypes") ) |
1859 |
my $itemtype = ( C4::Context->preference("item-level_itypes") ) |
1857 |
? $item->{ itype } |
1860 |
? $item->{ itype } |
1858 |
: $biblio->{ itemtype }; |
1861 |
: $biblio->{ itemtype }; |
1859 |
|
1862 |
|
1860 |
unless ($itemnumber) { |
|
|
1861 |
return (0, { BadBarcode => $barcode }); # no barcode means no item or borrower. bail out. |
1862 |
} |
1863 |
my $issue = GetItemIssue($itemnumber); |
1863 |
my $issue = GetItemIssue($itemnumber); |
1864 |
if ($issue and $issue->{borrowernumber}) { |
1864 |
if ($issue and $issue->{borrowernumber}) { |
1865 |
$borrower = C4::Members::GetMemberDetails($issue->{borrowernumber}) |
1865 |
$borrower = C4::Members::GetMemberDetails($issue->{borrowernumber}) |
1866 |
- |
|
|