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 |
use Koha::CsvProfiles; |
37 |
use Koha::CsvProfiles; |
Lines 1660-1676
sub CancelReceipt {
Link Here
|
1660 |
my @affects = split q{\|}, C4::Context->preference("AcqItemSetSubfieldsWhenReceiptIsCancelled"); |
1661 |
my @affects = split q{\|}, C4::Context->preference("AcqItemSetSubfieldsWhenReceiptIsCancelled"); |
1661 |
if ( @affects ) { |
1662 |
if ( @affects ) { |
1662 |
for my $in ( @itemnumbers ) { |
1663 |
for my $in ( @itemnumbers ) { |
1663 |
my $biblionumber = C4::Biblio::GetBiblionumberFromItemnumber( $in ); |
1664 |
my $item = Koha::Items->find( $in ); |
1664 |
my $frameworkcode = GetFrameworkCode($biblionumber); |
1665 |
my $biblio = $item->biblio; |
1665 |
my ( $itemfield ) = GetMarcFromKohaField( 'items.itemnumber', $frameworkcode ); |
1666 |
my ( $itemfield ) = GetMarcFromKohaField( 'items.itemnumber', $biblio->frameworkcode ); |
1666 |
my $item = C4::Items::GetMarcItem( $biblionumber, $in ); |
1667 |
my $item_marc = C4::Items::GetMarcItem( $biblio->biblionumber, $in ); |
1667 |
for my $affect ( @affects ) { |
1668 |
for my $affect ( @affects ) { |
1668 |
my ( $sf, $v ) = split q{=}, $affect, 2; |
1669 |
my ( $sf, $v ) = split q{=}, $affect, 2; |
1669 |
foreach ( $item->field($itemfield) ) { |
1670 |
foreach ( $item_marc->field($itemfield) ) { |
1670 |
$_->update( $sf => $v ); |
1671 |
$_->update( $sf => $v ); |
1671 |
} |
1672 |
} |
1672 |
} |
1673 |
} |
1673 |
C4::Items::ModItemFromMarc( $item, $biblionumber, $in ); |
1674 |
C4::Items::ModItemFromMarc( $item_marc, $biblio->biblionumber, $in ); |
1674 |
} |
1675 |
} |
1675 |
} |
1676 |
} |
1676 |
} |
1677 |
} |