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

(-)a/C4/Acquisition.pm (-15 / +22 lines)
Lines 1437-1448 sub ModReceiveOrder { Link Here
1437
        | if defined $order->{unitprice};
1437
        | if defined $order->{unitprice};
1438
1438
1439
        $query .= q|
1439
        $query .= q|
1440
            , rrp = ?, rrp_tax_included = ?, rrp_tax_excluded = ?
1440
            ,tax_value_on_receiving = ?
1441
        | if defined $order->{rrp};
1441
        | if defined $order->{tax_value_on_receiving};
1442
1442
1443
        $query .= q|
1443
        $query .= q|
1444
            , ecost = ?, ecost_tax_included = ?, ecost_tax_excluded = ?
1444
            ,tax_rate_on_receiving = ?
1445
        | if defined $order->{ecost};
1445
        | if defined $order->{tax_rate_on_receiving};
1446
1446
1447
        $query .= q|
1447
        $query .= q|
1448
            , order_internalnote = ?
1448
            , order_internalnote = ?
Lines 1456-1467 sub ModReceiveOrder { Link Here
1456
        if ( defined $order->{unitprice} ) {
1456
        if ( defined $order->{unitprice} ) {
1457
            push @params, $order->{unitprice}, $order->{unitprice_tax_included}, $order->{unitprice_tax_excluded};
1457
            push @params, $order->{unitprice}, $order->{unitprice_tax_included}, $order->{unitprice_tax_excluded};
1458
        }
1458
        }
1459
        if ( defined $order->{rrp} ) {
1459
1460
            push @params, $order->{rrp}, $order->{rrp_tax_included}, $order->{rrp_tax_excluded};
1460
        if ( defined $order->{tax_value_on_receiving} ) {
1461
            push @params, $order->{tax_value_on_receiving};
1461
        }
1462
        }
1462
        if ( defined $order->{ecost} ) {
1463
1463
            push @params, $order->{ecost}, $order->{ecost_tax_included}, $order->{ecost_tax_excluded};
1464
        if ( defined $order->{tax_rate_on_receiving} ) {
1465
            push @params, $order->{tax_rate_on_receiving};
1464
        }
1466
        }
1467
1465
        if ( defined $order->{order_internalnote} ) {
1468
        if ( defined $order->{order_internalnote} ) {
1466
            push @params, $order->{order_internalnote};
1469
            push @params, $order->{order_internalnote};
1467
        }
1470
        }
Lines 2858-2869 sub populate_order_with_prices { Link Here
2858
    $discount /= 100 if $discount > 1;
2861
    $discount /= 100 if $discount > 1;
2859
2862
2860
    if ($ordering) {
2863
    if ($ordering) {
2864
        $order->{tax_rate_on_ordering} //= $order->{tax_rate};
2861
        if ( $bookseller->{listincgst} ) {
2865
        if ( $bookseller->{listincgst} ) {
2862
            # The user entered the rrp tax included
2866
            # The user entered the rrp tax included
2863
            $order->{rrp_tax_included} = $order->{rrp};
2867
            $order->{rrp_tax_included} = $order->{rrp};
2864
2868
2865
            # rrp tax excluded = rrp tax included / ( 1 + tax rate )
2869
            # rrp tax excluded = rrp tax included / ( 1 + tax rate )
2866
            $order->{rrp_tax_excluded} = $order->{rrp_tax_included} / ( 1 + $order->{tax_rate} );
2870
            $order->{rrp_tax_excluded} = $order->{rrp_tax_included} / ( 1 + $order->{tax_rate_on_ordering} );
2867
2871
2868
            # ecost tax excluded = rrp tax excluded * ( 1 - discount )
2872
            # ecost tax excluded = rrp tax excluded * ( 1 - discount )
2869
            $order->{ecost_tax_excluded} = $order->{rrp_tax_excluded} * ( 1 - $discount );
2873
            $order->{ecost_tax_excluded} = $order->{rrp_tax_excluded} * ( 1 - $discount );
Lines 2876-2882 sub populate_order_with_prices { Link Here
2876
            $order->{rrp_tax_excluded} = $order->{rrp};
2880
            $order->{rrp_tax_excluded} = $order->{rrp};
2877
2881
2878
            # rrp tax included = rrp tax excluded * ( 1 - tax rate )
2882
            # rrp tax included = rrp tax excluded * ( 1 - tax rate )
2879
            $order->{rrp_tax_included} = $order->{rrp_tax_excluded} * ( 1 + $order->{tax_rate} );
2883
            $order->{rrp_tax_included} = $order->{rrp_tax_excluded} * ( 1 + $order->{tax_rate_on_ordering} );
2880
2884
2881
            # ecost tax excluded = rrp tax excluded * ( 1 - discount )
2885
            # ecost tax excluded = rrp tax excluded * ( 1 - discount )
2882
            $order->{ecost_tax_excluded} = $order->{rrp_tax_excluded} * ( 1 - $discount );
2886
            $order->{ecost_tax_excluded} = $order->{rrp_tax_excluded} * ( 1 - $discount );
Lines 2884-2898 sub populate_order_with_prices { Link Here
2884
            # ecost tax included = rrp tax excluded * ( 1 - tax rate ) * ( 1 - discount )
2888
            # ecost tax included = rrp tax excluded * ( 1 - tax rate ) * ( 1 - discount )
2885
            $order->{ecost_tax_included} =
2889
            $order->{ecost_tax_included} =
2886
                $order->{rrp_tax_excluded} *
2890
                $order->{rrp_tax_excluded} *
2887
                ( 1 + $order->{tax_rate} ) *
2891
                ( 1 + $order->{tax_rate_on_ordering} ) *
2888
                ( 1 - $discount );
2892
                ( 1 - $discount );
2889
        }
2893
        }
2890
2894
2891
        # tax value = quantity * ecost tax excluded * tax rate
2895
        # tax value = quantity * ecost tax excluded * tax rate
2892
        $order->{tax_value} = $order->{quantity} * $order->{ecost_tax_excluded} * $order->{tax_rate};
2896
        $order->{tax_value_on_ordering} =
2897
            $order->{quantity} * $order->{ecost_tax_excluded} * $order->{tax_rate_on_ordering};
2893
    }
2898
    }
2894
2899
2895
    if ($receiving) {
2900
    if ($receiving) {
2901
        $order->{tax_rate_on_receiving} //= $order->{tax_rate};
2896
        if ( $bookseller->{invoiceincgst} ) {
2902
        if ( $bookseller->{invoiceincgst} ) {
2897
            # Trick for unitprice. If the unit price rounded value is the same as the ecost rounded value
2903
            # Trick for unitprice. If the unit price rounded value is the same as the ecost rounded value
2898
            # we need to keep the exact ecost value
2904
            # we need to keep the exact ecost value
Lines 2904-2910 sub populate_order_with_prices { Link Here
2904
            $order->{unitprice_tax_included} = $order->{unitprice};
2910
            $order->{unitprice_tax_included} = $order->{unitprice};
2905
2911
2906
            # unit price tax excluded = unit price tax included / ( 1 + tax rate )
2912
            # unit price tax excluded = unit price tax included / ( 1 + tax rate )
2907
            $order->{unitprice_tax_excluded} = $order->{unitprice_tax_included} / ( 1 + $order->{tax_rate} );
2913
            $order->{unitprice_tax_excluded} = $order->{unitprice_tax_included} / ( 1 + $order->{tax_rate_on_receiving} );
2908
        }
2914
        }
2909
        else {
2915
        else {
2910
            # Trick for unitprice. If the unit price rounded value is the same as the ecost rounded value
2916
            # Trick for unitprice. If the unit price rounded value is the same as the ecost rounded value
Lines 2916-2927 sub populate_order_with_prices { Link Here
2916
            # The user entered the unit price tax excluded
2922
            # The user entered the unit price tax excluded
2917
            $order->{unitprice_tax_excluded} = $order->{unitprice};
2923
            $order->{unitprice_tax_excluded} = $order->{unitprice};
2918
2924
2925
2919
            # unit price tax included = unit price tax included * ( 1 + tax rate )
2926
            # unit price tax included = unit price tax included * ( 1 + tax rate )
2920
            $order->{unitprice_tax_included} = $order->{unitprice_tax_excluded} * ( 1 + $order->{tax_rate} );
2927
            $order->{unitprice_tax_included} = $order->{unitprice_tax_excluded} * ( 1 + $order->{tax_rate_on_receiving} );
2921
        }
2928
        }
2922
2929
2923
        # tax value = quantity * unit price tax excluded * tax rate
2930
        # tax value = quantity * unit price tax excluded * tax rate
2924
        $order->{tax_value} = $order->{quantity} * $order->{unitprice_tax_excluded} * $order->{tax_rate};
2931
        $order->{tax_value_on_receiving} = $order->{quantity} * $order->{unitprice_tax_excluded} * $order->{tax_rate_on_receiving};
2925
    }
2932
    }
2926
2933
2927
    return $order;
2934
    return $order;
(-)a/acqui/basket.pl (+5 lines)
Lines 315-320 elsif ( $op eq 'ediorder' ) { Link Here
315
            $template->param( uncertainprices => 1 );
315
            $template->param( uncertainprices => 1 );
316
        }
316
        }
317
317
318
        $line->{tax_rate} = $line->{tax_rate_on_ordering};
319
        $line->{tax_value} = $line->{tax_value_on_ordering};
320
318
        push @books_loop, $line;
321
        push @books_loop, $line;
319
322
320
        $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
323
        $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
Lines 422-427 sub get_order_infos { Link Here
422
425
423
    $line{total_tax_included} = $line{ecost_tax_included} * $line{quantity};
426
    $line{total_tax_included} = $line{ecost_tax_included} * $line{quantity};
424
    $line{total_tax_excluded} = $line{ecost_tax_excluded} * $line{quantity};
427
    $line{total_tax_excluded} = $line{ecost_tax_excluded} * $line{quantity};
428
    $line{tax_value} = $line{tax_value_on_ordering};
429
    $line{tax_rate} = $line{tax_rate_on_ordering};
425
430
426
    if ( $line{uncertainprice} ) {
431
    if ( $line{uncertainprice} ) {
427
        $line{rrp_tax_excluded} .= ' (Uncertain)';
432
        $line{rrp_tax_excluded} .= ' (Uncertain)';
(-)a/acqui/basketgroup.pl (+2 lines)
Lines 168-173 sub printbasketgrouppdf{ Link Here
168
                croak $@;
168
                croak $@;
169
            }
169
            }
170
170
171
            $ord->{tax_value} = $ord->{tax_value_on_ordering};
172
            $ord->{tax_rate} = $ord->{tax_rate_on_ordering};
171
            $ord->{total_tax_included} = $ord->{ecost_tax_included} * $ord->{quantity};
173
            $ord->{total_tax_included} = $ord->{ecost_tax_included} * $ord->{quantity};
172
            $ord->{total_tax_excluded} = $ord->{ecost_tax_excluded} * $ord->{quantity};
174
            $ord->{total_tax_excluded} = $ord->{ecost_tax_excluded} * $ord->{quantity};
173
175
(-)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 $datereceived     = $input->param('datereceived'),
51
my $datereceived     = $input->param('datereceived'),
52
my $invoiceid        = $input->param('invoiceid');
52
my $invoiceid        = $input->param('invoiceid');
53
my $invoice          = GetInvoice($invoiceid);
53
my $invoice          = GetInvoice($invoiceid);
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 127-132 foreach my $order (@$orders) { Link Here
127
    $line->{total_tax_excluded} = Koha::Number::Price->new( $line->{unitprice_tax_excluded} * $line->{quantity} )->format;
127
    $line->{total_tax_excluded} = Koha::Number::Price->new( $line->{unitprice_tax_excluded} * $line->{quantity} )->format;
128
    $line->{total_tax_included} = Koha::Number::Price->new( $line->{unitprice_tax_included} * $line->{quantity} )->format;
128
    $line->{total_tax_included} = Koha::Number::Price->new( $line->{unitprice_tax_included} * $line->{quantity} )->format;
129
129
130
    $line->{tax_value} = $line->{tax_value_on_receiving};
131
    $line->{tax_rate} = $line->{tax_rate_on_receiving};
132
130
    $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
133
    $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
131
    $foot{$$line{tax_rate}}{tax_value} += $$line{tax_value};
134
    $foot{$$line{tax_rate}}{tax_value} += $$line{tax_value};
132
    $total_tax_value += $$line{tax_value};
135
    $total_tax_value += $$line{tax_value};
(-)a/acqui/neworderempty.pl (-2 / +2 lines)
Lines 265-271 if ( defined $subscriptionid ) { Link Here
265
        $budget_id              = $lastOrderReceived->{budgetid};
265
        $budget_id              = $lastOrderReceived->{budgetid};
266
        $data->{listprice}      = $lastOrderReceived->{listprice};
266
        $data->{listprice}      = $lastOrderReceived->{listprice};
267
        $data->{uncertainprice} = $lastOrderReceived->{uncertainprice};
267
        $data->{uncertainprice} = $lastOrderReceived->{uncertainprice};
268
        $data->{tax_rate}        = $lastOrderReceived->{tax_rate};
268
        $data->{tax_rate}       = $lastOrderReceived->{tax_rate_on_ordering};
269
        $data->{discount}       = $lastOrderReceived->{discount};
269
        $data->{discount}       = $lastOrderReceived->{discount};
270
        $data->{rrp}            = $lastOrderReceived->{rrp};
270
        $data->{rrp}            = $lastOrderReceived->{rrp};
271
        $data->{ecost}          = $lastOrderReceived->{ecost};
271
        $data->{ecost}          = $lastOrderReceived->{ecost};
Lines 350-356 $template->param( Link Here
350
    quantityrec      => $quantity,
350
    quantityrec      => $quantity,
351
    rrp              => $data->{'rrp'},
351
    rrp              => $data->{'rrp'},
352
    gst_values       => \@gst_values,
352
    gst_values       => \@gst_values,
353
    tax_rate          => $data->{tax_rate} ? $data->{tax_rate}+0.0 : $bookseller->{tax_rate} ? $bookseller->{tax_rate}+0.0 : 0,
353
    tax_rate         => $data->{tax_rate_on_ordering} ? $data->{tax_rate_on_ordering}+0.0 : $bookseller->{tax_rate} ? $bookseller->{tax_rate}+0.0 : 0,
354
    listprice        => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice),
354
    listprice        => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice),
355
    total            => sprintf( "%.2f", ($data->{ecost} || 0) * ($data->{'quantity'} || 0) ),
355
    total            => sprintf( "%.2f", ($data->{ecost} || 0) * ($data->{'quantity'} || 0) ),
356
    ecost            => sprintf( "%.2f", $data->{ecost} || 0),
356
    ecost            => sprintf( "%.2f", $data->{ecost} || 0),
(-)a/acqui/orderreceive.pl (-34 / +30 lines)
Lines 151-182 if ($AcqCreateItem eq 'receiving') { Link Here
151
}
151
}
152
152
153
$order->{quantityreceived} = '' if $order->{quantityreceived} == 0;
153
$order->{quantityreceived} = '' if $order->{quantityreceived} == 0;
154
$order->{unitprice} = '' if $order->{unitprice} == 0;
154
155
155
my $unitprice = $order->{unitprice};
156
my $rrp;
156
my ( $rrp, $ecost );
157
my $ecost;
157
if ( $bookseller->{invoiceincgst} ) {
158
my $unitprice;
158
    $rrp = $order->{rrp_tax_included};
159
if ( $bookseller->{listincgst} ) {
159
    $ecost = $order->{ecost_tax_included};
160
    if ( $bookseller->{invoiceincgst} ) {
160
    unless ( $unitprice != 0 and defined $unitprice) {
161
        $rrp = $order->{rrp};
161
        $unitprice = $order->{ecost_tax_included};
162
        $ecost = $order->{ecost};
163
        $unitprice = $order->{unitprice};
164
    } else {
165
        $rrp = $order->{rrp} / ( 1 + $order->{tax_rate} );
166
        $ecost = $order->{ecost} / ( 1 + $order->{tax_rate} );
167
        $unitprice = $order->{unitprice} / ( 1 + $order->{tax_rate} );
168
    }
162
    }
169
} else {
163
} else {
170
    if ( $bookseller->{invoiceincgst} ) {
164
    $rrp = $order->{rrp_tax_excluded};
171
        $rrp = $order->{rrp} * ( 1 + $order->{tax_rate} );
165
    $ecost = $order->{ecost_tax_excluded};
172
        $ecost = $order->{ecost} * ( 1 + $order->{tax_rate} );
166
    unless ( $unitprice != 0 and defined $unitprice) {
173
        $unitprice = $order->{unitprice} * ( 1 + $order->{tax_rate} );
167
        $unitprice = $order->{ecost_tax_excluded};
174
    } else {
175
        $rrp = $order->{rrp};
176
        $ecost = $order->{ecost};
177
        $unitprice = $order->{unitprice};
178
    }
168
    }
179
 }
169
}
170
171
my $tax_rate;
172
if( defined $order->{tax_rate_on_receiving} ) {
173
    $tax_rate = $order->{tax_rate_on_receiving} + 0.0;
174
} else {
175
    $tax_rate = $order->{tax_rate_on_ordering} + 0.0;
176
}
180
177
181
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
178
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
182
179
Lines 187-192 my $budget = GetBudget( $order->{budget_id} ); Link Here
187
184
188
my $datereceived = $order->{datereceived} ? dt_from_string( $order->{datereceived} ) : dt_from_string;
185
my $datereceived = $order->{datereceived} ? dt_from_string( $order->{datereceived} ) : dt_from_string;
189
186
187
# get option values for gist syspref
188
my @gst_values = map {
189
    option => $_ + 0.0
190
}, split( '\|', C4::Context->preference("gist") );
191
190
$template->param(
192
$template->param(
191
    AcqCreateItem         => $AcqCreateItem,
193
    AcqCreateItem         => $AcqCreateItem,
192
    count                 => 1,
194
    count                 => 1,
Lines 205-212 $template->param( Link Here
205
    quantity              => $order->{'quantity'},
207
    quantity              => $order->{'quantity'},
206
    quantityreceivedplus1 => $order->{'quantityreceived'} + 1,
208
    quantityreceivedplus1 => $order->{'quantityreceived'} + 1,
207
    quantityreceived      => $order->{'quantityreceived'},
209
    quantityreceived      => $order->{'quantityreceived'},
208
    rrp                   => sprintf( "%.2f", $rrp ),
210
    rrp                   => $rrp,
209
    ecost                 => sprintf( "%.2f", $ecost ),
211
    ecost                 => $ecost,
212
    unitprice             => $unitprice,
213
    tax_rate              => $tax_rate,
210
    memberfirstname       => $member->{firstname} || "",
214
    memberfirstname       => $member->{firstname} || "",
211
    membersurname         => $member->{surname} || "",
215
    membersurname         => $member->{surname} || "",
212
    invoiceid             => $invoice->{invoiceid},
216
    invoiceid             => $invoice->{invoiceid},
Lines 217-222 $template->param( Link Here
217
    suggestionid          => $suggestion->{suggestionid},
221
    suggestionid          => $suggestion->{suggestionid},
218
    surnamesuggestedby    => $suggestion->{surnamesuggestedby},
222
    surnamesuggestedby    => $suggestion->{surnamesuggestedby},
219
    firstnamesuggestedby  => $suggestion->{firstnamesuggestedby},
223
    firstnamesuggestedby  => $suggestion->{firstnamesuggestedby},
224
    gst_values            => \@gst_values,
220
);
225
);
221
226
222
my $borrower = GetMember( 'borrowernumber' => $loggedinuser );
227
my $borrower = GetMember( 'borrowernumber' => $loggedinuser );
Lines 254-268 foreach my $period (@$periods) { Link Here
254
259
255
$template->{'VARS'}->{'budget_loop'} = \@budget_loop;
260
$template->{'VARS'}->{'budget_loop'} = \@budget_loop;
256
261
257
# regardless of the content of $unitprice e.g 0 or '' or any string will return in these cases 0.00
258
# and the 'IF' in the .tt will show 0.00 and not 'ecost' (see BZ 7129)
259
# So if $unitprice == 0 we don't create unitprice
260
if ( $unitprice != 0) {
261
    $template->param(
262
        unitprice             => sprintf( "%.2f", $unitprice),
263
    );
264
}
265
266
my $op = $input->param('op');
262
my $op = $input->param('op');
267
if ($op and $op eq 'edit'){
263
if ($op and $op eq 'edit'){
268
    $template->param(edit   =>   1);
264
    $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
114
116
my @orders        = @{ $invoice->{orders} };
115
my @orders        = @{ $invoice->{orders} };
117
my $countlines    = scalar @orders;
116
my $countlines    = scalar @orders;
Lines 147-152 for my $order ( @orders ) { Link Here
147
        $line{holds} += scalar( @$holds );
146
        $line{holds} += scalar( @$holds );
148
    }
147
    }
149
    $line{budget} = GetBudgetByOrderNumber( $line{ordernumber} );
148
    $line{budget} = GetBudgetByOrderNumber( $line{ordernumber} );
149
150
    $line{tax_value} = $line{tax_value_on_receiving};
151
    $line{tax_rate} = $line{tax_rate_on_receiving};
150
    $foot{$line{tax_rate}}{tax_rate} = $line{tax_rate};
152
    $foot{$line{tax_rate}}{tax_rate} = $line{tax_rate};
151
    $foot{$line{tax_rate}}{tax_value} += $line{tax_value};
153
    $foot{$line{tax_rate}}{tax_value} += $line{tax_value};
152
    $total_tax_excluded += $line{unitprice_tax_excluded} * $line{quantity};
154
    $total_tax_excluded += $line{unitprice_tax_excluded} * $line{quantity};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt (-7 / +21 lines)
Lines 263-269 Link Here
263
    <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
263
    <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
264
    <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
264
    <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
265
    <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
265
    <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
266
    <input type="hidden" name="tax_rate" value="[% tax_rate %]" />
267
	</div>
266
	</div>
268
	<div class="yui-u">
267
	<div class="yui-u">
269
    <fieldset class="rows">
268
    <fieldset class="rows">
Lines 330-343 Link Here
330
          [% END %][%# IF (AcqCreateItemReceiving) %]
329
          [% END %][%# IF (AcqCreateItemReceiving) %]
331
		</li>
330
		</li>
332
331
332
        [% IF ( gst_values ) %]
333
            <li>
334
                <label for="tax_rate">Tax rate: </label>
335
                <select name="tax_rate" id="tax_rate">
336
                [% FOREACH gst IN gst_values %]
337
                    [% IF gst.option == tax_rate %]
338
                        <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format("%.1f") %]%</option>
339
                    [% ELSE %]
340
                        <option value="[% gst.option %]">[% gst.option * 100 | format("%.1f") %]%</option>
341
                    [% END %]
342
                [% END %]
343
                </select>
344
            </li>
345
        [% ELSE %]
346
            <input type="hidden" name="tax_rate" value="0" />
347
        [% END %]
348
333
        <li><label for="rrp">Replacement cost: </label>[% rrp | $Price %]</li>
349
        <li><label for="rrp">Replacement cost: </label>[% rrp | $Price %]</li>
334
        <li><label for="ecost">Budgeted cost: </label>[% ecost | $Price %]</li>
350
        <li><label for="ecost">Budgeted cost: </label>[% ecost | $Price %]</li>
335
        <li><label for="cost">Actual cost:</label>
351
        <li>
336
        [% IF ( unitprice ) %]
352
            <label for="unitprice">Actual cost:</label>
337
             <input type="text" size="20" name="cost" id="cost" value="[% unitprice | $Price %]" />
353
            <input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price %]" />
338
        [% ELSE %]
354
        </li>
339
             <input type="text" size="20" name="cost" id="cost" value="[% ecost | $Price %]" />
340
        [% END %]</li>
341
        <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote %]</textarea></li>
355
        <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote %]</textarea></li>
342
        [% IF order_vendornote %]
356
        [% IF order_vendornote %]
343
            <li><label for="order_vendornote">Vendor note: </label><span>[% order_vendornote %]</span></li>
357
            <li><label for="order_vendornote">Vendor note: </label><span>[% order_vendornote %]</span></li>
(-)a/t/Prices.t (-9 / +9 lines)
Lines 113-125 for my $currency_format ( qw( US FR ) ) { Link Here
113
        );
113
        );
114
        compare(
114
        compare(
115
            {
115
            {
116
                got      => $order_0_0->{tax_value},
116
                got      => $order_0_0->{tax_value_on_ordering},
117
                expected => 7.38,
117
                expected => 7.38,
118
                conf     => '0 0',
118
                conf     => '0 0',
119
                field    => 'tax_value'
119
                field    => 'tax_value'
120
            }
120
            }
121
        );
121
        );
122
122
123
        #
123
        $order_0_0 = C4::Acquisition::populate_order_with_prices(
124
        $order_0_0 = C4::Acquisition::populate_order_with_prices(
124
            {
125
            {
125
                order        => $order_0_0,
126
                order        => $order_0_0,
Lines 146-152 for my $currency_format ( qw( US FR ) ) { Link Here
146
        );
147
        );
147
        compare(
148
        compare(
148
            {
149
            {
149
                got      => $order_0_0->{tax_value},
150
                got      => $order_0_0->{tax_value_on_receiving},
150
                expected => 7.38,
151
                expected => 7.38,
151
                conf     => '0 0',
152
                conf     => '0 0',
152
                field    => 'tax_value'
153
                field    => 'tax_value'
Lines 221-227 for my $currency_format ( qw( US FR ) ) { Link Here
221
        );
222
        );
222
        compare(
223
        compare(
223
            {
224
            {
224
                got      => $order_1_1->{tax_value},
225
                got      => $order_1_1->{tax_value_on_ordering},
225
                expected => 7.03,
226
                expected => 7.03,
226
                conf     => '1 1',
227
                conf     => '1 1',
227
                field    => 'tax_value'
228
                field    => 'tax_value'
Lines 254-260 for my $currency_format ( qw( US FR ) ) { Link Here
254
        );
255
        );
255
        compare(
256
        compare(
256
            {
257
            {
257
                got      => $order_1_1->{tax_value},
258
                got      => $order_1_1->{tax_value_on_receiving},
258
                expected => 7.03,
259
                expected => 7.03,
259
                conf     => '1 1',
260
                conf     => '1 1',
260
                field    => 'tax_value'
261
                field    => 'tax_value'
Lines 329-335 for my $currency_format ( qw( US FR ) ) { Link Here
329
        );
330
        );
330
        compare(
331
        compare(
331
            {
332
            {
332
                got      => $order_1_0->{tax_value},
333
                got      => $order_1_0->{tax_value_on_ordering},
333
                expected => 7.03,
334
                expected => 7.03,
334
                conf     => '1 0',
335
                conf     => '1 0',
335
                field    => 'tax_value'
336
                field    => 'tax_value'
Lines 362-368 for my $currency_format ( qw( US FR ) ) { Link Here
362
        );
363
        );
363
        compare(
364
        compare(
364
            {
365
            {
365
                got      => $order_1_0->{tax_value},
366
                got      => $order_1_0->{tax_value_on_receiving},
366
                expected => 7.03,
367
                expected => 7.03,
367
                conf     => '1 0',
368
                conf     => '1 0',
368
                field    => 'tax_value'
369
                field    => 'tax_value'
Lines 437-443 for my $currency_format ( qw( US FR ) ) { Link Here
437
        );
438
        );
438
        compare(
439
        compare(
439
            {
440
            {
440
                got      => $order_0_1->{tax_value},
441
                got      => $order_0_1->{tax_value_on_ordering},
441
                expected => 7.38,
442
                expected => 7.38,
442
                conf     => '0 1',
443
                conf     => '0 1',
443
                field    => 'tax_value'
444
                field    => 'tax_value'
Lines 470-476 for my $currency_format ( qw( US FR ) ) { Link Here
470
        );
471
        );
471
        compare(
472
        compare(
472
            {
473
            {
473
                got      => $order_0_1->{tax_value},
474
                got      => $order_0_1->{tax_value_on_receiving},
474
                expected => 7.38,
475
                expected => 7.38,
475
                conf     => '0 1',
476
                conf     => '0 1',
476
                field    => 'tax_value'
477
                field    => 'tax_value'
477
- 

Return to bug 13323