Bugzilla – Attachment 105866 Details for
Bug 25750
Fallback to ecost_tax_included, ecost_tax_excluded not happening when no 'Actual cost' entered
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25750: fix fallback to ecost_tax_included/ecost_tax_excluded
Bug-25750-fix-fallback-to-ecosttaxincludedecosttax.patch (text/plain), 2.58 KB, created by
Alex Buckley
on 2020-06-14 23:14:11 UTC
(
hide
)
Description:
Bug 25750: fix fallback to ecost_tax_included/ecost_tax_excluded
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2020-06-14 23:14:11 UTC
Size:
2.58 KB
patch
obsolete
>From 3d00c8ee268814e1c9bd6866eb265ae773c1afe2 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Sun, 14 Jun 2020 22:41:03 +0000 >Subject: [PATCH] Bug 25750: fix fallback to > ecost_tax_included/ecost_tax_excluded > >If 'Actual cost' has not been set then it has the value of 0.00 which >Perl evaluates to true so this patchset resets it to 0, so the fallback >to ecost_tax_included/ecost_tax_excluded happens. > >Test plan: >1. Add item to acquisition basket (make sure the vendor has: tax rate: 15%, 'List prices: Include tax', 'Invoice prices: Include tax') >2. Set 'Vendor price' = 10 and do not set 'Actual cost' >3. Save order >4. Observe basket.pl shows 'Total tax exc.' has a value of 0.00 and GST >column has value of -8.70 > >5. Jump into the database: >select tax_value_on_ordering from aqorders where >ordernumber=<ordernumber>; >[You can get the ordernumber from clicking on the 'Modify' line the item >is listed in] >6. Observe a negative value: -8.70 > >7. Apply patch and restart plack >8. Add a second item to the basket >9. Set 'Vendor price' = 10 and don't set 'Actual cost' >10. Save order >11. Observe basket.pl shows 'Total tax exc' has value of 8.70 and GST >has value of 1.30 >12. Repeat step 5 and observe tax_value_on_ordering = 1.30 > >Sponsored-by: Horowhenua District Council, NZ >--- > C4/Acquisition.pm | 1 + > acqui/basket.pl | 2 ++ > 2 files changed, 3 insertions(+) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index ca6058abb2..c6c2f3c087 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -2883,6 +2883,7 @@ sub populate_order_with_prices { > if ( $bookseller->listincgst ) { > > # The user entered the prices tax included >+ $order->{unitprice} = 0 if $order->{unitprice} == '0.00'; > $order->{unitprice_tax_included} = $order->{unitprice}; > $order->{rrp_tax_included} = $order->{rrp}; > >diff --git a/acqui/basket.pl b/acqui/basket.pl >index 92f3614676..94c2cfff27 100755 >--- a/acqui/basket.pl >+++ b/acqui/basket.pl >@@ -459,6 +459,8 @@ sub get_order_infos { > $line{budget_name} = $budget->{budget_name}; > > # If we have an actual cost that should be the total, otherwise use the ecost >+ $line{unitprice_tax_included} = 0 if $line{unitprice_tax_included} == '0.00'; >+ $line{unitprice_tax_excluded} = 0 if $line{unitprice_tax_excluded} == '0.00'; > my $cost_tax_included = $line{unitprice_tax_included} || $line{ecost_tax_included}; > my $cost_tax_excluded = $line{unitprice_tax_excluded} || $line{ecost_tax_excluded}; > $line{total_tax_included} = get_rounded_price($cost_tax_included) * $line{quantity}; >-- >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 25750
:
105866
|
105872
|
106217
|
106244
|
106410