Bug 27017: Code more defensively in process_invoice
This patch adds a check for ordernumber precence in the EDI Invoice message lines and skips process if one is not found. We log the failure as a trace log to allow administrators the oportunity to track down the issue further. We also add a trace log to entries to show which bib the invoice line is receipting to. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
1cc21ca6bd
commit
c009c3fa81
12
Koha/EDI.pm
12
Koha/EDI.pm
|
|
@ -312,12 +312,22 @@ sub process_invoice {
|
|||
|
||||
foreach my $line ( @{$lines} ) {
|
||||
my $ordernumber = $line->ordernumber;
|
||||
if (!$ordernumber ) {
|
||||
$logger->trace( "Skipping invoice line, no associated ordernumber" );
|
||||
next;
|
||||
}
|
||||
|
||||
$logger->trace( "Receipting order:$ordernumber Qty: ",
|
||||
$line->quantity );
|
||||
|
||||
my $order = $schema->resultset('Aqorder')->find($ordernumber);
|
||||
if ($order->biblionumber->biblionumber) {
|
||||
my $b = $order->biblionumber->biblionumber;
|
||||
my $id = $line->item_number_id;
|
||||
$logger->trace("Updating bib:$b id:$id");
|
||||
}
|
||||
|
||||
# ModReceiveOrder does not validate that $ordernumber exists validate here
|
||||
# ModReceiveOrder does not validate that $ordernumber exists validate here
|
||||
if ($order) {
|
||||
|
||||
# check suggestions
|
||||
|
|
|
|||
Loading…
Reference in New Issue