If using MarcItemFieldsToOrder with AcqCreateItem = Create,
the order and the items will be created, but they will not be linked via aqorders_items!
Test Plan:
1) Enable creation of items when ordering
2) Set up MarcItemFieldsToOrder
3) Upload an order record that uses the fields in step 2
4) Create a basket and add the records from the file
5) Note the order and items are created, but no rows in aqorders_items are created
6) Apply this patch
7) Repeat steps 3-4
8) Note the rows in aqorders_items are created!
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Marci Chen <mchen@mckinneytexas.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
my @replacementprices = $input->multi_param('replacementprice_' . $biblio_count);
my @itemcallnumbers = $input->multi_param('itemcallnumber_' . $biblio_count);
my $itemcreation = 0;
+
+ my @itemnumbers;
for (my $i = 0; $i < $count; $i++) {
$itemcreation = 1;
my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({
replacementprice => $replacementprices[$i],
itemcallnumber => $itemcallnumbers[$i],
}, $biblionumber);
+ push( @itemnumbers, $itemnumber );
}
if ($itemcreation == 1) {
# Group orderlines from MarcItemFieldsToOrder
};
my $order = Koha::Acquisition::Order->new( \%orderinfo )->insert;
+ $order->add_item( $_ ) for @itemnumbers;
}
}
} else {