|
Lines 290-296
sub process_invoice {
Link Here
|
| 290 |
)->single; |
290 |
)->single; |
| 291 |
} |
291 |
} |
| 292 |
if ( !$vendor_acct ) { |
292 |
if ( !$vendor_acct ) { |
| 293 |
$invoice_message->add_to_edifact_errors({ details => "Cannot find vendor with ean $vendor_ean" }); |
293 |
$invoice_message->add_to_edifact_errors({ details => "Cannot find vendor with SAN: $vendor_ean" }); |
| 294 |
$logger->error("Cannot find vendor with ean $vendor_ean for invoice $invoicenumber in ".$invoice_message->filename); |
294 |
$logger->error("Cannot find vendor with ean $vendor_ean for invoice $invoicenumber in ".$invoice_message->filename); |
| 295 |
next; |
295 |
next; |
| 296 |
} |
296 |
} |
|
Lines 316-323
sub process_invoice {
Link Here
|
| 316 |
if ( !$ordernumber ) { |
316 |
if ( !$ordernumber ) { |
| 317 |
$invoice_message->add_to_edifact_errors( |
317 |
$invoice_message->add_to_edifact_errors( |
| 318 |
{ |
318 |
{ |
| 319 |
section => $line->line_item_number, |
319 |
section => join("\n", map { $_->as_string } @{$line->{segs}}), |
| 320 |
details => "Message missing ordernumber" |
320 |
details => "Invoice line " . $line->line_item_number . " is missing an ordernumber" |
| 321 |
} |
321 |
} |
| 322 |
); |
322 |
); |
| 323 |
$logger->error("Skipping invoice line, no associated ordernumber"); |
323 |
$logger->error("Skipping invoice line, no associated ordernumber"); |
|
Lines 329-336
sub process_invoice {
Link Here
|
| 329 |
if ( !$order ) { |
329 |
if ( !$order ) { |
| 330 |
$invoice_message->add_to_edifact_errors( |
330 |
$invoice_message->add_to_edifact_errors( |
| 331 |
{ |
331 |
{ |
| 332 |
section => $line->line_item_number, |
332 |
section => join( "\n", map { $_->as_string } @{ $line->{segs} } ), |
| 333 |
details => "Koha order $ordernumber missing" |
333 |
details => "Unable to find matching Koha order for invoice " |
|
|
334 |
. $line->line_item_number |
| 335 |
. " with ordernumber $ordernumber" |
| 334 |
} |
336 |
} |
| 335 |
); |
337 |
); |
| 336 |
$logger->error("Skipping invoice line, no order found for $ordernumber, invoice:$invoicenumber"); |
338 |
$logger->error("Skipping invoice line, no order found for $ordernumber, invoice:$invoicenumber"); |
|
Lines 341-348
sub process_invoice {
Link Here
|
| 341 |
if ( !$bib ) { |
343 |
if ( !$bib ) { |
| 342 |
$invoice_message->add_to_edifact_errors( |
344 |
$invoice_message->add_to_edifact_errors( |
| 343 |
{ |
345 |
{ |
| 344 |
section => $line->line_item_number, |
346 |
section => join("\n", map { $_->as_string } @{$line->{segs}}), |
| 345 |
details => "Koha biblio missing" |
347 |
details => "Unable to find Koha biblio for invoice " |
|
|
348 |
. $line->line_item_number |
| 349 |
. " with ordernumber $ordernumber" |
| 346 |
} |
350 |
} |
| 347 |
); |
351 |
); |
| 348 |
$logger->error( |
352 |
$logger->error( |
|
Lines 472-479
sub receipt_items {
Link Here
|
| 472 |
my $i = $ilink->itemnumber; |
476 |
my $i = $ilink->itemnumber; |
| 473 |
$invoice_message->add_to_edifact_errors( |
477 |
$invoice_message->add_to_edifact_errors( |
| 474 |
{ |
478 |
{ |
| 475 |
section => $inv_line->line_item_number, |
479 |
section => join("\n", map { $_->as_string } @{$inv_line->{segs}}), |
| 476 |
details => "Cannot fine aqorder item" |
480 |
details => "Unable to find Koha item for invoice " |
|
|
481 |
. $inv_line->line_item_number |
| 482 |
. " with ordernumber $ordernumber" |
| 477 |
} |
483 |
} |
| 478 |
); |
484 |
); |
| 479 |
$logger->warn( |
485 |
$logger->warn( |
|
Lines 517-524
sub receipt_items {
Link Here
|
| 517 |
if ( $rs->count > 0 ) { |
523 |
if ( $rs->count > 0 ) { |
| 518 |
$invoice_message->add_to_edifact_errors( |
524 |
$invoice_message->add_to_edifact_errors( |
| 519 |
{ |
525 |
{ |
| 520 |
section => $inv_line->line_item_number . " : " . $gir_occurrence, |
526 |
section => join("\n", map { $_->as_string } @{$inv_line->{segs}}), |
| 521 |
details => "Duplicate barcode found $barcode" |
527 |
details => "Duplicate barcode $barcode found for invoice line " |
|
|
528 |
. $inv_line->line_item_number . ":" |
| 529 |
. $gir_occurrence |
| 522 |
} |
530 |
} |
| 523 |
); |
531 |
); |
| 524 |
$logger->warn("Barcode $barcode is a duplicate"); |
532 |
$logger->warn("Barcode $barcode is a duplicate"); |
|
Lines 547-554
sub receipt_items {
Link Here
|
| 547 |
else { |
555 |
else { |
| 548 |
$invoice_message->add_to_edifact_errors( |
556 |
$invoice_message->add_to_edifact_errors( |
| 549 |
{ |
557 |
{ |
| 550 |
section => $inv_line->line_item_number, |
558 |
section => join("\n", map { $_->as_string } @{$inv_line->{segs}}), |
| 551 |
details => "Unmatched item at branch $branch" |
559 |
details => "No matching item found for invoice line " |
|
|
560 |
. $inv_line->line_item_number . ":" |
| 561 |
. $gir_occurrence |
| 562 |
. " at branch $branch" |
| 552 |
} |
563 |
} |
| 553 |
); |
564 |
); |
| 554 |
$logger->warn("Unmatched item at branch:$branch"); |
565 |
$logger->warn("Unmatched item at branch:$branch"); |
|
Lines 747-753
sub quote_item {
Link Here
|
| 747 |
if ( $gir_count != $order_quantity ) { |
758 |
if ( $gir_count != $order_quantity ) { |
| 748 |
$quote_message->add_to_edifact_errors( |
759 |
$quote_message->add_to_edifact_errors( |
| 749 |
{ |
760 |
{ |
| 750 |
section => "GIR", |
761 |
section => join('\n', @{$item->{GIR}}), |
| 751 |
details => "Order for $order_quantity items, $gir_count segments present" |
762 |
details => "Order for $order_quantity items, $gir_count segments present" |
| 752 |
} |
763 |
} |
| 753 |
); |
764 |
); |
|
Lines 833-839
sub quote_item {
Link Here
|
| 833 |
if ( $item->quantity > 1 ) { |
844 |
if ( $item->quantity > 1 ) { |
| 834 |
$quote_message->add_to_edifact_errors( |
845 |
$quote_message->add_to_edifact_errors( |
| 835 |
{ |
846 |
{ |
| 836 |
section => "GIR", |
847 |
section => join('\n', @{$item->{GIR}}), |
| 837 |
details => "Skipped GIR line with invalid budget: " . $item->girfield('fund_allocation') |
848 |
details => "Skipped GIR line with invalid budget: " . $item->girfield('fund_allocation') |
| 838 |
} |
849 |
} |
| 839 |
); |
850 |
); |
|
Lines 842-848
sub quote_item {
Link Here
|
| 842 |
} else { |
853 |
} else { |
| 843 |
$quote_message->add_to_edifact_errors( |
854 |
$quote_message->add_to_edifact_errors( |
| 844 |
{ |
855 |
{ |
| 845 |
section => "GIR", |
856 |
section => join("\n", map { $_->as_string } @{$item->{segs}}), |
| 846 |
details => "Skipped orderline line with invalid budget: " . $item->girfield('fund_allocation') |
857 |
details => "Skipped orderline line with invalid budget: " . $item->girfield('fund_allocation') |
| 847 |
} |
858 |
} |
| 848 |
); |
859 |
); |
|
Lines 901-908
sub quote_item {
Link Here
|
| 901 |
} else { |
912 |
} else { |
| 902 |
$quote_message->add_to_edifact_errors( |
913 |
$quote_message->add_to_edifact_errors( |
| 903 |
{ |
914 |
{ |
| 904 |
section => "LRP", |
915 |
section => $item->{GIR}->[0], |
| 905 |
details => "No rota found for passed $lrp in orderline" |
916 |
details => "No rota found for passed LRP:$lrp in orderline" |
| 906 |
} |
917 |
} |
| 907 |
); |
918 |
); |
| 908 |
$logger->error("No rota found matching $lrp in orderline"); |
919 |
$logger->error("No rota found matching $lrp in orderline"); |
|
Lines 925-932
sub quote_item {
Link Here
|
| 925 |
$item->girfield( 'fund_allocation', $occurrence ); |
936 |
$item->girfield( 'fund_allocation', $occurrence ); |
| 926 |
$quote_message->add_to_edifact_errors( |
937 |
$quote_message->add_to_edifact_errors( |
| 927 |
{ |
938 |
{ |
| 928 |
section => "GIR", |
939 |
section => $item->{GIR}->[$occurrence], |
| 929 |
details => "Skipped GIR line with invalid budget: $bad_budget" |
940 |
details => "Invalid budget $bad_budget found" |
| 930 |
} |
941 |
} |
| 931 |
); |
942 |
); |
| 932 |
$logger->trace( |
943 |
$logger->trace( |
|
Lines 1020-1027
sub quote_item {
Link Here
|
| 1020 |
else { |
1031 |
else { |
| 1021 |
$quote_message->add_to_edifact_errors( |
1032 |
$quote_message->add_to_edifact_errors( |
| 1022 |
{ |
1033 |
{ |
| 1023 |
section => "LRP", |
1034 |
section => $item->{GIR}->[$occurrence], |
| 1024 |
details => "No rota found for passed $lrp in orderline" |
1035 |
details => "No rota found for passed LRP:$lrp in orderline" |
| 1025 |
} |
1036 |
} |
| 1026 |
); |
1037 |
); |
| 1027 |
$logger->error( |
1038 |
$logger->error( |
|
Lines 1096-1103
sub quote_item {
Link Here
|
| 1096 |
else { |
1107 |
else { |
| 1097 |
$quote_message->add_to_edifact_errors( |
1108 |
$quote_message->add_to_edifact_errors( |
| 1098 |
{ |
1109 |
{ |
| 1099 |
section => "LRP", |
1110 |
section => $item->{GIR}->[$occurrence], |
| 1100 |
details => "No rota found for passed $lrp in orderline" |
1111 |
details => "No rota found for passed LRP:$lrp in orderline" |
| 1101 |
} |
1112 |
} |
| 1102 |
); |
1113 |
); |
| 1103 |
$logger->error( |
1114 |
$logger->error( |
| 1104 |
- |
|
|