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

(-)a/C4/Acquisition.pm (-15 / +22 lines)
Lines 1421-1432 sub ModReceiveOrder { Link Here
1421
        | if defined $order->{unitprice};
1421
        | if defined $order->{unitprice};
1422
1422
1423
        $query .= q|
1423
        $query .= q|
1424
            , rrp = ?, rrp_tax_included = ?, rrp_tax_excluded = ?
1424
            ,tax_value_on_receiving = ?
1425
        | if defined $order->{rrp};
1425
        | if defined $order->{tax_value_on_receiving};
1426
1426
1427
        $query .= q|
1427
        $query .= q|
1428
            , ecost = ?, ecost_tax_included = ?, ecost_tax_excluded = ?
1428
            ,tax_rate_on_receiving = ?
1429
        | if defined $order->{ecost};
1429
        | if defined $order->{tax_rate_on_receiving};
1430
1430
1431
        $query .= q|
1431
        $query .= q|
1432
            , order_internalnote = ?
1432
            , order_internalnote = ?
Lines 1440-1451 sub ModReceiveOrder { Link Here
1440
        if ( defined $order->{unitprice} ) {
1440
        if ( defined $order->{unitprice} ) {
1441
            push @params, $order->{unitprice}, $order->{unitprice_tax_included}, $order->{unitprice_tax_excluded};
1441
            push @params, $order->{unitprice}, $order->{unitprice_tax_included}, $order->{unitprice_tax_excluded};
1442
        }
1442
        }
1443
        if ( defined $order->{rrp} ) {
1443
1444
            push @params, $order->{rrp}, $order->{rrp_tax_included}, $order->{rrp_tax_excluded};
1444
        if ( defined $order->{tax_value_on_receiving} ) {
1445
            push @params, $order->{tax_value_on_receiving};
1445
        }
1446
        }
1446
        if ( defined $order->{ecost} ) {
1447
1447
            push @params, $order->{ecost}, $order->{ecost_tax_included}, $order->{ecost_tax_excluded};
1448
        if ( defined $order->{tax_rate_on_receiving} ) {
1449
            push @params, $order->{tax_rate_on_receiving};
1448
        }
1450
        }
1451
1449
        if ( defined $order->{order_internalnote} ) {
1452
        if ( defined $order->{order_internalnote} ) {
1450
            push @params, $order->{order_internalnote};
1453
            push @params, $order->{order_internalnote};
1451
        }
1454
        }
Lines 2820-2831 sub populate_order_with_prices { Link Here
2820
    $discount /= 100 if $discount > 1;
2823
    $discount /= 100 if $discount > 1;
2821
2824
2822
    if ($ordering) {
2825
    if ($ordering) {
2826
        $order->{tax_rate_on_ordering} //= $order->{tax_rate};
2823
        if ( $bookseller->{listincgst} ) {
2827
        if ( $bookseller->{listincgst} ) {
2824
            # The user entered the rrp tax included
2828
            # The user entered the rrp tax included
2825
            $order->{rrp_tax_included} = $order->{rrp};
2829
            $order->{rrp_tax_included} = $order->{rrp};
2826
2830
2827
            # rrp tax excluded = rrp tax included / ( 1 + tax rate )
2831
            # rrp tax excluded = rrp tax included / ( 1 + tax rate )
2828
            $order->{rrp_tax_excluded} = $order->{rrp_tax_included} / ( 1 + $order->{tax_rate} );
2832
            $order->{rrp_tax_excluded} = $order->{rrp_tax_included} / ( 1 + $order->{tax_rate_on_ordering} );
2829
2833
2830
            # ecost tax excluded = rrp tax excluded * ( 1 - discount )
2834
            # ecost tax excluded = rrp tax excluded * ( 1 - discount )
2831
            $order->{ecost_tax_excluded} = $order->{rrp_tax_excluded} * ( 1 - $discount );
2835
            $order->{ecost_tax_excluded} = $order->{rrp_tax_excluded} * ( 1 - $discount );
Lines 2838-2844 sub populate_order_with_prices { Link Here
2838
            $order->{rrp_tax_excluded} = $order->{rrp};
2842
            $order->{rrp_tax_excluded} = $order->{rrp};
2839
2843
2840
            # rrp tax included = rrp tax excluded * ( 1 - tax rate )
2844
            # rrp tax included = rrp tax excluded * ( 1 - tax rate )
2841
            $order->{rrp_tax_included} = $order->{rrp_tax_excluded} * ( 1 + $order->{tax_rate} );
2845
            $order->{rrp_tax_included} = $order->{rrp_tax_excluded} * ( 1 + $order->{tax_rate_on_ordering} );
2842
2846
2843
            # ecost tax excluded = rrp tax excluded * ( 1 - discount )
2847
            # ecost tax excluded = rrp tax excluded * ( 1 - discount )
2844
            $order->{ecost_tax_excluded} = $order->{rrp_tax_excluded} * ( 1 - $discount );
2848
            $order->{ecost_tax_excluded} = $order->{rrp_tax_excluded} * ( 1 - $discount );
Lines 2846-2860 sub populate_order_with_prices { Link Here
2846
            # ecost tax included = rrp tax excluded * ( 1 - tax rate ) * ( 1 - discount )
2850
            # ecost tax included = rrp tax excluded * ( 1 - tax rate ) * ( 1 - discount )
2847
            $order->{ecost_tax_included} =
2851
            $order->{ecost_tax_included} =
2848
                $order->{rrp_tax_excluded} *
2852
                $order->{rrp_tax_excluded} *
2849
                ( 1 + $order->{tax_rate} ) *
2853
                ( 1 + $order->{tax_rate_on_ordering} ) *
2850
                ( 1 - $discount );
2854
                ( 1 - $discount );
2851
        }
2855
        }
2852
2856
2853
        # tax value = quantity * ecost tax excluded * tax rate
2857
        # tax value = quantity * ecost tax excluded * tax rate
2854
        $order->{tax_value} = $order->{quantity} * $order->{ecost_tax_excluded} * $order->{tax_rate};
2858
        $order->{tax_value_on_ordering} = 
2859
            $order->{quantity} * $order->{ecost_tax_excluded} * $order->{tax_rate_on_ordering};
2855
    }
2860
    }
2856
2861
2857
    if ($receiving) {
2862
    if ($receiving) {
2863
        $order->{tax_rate_on_receiving} //= $order->{tax_rate};
2858
        if ( $bookseller->{invoiceincgst} ) {
2864
        if ( $bookseller->{invoiceincgst} ) {
2859
            # Trick for unitprice. If the unit price rounded value is the same as the ecost rounded value
2865
            # Trick for unitprice. If the unit price rounded value is the same as the ecost rounded value
2860
            # we need to keep the exact ecost value
2866
            # we need to keep the exact ecost value
Lines 2866-2872 sub populate_order_with_prices { Link Here
2866
            $order->{unitprice_tax_included} = $order->{unitprice};
2872
            $order->{unitprice_tax_included} = $order->{unitprice};
2867
2873
2868
            # unit price tax excluded = unit price tax included / ( 1 + tax rate )
2874
            # unit price tax excluded = unit price tax included / ( 1 + tax rate )
2869
            $order->{unitprice_tax_excluded} = $order->{unitprice_tax_included} / ( 1 + $order->{tax_rate} );
2875
            $order->{unitprice_tax_excluded} = $order->{unitprice_tax_included} / ( 1 + $order->{tax_rate_on_receiving} );
2870
        }
2876
        }
2871
        else {
2877
        else {
2872
            # Trick for unitprice. If the unit price rounded value is the same as the ecost rounded value
2878
            # Trick for unitprice. If the unit price rounded value is the same as the ecost rounded value
Lines 2878-2889 sub populate_order_with_prices { Link Here
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 307-312 if ( $op eq 'delete_confirm' ) { Link Here
307
            $template->param( uncertainprices => 1 );
307
            $template->param( uncertainprices => 1 );
308
        }
308
        }
309
309
310
        $line->{tax_rate} = $line->{tax_rate_on_ordering};
311
        $line->{tax_value} = $line->{tax_value_on_ordering};
312
310
        push @books_loop, $line;
313
        push @books_loop, $line;
311
314
312
        $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
315
        $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
Lines 407-412 sub get_order_infos { Link Here
407
410
408
    $line{total_tax_included} = $line{ecost_tax_included} * $line{quantity};
411
    $line{total_tax_included} = $line{ecost_tax_included} * $line{quantity};
409
    $line{total_tax_excluded} = $line{ecost_tax_excluded} * $line{quantity};
412
    $line{total_tax_excluded} = $line{ecost_tax_excluded} * $line{quantity};
413
    $line{tax_value} = $line{tax_value_on_ordering};
414
    $line{tax_rate} = $line{tax_rate_on_ordering};
410
415
411
    if ( $line{uncertainprice} ) {
416
    if ( $line{uncertainprice} ) {
412
        $line{rrp_tax_excluded} .= ' (Uncertain)';
417
        $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 125-130 foreach my $order (@$orders) { Link Here
125
    $line->{total_tax_excluded} = Koha::Number::Price->new( $line->{unitprice_tax_excluded} * $line->{quantity} )->format;
125
    $line->{total_tax_excluded} = Koha::Number::Price->new( $line->{unitprice_tax_excluded} * $line->{quantity} )->format;
126
    $line->{total_tax_included} = Koha::Number::Price->new( $line->{unitprice_tax_included} * $line->{quantity} )->format;
126
    $line->{total_tax_included} = Koha::Number::Price->new( $line->{unitprice_tax_included} * $line->{quantity} )->format;
127
127
128
    $line->{tax_value} = $line->{tax_value_on_receiving};
129
    $line->{tax_rate} = $line->{tax_rate_on_receiving};
130
128
    $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
131
    $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
129
    $foot{$$line{tax_rate}}{tax_value} += $$line{tax_value};
132
    $foot{$$line{tax_rate}}{tax_value} += $$line{tax_value};
130
    $total_tax_value += $$line{tax_value};
133
    $total_tax_value += $$line{tax_value};
(-)a/acqui/neworderempty.pl (-2 / +2 lines)
Lines 284-290 if ( defined $subscriptionid ) { Link Here
284
        $budget_id              = $lastOrderReceived->{budgetid};
284
        $budget_id              = $lastOrderReceived->{budgetid};
285
        $data->{listprice}      = $lastOrderReceived->{listprice};
285
        $data->{listprice}      = $lastOrderReceived->{listprice};
286
        $data->{uncertainprice} = $lastOrderReceived->{uncertainprice};
286
        $data->{uncertainprice} = $lastOrderReceived->{uncertainprice};
287
        $data->{tax_rate}        = $lastOrderReceived->{tax_rate};
287
        $data->{tax_rate}       = $lastOrderReceived->{tax_rate_on_ordering};
288
        $data->{discount}       = $lastOrderReceived->{discount};
288
        $data->{discount}       = $lastOrderReceived->{discount};
289
        $data->{rrp}            = $lastOrderReceived->{rrp};
289
        $data->{rrp}            = $lastOrderReceived->{rrp};
290
        $data->{ecost}          = $lastOrderReceived->{ecost};
290
        $data->{ecost}          = $lastOrderReceived->{ecost};
Lines 366-372 $template->param( Link Here
366
    quantityrec      => $quantity,
366
    quantityrec      => $quantity,
367
    rrp              => $data->{'rrp'},
367
    rrp              => $data->{'rrp'},
368
    gst_values       => \@gst_values,
368
    gst_values       => \@gst_values,
369
    tax_rate          => $data->{tax_rate} ? $data->{tax_rate}+0.0 : $bookseller->{tax_rate} ? $bookseller->{tax_rate}+0.0 : 0,
369
    tax_rate         => $data->{tax_rate_on_ordering} ? $data->{tax_rate_on_ordering}+0.0 : $bookseller->{tax_rate} ? $bookseller->{tax_rate}+0.0 : 0,
370
    listprice        => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice),
370
    listprice        => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice),
371
    total            => sprintf( "%.2f", ($data->{ecost} || 0) * ($data->{'quantity'} || 0) ),
371
    total            => sprintf( "%.2f", ($data->{ecost} || 0) * ($data->{'quantity'} || 0) ),
372
    ecost            => sprintf( "%.2f", $data->{ecost} || 0),
372
    ecost            => sprintf( "%.2f", $data->{ecost} || 0),
(-)a/acqui/orderreceive.pl (-34 / +30 lines)
Lines 158-189 if ($AcqCreateItem eq 'receiving') { Link Here
158
}
158
}
159
159
160
$order->{quantityreceived} = '' if $order->{quantityreceived} == 0;
160
$order->{quantityreceived} = '' if $order->{quantityreceived} == 0;
161
$order->{unitprice} = '' if $order->{unitprice} == 0;
161
162
162
my $unitprice = $order->{unitprice};
163
my $rrp;
163
my ( $rrp, $ecost );
164
my $ecost;
164
if ( $bookseller->{invoiceincgst} ) {
165
my $unitprice;
165
    $rrp = $order->{rrp_tax_included};
166
if ( $bookseller->{listincgst} ) {
166
    $ecost = $order->{ecost_tax_included};
167
    if ( $bookseller->{invoiceincgst} ) {
167
    unless ( $unitprice != 0 and defined $unitprice) {
168
        $rrp = $order->{rrp};
168
        $unitprice = $order->{ecost_tax_included};
169
        $ecost = $order->{ecost};
170
        $unitprice = $order->{unitprice};
171
    } else {
172
        $rrp = $order->{rrp} / ( 1 + $order->{tax_rate} );
173
        $ecost = $order->{ecost} / ( 1 + $order->{tax_rate} );
174
        $unitprice = $order->{unitprice} / ( 1 + $order->{tax_rate} );
175
    }
169
    }
176
} else {
170
} else {
177
    if ( $bookseller->{invoiceincgst} ) {
171
    $rrp = $order->{rrp_tax_excluded};
178
        $rrp = $order->{rrp} * ( 1 + $order->{tax_rate} );
172
    $ecost = $order->{ecost_tax_excluded};
179
        $ecost = $order->{ecost} * ( 1 + $order->{tax_rate} );
173
    unless ( $unitprice != 0 and defined $unitprice) {
180
        $unitprice = $order->{unitprice} * ( 1 + $order->{tax_rate} );
174
        $unitprice = $order->{ecost_tax_excluded};
181
    } else {
182
        $rrp = $order->{rrp};
183
        $ecost = $order->{ecost};
184
        $unitprice = $order->{unitprice};
185
    }
175
    }
186
 }
176
}
177
178
my $tax_rate;
179
if( defined $order->{tax_rate_on_receiving} ) {
180
    $tax_rate = $order->{tax_rate_on_receiving} + 0.0;
181
} else {
182
    $tax_rate = $order->{tax_rate_on_ordering} + 0.0;
183
}
187
184
188
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
185
my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
189
186
Lines 194-199 my $budget = GetBudget( $order->{budget_id} ); Link Here
194
191
195
my $datereceived = $order->{datereceived} ? dt_from_string( $order->{datereceived} ) : dt_from_string;
192
my $datereceived = $order->{datereceived} ? dt_from_string( $order->{datereceived} ) : dt_from_string;
196
193
194
# get option values for gist syspref
195
my @gst_values = map {
196
    option => $_ + 0.0
197
}, split( '\|', C4::Context->preference("gist") );
198
197
$template->param(
199
$template->param(
198
    AcqCreateItem         => $AcqCreateItem,
200
    AcqCreateItem         => $AcqCreateItem,
199
    count                 => 1,
201
    count                 => 1,
Lines 212-219 $template->param( Link Here
212
    quantity              => $order->{'quantity'},
214
    quantity              => $order->{'quantity'},
213
    quantityreceivedplus1 => $order->{'quantityreceived'} + 1,
215
    quantityreceivedplus1 => $order->{'quantityreceived'} + 1,
214
    quantityreceived      => $order->{'quantityreceived'},
216
    quantityreceived      => $order->{'quantityreceived'},
215
    rrp                   => sprintf( "%.2f", $rrp ),
217
    rrp                   => $rrp,
216
    ecost                 => sprintf( "%.2f", $ecost ),
218
    ecost                 => $ecost,
219
    unitprice             => $unitprice,
220
    tax_rate              => $tax_rate,
217
    memberfirstname       => $member->{firstname} || "",
221
    memberfirstname       => $member->{firstname} || "",
218
    membersurname         => $member->{surname} || "",
222
    membersurname         => $member->{surname} || "",
219
    invoiceid             => $invoice->{invoiceid},
223
    invoiceid             => $invoice->{invoiceid},
Lines 224-229 $template->param( Link Here
224
    suggestionid          => $suggestion->{suggestionid},
228
    suggestionid          => $suggestion->{suggestionid},
225
    surnamesuggestedby    => $suggestion->{surnamesuggestedby},
229
    surnamesuggestedby    => $suggestion->{surnamesuggestedby},
226
    firstnamesuggestedby  => $suggestion->{firstnamesuggestedby},
230
    firstnamesuggestedby  => $suggestion->{firstnamesuggestedby},
231
    gst_values            => \@gst_values,
227
);
232
);
228
233
229
my $borrower = GetMember( 'borrowernumber' => $loggedinuser );
234
my $borrower = GetMember( 'borrowernumber' => $loggedinuser );
Lines 261-275 foreach my $period (@$periods) { Link Here
261
266
262
$template->{'VARS'}->{'budget_loop'} = \@budget_loop;
267
$template->{'VARS'}->{'budget_loop'} = \@budget_loop;
263
268
264
# regardless of the content of $unitprice e.g 0 or '' or any string will return in these cases 0.00
265
# and the 'IF' in the .tt will show 0.00 and not 'ecost' (see BZ 7129)
266
# So if $unitprice == 0 we don't create unitprice
267
if ( $unitprice != 0) {
268
    $template->param(
269
        unitprice             => sprintf( "%.2f", $unitprice),
270
    );
271
}
272
273
my $op = $input->param('op');
269
my $op = $input->param('op');
274
if ($op and $op eq 'edit'){
270
if ($op and $op eq 'edit'){
275
    $template->param(edit   =>   1);
271
    $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 / +22 lines)
Lines 1-4 Link Here
1
[% USE KohaDates %]
1
[% USE KohaDates %]
2
[% USE Price %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Acquisitions &rsaquo; Receipt summary for : [% name %] [% IF ( invoice ) %]invoice, [% invoice %][% END %]</title>
4
<title>Koha &rsaquo; Acquisitions &rsaquo; Receipt summary for : [% name %] [% IF ( invoice ) %]invoice, [% invoice %][% END %]</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
Lines 261-267 Link Here
261
    <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
262
    <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
262
    <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
263
    <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
263
    <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
264
    <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
264
    <input type="hidden" name="tax_rate" value="[% tax_rate %]" />
265
	</div>
265
	</div>
266
	<div class="yui-u">
266
	<div class="yui-u">
267
    <fieldset class="rows">
267
    <fieldset class="rows">
Lines 328-341 Link Here
328
          [% END %][%# IF (AcqCreateItemReceiving) %]
328
          [% END %][%# IF (AcqCreateItemReceiving) %]
329
		</li>
329
		</li>
330
330
331
        [% IF ( gst_values ) %]
332
            <li>
333
                <label for="tax_rate">Tax rate: </label>
334
                <select name="tax_rate" id="tax_rate">
335
                [% FOREACH gst IN gst_values %]
336
                    [% IF gst.option == tax_rate %]
337
                        <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format("%.1f") %]%</option>
338
                    [% ELSE %]
339
                        <option value="[% gst.option %]">[% gst.option * 100 | format("%.1f") %]%</option>
340
                    [% END %]
341
                [% END %]
342
                </select>
343
            </li>
344
        [% ELSE %]
345
            <input type="hidden" name="tax_rate" value="0" />
346
        [% END %]
347
331
        <li><label for="rrp">Replacement cost: </label>[% rrp | $Price %]</li>
348
        <li><label for="rrp">Replacement cost: </label>[% rrp | $Price %]</li>
332
        <li><label for="ecost">Budgeted cost: </label>[% ecost | $Price %]</li>
349
        <li><label for="ecost">Budgeted cost: </label>[% ecost | $Price %]</li>
333
        <li><label for="cost">Actual cost:</label>
350
        <li>
334
        [% IF ( unitprice ) %]
351
            <label for="unitprice">Actual cost:</label>
335
             <input type="text" size="20" name="cost" id="cost" value="[% unitprice | $Price %]" />
352
            <input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price %]" />
336
        [% ELSE %]
353
        </li>
337
             <input type="text" size="20" name="cost" id="cost" value="[% ecost | $Price %]" />
338
        [% END %]</li>
339
        <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote %]</textarea></li>
354
        <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote %]</textarea></li>
340
        [% IF order_vendornote %]
355
        [% IF order_vendornote %]
341
            <li><label for="order_vendornote">Vendor note: </label><span>[% order_vendornote %]</span></li>
356
            <li><label for="order_vendornote">Vendor note: </label><span>[% order_vendornote %]</span></li>
(-)a/t/Prices.t (-9 / +9 lines)
Lines 89-101 for my $currency_format ( qw( US FR ) ) { Link Here
89
        );
89
        );
90
        compare(
90
        compare(
91
            {
91
            {
92
                got      => $order_0_0->{tax_value},
92
                got      => $order_0_0->{tax_value_on_ordering},
93
                expected => 7.38,
93
                expected => 7.38,
94
                conf     => '0 0',
94
                conf     => '0 0',
95
                field    => 'tax_value'
95
                field    => 'tax_value'
96
            }
96
            }
97
        );
97
        );
98
98
99
        # 
99
        $order_0_0 = C4::Acquisition::populate_order_with_prices(
100
        $order_0_0 = C4::Acquisition::populate_order_with_prices(
100
            {
101
            {
101
                order        => $order_0_0,
102
                order        => $order_0_0,
Lines 122-128 for my $currency_format ( qw( US FR ) ) { Link Here
122
        );
123
        );
123
        compare(
124
        compare(
124
            {
125
            {
125
                got      => $order_0_0->{tax_value},
126
                got      => $order_0_0->{tax_value_on_receiving},
126
                expected => 7.38,
127
                expected => 7.38,
127
                conf     => '0 0',
128
                conf     => '0 0',
128
                field    => 'tax_value'
129
                field    => 'tax_value'
Lines 197-203 for my $currency_format ( qw( US FR ) ) { Link Here
197
        );
198
        );
198
        compare(
199
        compare(
199
            {
200
            {
200
                got      => $order_1_1->{tax_value},
201
                got      => $order_1_1->{tax_value_on_ordering},
201
                expected => 7.03,
202
                expected => 7.03,
202
                conf     => '1 1',
203
                conf     => '1 1',
203
                field    => 'tax_value'
204
                field    => 'tax_value'
Lines 230-236 for my $currency_format ( qw( US FR ) ) { Link Here
230
        );
231
        );
231
        compare(
232
        compare(
232
            {
233
            {
233
                got      => $order_1_1->{tax_value},
234
                got      => $order_1_1->{tax_value_on_receiving},
234
                expected => 7.03,
235
                expected => 7.03,
235
                conf     => '1 1',
236
                conf     => '1 1',
236
                field    => 'tax_value'
237
                field    => 'tax_value'
Lines 305-311 for my $currency_format ( qw( US FR ) ) { Link Here
305
        );
306
        );
306
        compare(
307
        compare(
307
            {
308
            {
308
                got      => $order_1_0->{tax_value},
309
                got      => $order_1_0->{tax_value_on_ordering},
309
                expected => 7.03,
310
                expected => 7.03,
310
                conf     => '1 0',
311
                conf     => '1 0',
311
                field    => 'tax_value'
312
                field    => 'tax_value'
Lines 338-344 for my $currency_format ( qw( US FR ) ) { Link Here
338
        );
339
        );
339
        compare(
340
        compare(
340
            {
341
            {
341
                got      => $order_1_0->{tax_value},
342
                got      => $order_1_0->{tax_value_on_receiving},
342
                expected => 7.03,
343
                expected => 7.03,
343
                conf     => '1 0',
344
                conf     => '1 0',
344
                field    => 'tax_value'
345
                field    => 'tax_value'
Lines 413-419 for my $currency_format ( qw( US FR ) ) { Link Here
413
        );
414
        );
414
        compare(
415
        compare(
415
            {
416
            {
416
                got      => $order_0_1->{tax_value},
417
                got      => $order_0_1->{tax_value_on_ordering},
417
                expected => 7.38,
418
                expected => 7.38,
418
                conf     => '0 1',
419
                conf     => '0 1',
419
                field    => 'tax_value'
420
                field    => 'tax_value'
Lines 446-452 for my $currency_format ( qw( US FR ) ) { Link Here
446
        );
447
        );
447
        compare(
448
        compare(
448
            {
449
            {
449
                got      => $order_0_1->{tax_value},
450
                got      => $order_0_1->{tax_value_on_receiving},
450
                expected => 7.38,
451
                expected => 7.38,
451
                conf     => '0 1',
452
                conf     => '0 1',
452
                field    => 'tax_value'
453
                field    => 'tax_value'
453
- 

Return to bug 13323