View | Details | Raw Unified | Return to bug 41996
Collapse All | Expand All

(-)a/Koha/EDI.pm (-2 / +21 lines)
Lines 393-398 sub process_invoice { Link Here
393
                $logger->trace( "Receipting order:$ordernumber Qty: " . $line->quantity );
393
                $logger->trace( "Receipting order:$ordernumber Qty: " . $line->quantity );
394
                $logger->trace( "Updating bib:" . $bib->biblionumber . " id:" . $line->item_number_id );
394
                $logger->trace( "Updating bib:" . $bib->biblionumber . " id:" . $line->item_number_id );
395
395
396
                if ( $order->orderstatus eq 'complete' ) {
397
                    $invoice_message->add_to_edifact_errors(
398
                        {
399
                            section => join( "\n", map { $_->as_string } @{ $line->{segs} } ),
400
                            details => "Warning: invoice line "
401
                                . $line->line_item_number
402
                                . " references ordernumber "
403
                                . $ordernumber
404
                                . " which is already marked as complete (previously received on "
405
                                . ( $order->datereceived // 'unknown date' )
406
                                . "). The ordernumber in this invoice may be incorrect."
407
                        }
408
                    );
409
                    $logger->warn(
410
                        "Invoice line references already-complete order $ordernumber (invoice $invoicenumber)");
411
                }
412
396
                # check suggestions
413
                # check suggestions
397
                my $s = $schema->resultset('Suggestion')->search(
414
                my $s = $schema->resultset('Suggestion')->search(
398
                    {
415
                    {
Lines 592-597 sub receipt_items { Link Here
592
609
593
            $item->update;
610
            $item->update;
594
        } else {
611
        } else {
612
            my $available_branches = join( ', ', sort keys %branch_map ) || 'none';
595
            $invoice_message->add_to_edifact_errors(
613
            $invoice_message->add_to_edifact_errors(
596
                {
614
                {
597
                    section => join( "\n", map { $_->as_string } @{ $inv_line->{segs} } ),
615
                    section => join( "\n", map { $_->as_string } @{ $inv_line->{segs} } ),
Lines 599-607 sub receipt_items { Link Here
599
                        . $inv_line->line_item_number . ":"
617
                        . $inv_line->line_item_number . ":"
600
                        . $gir_occurrence
618
                        . $gir_occurrence
601
                        . " at branch $branch"
619
                        . " at branch $branch"
620
                        . " (order $ordernumber has items at: $available_branches)."
621
                        . " Check whether the ordernumber in the invoice (RFF+LI) is correct."
602
                }
622
                }
603
            );
623
            );
604
            $logger->warn("Unmatched item at branch:$branch");
624
            $logger->warn("Unmatched item at branch:$branch for order:$ordernumber (available: $available_branches)");
605
        }
625
        }
606
        ++$gir_occurrence;
626
        ++$gir_occurrence;
607
    }
627
    }
608
- 

Return to bug 41996