Bugzilla – Attachment 56906 Details for
Bug 13321
Fix tax and prices calculation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13321: Recalculate tax_value for partially received orders
Bug-13321-Recalculate-taxvalue-for-partially-recei.patch (text/plain), 2.12 KB, created by
Nick Clemens (kidclamp)
on 2016-10-27 01:01:56 UTC
(
hide
)
Description:
Bug 13321: Recalculate tax_value for partially received orders
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2016-10-27 01:01:56 UTC
Size:
2.12 KB
patch
obsolete
>From 857224ec6c8a99369eaf9b423a928001f4aa8f05 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Mon, 5 Sep 2016 11:11:44 +0200 >Subject: [PATCH] Bug 13321: Recalculate tax_value for partially received > orders > >Test plan: >1. Create an order with at least 2 items >2. Receive only 1 item >3. Check that the tax value of the received order line is correct on > the parcel and invoice pages >4. Check that the tax value of the original order line is correct (on > the basket page for example) >5. Cancel the receipt >6. Check that the tax value of the original order line is correct > >Signed-off-by: Sonia Bouis <koha@univ-lyon3.fr> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > C4/Acquisition.pm | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 2a8a85c..355c914 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -1400,10 +1400,18 @@ sub ModReceiveOrder { > $order->{ordernumber} > ); > >+ # Recalculate tax_value >+ $dbh->do(q| >+ UPDATE aqorders >+ SET tax_value = quantity * ecost_tax_excluded * tax_rate >+ WHERE ordernumber = ? >+ |, undef, $order->{ordernumber}); >+ > delete $order->{ordernumber}; > $order->{budget_id} = ( $budget_id || $order->{budget_id} ); > $order->{quantity} = $quantrec; > $order->{quantityreceived} = $quantrec; >+ $order->{tax_value} = $order->{quantity} * $order->{unitprice_tax_excluded} * $order->{tax_rate}; > $order->{datereceived} = $datereceived; > $order->{invoiceid} = $invoice->{invoiceid}; > $order->{orderstatus} = 'complete'; >@@ -1556,6 +1564,14 @@ sub CancelReceipt { > " receipt"; > return; > } >+ >+ # Recalculate tax_value >+ $dbh->do(q| >+ UPDATE aqorders >+ SET tax_value = quantity * ecost_tax_excluded * tax_rate >+ WHERE ordernumber = ? >+ |, undef, $parent_ordernumber); >+ > _cancel_items_receipt( $ordernumber, $parent_ordernumber ); > # Delete order line > $query = qq{ >-- >2.1.4
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 13321
:
33789
|
33790
|
33791
|
33792
|
33793
|
34432
|
35152
|
35165
|
47489
|
47490
|
47491
|
47492
|
47493
|
47494
|
48867
|
48868
|
48869
|
48870
|
48871
|
48872
|
51080
|
51081
|
51082
|
51083
|
51084
|
51085
|
51643
|
51644
|
51645
|
51646
|
51647
|
51648
|
51649
|
52046
|
55168
|
55415
|
55416
|
55417
|
55418
|
55419
|
55420
|
55421
|
55422
|
55423
|
55427
|
56408
|
56422
|
56423
|
56424
|
56425
|
56426
|
56427
|
56428
|
56429
|
56430
|
56431
|
56432
|
56898
|
56899
|
56900
|
56901
|
56902
|
56903
|
56904
|
56905
| 56906 |
56907
|
56908
|
56909
|
56930
|
56959