details: https://code.openbravo.com/erp/devel/pi/rev/9bf627820d9e
changeset: 33415:9bf627820d9e
user: Mark <markmm82 <at> gmail.com>
date: Fri Feb 09 09:43:33 2018 +0100
summary: Fixes issue 37823: Sales tax selected in Return To Vendor if the
returned goods
receipt does not have a purchase order related
A wrong sales tax was selected in Return To Vendor if the returned goods receipt
does not have a purchase order related.
The Tax field has the Tax Id value of the receipt line being copied, in case
that the good receipt line was created from an order then it will have the tax
id
used on the order line. But in case the goods receipt line was created
manually, as
it lines aren't related to any order lines, the tax received will be NULL, so
it is
needed to get the default Tax to be used in the new generated returned line.
In the case of a Return to Vendor is needed to return the default Purchase Tax
of the
product. In the case of Return from Customer is neede to use the default Sales
tax
of the product. It was fixed passing this parameter taking into account the
processed
order is sales transaction or not.
diffstat:
src/org/openbravo/common/actionhandler/SRMOPickEditLines.java | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diffs (29 lines):
diff -r 7a23607a0b6c -r 9bf627820d9e
src/org/openbravo/common/actionhandler/SRMOPickEditLines.java
--- a/src/org/openbravo/common/actionhandler/SRMOPickEditLines.java Fri Feb
09 09:15:50 2018 +0100
+++ b/src/org/openbravo/common/actionhandler/SRMOPickEditLines.java Fri Feb
09 09:43:33 2018 +0100
@@ -52,6 +52,7 @@
import org.openbravo.service.db.CallStoredProcedure;
import org.openbravo.service.db.DalConnectionProvider;
import org.openbravo.service.db.DbUtility;
+import org.openbravo.service.json.JsonUtils;
/**
*
@@ -213,7 +214,7 @@
tax = shipmentLine.getSalesOrderLine().getTax();
} else {
String taxId = "";
- if (selectedLine.get("tax").equals(null) ||
selectedLine.get("tax").equals("")) {
+ if (JsonUtils.isValueEmpty(selectedLine.get("tax").toString())) {
List<Object> parameters = new ArrayList<Object>();
parameters.add(product.getId());
@@ -228,7 +229,7 @@
} else {
parameters.add(null);
}
- parameters.add("Y");
+ parameters.add(order.isSalesTransaction() ? "Y" : "N");
taxId = (String) CallStoredProcedure.getInstance().call("C_Gettax",
parameters, null);
if (taxId == null || "".equals(taxId)) {
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits