Bugzilla – Attachment 142714 Details for
Bug 27017
Add further defensive coding to EDI Invoice handling
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27017: Code more defensively in process_invoice
Bug-27017-Code-more-defensively-in-processinvoice.patch (text/plain), 1.80 KB, created by
Martin Renvoize
on 2022-10-27 12:47:29 UTC
(
hide
)
Description:
Bug 27017: Code more defensively in process_invoice
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2022-10-27 12:47:29 UTC
Size:
1.80 KB
patch
obsolete
>From 91b74f4dcf9dfcc7ec31c470d39ba5158a740bcd Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Fri, 13 Nov 2020 13:46:13 +0000 >Subject: [PATCH] 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> >--- > Koha/EDI.pm | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > >diff --git a/Koha/EDI.pm b/Koha/EDI.pm >index 4778a1d7f7..9fc92a48d7 100644 >--- a/Koha/EDI.pm >+++ b/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 >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27017
:
113604
|
142714
|
142726
|
142730