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

(-)a/C4/Acquisition.pm (-15 / +22 lines)
Lines 1420-1431 sub ModReceiveOrder { Link Here
1420
        | if defined $order->{unitprice};
1420
        | if defined $order->{unitprice};
1421
1421
1422
        $query .= q|
1422
        $query .= q|
1423
            , rrp = ?, rrp_tax_included = ?, rrp_tax_excluded = ?
1423
            ,tax_value_on_receiving = ?
1424
        | if defined $order->{rrp};
1424
        | if defined $order->{tax_value_on_receiving};
1425
1425
1426
        $query .= q|
1426
        $query .= q|
1427
            , ecost = ?, ecost_tax_included = ?, ecost_tax_excluded = ?
1427
            ,tax_rate_on_receiving = ?
1428
        | if defined $order->{ecost};
1428
        | if defined $order->{tax_rate_on_receiving};
1429
1429
1430
        $query .= q|
1430
        $query .= q|
1431
            , order_internalnote = ?
1431
            , order_internalnote = ?
Lines 1439-1450 sub ModReceiveOrder { Link Here
1439
        if ( defined $order->{unitprice} ) {
1439
        if ( defined $order->{unitprice} ) {
1440
            push @params, $order->{unitprice}, $order->{unitprice_tax_included}, $order->{unitprice_tax_excluded};
1440
            push @params, $order->{unitprice}, $order->{unitprice_tax_included}, $order->{unitprice_tax_excluded};
1441
        }
1441
        }
1442
        if ( defined $order->{rrp} ) {
1442
1443
            push @params, $order->{rrp}, $order->{rrp_tax_included}, $order->{rrp_tax_excluded};
1443
        if ( defined $order->{tax_value_on_receiving} ) {
1444
            push @params, $order->{tax_value_on_receiving};
1444
        }
1445
        }
1445
        if ( defined $order->{ecost} ) {
1446
1446
            push @params, $order->{ecost}, $order->{ecost_tax_included}, $order->{ecost_tax_excluded};
1447
        if ( defined $order->{tax_rate_on_receiving} ) {
1448
            push @params, $order->{tax_rate_on_receiving};
1447
        }
1449
        }
1450
1448
        if ( defined $order->{order_internalnote} ) {
1451
        if ( defined $order->{order_internalnote} ) {
1449
            push @params, $order->{order_internalnote};
1452
            push @params, $order->{order_internalnote};
1450
        }
1453
        }
Lines 2819-2830 sub populate_order_with_prices { Link Here
2819
    $discount /= 100 if $discount > 1;
2822
    $discount /= 100 if $discount > 1;
2820
2823
2821
    if ($ordering) {
2824
    if ($ordering) {
2825
        $order->{tax_rate_on_ordering} //= $order->{tax_rate};
2822
        if ( $bookseller->{listincgst} ) {
2826
        if ( $bookseller->{listincgst} ) {
2823
            # The user entered the rrp tax included
2827
            # The user entered the rrp tax included
2824
            $order->{rrp_tax_included} = $order->{rrp};
2828
            $order->{rrp_tax_included} = $order->{rrp};
2825
2829
2826
            # rrp tax excluded = rrp tax included / ( 1 + tax rate )
2830
            # rrp tax excluded = rrp tax included / ( 1 + tax rate )
2827
            $order->{rrp_tax_excluded} = $order->{rrp_tax_included} / ( 1 + $order->{tax_rate} );
2831
            $order->{rrp_tax_excluded} = $order->{rrp_tax_included} / ( 1 + $order->{tax_rate_on_ordering} );
2828
2832
2829
            # ecost tax excluded = rrp tax excluded * ( 1 - discount )
2833
            # ecost tax excluded = rrp tax excluded * ( 1 - discount )
2830
            $order->{ecost_tax_excluded} = $order->{rrp_tax_excluded} * ( 1 - $discount );
2834
            $order->{ecost_tax_excluded} = $order->{rrp_tax_excluded} * ( 1 - $discount );
Lines 2837-2843 sub populate_order_with_prices { Link Here
2837
            $order->{rrp_tax_excluded} = $order->{rrp};
2841
            $order->{rrp_tax_excluded} = $order->{rrp};
2838
2842
2839
            # rrp tax included = rrp tax excluded * ( 1 - tax rate )
2843
            # rrp tax included = rrp tax excluded * ( 1 - tax rate )
2840
            $order->{rrp_tax_included} = $order->{rrp_tax_excluded} * ( 1 + $order->{tax_rate} );
2844
            $order->{rrp_tax_included} = $order->{rrp_tax_excluded} * ( 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 2845-2859 sub populate_order_with_prices { Link Here
2845
            # ecost tax included = rrp tax excluded * ( 1 - tax rate ) * ( 1 - discount )
2849
            # ecost tax included = rrp tax excluded * ( 1 - tax rate ) * ( 1 - discount )
2846
            $order->{ecost_tax_included} =
2850
            $order->{ecost_tax_included} =
2847
                $order->{rrp_tax_excluded} *
2851
                $order->{rrp_tax_excluded} *
2848
                ( 1 + $order->{tax_rate} ) *
2852
                ( 1 + $order->{tax_rate_on_ordering} ) *
2849
                ( 1 - $discount );
2853
                ( 1 - $discount );
2850
        }
2854
        }
2851
2855
2852
        # tax value = quantity * ecost tax excluded * tax rate
2856
        # tax value = quantity * ecost tax excluded * tax rate
2853
        $order->{tax_value} = $order->{quantity} * $order->{ecost_tax_excluded} * $order->{tax_rate};
2857
        $order->{tax_value_on_ordering} = 
2858
            $order->{quantity} * $order->{ecost_tax_excluded} * $order->{tax_rate_on_ordering};
2854
    }
2859
    }
2855
2860
2856
    if ($receiving) {
2861
    if ($receiving) {
2862
        $order->{tax_rate_on_receiving} //= $order->{tax_rate};
2857
        if ( $bookseller->{invoiceincgst} ) {
2863
        if ( $bookseller->{invoiceincgst} ) {
2858
            # Trick for unitprice. If the unit price rounded value is the same as the ecost rounded value
2864
            # Trick for unitprice. If the unit price rounded value is the same as the ecost rounded value
2859
            # we need to keep the exact ecost value
2865
            # we need to keep the exact ecost value
Lines 2865-2871 sub populate_order_with_prices { Link Here
2865
            $order->{unitprice_tax_included} = $order->{unitprice};
2871
            $order->{unitprice_tax_included} = $order->{unitprice};
2866
2872
2867
            # unit price tax excluded = unit price tax included / ( 1 + tax rate )
2873
            # unit price tax excluded = unit price tax included / ( 1 + tax rate )
2868
            $order->{unitprice_tax_excluded} = $order->{unitprice_tax_included} / ( 1 + $order->{tax_rate} );
2874
            $order->{unitprice_tax_excluded} = $order->{unitprice_tax_included} / ( 1 + $order->{tax_rate_on_receiving} );
2869
        }
2875
        }
2870
        else {
2876
        else {
2871
            # Trick for unitprice. If the unit price rounded value is the same as the ecost rounded value
2877
            # Trick for unitprice. If the unit price rounded value is the same as the ecost rounded value
Lines 2877-2888 sub populate_order_with_prices { Link Here
2877
            # The user entered the unit price tax excluded
2883
            # The user entered the unit price tax excluded
2878
            $order->{unitprice_tax_excluded} = $order->{unitprice};
2884
            $order->{unitprice_tax_excluded} = $order->{unitprice};
2879
2885
2886
2880
            # unit price tax included = unit price tax included * ( 1 + tax rate )
2887
            # unit price tax included = unit price tax included * ( 1 + tax rate )
2881
            $order->{unitprice_tax_included} = $order->{unitprice_tax_excluded} * ( 1 + $order->{tax_rate} );
2888
            $order->{unitprice_tax_included} = $order->{unitprice_tax_excluded} * ( 1 + $order->{tax_rate_on_receiving} );
2882
        }
2889
        }
2883
2890
2884
        # tax value = quantity * unit price tax excluded * tax rate
2891
        # tax value = quantity * unit price tax excluded * tax rate
2885
        $order->{tax_value} = $order->{quantity} * $order->{unitprice_tax_excluded} * $order->{tax_rate};
2892
        $order->{tax_value_on_receiving} = $order->{quantity} * $order->{unitprice_tax_excluded} * $order->{tax_rate_on_receiving};
2886
    }
2893
    }
2887
2894
2888
    return $order;
2895
    return $order;
(-)a/acqui/basket.pl (+5 lines)
Lines 309-314 if ( $op eq 'delete_confirm' ) { Link Here
309
            $template->param( uncertainprices => 1 );
309
            $template->param( uncertainprices => 1 );
310
        }
310
        }
311
311
312
        $line->{tax_rate} = $line->{tax_rate_on_ordering};
313
        $line->{tax_value} = $line->{tax_value_on_ordering};
314
312
        push @books_loop, $line;
315
        push @books_loop, $line;
313
316
314
        $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
317
        $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
Lines 409-414 sub get_order_infos { Link Here
409
412
410
    $line{total_tax_included} = $line{ecost_tax_included} * $line{quantity};
413
    $line{total_tax_included} = $line{ecost_tax_included} * $line{quantity};
411
    $line{total_tax_excluded} = $line{ecost_tax_excluded} * $line{quantity};
414
    $line{total_tax_excluded} = $line{ecost_tax_excluded} * $line{quantity};
415
    $line{tax_value} = $line{tax_value_on_ordering};
416
    $line{tax_rate} = $line{tax_rate_on_ordering};
412
417
413
    if ( $line{uncertainprice} ) {
418
    if ( $line{uncertainprice} ) {
414
        $line{rrp_tax_excluded} .= ' (Uncertain)';
419
        $line{rrp_tax_excluded} .= ' (Uncertain)';
(-)a/acqui/basketgroup.pl (+2 lines)
Lines 169-174 sub printbasketgrouppdf{ Link Here
169
                croak $@;
169
                croak $@;
170
            }
170
            }
171
171
172
            $ord->{tax_value} = $ord->{tax_value_on_ordering};
173
            $ord->{tax_rate} = $ord->{tax_rate_on_ordering};
172
            $ord->{total_tax_included} = $ord->{ecost_tax_included} * $ord->{quantity};
174
            $ord->{total_tax_included} = $ord->{ecost_tax_included} * $ord->{quantity};
173
            $ord->{total_tax_excluded} = $ord->{ecost_tax_excluded} * $ord->{quantity};
175
            $ord->{total_tax_excluded} = $ord->{ecost_tax_excluded} * $ord->{quantity};
174
176
(-)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 124-129 foreach my $order (@$orders) { Link Here
124
    $line->{total_tax_excluded} = Koha::Number::Price->new( $line->{unitprice_tax_excluded} * $line->{quantity} )->format;
124
    $line->{total_tax_excluded} = Koha::Number::Price->new( $line->{unitprice_tax_excluded} * $line->{quantity} )->format;
125
    $line->{total_tax_included} = Koha::Number::Price->new( $line->{unitprice_tax_included} * $line->{quantity} )->format;
125
    $line->{total_tax_included} = Koha::Number::Price->new( $line->{unitprice_tax_included} * $line->{quantity} )->format;
126
126
127
    $line->{tax_value} = $line->{tax_value_on_receiving};
128
    $line->{tax_rate} = $line->{tax_rate_on_receiving};
129
127
    $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
130
    $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
128
    $foot{$$line{tax_rate}}{tax_value} += $$line{tax_value};
131
    $foot{$$line{tax_rate}}{tax_value} += $$line{tax_value};
129
    $total_tax_value += $$line{tax_value};
132
    $total_tax_value += $$line{tax_value};
(-)a/acqui/neworderempty.pl (-2 / +2 lines)
Lines 312-318 if ( defined $subscriptionid ) { Link Here
312
        $budget_id              = $lastOrderReceived->{budgetid};
312
        $budget_id              = $lastOrderReceived->{budgetid};
313
        $data->{listprice}      = $lastOrderReceived->{listprice};
313
        $data->{listprice}      = $lastOrderReceived->{listprice};
314
        $data->{uncertainprice} = $lastOrderReceived->{uncertainprice};
314
        $data->{uncertainprice} = $lastOrderReceived->{uncertainprice};
315
        $data->{tax_rate}        = $lastOrderReceived->{tax_rate};
315
        $data->{tax_rate}       = $lastOrderReceived->{tax_rate_on_ordering};
316
        $data->{discount}       = $lastOrderReceived->{discount};
316
        $data->{discount}       = $lastOrderReceived->{discount};
317
        $data->{rrp}            = $lastOrderReceived->{rrp};
317
        $data->{rrp}            = $lastOrderReceived->{rrp};
318
        $data->{ecost}          = $lastOrderReceived->{ecost};
318
        $data->{ecost}          = $lastOrderReceived->{ecost};
Lines 394-400 $template->param( Link Here
394
    quantityrec      => $quantity,
394
    quantityrec      => $quantity,
395
    rrp              => $data->{'rrp'},
395
    rrp              => $data->{'rrp'},
396
    gst_values       => \@gst_values,
396
    gst_values       => \@gst_values,
397
    tax_rate          => $data->{tax_rate} ? $data->{tax_rate}+0.0 : $bookseller->{tax_rate} ? $bookseller->{tax_rate}+0.0 : 0,
397
    tax_rate         => $data->{tax_rate_on_ordering} ? $data->{tax_rate_on_ordering}+0.0 : $bookseller->{tax_rate} ? $bookseller->{tax_rate}+0.0 : 0,
398
    listprice        => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice),
398
    listprice        => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice),
399
    total            => sprintf( "%.2f", ($data->{ecost} || 0) * ($data->{'quantity'} || 0) ),
399
    total            => sprintf( "%.2f", ($data->{ecost} || 0) * ($data->{'quantity'} || 0) ),
400
    ecost            => sprintf( "%.2f", $data->{ecost} || 0),
400
    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