Lines 290-296
sub process_invoice {
Link Here
|
290 |
)->single; |
290 |
)->single; |
291 |
} |
291 |
} |
292 |
if ( !$vendor_acct ) { |
292 |
if ( !$vendor_acct ) { |
293 |
carp "Cannot find vendor with ean $vendor_ean for invoice $invoicenumber in ".$invoice_message->filename; |
293 |
$invoice_message->add_to_edifact_errors({ details => "Cannot find vendor with ean $vendor_ean" }); |
|
|
294 |
$logger->error("Cannot find vendor with ean $vendor_ean for invoice $invoicenumber in ".$invoice_message->filename); |
294 |
next; |
295 |
next; |
295 |
} |
296 |
} |
296 |
$invoice_message->edi_acct( $vendor_acct->id ); |
297 |
$invoice_message->edi_acct( $vendor_acct->id ); |
Lines 313-318
sub process_invoice {
Link Here
|
313 |
foreach my $line ( @{$lines} ) { |
314 |
foreach my $line ( @{$lines} ) { |
314 |
my $ordernumber = $line->ordernumber; |
315 |
my $ordernumber = $line->ordernumber; |
315 |
if ( !$ordernumber ) { |
316 |
if ( !$ordernumber ) { |
|
|
317 |
$invoice_message->add_to_edifact_errors( |
318 |
{ |
319 |
section => $line->line_item_number, |
320 |
details => "Message missing ordernumber" |
321 |
} |
322 |
); |
316 |
$logger->error("Skipping invoice line, no associated ordernumber"); |
323 |
$logger->error("Skipping invoice line, no associated ordernumber"); |
317 |
next; |
324 |
next; |
318 |
} |
325 |
} |
Lines 320-331
sub process_invoice {
Link Here
|
320 |
# ModReceiveOrder does not validate that $ordernumber exists validate here |
327 |
# ModReceiveOrder does not validate that $ordernumber exists validate here |
321 |
my $order = $schema->resultset('Aqorder')->find($ordernumber); |
328 |
my $order = $schema->resultset('Aqorder')->find($ordernumber); |
322 |
if ( !$order ) { |
329 |
if ( !$order ) { |
|
|
330 |
$invoice_message->add_to_edifact_errors( |
331 |
{ |
332 |
section => $line->line_item_number, |
333 |
details => "Koha order $ordernumber missing" |
334 |
} |
335 |
); |
323 |
$logger->error("Skipping invoice line, no order found for $ordernumber, invoice:$invoicenumber"); |
336 |
$logger->error("Skipping invoice line, no order found for $ordernumber, invoice:$invoicenumber"); |
324 |
next; |
337 |
next; |
325 |
} |
338 |
} |
326 |
|
339 |
|
327 |
my $bib = $order->biblionumber; |
340 |
my $bib = $order->biblionumber; |
328 |
if ( !$bib ) { |
341 |
if ( !$bib ) { |
|
|
342 |
$invoice_message->add_to_edifact_errors( |
343 |
{ |
344 |
section => $line->line_item_number, |
345 |
details => "Koha biblio missing" |
346 |
} |
347 |
); |
329 |
$logger->error( |
348 |
$logger->error( |
330 |
"Skipping invoice line, no bibliographic record found for $ordernumber, invoice:$invoicenumber" |
349 |
"Skipping invoice line, no bibliographic record found for $ordernumber, invoice:$invoicenumber" |
331 |
); |
350 |
); |
332 |
- |
|
|