Bugzilla – Attachment 114476 Details for
Bug 27203
Order unitprice is not set anymore and totals are 0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27203: [alternate] Calculate tax based on ecost if unitprice not set
Bug-27203-alternate-Calculate-tax-based-on-ecost-i.patch (text/plain), 2.33 KB, created by
Nick Clemens (kidclamp)
on 2020-12-17 12:31:55 UTC
(
hide
)
Description:
Bug 27203: [alternate] Calculate tax based on ecost if unitprice not set
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2020-12-17 12:31:55 UTC
Size:
2.33 KB
patch
obsolete
>From 69ace403dbc558e380e6d632ae5668d7c2627d37 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Thu, 17 Dec 2020 12:21:32 +0000 >Subject: [PATCH] Bug 27203: [alternate] Calculate tax based on ecost if > unitprice not set > >There is code in populate_order_with_prices that is intended to use ecost over unitprice, >it just doens't seem to be working. > >Making it more explicit seems to take care of the issue. > >To test: >1 - Create a basket >2 - Add an order line, don't set 'Actual cost: ', but use vendor price >and a discount. >3 - Save >4 - Display all columns, 'Actual cost tax inc.' are GST columns aren't set. >5 - Apply batch >6 - Redo 1,2, 3 >7 - Display all columns, GST is calculated correctly, unitprice remains 0. >--- > C4/Acquisition.pm | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 2ac15473b4..72c0bcd882 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -2798,8 +2798,8 @@ sub populate_order_with_prices { > > # tax value = quantity * ecost tax excluded * tax rate > # we should use the unitprice if included >- my $cost_tax_included = $order->{unitprice_tax_included} || $order->{ecost_tax_included}; >- my $cost_tax_excluded = $order->{unitprice_tax_excluded} || $order->{ecost_tax_excluded}; >+ my $cost_tax_included = $order->{unitprice_tax_included} == 0 ? $order->{ecost_tax_included} : $order->{unitprice_tax_included}; >+ my $cost_tax_excluded = $order->{unitprice_tax_excluded} == 0 ? $order->{ecost_tax_excluded} : $order->{unitprice_tax_excluded}; > $order->{tax_value_on_ordering} = ( get_rounded_price($cost_tax_included) - get_rounded_price($cost_tax_excluded) ) * $order->{quantity}; > > } >@@ -2820,7 +2820,7 @@ sub populate_order_with_prices { > > # tax value = quantity * ecost tax included * tax rate > # we should use the unitprice if included >- my $cost_tax_excluded = $order->{unitprice_tax_excluded} || $order->{ecost_tax_excluded}; >+ my $cost_tax_excluded = $order->{unitprice_tax_excluded} == 0 ? $order->{ecost_tax_excluded} : $order->{unitprice_tax_excluded}; > $order->{tax_value_on_ordering} = $order->{quantity} * get_rounded_price($cost_tax_excluded) * $order->{tax_rate_on_ordering}; > } > } >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27203
:
114342
|
114476
|
120051
|
120052
|
120053
|
120249
|
120250
|
120551
|
120552
|
120724
|
120725
|
120765
|
120814
|
120815