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

(-)a/Koha/EDI.pm (+3 lines)
Lines 288-293 sub process_invoice { Link Here
288
                    }
288
                    }
289
289
290
                    my $price = _get_invoiced_price($line);
290
                    my $price = _get_invoiced_price($line);
291
                    my $tax_rate = $line->tax_rate;
291
292
292
                    if ( $order->quantity > $line->quantity ) {
293
                    if ( $order->quantity > $line->quantity ) {
293
                        my $ordered = $order->quantity;
294
                        my $ordered = $order->quantity;
Lines 305-310 sub process_invoice { Link Here
305
                                unitprice        => $price,
306
                                unitprice        => $price,
306
                                invoiceid        => $invoiceid,
307
                                invoiceid        => $invoiceid,
307
                                datereceived     => $msg_date,
308
                                datereceived     => $msg_date,
309
                                tax_rate_on_receiving => $trax_rate->{rate},
308
                            }
310
                            }
309
                        );
311
                        );
310
                        my $p_updates =
312
                        my $p_updates =
Lines 324-329 sub process_invoice { Link Here
324
                        $order->datereceived($msg_date);
326
                        $order->datereceived($msg_date);
325
                        $order->invoiceid($invoiceid);
327
                        $order->invoiceid($invoiceid);
326
                        $order->unitprice($price);
328
                        $order->unitprice($price);
329
                        $order->tax_rate_on_receiving($trax_rate->{rate});
327
                        $order->orderstatus('complete');
330
                        $order->orderstatus('complete');
328
                        my $p_updates = update_price_from_invoice( $order,
331
                        my $p_updates = update_price_from_invoice( $order,
329
                            $invoice_message->vendor_id );
332
                            $invoice_message->vendor_id );
(-)a/Koha/Edifact/Line.pm (-1 / +24 lines)
Lines 804-809 sub tax { Link Here
804
    return $self->moa_amt('124');
804
    return $self->moa_amt('124');
805
}
805
}
806
806
807
sub tax_rate {
808
    my $self = shift;
809
    my $tr = {};
810
    foreach my $s ( @{ $self->{segs} } ) {
811
        if ( $s->tag eq 'TAX' && $s->elem( 0, 0 ) == 7 ) {
812
            $tr->{type} = $s->elem( 1, 0 ); # VAT, GST or IMP
813
            $tr->{rate} = $s->elem( 4, 3 ); # percentage
814
            # category values may be:
815
            # E = exempt from tax
816
            # G = export item, tax not charged
817
            # H = higher rate
818
            # L = lower rate
819
            # S = standard rate
820
            # Z = zero-rated
821
            $tr->{category} = $s->elem( 5, 0 );
822
            if (!defined $tr->{rate} && $tr->{category} eq 'Z') {
823
                $tr->{rate} = 0;
824
            }
825
            return $tr;
826
        }
827
    }
828
    return;
829
}
830
807
sub availability_date {
831
sub availability_date {
808
    my $self = shift;
832
    my $self = shift;
809
    if ( exists $self->{availability_date} ) {
833
    if ( exists $self->{availability_date} ) {
810
- 

Return to bug 18267