Commit a8627b01 authored by prane's avatar prane

Taxes need to set on itemchange of item_code_ord in sale order detail screen...

Taxes need to set on itemchange of item_code_ord in sale order detail screen based on Bill to/Dlv to customer.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@188794 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ae0b7393
......@@ -7992,7 +7992,7 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
String ldtDateStr = "";
boolean lbProceed = false, lbOrdFlag = false;
Timestamp ldtPldate = null, orderDate = null;
String lsItemSer = "", custCodeBill = "", orderType = "", custTaxOpt = "", stanCodeTo="", custCodeTax="", lsSiteCodeDet="",itemCodeDet="";
itemCodeOrd = checkNull(genericUtility.getColumnValue("item_code__ord", dom));
lsQuotNo = checkNull(genericUtility.getColumnValue("quot_no", dom1));
......@@ -8588,10 +8588,11 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
mItemSer = distCommon.getItemSer(itemCodeOrd, lsSiteCode, orderDate, lsCustCode, "C", conn);
toStation = checkNull(genericUtility.getColumnValue("stan_code", dom1));
lsCustCodeDlv = checkNull(genericUtility.getColumnValue("cust_code__dlv", dom1));
lsSiteCodeDet = checkNull(genericUtility.getColumnValue("site_code", dom1));
sql = "Select stan_code From site Where site_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsSiteCode);
//pstmt.setString(1, lsSiteCode);
pstmt.setString(1, lsSiteCodeDet);
rs = pstmt.executeQuery();
if (rs.next()) {
frStation = rs.getString("stan_code");
......@@ -8605,17 +8606,60 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
lsTaxClassHdr = checkNull(genericUtility.getColumnValue("tax_class", dom1));
lsTaxEnvHdr = checkNull(genericUtility.getColumnValue("tax_env", dom1));
if (lsTaxChapHdr == null || lsTaxChapHdr.trim().length() == 0) {
lsTaxChap = distCommon.getTaxChap(itemCodeOrd, mItemSer, "C", lsCustCode, lsSiteCode, conn);
} else {
lsTaxChap = lsTaxChapHdr;
//Changed by Pavan Rane on 06AUG18 [to set taxes based on a cust_tax_opt parameter in order type]
itemCodeDet = checkNull(genericUtility.getColumnValue("item_code__ord", dom));
lsItemSer = checkNull(genericUtility.getColumnValue("item_ser", dom1));
custCodeBill = checkNull(genericUtility.getColumnValue("cust_code__bil", dom1));
orderType = checkNull(genericUtility.getColumnValue("order_type",dom1));
sql = "select cust_tax_opt from sordertype where order_type = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, orderType);
rs = pstmt.executeQuery();
if (rs.next()) {
custTaxOpt = checkNull(rs.getString("cust_tax_opt"));
}
if (lsTaxClassHdr == null || lsTaxChapHdr.trim().length() == 0) {
lsTaxClass = distCommon.getTaxClass("C", lsCustCodeDlv, itemCodeOrd, lsSiteCode, conn);
} else {
lsTaxClass = lsTaxClassHdr;
pstmt.close();
pstmt = null;
rs.close();
rs = null;
System.out.println("orderType:["+orderType+"] custTaxOpt["+custTaxOpt+"]");
//for default customer as dlv_cust if null found
if(custTaxOpt == null || custTaxOpt.trim().length() == 0 || "null".equals(custTaxOpt))
{
custTaxOpt = "0";
}
sql = "select stan_code from customer where cust_code = ?";
pstmt = conn.prepareStatement(sql);
if("1".equals(custTaxOpt)) {
pstmt.setString(1, custCodeBill);
custCodeTax = custCodeBill;
}else if("0".equals(custTaxOpt)) {
pstmt.setString(1, lsCustCodeDlv);
custCodeTax = lsCustCodeDlv;
}
if (lsTaxEnvHdr == null || lsTaxEnvHdr.trim().length() == 0) {
rs = pstmt.executeQuery();
if (rs.next()) {
stanCodeTo = rs.getString("stan_code");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
System.out.println(">> 8650 stanCodeTo ["+stanCodeTo+"]");
//if (lsTaxChapHdr == null || lsTaxChapHdr.trim().length() == 0) {
lsTaxChap = distCommon.getTaxChap(itemCodeDet, lsItemSer, "C", custCodeTax, lsSiteCodeDet, conn);
//} else {
//lsTaxChap = lsTaxChapHdr;
//}
//if (lsTaxClassHdr == null || lsTaxChapHdr.trim().length() == 0) {
lsTaxClass = distCommon.getTaxClass("C", custCodeTax, itemCodeDet, lsSiteCodeDet, conn);
//} else {
//lsTaxClass = lsTaxClassHdr;
//}
//if (lsTaxEnvHdr == null || lsTaxEnvHdr.trim().length() == 0) {
sql = "select tax_env from customeritem where cust_code = ? and item_code =?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsCustCode);
......@@ -8630,12 +8674,12 @@ public class SalesOrderIC extends ValidatorEJB implements SalesOrderICLocal, Sal
pstmt = null;
if (lsTaxEnv == null || lsTaxEnv.trim().length() == 0) {
lsTaxEnv = distCommon.getTaxEnv(frStation, toStation, lsTaxChap, lsTaxClass, lsSiteCode,
conn);
}
} else {
lsTaxEnv = lsTaxEnvHdr;
lsTaxEnv = distCommon.getTaxEnv(frStation, stanCodeTo, lsTaxChap, lsTaxClass, lsSiteCodeDet,conn);
}
///} else {
// lsTaxEnv = lsTaxEnvHdr;
//}
//Pavan R End
valueXmlString.append("<tax_chap>").append("<![CDATA[" + lsTaxChap + "]]>").append("</tax_chap>");
setNodeValue(dom, "tax_chap", getAbsString(lsTaxChap));
valueXmlString.append("<tax_class>").append("<![CDATA[" + lsTaxClass + "]]>")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment