if ( grep { $_ eq 'holdingbranch' } @t_fields_to_copy ) {
$values->{holdingbranch} = $statistic->item->holdingbranch;
}
+ if ( grep { $_ eq 'homebranch' } @t_fields_to_copy ) {
+ $values->{homebranch} = $statistic->item->homebranch;
+ }
if ( grep { $_ eq 'transaction_type' } @t_fields_to_copy ) {
$values->{transaction_type} = $statistic->type;
}
@t_fields_to_copy = grep {
$_ ne 'transaction_branchcode'
&& $_ ne 'holdingbranch'
+ && $_ ne 'homebranch'
&& $_ ne 'transaction_type'
&& $_ ne 'itemcallnumber'
} @t_fields_to_copy;
`itemnumber` int(11) default NULL,
`itemtype` varchar(10) default NULL,
`holdingbranch` varchar(10) default null,
+ `homebranch` varchar(10) default null,
`location` varchar(80) default NULL,
`itemcallnumber` varchar(255) default NULL,
`ccode` varchar(80) default NULL,
|);
$dbh->do(q|
INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type)
- VALUES ('PseudonymizationTransactionFields','','datetime,transaction_branchcode,transaction_type,itemnumber,itemtype,holdingbranch,location,itemcallnumber,ccode','Transaction fields to copy to the pseudonymized_transactions table','multiple')
+ VALUES ('PseudonymizationTransactionFields','','datetime,transaction_branchcode,transaction_type,itemnumber,itemtype,holdingbranch,homebranch,location,itemcallnumber,ccode','Transaction fields to copy to the pseudonymized_transactions table','multiple')
|);
unless( TableExists( 'pseudonymized_borrower_attributes' ) ) {
`itemnumber` int(11) default NULL,
`itemtype` varchar(10) default NULL,
`holdingbranch` varchar(10) default null,
+ `homebranch` varchar(10) default null,
`location` varchar(80) default NULL,
`itemcallnumber` varchar(255) default NULL,
`ccode` varchar(80) default NULL,
itemnumber: "Itemnumber"
itemtype: "Item type"
holdingbranch: "Holding branch"
+ homebranch: "Home branch"
location: "Location"
itemcallnumber: "Item's callnumber"
ccode: "Collection code"
subtest 'Koha::Anonymized::Transactions tests' => sub {
- plan tests => 11;
+ plan tests => 12;
$schema->storage->txn_begin;
'No pseudonymized transaction if Pseudonymization is off' );
t::lib::Mocks::mock_preference( 'Pseudonymization', 1 );
- t::lib::Mocks::mock_preference( 'PseudonymizationTransactionFields', 'datetime,transaction_branchcode,transaction_type,itemnumber,itemtype,holdingbranch,location,itemcallnumber,ccode'
+ t::lib::Mocks::mock_preference( 'PseudonymizationTransactionFields', 'datetime,transaction_branchcode,transaction_type,itemnumber,itemtype,holdingbranch,homebranch,location,itemcallnumber,ccode'
);
$item = $builder->build_sample_item;
t::lib::Mocks::mock_userenv({ branchcode => $item->homebranch });
is( $pseudonymized->itemnumber, $item->itemnumber );
is( $pseudonymized->itemtype, $item->effective_itemtype );
is( $pseudonymized->holdingbranch, $item->holdingbranch );
+ is( $pseudonymized->homebranch, $item->homebranch );
is( $pseudonymized->location, $item->location );
is( $pseudonymized->itemcallnumber, $item->itemcallnumber );
is( $pseudonymized->ccode, $item->ccode );