Bugzilla – Attachment 127592 Details for
Bug 28627
Revert the order receive page to display 'Actual cost' as ecost_tax_included/ecost_tax_excluded if unitprice not set
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28627: [alternate] Calculate unitprice if not set
Bug-28627-alternate-Calculate-unitprice-if-not-set.patch (text/plain), 2.89 KB, created by
Nick Clemens (kidclamp)
on 2021-11-12 17:21:35 UTC
(
hide
)
Description:
Bug 28627: [alternate] Calculate unitprice if not set
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-11-12 17:21:35 UTC
Size:
2.89 KB
patch
obsolete
>From 3e14b1705aa763514ec678b3ede26532c4372a48 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 12 Nov 2021 17:15:20 +0000 >Subject: [PATCH] Bug 28627: [alternate] Calculate unitprice if not set > >On bug 23376 the developer was too clever by half. Instead of passing >values to the template we moved to simply passing the order object. > >The calculations that populated the unitprice, however, were simply dropped. > >This patch restores the behaviour of setting unitprice to the estimated cost >by default. We do this conditionally in the template > >To test: > 1 - Create a basket and adding items to it. Set the 'Vendor price' to > '20', do not add an 'Actual cost' > 2 - Close the basket > 3 - Select 'Receive shipment' > 4 - Set a value for vendor invoice > 5 - Receive the order you created > 6 - Observe 'Actual cost' is = 0.00 > 7 - Apply patch > 8 - Refresh the order receival page, and confirm the 'Actual cost' = > 20.00 > 9 - Cancel receipt - reopen basket - edit order - add an actual cost - close >10 - Receive the order again >11 - Confirm the actual price is used >12 - Repeat this whole plan, but ensure the vendor has a different value for > Invoice prices: Include tax >--- > .../intranet-tmpl/prog/en/modules/acqui/orderreceive.tt | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >index 1a19ca32ef..0f84cb4384 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >@@ -377,9 +377,11 @@ > <li> > <label for="unitprice">Actual cost:</label> > [% IF (invoiceincgst) %] >- <input type="text" size="20" name="unitprice" id="unitprice" value="[% order.unitprice_tax_included | $Price on_editing => 1 %]" /> <span class="hint">(tax inclusive)</span> >+ [% SET unitprice = order.unitprice_tax_included > 0 ? order.unitprice_tax_included : order.ecost_tax_included %] >+ <input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price on_editing => 1 %]" /> <span class="hint">(tax inclusive)</span> > [% ELSE %] >- <input type="text" size="20" name="unitprice" id="unitprice" value="[% order.unitprice_tax_excluded | $Price on_editing => 1 %]" /> <span class="hint">(tax exclusive)</span> >+ [% SET unitprice = order.unitprice_tax_included > 0 ? order.unitprice_tax_excluded : order.ecost_tax_excluded %] >+ <input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price on_editing => 1 %]" /> <span class="hint">(tax exclusive)</span> > [% END %] > <label style="font-weight: inherit; float:none;"><input type="checkbox" name="change_currency">Change currency</label> > </li> >-- >2.20.1
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 28627
:
122380
|
127592
|
127597
|
127604