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 2834-2845 sub populate_order_with_prices { Link Here
2834
    $discount /= 100 if $discount > 1;
2837
    $discount /= 100 if $discount > 1;
2835
2838
2836
    if ($ordering) {
2839
    if ($ordering) {
2840
        $order->{tax_rate_on_ordering} //= $order->{tax_rate};
2837
        if ( $bookseller->{listincgst} ) {
2841
        if ( $bookseller->{listincgst} ) {
2838
            # The user entered the rrp tax included
2842
            # The user entered the rrp tax included
2839
            $order->{rrp_tax_included} = $order->{rrp};
2843
            $order->{rrp_tax_included} = $order->{rrp};
2840
2844
2841
            # rrp tax excluded = rrp tax included / ( 1 + tax rate )
2845
            # rrp tax excluded = rrp tax included / ( 1 + tax rate )
2842
            $order->{rrp_tax_excluded} = $order->{rrp_tax_included} / ( 1 + $order->{tax_rate} );
2846
            $order->{rrp_tax_excluded} = $order->{rrp_tax_included} / ( 1 + $order->{tax_rate_on_ordering} );
2843
2847
2844
            # ecost tax excluded = rrp tax excluded * ( 1 - discount )
2848
            # ecost tax excluded = rrp tax excluded * ( 1 - discount )
2845
            $order->{ecost_tax_excluded} = $order->{rrp_tax_excluded} * ( 1 - $discount );
2849
            $order->{ecost_tax_excluded} = $order->{rrp_tax_excluded} * ( 1 - $discount );
Lines 2852-2858 sub populate_order_with_prices { Link Here
2852
            $order->{rrp_tax_excluded} = $order->{rrp};
2856
            $order->{rrp_tax_excluded} = $order->{rrp};
2853
2857
2854
            # rrp tax included = rrp tax excluded * ( 1 - tax rate )
2858
            # rrp tax included = rrp tax excluded * ( 1 - tax rate )
2855
            $order->{rrp_tax_included} = $order->{rrp_tax_excluded} * ( 1 + $order->{tax_rate} );
2859
            $order->{rrp_tax_included} = $order->{rrp_tax_excluded} * ( 1 + $order->{tax_rate_on_ordering} );
2856
2860
2857
            # ecost tax excluded = rrp tax excluded * ( 1 - discount )
2861
            # ecost tax excluded = rrp tax excluded * ( 1 - discount )
2858
            $order->{ecost_tax_excluded} = $order->{rrp_tax_excluded} * ( 1 - $discount );
2862
            $order->{ecost_tax_excluded} = $order->{rrp_tax_excluded} * ( 1 - $discount );
Lines 2860-2874 sub populate_order_with_prices { Link Here
2860
            # ecost tax included = rrp tax excluded * ( 1 - tax rate ) * ( 1 - discount )
2864
            # ecost tax included = rrp tax excluded * ( 1 - tax rate ) * ( 1 - discount )
2861
            $order->{ecost_tax_included} =
2865
            $order->{ecost_tax_included} =
2862
                $order->{rrp_tax_excluded} *
2866
                $order->{rrp_tax_excluded} *
2863
                ( 1 + $order->{tax_rate} ) *
2867
                ( 1 + $order->{tax_rate_on_ordering} ) *
2864
                ( 1 - $discount );
2868
                ( 1 - $discount );
2865
        }
2869
        }
2866
2870
2867
        # tax value = quantity * ecost tax excluded * tax rate
2871
        # tax value = quantity * ecost tax excluded * tax rate
2868
        $order->{tax_value} = $order->{quantity} * $order->{ecost_tax_excluded} * $order->{tax_rate};
2872
        $order->{tax_value_on_ordering} =
2873
            $order->{quantity} * $order->{ecost_tax_excluded} * $order->{tax_rate_on_ordering};
2869
    }
2874
    }
2870
2875
2871
    if ($receiving) {
2876
    if ($receiving) {
2877
        $order->{tax_rate_on_receiving} //= $order->{tax_rate};
2872
        if ( $bookseller->{invoiceincgst} ) {
2878
        if ( $bookseller->{invoiceincgst} ) {
2873
            # Trick for unitprice. If the unit price rounded value is the same as the ecost rounded value
2879
            # Trick for unitprice. If the unit price rounded value is the same as the ecost rounded value
2874
            # we need to keep the exact ecost value
2880
            # we need to keep the exact ecost value
Lines 2880-2886 sub populate_order_with_prices { Link Here
2880
            $order->{unitprice_tax_included} = $order->{unitprice};
2886
            $order->{unitprice_tax_included} = $order->{unitprice};
2881
2887
2882
            # unit price tax excluded = unit price tax included / ( 1 + tax rate )
2888
            # unit price tax excluded = unit price tax included / ( 1 + tax rate )
2883
            $order->{unitprice_tax_excluded} = $order->{unitprice_tax_included} / ( 1 + $order->{tax_rate} );
2889
            $order->{unitprice_tax_excluded} = $order->{unitprice_tax_included} / ( 1 + $order->{tax_rate_on_receiving} );
2884
        }
2890
        }
2885
        else {
2891
        else {
2886
            # Trick for unitprice. If the unit price rounded value is the same as the ecost rounded value
2892
            # Trick for unitprice. If the unit price rounded value is the same as the ecost rounded value
Lines 2892-2903 sub populate_order_with_prices { Link Here
2892
            # The user entered the unit price tax excluded
2898
            # The user entered the unit price tax excluded
2893
            $order->{unitprice_tax_excluded} = $order->{unitprice};
2899
            $order->{unitprice_tax_excluded} = $order->{unitprice};
2894
2900
2901
2895
            # unit price tax included = unit price tax included * ( 1 + tax rate )
2902
            # unit price tax included = unit price tax included * ( 1 + tax rate )
2896
            $order->{unitprice_tax_included} = $order->{unitprice_tax_excluded} * ( 1 + $order->{tax_rate} );
2903
            $order->{unitprice_tax_included} = $order->{unitprice_tax_excluded} * ( 1 + $order->{tax_rate_on_receiving} );
2897
        }
2904
        }
2898
2905
2899
        # tax value = quantity * unit price tax excluded * tax rate
2906
        # tax value = quantity * unit price tax excluded * tax rate
2900
        $order->{tax_value} = $order->{quantity} * $order->{unitprice_tax_excluded} * $order->{tax_rate};
2907
        $order->{tax_value_on_receiving} = $order->{quantity} * $order->{unitprice_tax_excluded} * $order->{tax_rate_on_receiving};
2901
    }
2908
    }
2902
2909
2903
    return $order;
2910
    return $order;
(-)a/acqui/basket.pl (+5 lines)
Lines 317-322 elsif ( $op eq 'ediorder' ) { Link Here
317
            $template->param( uncertainprices => 1 );
317
            $template->param( uncertainprices => 1 );
318
        }
318
        }
319
319
320
        $line->{tax_rate} = $line->{tax_rate_on_ordering};
321
        $line->{tax_value} = $line->{tax_value_on_ordering};
322
320
        push @books_loop, $line;
323
        push @books_loop, $line;
321
324
322
        $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
325
        $foot{$$line{tax_rate}}{tax_rate} = $$line{tax_rate};
Lines 426-431 sub get_order_infos { Link Here
426
429
427
    $line{total_tax_included} = $line{ecost_tax_included} * $line{quantity};
430
    $line{total_tax_included} = $line{ecost_tax_included} * $line{quantity};
428
    $line{total_tax_excluded} = $line{ecost_tax_excluded} * $line{quantity};
431
    $line{total_tax_excluded} = $line{ecost_tax_excluded} * $line{quantity};
432
    $line{tax_value} = $line{tax_value_on_ordering};
433
    $line{tax_rate} = $line{tax_rate_on_ordering};
429
434
430
    if ( $line{uncertainprice} ) {
435
    if ( $line{uncertainprice} ) {
431
        $line{rrp_tax_excluded} .= ' (Uncertain)';
436
        $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 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 369-375 $template->param( Link Here
369
    quantityrec      => $quantity,
369
    quantityrec      => $quantity,
370
    rrp              => $data->{'rrp'},
370
    rrp              => $data->{'rrp'},
371
    gst_values       => \@gst_values,
371
    gst_values       => \@gst_values,
372
    tax_rate          => $data->{tax_rate} ? $data->{tax_rate}+0.0 : $bookseller->{tax_rate} ? $bookseller->{tax_rate}+0.0 : 0,
372
    tax_rate         => $data->{tax_rate_on_ordering} ? $data->{tax_rate_on_ordering}+0.0 : $bookseller->{tax_rate} ? $bookseller->{tax_rate}+0.0 : 0,
373
    listprice        => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice),
373
    listprice        => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice),
374
    total            => sprintf( "%.2f", ($data->{ecost} || 0) * ($data->{'quantity'} || 0) ),
374
    total            => sprintf( "%.2f", ($data->{ecost} || 0) * ($data->{'quantity'} || 0) ),
375
    ecost            => sprintf( "%.2f", $data->{ecost} || 0),
375
    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 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