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

(-)a/C4/Acquisition.pm (-15 / +22 lines)
Lines 1447-1458 sub ModReceiveOrder { Link Here
1447
        | if defined $order->{unitprice};
1447
        | if defined $order->{unitprice};
1448
1448
1449
        $query .= q|
1449
        $query .= q|
1450
            , rrp = ?, rrp_tax_included = ?, rrp_tax_excluded = ?
1450
            ,tax_value_on_receiving = ?
1451
        | if defined $order->{rrp};
1451
        | if defined $order->{tax_value_on_receiving};
1452
1452
1453
        $query .= q|
1453
        $query .= q|
1454
            , ecost = ?, ecost_tax_included = ?, ecost_tax_excluded = ?
1454
            ,tax_rate_on_receiving = ?
1455
        | if defined $order->{ecost};
1455
        | if defined $order->{tax_rate_on_receiving};
1456
1456
1457
        $query .= q|
1457
        $query .= q|
1458
            , order_internalnote = ?
1458
            , order_internalnote = ?
Lines 1466-1477 sub ModReceiveOrder { Link Here
1466
        if ( defined $order->{unitprice} ) {
1466
        if ( defined $order->{unitprice} ) {
1467
            push @params, $order->{unitprice}, $order->{unitprice_tax_included}, $order->{unitprice_tax_excluded};
1467
            push @params, $order->{unitprice}, $order->{unitprice_tax_included}, $order->{unitprice_tax_excluded};
1468
        }
1468
        }
1469
        if ( defined $order->{rrp} ) {
1469
1470
            push @params, $order->{rrp}, $order->{rrp_tax_included}, $order->{rrp_tax_excluded};
1470
        if ( defined $order->{tax_value_on_receiving} ) {
1471
            push @params, $order->{tax_value_on_receiving};
1471
        }
1472
        }
1472
        if ( defined $order->{ecost} ) {
1473
1473
            push @params, $order->{ecost}, $order->{ecost_tax_included}, $order->{ecost_tax_excluded};
1474
        if ( defined $order->{tax_rate_on_receiving} ) {
1475
            push @params, $order->{tax_rate_on_receiving};
1474
        }
1476
        }
1477
1475
        if ( defined $order->{order_internalnote} ) {
1478
        if ( defined $order->{order_internalnote} ) {
1476
            push @params, $order->{order_internalnote};
1479
            push @params, $order->{order_internalnote};
1477
        }
1480
        }
Lines 2832-2843 sub populate_order_with_prices { Link Here
2832
    $discount /= 100 if $discount > 1;
2835
    $discount /= 100 if $discount > 1;
2833
2836
2834
    if ($ordering) {
2837
    if ($ordering) {
2838
        $order->{tax_rate_on_ordering} //= $order->{tax_rate};
2835
        if ( $bookseller->{listincgst} ) {
2839
        if ( $bookseller->{listincgst} ) {
2836
            # The user entered the rrp tax included
2840
            # The user entered the rrp tax included
2837
            $order->{rrp_tax_included} = $order->{rrp};
2841
            $order->{rrp_tax_included} = $order->{rrp};
2838
2842
2839
            # rrp tax excluded = rrp tax included / ( 1 + tax rate )
2843
            # rrp tax excluded = rrp tax included / ( 1 + tax rate )
2840
            $order->{rrp_tax_excluded} = $order->{rrp_tax_included} / ( 1 + $order->{tax_rate} );
2844
            $order->{rrp_tax_excluded} = $order->{rrp_tax_included} / ( 1 + $order->{tax_rate_on_ordering} );
2841
2845
2842
            # ecost tax excluded = rrp tax excluded * ( 1 - discount )
2846
            # ecost tax excluded = rrp tax excluded * ( 1 - discount )
2843
            $order->{ecost_tax_excluded} = $order->{rrp_tax_excluded} * ( 1 - $discount );
2847
            $order->{ecost_tax_excluded} = $order->{rrp_tax_excluded} * ( 1 - $discount );
Lines 2850-2856 sub populate_order_with_prices { Link Here
2850
            $order->{rrp_tax_excluded} = $order->{rrp};
2854
            $order->{rrp_tax_excluded} = $order->{rrp};
2851
2855
2852
            # rrp tax included = rrp tax excluded * ( 1 - tax rate )
2856
            # rrp tax included = rrp tax excluded * ( 1 - tax rate )
2853
            $order->{rrp_tax_included} = $order->{rrp_tax_excluded} * ( 1 + $order->{tax_rate} );
2857
            $order->{rrp_tax_included} = $order->{rrp_tax_excluded} * ( 1 + $order->{tax_rate_on_ordering} );
2854
2858
2855
            # ecost tax excluded = rrp tax excluded * ( 1 - discount )
2859
            # ecost tax excluded = rrp tax excluded * ( 1 - discount )
2856
            $order->{ecost_tax_excluded} = $order->{rrp_tax_excluded} * ( 1 - $discount );
2860
            $order->{ecost_tax_excluded} = $order->{rrp_tax_excluded} * ( 1 - $discount );
Lines 2858-2889 sub populate_order_with_prices { Link Here
2858
            # ecost tax included = rrp tax excluded * ( 1 - tax rate ) * ( 1 - discount )
2862
            # ecost tax included = rrp tax excluded * ( 1 - tax rate ) * ( 1 - discount )
2859
            $order->{ecost_tax_included} =
2863
            $order->{ecost_tax_included} =
2860
                $order->{rrp_tax_excluded} *
2864
                $order->{rrp_tax_excluded} *
2861
                ( 1 + $order->{tax_rate} ) *
2865
                ( 1 + $order->{tax_rate_on_ordering} ) *
2862
                ( 1 - $discount );
2866
                ( 1 - $discount );
2863
        }
2867
        }
2864
2868
2865
        # tax value = quantity * ecost tax excluded * tax rate
2869
        # tax value = quantity * ecost tax excluded * tax rate
2866
        $order->{tax_value} = $order->{quantity} * $order->{ecost_tax_excluded} * $order->{tax_rate};
2870
        $order->{tax_value_on_ordering} = 
2871
            $order->{quantity} * $order->{ecost_tax_excluded} * $order->{tax_rate_on_ordering};
2867
    }
2872
    }
2868
2873
2869
    if ($receiving) {
2874
    if ($receiving) {
2875
        $order->{tax_rate_on_receiving} //= $order->{tax_rate};
2870
        if ( $bookseller->{invoiceincgst} ) {
2876
        if ( $bookseller->{invoiceincgst} ) {
2871
            # The user entered the unit price tax included
2877
            # The user entered the unit price tax included
2872
            $order->{unitprice_tax_included} = $order->{unitprice};
2878
            $order->{unitprice_tax_included} = $order->{unitprice};
2873
2879
2874
            # unit price tax excluded = unit price tax included / ( 1 + tax rate )
2880
            # unit price tax excluded = unit price tax included / ( 1 + tax rate )
2875
            $order->{unitprice_tax_excluded} = $order->{unitprice_tax_included} / ( 1 + $order->{tax_rate} );
2881
            $order->{unitprice_tax_excluded} = $order->{unitprice_tax_included} / ( 1 + $order->{tax_rate_on_receiving} );
2876
        }
2882
        }
2877
        else {
2883
        else {
2878
            # The user entered the unit price tax excluded
2884
            # The user entered the unit price tax excluded
2879
            $order->{unitprice_tax_excluded} = $order->{unitprice};
2885
            $order->{unitprice_tax_excluded} = $order->{unitprice};
2880
2886
2887
2881
            # unit price tax included = unit price tax included * ( 1 + tax rate )
2888
            # unit price tax included = unit price tax included * ( 1 + tax rate )
2882
            $order->{unitprice_tax_included} = $order->{unitprice_tax_excluded} * ( 1 + $order->{tax_rate} );
2889
            $order->{unitprice_tax_included} = $order->{unitprice_tax_excluded} * ( 1 + $order->{tax_rate_on_receiving} );
2883
        }
2890
        }
2884
2891
2885
        # tax value = quantity * unit price tax excluded * tax rate
2892
        # tax value = quantity * unit price tax excluded * tax rate
2886
        $order->{tax_value} = $order->{quantity} * $order->{unitprice_tax_excluded} * $order->{tax_rate};
2893
        $order->{tax_value_on_receiving} = $order->{quantity} * $order->{unitprice_tax_excluded} * $order->{tax_rate_on_receiving};
2887
    }
2894
    }
2888
2895
2889
    return $order;
2896
    return $order;
(-)a/acqui/basket.pl (+5 lines)
Lines 349-354 if ( $op eq 'delete_confirm' ) { Link Here
349
            $template->param( uncertainprices => 1 );
349
            $template->param( uncertainprices => 1 );
350
        }
350
        }
351
351
352
        $line->{tax_rate} = $line->{tax_rate_on_ordering};
353
        $line->{tax_value} = $line->{tax_value_on_ordering};
354
352
        push @books_loop, $line;
355
        push @books_loop, $line;
353
356
354
        $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
357
        $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
Lines 448-453 sub get_order_infos { Link Here
448
451
449
    $line{total_tax_included} = $line{ecost_tax_included} * $line{quantity};
452
    $line{total_tax_included} = $line{ecost_tax_included} * $line{quantity};
450
    $line{total_tax_excluded} = $line{ecost_tax_excluded} * $line{quantity};
453
    $line{total_tax_excluded} = $line{ecost_tax_excluded} * $line{quantity};
454
    $line{tax_value} = $line{tax_value_on_ordering};
455
    $line{tax_rate} = $line{tax_rate_on_ordering};
451
456
452
    if ( $line{uncertainprice} ) {
457
    if ( $line{uncertainprice} ) {
453
        $line{rrp_tax_excluded} .= ' (Uncertain)';
458
        $line{rrp_tax_excluded} .= ' (Uncertain)';
(-)a/acqui/basketgroup.pl (+2 lines)
Lines 170-175 sub printbasketgrouppdf{ Link Here
170
                croak $@;
170
                croak $@;
171
            }
171
            }
172
172
173
            $ord->{tax_value} = $ord->{tax_value_on_ordering};
174
            $ord->{tax_rate} = $ord->{tax_rate_on_ordering};
173
            $ord->{total_tax_included} = $ord->{ecost_tax_included} * $ord->{quantity};
175
            $ord->{total_tax_included} = $ord->{ecost_tax_included} * $ord->{quantity};
174
            $ord->{total_tax_excluded} = $ord->{ecost_tax_excluded} * $ord->{quantity};
176
            $ord->{total_tax_excluded} = $ord->{ecost_tax_excluded} * $ord->{quantity};
175
177
(-)a/acqui/finishreceive.pl (-1 / +2 lines)
Lines 47-53 my $ordernumber = $input->param('ordernumber'); Link Here
47
my $origquantityrec  = $input->param('origquantityrec');
47
my $origquantityrec  = $input->param('origquantityrec');
48
my $quantityrec      = $input->param('quantityrec');
48
my $quantityrec      = $input->param('quantityrec');
49
my $quantity         = $input->param('quantity');
49
my $quantity         = $input->param('quantity');
50
my $unitprice        = $input->param('cost');
50
my $unitprice        = $input->param('unitprice');
51
my $invoiceid        = $input->param('invoiceid');
51
my $invoiceid        = $input->param('invoiceid');
52
my $invoice          = GetInvoice($invoiceid);
52
my $invoice          = GetInvoice($invoiceid);
53
my $invoiceno        = $invoice->{invoicenumber};
53
my $invoiceno        = $invoice->{invoicenumber};
Lines 81-86 if ($quantityrec > $origquantityrec ) { Link Here
81
    }
81
    }
82
82
83
    $order->{order_internalnote} = $input->param("order_internalnote");
83
    $order->{order_internalnote} = $input->param("order_internalnote");
84
    $order->{tax_rate_on_receiving} = $input->param("tax_rate");
84
    $order->{unitprice} = $unitprice;
85
    $order->{unitprice} = $unitprice;
85
86
86
    my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
87
    my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
(-)a/acqui/invoice.pl (+3 lines)
Lines 126-131 foreach my $order (@$orders) { Link Here
126
    $line->{total_tax_excluded} = Koha::Number::Price->new( $line->{unitprice_tax_excluded} * $line->{quantity} )->format;
126
    $line->{total_tax_excluded} = Koha::Number::Price->new( $line->{unitprice_tax_excluded} * $line->{quantity} )->format;
127
    $line->{total_tax_included} = Koha::Number::Price->new( $line->{unitprice_tax_included} * $line->{quantity} )->format;
127
    $line->{total_tax_included} = Koha::Number::Price->new( $line->{unitprice_tax_included} * $line->{quantity} )->format;
128
128
129
    $line->{tax_value} = $line->{tax_value_on_receiving};
130
    $line->{tax_rate} = $line->{tax_rate_on_receiving};
131
129
    $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
132
    $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
130
    $foot{$$line{tax_rate}}{tax_value} += $$line{tax_value};
133
    $foot{$$line{tax_rate}}{tax_value} += $$line{tax_value};
131
    $total_tax_value += $$line{tax_value};
134
    $total_tax_value += $$line{tax_value};
(-)a/acqui/neworderempty.pl (-2 / +2 lines)
Lines 307-313 if ( defined $subscriptionid ) { Link Here
307
        $budget_id              = $lastOrderReceived->{budgetid};
307
        $budget_id              = $lastOrderReceived->{budgetid};
308
        $data->{listprice}      = $lastOrderReceived->{listprice};
308
        $data->{listprice}      = $lastOrderReceived->{listprice};
309
        $data->{uncertainprice} = $lastOrderReceived->{uncertainprice};
309
        $data->{uncertainprice} = $lastOrderReceived->{uncertainprice};
310
        $data->{tax_rate}        = $lastOrderReceived->{tax_rate};
310
        $data->{tax_rate}       = $lastOrderReceived->{tax_rate_on_ordering};
311
        $data->{discount}       = $lastOrderReceived->{discount};
311
        $data->{discount}       = $lastOrderReceived->{discount};
312
        $data->{rrp}            = $lastOrderReceived->{rrp};
312
        $data->{rrp}            = $lastOrderReceived->{rrp};
313
        $data->{ecost}          = $lastOrderReceived->{ecost};
313
        $data->{ecost}          = $lastOrderReceived->{ecost};
Lines 390-396 $template->param( Link Here
390
    quantityrec      => $quantity,
390
    quantityrec      => $quantity,
391
    rrp              => $data->{'rrp'},
391
    rrp              => $data->{'rrp'},
392
    gst_values       => \@gst_values,
392
    gst_values       => \@gst_values,
393
    tax_rate          => $data->{tax_rate} ? $data->{tax_rate}+0.0 : $bookseller->{tax_rate} ? $bookseller->{tax_rate}+0.0 : 0,
393
    tax_rate         => $data->{tax_rate_on_ordering} ? $data->{tax_rate_on_ordering}+0.0 : $bookseller->{tax_rate} ? $bookseller->{tax_rate}+0.0 : 0,
394
    listprice        => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice),
394
    listprice        => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice),
395
    total            => sprintf( "%.2f", ($data->{ecost} || 0) * ($data->{'quantity'} || 0) ),
395
    total            => sprintf( "%.2f", ($data->{ecost} || 0) * ($data->{'quantity'} || 0) ),
396
    ecost            => sprintf( "%.2f", $data->{ecost} || 0),
396
    ecost            => sprintf( "%.2f", $data->{ecost} || 0),
(-)a/acqui/orderreceive.pl (-34 / +30 lines)
Lines 162-193 if ($AcqCreateItem eq 'receiving') { Link Here
162
}
162
}
163
163
164
$order->{quantityreceived} = '' if $order->{quantityreceived} == 0;
164
$order->{quantityreceived} = '' if $order->{quantityreceived} == 0;
165
$order->{unitprice} = '' if $order->{unitprice} == 0;
165
166
166
my $unitprice = $order->{unitprice};
167
my $rrp;
167
my ( $rrp, $ecost );
168
my $ecost;
168
if ( $bookseller->{invoiceincgst} ) {
169
my $unitprice;
169
    $rrp = $order->{rrp_tax_included};
170
if ( $bookseller->{listincgst} ) {
170
    $ecost = $order->{ecost_tax_included};
171
    if ( $bookseller->{invoiceincgst} ) {
171
    unless ( $unitprice != 0 and defined $unitprice) {
172
        $rrp = $order->{rrp};
172
        $unitprice = $order->{ecost_tax_included};
173
        $ecost = $order->{ecost};
174
        $unitprice = $order->{unitprice};
175
    } else {
176
        $rrp = $order->{rrp} / ( 1 + $order->{tax_rate} );
177
        $ecost = $order->{ecost} / ( 1 + $order->{tax_rate} );
178
        $unitprice = $order->{unitprice} / ( 1 + $order->{tax_rate} );
179
    }
173
    }
180
} else {
174
} else {
181
    if ( $bookseller->{invoiceincgst} ) {
175
    $rrp = $order->{rrp_tax_excluded};
182
        $rrp = $order->{rrp} * ( 1 + $order->{tax_rate} );
176
    $ecost = $order->{ecost_tax_excluded};
183
        $ecost = $order->{ecost} * ( 1 + $order->{tax_rate} );
177
    unless ( $unitprice != 0 and defined $unitprice) {
184
        $unitprice = $order->{unitprice} * ( 1 + $order->{tax_rate} );
178
        $unitprice = $order->{ecost_tax_excluded};
185
    } else {
186
        $rrp = $order->{rrp};
187
        $ecost = $order->{ecost};
188
        $unitprice = $order->{unitprice};
189
    }
179
    }
190
 }
180
}
181
182
my $tax_rate;
183
if( defined $order->{tax_rate_on_receiving} ) {
184
    $tax_rate = $order->{tax_rate_on_receiving} + 0.0;
185
} else {
186
    $tax_rate = $order->{tax_rate_on_ordering} + 0.0;
187
}
191
188
192
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
189
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
193
190
Lines 196-201 my $member = GetMember( borrowernumber => $authorisedby ); Link Here
196
193
197
my $budget = GetBudget( $order->{budget_id} );
194
my $budget = GetBudget( $order->{budget_id} );
198
195
196
# get option values for gist syspref
197
my @gst_values = map {
198
    option => $_ + 0.0
199
}, split( '\|', C4::Context->preference("gist") );
200
199
$template->param(
201
$template->param(
200
    AcqCreateItem         => $AcqCreateItem,
202
    AcqCreateItem         => $AcqCreateItem,
201
    count                 => 1,
203
    count                 => 1,
Lines 215-222 $template->param( Link Here
215
    quantity              => $order->{'quantity'},
217
    quantity              => $order->{'quantity'},
216
    quantityreceivedplus1 => $order->{'quantityreceived'} + 1,
218
    quantityreceivedplus1 => $order->{'quantityreceived'} + 1,
217
    quantityreceived      => $order->{'quantityreceived'},
219
    quantityreceived      => $order->{'quantityreceived'},
218
    rrp                   => sprintf( "%.2f", $rrp ),
220
    rrp                   => $rrp,
219
    ecost                 => sprintf( "%.2f", $ecost ),
221
    ecost                 => $ecost,
222
    unitprice             => $unitprice,
223
    tax_rate              => $tax_rate,
220
    memberfirstname       => $member->{firstname} || "",
224
    memberfirstname       => $member->{firstname} || "",
221
    membersurname         => $member->{surname} || "",
225
    membersurname         => $member->{surname} || "",
222
    invoiceid             => $invoice->{invoiceid},
226
    invoiceid             => $invoice->{invoiceid},
Lines 228-233 $template->param( Link Here
228
    suggestionid          => $suggestion->{suggestionid},
232
    suggestionid          => $suggestion->{suggestionid},
229
    surnamesuggestedby    => $suggestion->{surnamesuggestedby},
233
    surnamesuggestedby    => $suggestion->{surnamesuggestedby},
230
    firstnamesuggestedby  => $suggestion->{firstnamesuggestedby},
234
    firstnamesuggestedby  => $suggestion->{firstnamesuggestedby},
235
    gst_values            => \@gst_values,
231
);
236
);
232
237
233
my $borrower = GetMember( 'borrowernumber' => $loggedinuser );
238
my $borrower = GetMember( 'borrowernumber' => $loggedinuser );
Lines 265-279 foreach my $period (@$periods) { Link Here
265
270
266
$template->{'VARS'}->{'budget_loop'} = \@budget_loop;
271
$template->{'VARS'}->{'budget_loop'} = \@budget_loop;
267
272
268
# regardless of the content of $unitprice e.g 0 or '' or any string will return in these cases 0.00
269
# and the 'IF' in the .tt will show 0.00 and not 'ecost' (see BZ 7129)
270
# So if $unitprice == 0 we don't create unitprice
271
if ( $unitprice != 0) {
272
    $template->param(
273
        unitprice             => sprintf( "%.2f", $unitprice),
274
    );
275
}
276
277
my $op = $input->param('op');
273
my $op = $input->param('op');
278
if ($op and $op eq 'edit'){
274
if ($op and $op eq 'edit'){
279
    $template->param(edit   =>   1);
275
    $template->param(edit   =>   1);
(-)a/acqui/parcel.pl (-1 / +3 lines)
Lines 111-117 unless( $invoiceid and $invoice->{invoiceid} ) { Link Here
111
111
112
my $booksellerid = $invoice->{booksellerid};
112
my $booksellerid = $invoice->{booksellerid};
113
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
113
my $bookseller = Koha::Acquisition::Bookseller->fetch({ id => $booksellerid });
114
my $gst = $bookseller->{tax_rate} // C4::Context->preference("gist") // 0;
115
my $datereceived = C4::Dates->new();
114
my $datereceived = C4::Dates->new();
116
115
117
my @orders        = @{ $invoice->{orders} };
116
my @orders        = @{ $invoice->{orders} };
Lines 148-153 for my $order ( @orders ) { Link Here
148
        $line{holds} += scalar( @$holds );
147
        $line{holds} += scalar( @$holds );
149
    }
148
    }
150
    $line{budget} = GetBudgetByOrderNumber( $line{ordernumber} );
149
    $line{budget} = GetBudgetByOrderNumber( $line{ordernumber} );
150
151
    $line{tax_value} = $line{tax_value_on_receiving};
152
    $line{tax_rate} = $line{tax_rate_on_receiving};
151
    $foot{$line{tax_rate}}{tax_rate} = $line{tax_rate};
153
    $foot{$line{tax_rate}}{tax_rate} = $line{tax_rate};
152
    $foot{$line{tax_rate}}{tax_value} += $line{tax_value};
154
    $foot{$line{tax_rate}}{tax_value} += $line{tax_value};
153
    $total_tax_excluded += $line{unitprice_tax_excluded} * $line{quantity};
155
    $total_tax_excluded += $line{unitprice_tax_excluded} * $line{quantity};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-7 / +22 lines)
Lines 1-3 Link Here
1
[% USE Price %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Acquisitions &rsaquo; Receipt summary for : [% name %] [% IF ( invoice ) %]invoice, [% invoice %][% END %]</title>
3
<title>Koha &rsaquo; Acquisitions &rsaquo; Receipt summary for : [% name %] [% IF ( invoice ) %]invoice, [% invoice %][% END %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
Lines 258-264 Link Here
258
    <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
259
    <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
259
    <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
260
    <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
260
    <input type="hidden" name="datereceived" value="[% datereceived_iso %]" />
261
    <input type="hidden" name="datereceived" value="[% datereceived_iso %]" />
261
    <input type="hidden" name="tax_rate" value="[% tax_rate %]" />
262
	</div>
262
	</div>
263
	<div class="yui-u">
263
	<div class="yui-u">
264
    <fieldset class="rows">
264
    <fieldset class="rows">
Lines 322-335 Link Here
322
          [% END %][%# IF (AcqCreateItemReceiving) %]
322
          [% END %][%# IF (AcqCreateItemReceiving) %]
323
		</li>
323
		</li>
324
324
325
        [% IF ( gst_values ) %]
326
            <li>
327
                <label for="tax_rate">Tax rate: </label>
328
                <select name="tax_rate" id="tax_rate">
329
                [% FOREACH gst IN gst_values %]
330
                    [% IF gst.option == tax_rate %]
331
                        <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format("%.1f") %]%</option>
332
                    [% ELSE %]
333
                        <option value="[% gst.option %]">[% gst.option * 100 | format("%.1f") %]%</option>
334
                    [% END %]
335
                [% END %]
336
                </select>
337
            </li>
338
        [% ELSE %]
339
            <input type="hidden" name="tax_rate" value="0" />
340
        [% END %]
341
325
        <li><label for="rrp">Replacement cost: </label>[% rrp | $Price %]</li>
342
        <li><label for="rrp">Replacement cost: </label>[% rrp | $Price %]</li>
326
        <li><label for="ecost">Budgeted cost: </label>[% ecost | $Price %]</li>
343
        <li><label for="ecost">Budgeted cost: </label>[% ecost | $Price %]</li>
327
        <li><label for="cost">Actual cost:</label>
344
        <li>
328
        [% IF ( unitprice ) %]
345
            <label for="unitprice">Actual cost:</label>
329
             <input type="text" size="20" name="cost" id="cost" value="[% unitprice | $Price %]" />
346
            <input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price %]" />
330
        [% ELSE %]
347
        </li>
331
             <input type="text" size="20" name="cost" id="cost" value="[% ecost | $Price %]" />
332
        [% END %]</li>
333
        <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote %]</textarea></li>
348
        <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote %]</textarea></li>
334
        <li><label for="order_vendornote">Vendor note: </label><span>[% order_vendornote %]</span></li>
349
        <li><label for="order_vendornote">Vendor note: </label><span>[% order_vendornote %]</span></li>
335
        </ol>
350
        </ol>
(-)a/t/Prices.t (-9 / +9 lines)
Lines 87-99 for my $currency_format ( qw( US FR ) ) { Link Here
87
        );
87
        );
88
        compare(
88
        compare(
89
            {
89
            {
90
                got      => $order_0_0->{tax_value},
90
                got      => $order_0_0->{tax_value_on_ordering},
91
                expected => 7.38,
91
                expected => 7.38,
92
                conf     => '0 0',
92
                conf     => '0 0',
93
                field    => 'tax_value'
93
                field    => 'tax_value'
94
            }
94
            }
95
        );
95
        );
96
96
97
        # 
97
        $order_0_0 = C4::Acquisition::populate_order_with_prices(
98
        $order_0_0 = C4::Acquisition::populate_order_with_prices(
98
            {
99
            {
99
                order        => $order_0_0,
100
                order        => $order_0_0,
Lines 120-126 for my $currency_format ( qw( US FR ) ) { Link Here
120
        );
121
        );
121
        compare(
122
        compare(
122
            {
123
            {
123
                got      => $order_0_0->{tax_value},
124
                got      => $order_0_0->{tax_value_on_receiving},
124
                expected => 7.38,
125
                expected => 7.38,
125
                conf     => '0 0',
126
                conf     => '0 0',
126
                field    => 'tax_value'
127
                field    => 'tax_value'
Lines 195-201 for my $currency_format ( qw( US FR ) ) { Link Here
195
        );
196
        );
196
        compare(
197
        compare(
197
            {
198
            {
198
                got      => $order_1_1->{tax_value},
199
                got      => $order_1_1->{tax_value_on_ordering},
199
                expected => 7.03,
200
                expected => 7.03,
200
                conf     => '1 1',
201
                conf     => '1 1',
201
                field    => 'tax_value'
202
                field    => 'tax_value'
Lines 228-234 for my $currency_format ( qw( US FR ) ) { Link Here
228
        );
229
        );
229
        compare(
230
        compare(
230
            {
231
            {
231
                got      => $order_1_1->{tax_value},
232
                got      => $order_1_1->{tax_value_on_receiving},
232
                expected => 7.03,
233
                expected => 7.03,
233
                conf     => '1 1',
234
                conf     => '1 1',
234
                field    => 'tax_value'
235
                field    => 'tax_value'
Lines 303-309 for my $currency_format ( qw( US FR ) ) { Link Here
303
        );
304
        );
304
        compare(
305
        compare(
305
            {
306
            {
306
                got      => $order_1_0->{tax_value},
307
                got      => $order_1_0->{tax_value_on_ordering},
307
                expected => 7.03,
308
                expected => 7.03,
308
                conf     => '1 0',
309
                conf     => '1 0',
309
                field    => 'tax_value'
310
                field    => 'tax_value'
Lines 336-342 for my $currency_format ( qw( US FR ) ) { Link Here
336
        );
337
        );
337
        compare(
338
        compare(
338
            {
339
            {
339
                got      => $order_1_0->{tax_value},
340
                got      => $order_1_0->{tax_value_on_receiving},
340
                expected => 7.03,
341
                expected => 7.03,
341
                conf     => '1 0',
342
                conf     => '1 0',
342
                field    => 'tax_value'
343
                field    => 'tax_value'
Lines 411-417 for my $currency_format ( qw( US FR ) ) { Link Here
411
        );
412
        );
412
        compare(
413
        compare(
413
            {
414
            {
414
                got      => $order_0_1->{tax_value},
415
                got      => $order_0_1->{tax_value_on_ordering},
415
                expected => 7.38,
416
                expected => 7.38,
416
                conf     => '0 1',
417
                conf     => '0 1',
417
                field    => 'tax_value'
418
                field    => 'tax_value'
Lines 444-450 for my $currency_format ( qw( US FR ) ) { Link Here
444
        );
445
        );
445
        compare(
446
        compare(
446
            {
447
            {
447
                got      => $order_0_1->{tax_value},
448
                got      => $order_0_1->{tax_value_on_receiving},
448
                expected => 7.38,
449
                expected => 7.38,
449
                conf     => '0 1',
450
                conf     => '0 1',
450
                field    => 'tax_value'
451
                field    => 'tax_value'
451
- 

Return to bug 13323