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,87 +6440,128 @@ public class POrderIC extends ValidatorEJB implements POrderICRemote, ...@@ -6440,87 +6440,128 @@ 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)
//Changes by mayur on 15-May-2018---[start] {
if(taxClass == null || taxClass.trim().length() == 0 && taxEnv == null || taxEnv.trim().length() == 0) sql = "select tax_class from supplier where supp_code = ? "; //checking tax_class in supplier table
{
sql = "select tax_class,tax_env from site_supplier where site_code = ?" //checking tax_class,tax_env in site_supplier table
+" supp_code = ? ";
System.out.println("SQL::"+sql); System.out.println("SQL::"+sql);
pStmt = conn.prepareStatement(sql); pStmt = conn.prepareStatement(sql);
pStmt.setString(1, siteCodeDlv); pStmt.setString(1, suppCode);
pStmt.setString(2, suppCode);
rs = pStmt.executeQuery(); rs = pStmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
taxClass = rs.getString("tax_class") == null ? "" : rs taxclassDes = rs.getString("tax_class") == null ? "" : rs
.getString("tax_class"); .getString("tax_class");
taxclassDes = taxClass ; //taxclassDes = taxClassSupplier;
System.out.println("@@taxClassSupplier in supplier@@"+taxclassDes);
taxEnv = rs.getString("tax_env") == null ? "" : rs
.getString("tax_env");
taxenvDes = taxEnv ;
System.out.println("@@taxclassDes in site_supplier@@"+taxclassDes);
System.out.println("@@taxenvDes in site_supplier@@"+taxenvDes);
} }
rs.close(); rs.close();
rs = null; rs = null;
pStmt.close(); pStmt.close();
pStmt = null; 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);
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, siteCodeDlv);
pStmt.setString(2, suppCode);
rs = pStmt.executeQuery();
if (rs.next())
{
taxenvDes= rs.getString("tax_env") == null ? "" : rs
.getString("tax_env");
//taxenvDes = taxEnvSiteSupp;
System.out.println("@@taxEnvSiteSupp in site_supplier@@"+taxenvDes);
}
rs.close();
rs = null;
pStmt.close();
pStmt = null;
}
if(taxenvDes == null || taxenvDes.trim().length() == 0)
{
sql = "select tax_env from supplier where supp_code = ? "; //checking tax_class in supplier table
if( taxClass == null || taxClass.trim().length() == 0 && taxEnv == null || taxEnv.trim().length() == 0) System.out.println("SQL::"+sql);
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, suppCode);
rs = pStmt.executeQuery();
if (rs.next())
{ {
sql = "select tax_class,tax_env from supplier where supp_code = ? "; //checking tax_class,tax_env in supplier table
taxenvDes = rs.getString("tax_env") == null ? "" : rs
System.out.println("SQL::"+sql); .getString("tax_env");
pStmt = conn.prepareStatement(sql); //taxenvDes = taxEnvSupplier;
pStmt.setString(1, suppCode); System.out.println("@@taxEnvSupplier in supplier@@"+taxenvDes);
rs = pStmt.executeQuery();
if (rs.next()) }
{ rs.close();
taxClass = rs.getString("tax_class") == null ? "" : rs rs = null;
.getString("tax_class"); pStmt.close();
taxclassDes = taxClass ; pStmt = null;
}
taxEnv = rs.getString("tax_env") == null ? "" : rs //Changes by mayur on 16-May-2018---[end]
.getString("tax_env");
taxenvDes = taxEnv ; sql = "select stan_code from site where site_code = ? ";
pStmt = conn.prepareStatement(sql);
System.out.println("@@taxclassDes in site_supplier@@"+taxclassDes); pStmt.setString(1, siteCodeDlv);
System.out.println("@@taxenvDes in site_supplier@@"+taxenvDes); rs = pStmt.executeQuery();
if (rs.next()) {
} stationCodeto = rs.getString("stan_code");
rs.close(); }
rs = null; rs.close();
pStmt.close(); rs = null;
pStmt = null; pStmt.close();
} pStmt = null;
//Changes by mayur on 15-May-2018---[end]
if ("A".equalsIgnoreCase(editFlag)) {
if (taxClass == null || taxClass.trim().length() == 0) { 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