Lines 31-36
use Koha::DateUtils qw( dt_from_string output_pref );
Link Here
|
31 |
use Koha::Acquisition::Order; |
31 |
use Koha::Acquisition::Order; |
32 |
use Koha::Acquisition::Booksellers; |
32 |
use Koha::Acquisition::Booksellers; |
33 |
use Koha::Biblios; |
33 |
use Koha::Biblios; |
|
|
34 |
use Koha::Items; |
34 |
use Koha::Number::Price; |
35 |
use Koha::Number::Price; |
35 |
use Koha::Libraries; |
36 |
use Koha::Libraries; |
36 |
|
37 |
|
Lines 1606-1622
sub CancelReceipt {
Link Here
|
1606 |
my @affects = split q{\|}, C4::Context->preference("AcqItemSetSubfieldsWhenReceiptIsCancelled"); |
1607 |
my @affects = split q{\|}, C4::Context->preference("AcqItemSetSubfieldsWhenReceiptIsCancelled"); |
1607 |
if ( @affects ) { |
1608 |
if ( @affects ) { |
1608 |
for my $in ( @itemnumbers ) { |
1609 |
for my $in ( @itemnumbers ) { |
1609 |
my $biblionumber = C4::Biblio::GetBiblionumberFromItemnumber( $in ); |
1610 |
my $item = Koha::Items->find( $in ); |
1610 |
my $frameworkcode = GetFrameworkCode($biblionumber); |
1611 |
my $biblio = $item->biblio; |
1611 |
my ( $itemfield ) = GetMarcFromKohaField( 'items.itemnumber', $frameworkcode ); |
1612 |
my ( $itemfield ) = GetMarcFromKohaField( 'items.itemnumber', $biblio->frameworkcode ); |
1612 |
my $item = C4::Items::GetMarcItem( $biblionumber, $in ); |
1613 |
my $item_marc = C4::Items::GetMarcItem( $biblio->biblionumber, $in ); |
1613 |
for my $affect ( @affects ) { |
1614 |
for my $affect ( @affects ) { |
1614 |
my ( $sf, $v ) = split q{=}, $affect, 2; |
1615 |
my ( $sf, $v ) = split q{=}, $affect, 2; |
1615 |
foreach ( $item->field($itemfield) ) { |
1616 |
foreach ( $item_marc->field($itemfield) ) { |
1616 |
$_->update( $sf => $v ); |
1617 |
$_->update( $sf => $v ); |
1617 |
} |
1618 |
} |
1618 |
} |
1619 |
} |
1619 |
C4::Items::ModItemFromMarc( $item, $biblionumber, $in ); |
1620 |
C4::Items::ModItemFromMarc( $item_marc, $biblio->biblionumber, $in ); |
1620 |
} |
1621 |
} |
1621 |
} |
1622 |
} |
1622 |
} |
1623 |
} |