Commit fbe5bffd authored by mnair's avatar mnair

Inside supp code itemchange Added new sql query to first get tax_env and...

Inside supp code itemchange Added new sql query to first get tax_env and tax_class from site_supplier table if not found then from supplier table or else from the current logic 

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@185105 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 490e496c
...@@ -6440,25 +6440,58 @@ public class POrderIC extends ValidatorEJB implements POrderICRemote, ...@@ -6440,25 +6440,58 @@ public class POrderIC extends ValidatorEJB implements POrderICRemote,
stationstanCode = genericUtility.getColumnValue( stationstanCode = genericUtility.getColumnValue(
"station_stan_code", dom); "station_stan_code", dom);
sql = "select stan_code from site where site_code = ? ";
//Changes by mayur on 16-May-2018---[start]
if(taxclassDes == null || taxclassDes.trim().length() == 0 )
{
sql = "select tax_class from site_supplier where site_code = ?" //checking tax_class in site_supplier table
+" and supp_code = ? ";
System.out.println("SQL::"+sql);
pStmt = conn.prepareStatement(sql); pStmt = conn.prepareStatement(sql);
pStmt.setString(1, siteCodeDlv); pStmt.setString(1, siteCodeDlv);
pStmt.setString(2, suppCode);
rs = pStmt.executeQuery(); rs = pStmt.executeQuery();
if (rs.next()) { if (rs.next())
stationCodeto = rs.getString("stan_code"); {
taxclassDes = rs.getString("tax_class") == null ? "" : rs
.getString("tax_class");
// taxclassDes = taxClassSiteSupp;
System.out.println("@@taxClassSiteSupp in site_supplier@@"+taxclassDes);
} }
rs.close(); rs.close();
rs = null; rs = null;
pStmt.close(); pStmt.close();
pStmt = null; pStmt = null;
}
if ("A".equalsIgnoreCase(editFlag)) { if(taxclassDes == null || taxclassDes.trim().length() == 0)
{
sql = "select tax_class from supplier where supp_code = ? "; //checking tax_class in supplier table
//Changes by mayur on 15-May-2018---[start] System.out.println("SQL::"+sql);
if(taxClass == null || taxClass.trim().length() == 0 && taxEnv == null || taxEnv.trim().length() == 0) pStmt = conn.prepareStatement(sql);
pStmt.setString(1, suppCode);
rs = pStmt.executeQuery();
if (rs.next())
{ {
sql = "select tax_class,tax_env from site_supplier where site_code = ?" //checking tax_class,tax_env in site_supplier table taxclassDes = rs.getString("tax_class") == null ? "" : rs
+" supp_code = ? "; .getString("tax_class");
//taxclassDes = taxClassSupplier;
System.out.println("@@taxClassSupplier in supplier@@"+taxclassDes);
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
}
if(taxenvDes == null || taxenvDes.trim().length() == 0)
{
sql = "select tax_env from site_supplier where site_code = ?" //checking tax_env in site_supplier table
+" and supp_code = ? ";
System.out.println("SQL::"+sql); System.out.println("SQL::"+sql);
pStmt = conn.prepareStatement(sql); pStmt = conn.prepareStatement(sql);
...@@ -6467,16 +6500,11 @@ public class POrderIC extends ValidatorEJB implements POrderICRemote, ...@@ -6467,16 +6500,11 @@ public class POrderIC extends ValidatorEJB implements POrderICRemote,
rs = pStmt.executeQuery(); rs = pStmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
taxClass = rs.getString("tax_class") == null ? "" : rs taxenvDes= rs.getString("tax_env") == null ? "" : rs
.getString("tax_class");
taxclassDes = taxClass ;
taxEnv = rs.getString("tax_env") == null ? "" : rs
.getString("tax_env"); .getString("tax_env");
taxenvDes = taxEnv ; //taxenvDes = taxEnvSiteSupp;
System.out.println("@@taxEnvSiteSupp in site_supplier@@"+taxenvDes);
System.out.println("@@taxclassDes in site_supplier@@"+taxclassDes);
System.out.println("@@taxenvDes in site_supplier@@"+taxenvDes);
} }
rs.close(); rs.close();
...@@ -6485,9 +6513,9 @@ public class POrderIC extends ValidatorEJB implements POrderICRemote, ...@@ -6485,9 +6513,9 @@ public class POrderIC extends ValidatorEJB implements POrderICRemote,
pStmt = null; pStmt = null;
} }
if( taxClass == null || taxClass.trim().length() == 0 && taxEnv == null || taxEnv.trim().length() == 0) if(taxenvDes == null || taxenvDes.trim().length() == 0)
{ {
sql = "select tax_class,tax_env from supplier where supp_code = ? "; //checking tax_class,tax_env in supplier table sql = "select tax_env from supplier where supp_code = ? "; //checking tax_class in supplier table
System.out.println("SQL::"+sql); System.out.println("SQL::"+sql);
pStmt = conn.prepareStatement(sql); pStmt = conn.prepareStatement(sql);
...@@ -6495,16 +6523,11 @@ public class POrderIC extends ValidatorEJB implements POrderICRemote, ...@@ -6495,16 +6523,11 @@ public class POrderIC extends ValidatorEJB implements POrderICRemote,
rs = pStmt.executeQuery(); rs = pStmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
taxClass = rs.getString("tax_class") == null ? "" : rs
.getString("tax_class");
taxclassDes = taxClass ;
taxEnv = rs.getString("tax_env") == null ? "" : rs taxenvDes = rs.getString("tax_env") == null ? "" : rs
.getString("tax_env"); .getString("tax_env");
taxenvDes = taxEnv ; //taxenvDes = taxEnvSupplier;
System.out.println("@@taxEnvSupplier in supplier@@"+taxenvDes);
System.out.println("@@taxclassDes in site_supplier@@"+taxclassDes);
System.out.println("@@taxenvDes in site_supplier@@"+taxenvDes);
} }
rs.close(); rs.close();
...@@ -6512,15 +6535,33 @@ public class POrderIC extends ValidatorEJB implements POrderICRemote, ...@@ -6512,15 +6535,33 @@ public class POrderIC extends ValidatorEJB implements POrderICRemote,
pStmt.close(); pStmt.close();
pStmt = null; pStmt = null;
} }
//Changes by mayur on 15-May-2018---[end] //Changes by mayur on 16-May-2018---[end]
if (taxClass == null || taxClass.trim().length() == 0) { sql = "select stan_code from site where site_code = ? ";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, siteCodeDlv);
rs = pStmt.executeQuery();
if (rs.next()) {
stationCodeto = rs.getString("stan_code");
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
if ("A".equalsIgnoreCase(editFlag)) {
if (taxclassDes == null || taxclassDes.trim().length() == 0) {
// taxclassDes = // taxclassDes =
// gf_get_taxclass('S',suppCode,"",siteCodeDlv) // gf_get_taxclass('S',suppCode,"",siteCodeDlv)
taxclassDes = distComm.getTaxClass("S", suppCode, taxclassDes = distComm.getTaxClass("S", suppCode,
"", siteCodeDlv, conn); "", siteCodeDlv, conn);
} else { System.out.println("@@taxclassDes from distComm@@"+taxclassDes);
taxclassDes = taxClass; }
else
{
taxclassDes = "";
System.out.println("@@taxclassDes as empty value@@"+taxclassDes);
} }
if (taxChap == null || taxChap.trim().length() == 0) { if (taxChap == null || taxChap.trim().length() == 0) {
// taxchapDes = gf_get_taxchap("", itemSer, 'S', // taxchapDes = gf_get_taxchap("", itemSer, 'S',
...@@ -6531,17 +6572,20 @@ public class POrderIC extends ValidatorEJB implements POrderICRemote, ...@@ -6531,17 +6572,20 @@ public class POrderIC extends ValidatorEJB implements POrderICRemote,
taxchapDes = taxChap; taxchapDes = taxChap;
} }
if (taxEnv == null || taxEnv.trim().length() == 0) { if (taxenvDes == null || taxenvDes.trim().length() == 0) {
// taxenvDes = gf_get_taxenv(stationstanCode, // taxenvDes = gf_get_taxenv(stationstanCode,
// stationCodeto, taxchapDes, // stationCodeto, taxchapDes,
// taxclassDes,siteCodeDlv) // taxclassDes,siteCodeDlv)
taxenvDes = distComm.getTaxEnv(stationstanCode, taxenvDes = distComm.getTaxEnv(stationstanCode,
stationCodeto, taxchapDes, taxclassDes, stationCodeto, taxchapDes, taxclassDes,
siteCodeDlv, conn); siteCodeDlv, conn);
} else { System.out.println("@@taxenvDes from distComm@@"+taxenvDes);
taxenvDes = taxEnv; }
else
{
taxenvDes = "";
System.out.println("@@taxenvDes as empty value@@"+taxenvDes);
} }
valueXmlString.append("<tax_class>") valueXmlString.append("<tax_class>")
.append("<![CDATA[" + taxclassDes + "]]>") .append("<![CDATA[" + taxclassDes + "]]>")
.append("</tax_class>"); .append("</tax_class>");
......
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