Bug 35398: (QA follow-up) Tidy code

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ab7a8db43d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Kyle M Hall 2024-01-02 08:58:04 -05:00 committed by Fridolin Somers
parent d96168e38f
commit 07a5a2ca59
2 changed files with 16 additions and 16 deletions

View File

@ -830,19 +830,17 @@ sub quote_item {
);
++$created;
my $lrp =
$item->girfield( 'library_rotation_plan' );
my $lrp = $item->girfield('library_rotation_plan');
if ($lrp) {
my $rota =
Koha::StockRotationRotas->find( { title => $lrp },
{ key => 'stockrotationrotas_title' } );
my $rota = Koha::StockRotationRotas->find(
{ title => $lrp },
{ key => 'stockrotationrotas_title' }
);
if ($rota) {
$rota->add_item($itemnumber);
$logger->trace("Item added to rota $rota->id");
}
else {
$logger->error(
"No rota found matching $lrp in orderline");
} else {
$logger->error("No rota found matching $lrp in orderline");
}
}
}

View File

@ -83,10 +83,12 @@ subtest 'process_quote' => sub {
value => { title => 'ROT1' }
}
);
$builder->build({
source => 'Stockrotationstage',
value => { rota_id => $rota->rota_id },
});
$builder->build(
{
source => 'Stockrotationstage',
value => { rota_id => $rota->rota_id },
}
);
# Process the test quote file
process_quote($quote);
@ -113,11 +115,11 @@ subtest 'process_quote' => sub {
my $item = $items->next;
# Test that item is added to rota appropriately
my $on_rota = Koha::StockRotationItems->search({ itemnumber_id => $item->itemnumber });
is($on_rota->count, 1, "Item added to stockrotation rota");
my $on_rota = Koha::StockRotationItems->search( { itemnumber_id => $item->itemnumber } );
is( $on_rota->count, 1, "Item added to stockrotation rota" );
my $rota_item = $on_rota->next;
is($rota_item->stage->rota->id, $rota->id, "Item is on correct rota");
is( $rota_item->stage->rota->id, $rota->id, "Item is on correct rota" );
$schema->storage->txn_rollback;
};