Commit 04cbdd86 authored by ssalve's avatar ssalve

changes for editable and noneditable for placeofsupply,gstin num,gst_type and doc_type on 4AUG2017


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106489 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e5c6c81c
package ibase.webitm.ejb.gst; package ibase.webitm.ejb.gst;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
import ibase.webitm.ejb.ValidatorEJB; import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException; import ibase.webitm.utility.ITMException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.Connection; import java.sql.Connection;
...@@ -12,7 +13,7 @@ import java.util.ArrayList; ...@@ -12,7 +13,7 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import ibase.webitm.ejb.fin.FinCommon; import ibase.webitm.ejb.fin.FinCommon;
import javax.ejb.Stateless; import javax.ejb.Stateless;
import ibase.webitm.util.gst.GSTCommonUtil;
import org.apache.log4j.spi.ErrorCode; import org.apache.log4j.spi.ErrorCode;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Node; import org.w3c.dom.Node;
...@@ -25,6 +26,8 @@ import org.w3c.dom.NodeList; ...@@ -25,6 +26,8 @@ import org.w3c.dom.NodeList;
public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
{ {
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
//Added by sarita on 4AUG2017
GSTCommonUtil gstUtility = new GSTCommonUtil();
String GSTINFORMAT_REGEX = "[0-9]{2}[a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}[1-9A-Za-z]{1}[Z]{1}[0-9a-zA-Z]{1}"; String GSTINFORMAT_REGEX = "[0-9]{2}[a-zA-Z]{5}[0-9]{4}[a-zA-Z]{1}[1-9A-Za-z]{1}[Z]{1}[0-9a-zA-Z]{1}";
String GSTN_CODEPOINT_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; String GSTN_CODEPOINT_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
...@@ -121,8 +124,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -121,8 +124,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
childNodeName = childNode.getNodeName(); childNodeName = childNode.getNodeName();
if("gst_type".equalsIgnoreCase(childNodeName)) if("gst_type".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();//System.out.println("childNodeName:::"+childNodeName+"childNode["+childNode+"]"+"gst_type["+gst_type+"]");
//System.out.println("childNodeName:::"+childNodeName+"childNode["+childNode+"]"+"gst_type["+gst_type+"]");
if(gst_type == null || gst_type.trim().length() == 0) if(gst_type == null || gst_type.trim().length() == 0)
{ {
errCode = "NULLDOCTYP"; errCode = "NULLDOCTYP";
...@@ -131,7 +133,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -131,7 +133,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
else else
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
sql = "select count(*) as cnt from gencodes where fld_name='GST_TYPE' and fld_value=?"; sql = "select count(*) as cnt from gencodes where fld_name='GST_TYPE' and fld_value=?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,gst_type); pstmt.setString(1,gst_type);
...@@ -161,155 +163,157 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -161,155 +163,157 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
else if("doc_type".equalsIgnoreCase(childNodeName)) else if("doc_type".equalsIgnoreCase(childNodeName))
{ {
doc_type = checkNull(genericUtility.getColumnValue("doc_type", dom)).trim(); doc_type = gstUtility.checkNull(genericUtility.getColumnValue("doc_type", dom)).trim();
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
//System.out.println("INPUT VALUE"+"Document Type is ["+doc_type+"]"+"gst_type["+gst_type+"]"); //System.out.println("INPUT VALUE"+"Document Type is ["+doc_type+"]"+"gst_type["+gst_type+"]");
}//end of if block for doc_type }//end of if block for doc_type
else if("tax_reg_no".equalsIgnoreCase(childNodeName)) else if("tax_reg_no".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
tax_reg_no = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim(); tax_reg_no = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim();
//System.out.println("INPUT VALUE"+"tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"); //System.out.println("INPUT VALUE"+"tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]");
}//end of if block for tax_reg_no }//end of if block for tax_reg_no
else if("name".equalsIgnoreCase(childNodeName)) else if("name".equalsIgnoreCase(childNodeName))
{ {
tax_reg_no = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim(); tax_reg_no = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim();
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
name = checkNull(genericUtility.getColumnValue("name", dom)).trim(); name = gstUtility.checkNull(genericUtility.getColumnValue("name", dom)).trim();
//System.out.println("INPUT VALUE"+"tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"name["+name+"]"); //System.out.println("INPUT VALUE"+"tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"name["+name+"]");
}//end of if block for name }//end of if block for name
else if("addr1".equalsIgnoreCase(childNodeName)) else if("addr1".equalsIgnoreCase(childNodeName))
{ {
tax_reg_no = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim(); tax_reg_no = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim();
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
addr1 = checkNull(genericUtility.getColumnValue("addr1", dom)).trim(); addr1 = gstUtility.checkNull(genericUtility.getColumnValue("addr1", dom)).trim();
//System.out.println("INPUT VALUE"+"tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"addr1["+addr1+"]"); //System.out.println("INPUT VALUE"+"tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"addr1["+addr1+"]");
}//end of if block for addr1 }//end of if block for addr1
else if("addr2".equalsIgnoreCase(childNodeName)) else if("addr2".equalsIgnoreCase(childNodeName))
{ {
tax_reg_no = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim(); tax_reg_no = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim();
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
addr2 = checkNull(genericUtility.getColumnValue("addr2", dom)).trim(); addr2 = gstUtility.checkNull(genericUtility.getColumnValue("addr2", dom)).trim();
//System.out.println("INPUT VALUE"+"tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"addr2["+addr2+"]"); //System.out.println("INPUT VALUE"+"tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"addr2["+addr2+"]");
}//end of if block for addr2 }//end of if block for addr2
else if("addr3".equalsIgnoreCase(childNodeName)) else if("addr3".equalsIgnoreCase(childNodeName))
{ {
tax_reg_no = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim(); tax_reg_no = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim();
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
addr3 = checkNull(genericUtility.getColumnValue("addr3", dom)).trim(); addr3 = gstUtility.checkNull(genericUtility.getColumnValue("addr3", dom)).trim();
//System.out.println("INPUT VALUE"+"tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"addr3["+addr3+"]"); //System.out.println("INPUT VALUE"+"tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"addr3["+addr3+"]");
}//end of if block for addr3 }//end of if block for addr3
else if("city".equalsIgnoreCase(childNodeName)) else if("city".equalsIgnoreCase(childNodeName))
{ {
tax_reg_no = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim(); tax_reg_no = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim();
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
city = checkNull(genericUtility.getColumnValue("city", dom)).trim(); city = gstUtility.checkNull(genericUtility.getColumnValue("city", dom)).trim();
//System.out.println("INPUT VALUE"+"tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"city["+city+"]"); //System.out.println("INPUT VALUE"+"tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"city["+city+"]");
}//end of if block for city }//end of if block for city
else if("gst_state_code".equalsIgnoreCase(childNodeName)) else if("gst_state_code".equalsIgnoreCase(childNodeName))
{ {
tax_reg_no = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim(); tax_reg_no = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim();
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
state = checkNull(genericUtility.getColumnValue("gst_state_code", dom)).trim(); state = gstUtility.checkNull(genericUtility.getColumnValue("gst_state_code", dom)).trim();
//System.out.println("INPUT VALUE"+"tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"state["+state+"]"); //System.out.println("INPUT VALUE"+"tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"state["+state+"]");
}//end of if block for state }//end of if block for state
else if("pin".equalsIgnoreCase(childNodeName)) else if("pin".equalsIgnoreCase(childNodeName))
{ {
tax_reg_no = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim(); tax_reg_no = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim();
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
pin = checkNull(genericUtility.getColumnValue("pin", dom)).trim(); pin = gstUtility.checkNull(genericUtility.getColumnValue("pin", dom)).trim();
//System.out.println("INPUT VALUE"+"tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"pin["+pin+"]"); //System.out.println("INPUT VALUE"+"tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"pin["+pin+"]");
}//end of if block for pin }//end of if block for pin
//added by sarita on 21JUL2017 //added by sarita on 21JUL2017
else if("cust_name".equalsIgnoreCase(childNodeName)) else if("cust_name".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
cust_name = checkNull(genericUtility.getColumnValue("cust_name", dom)).trim(); cust_name = gstUtility.checkNull(genericUtility.getColumnValue("cust_name", dom)).trim();
//System.out.println("INPUT VALUE"+"tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"name["+name+"]"); //System.out.println("INPUT VALUE"+"tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"name["+name+"]");
}//end of if block for name }//end of if block for name
else if("gst_code_state".equalsIgnoreCase(childNodeName)) else if("gst_code_state".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
state_code = checkNull(genericUtility.getColumnValue("gst_code_state", dom)).trim(); state_code = gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom)).trim();
doc_type = gstUtility.checkNull(genericUtility.getColumnValue("doc_type", dom)).trim();
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"gst_code_state["+state_code+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"gst_code_state["+state_code+"]");
}//end of if block for gst_code_state }//end of if block for gst_code_state
else if("doc_no".equalsIgnoreCase(childNodeName)) else if("doc_no".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
doc_no = checkNull(genericUtility.getColumnValue("doc_no", dom)).trim(); doc_no = gstUtility.checkNull(genericUtility.getColumnValue("doc_no", dom)).trim();
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"doc_no["+doc_no+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"doc_no["+doc_no+"]");
}//end of if block for doc_no }//end of if block for doc_no
else if("doc_date".equalsIgnoreCase(childNodeName)) else if("doc_date".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
doc_date = checkNull(genericUtility.getColumnValue("doc_date", dom)).trim(); doc_date = gstUtility.checkNull(genericUtility.getColumnValue("doc_date", dom)).trim();
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"doc_date["+doc_date+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"doc_date["+doc_date+"]");
}//end of if block for doc_date }//end of if block for doc_date
else if("amount".equalsIgnoreCase(childNodeName)) else if("amount".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
amount = checkNull(genericUtility.getColumnValue("amount", dom)).trim(); amount = gstUtility.checkNull(genericUtility.getColumnValue("amount", dom)).trim();
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"amount["+amount+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"amount["+amount+"]");
}//end of if block for amount }//end of if block for amount
else if("reverse_chrg".equalsIgnoreCase(childNodeName)) else if("reverse_chrg".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
reverse_chrg = checkNull(genericUtility.getColumnValue("reverse_chrg", dom)).trim(); reverse_chrg = gstUtility.checkNull(genericUtility.getColumnValue("reverse_chrg", dom)).trim();
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"reverse_chrg["+reverse_chrg+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"reverse_chrg["+reverse_chrg+"]");
}//end of if block for reverse_chrg }//end of if block for reverse_chrg
else if("ecom_reg_no".equalsIgnoreCase(childNodeName)) else if("ecom_reg_no".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
doc_type = checkNull(genericUtility.getColumnValue("doc_type", dom)).trim(); doc_type = gstUtility.checkNull(genericUtility.getColumnValue("doc_type", dom)).trim();
ecomRegNo = checkNull(genericUtility.getColumnValue("ecom_reg_no", dom)).trim(); ecomRegNo = gstUtility.checkNull(genericUtility.getColumnValue("ecom_reg_no", dom)).trim();
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"doc_type["+doc_type+"]"+"ecomRegNo["+ecomRegNo+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"doc_type["+doc_type+"]"+"ecomRegNo["+ecomRegNo+"]");
}//end of if block for ecom_reg_no }//end of if block for ecom_reg_no
else if("ref_id__inv".equalsIgnoreCase(childNodeName)) else if("ref_id__inv".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
ref_id__inv = checkNull(genericUtility.getColumnValue("ref_id__inv", dom)).trim(); ref_id__inv = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom)).trim();
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"ref_id__inv["+ref_id__inv+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"ref_id__inv["+ref_id__inv+"]");
}//end of if block for ref_id__inv }//end of if block for ref_id__inv
else if("ref_date__inv".equalsIgnoreCase(childNodeName)) else if("ref_date__inv".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
ref_date__inv = checkNull(genericUtility.getColumnValue("ref_date__inv", dom)).trim(); ref_date__inv = gstUtility.checkNull(genericUtility.getColumnValue("ref_date__inv", dom)).trim();
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"ref_date__inv["+ref_date__inv+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"ref_date__inv["+ref_date__inv+"]");
}//end of if block for ref_date__inv }//end of if block for ref_date__inv
else if("order_no".equalsIgnoreCase(childNodeName)) else if("order_no".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
orderNo = checkNull(genericUtility.getColumnValue("order_no", dom)).trim(); orderNo = gstUtility.checkNull(genericUtility.getColumnValue("order_no", dom)).trim();
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"orderNo["+orderNo+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"orderNo["+orderNo+"]");
}//end of if block for order_no }//end of if block for order_no
else if("lr_no".equalsIgnoreCase(childNodeName)) else if("lr_no".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
lr_no = checkNull(genericUtility.getColumnValue("lr_no", dom)).trim(); lr_no = gstUtility.checkNull(genericUtility.getColumnValue("lr_no", dom)).trim();
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"lr_no["+lr_no+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"lr_no["+lr_no+"]");
}//end of if block for lr_no }//end of if block for lr_no
else if("lr_date".equalsIgnoreCase(childNodeName)) else if("lr_date".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
lr_date = checkNull(genericUtility.getColumnValue("lr_date", dom)).trim(); lr_date = gstUtility.checkNull(genericUtility.getColumnValue("lr_date", dom)).trim();
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"lr_date["+lr_date+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"lr_date["+lr_date+"]");
}//end of if block for lr_date }//end of if block for lr_date
}//end of for loop }//end of for loop
...@@ -357,7 +361,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -357,7 +361,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
// *************************** Validation for tax_reg_no [end] *************************************** // *************************** Validation for tax_reg_no [end] ***************************************
// Removed validation for name , state, city and pin by sarita on 20-07-2017 // Removed validation for name , state, city and pin by sarita on 20-07-2017
// *************************** Validation for name [start] ******************************************* // *************************** Validation for name [start] *******************************************
// *************************** Validation for name [end] ********************************************* // *************************** Validation for name [end] *********************************************
// *************************** Validation for city [start] ******************************************* // *************************** Validation for city [start] *******************************************
...@@ -386,7 +390,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -386,7 +390,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
// *************************** Validation for cust_name [end] ********************************************* // *************************** Validation for cust_name [end] *********************************************
// **************************** Validation for Place of Supply [start] ****************************** // **************************** Validation for Place of Supply [start] ******************************
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type) if("I".equalsIgnoreCase(gst_type) && ("R".equalsIgnoreCase(doc_type)) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type)
|| "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type)) || "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type))
{ {
if(state_code == null || state_code.trim().length() == 0) if(state_code == null || state_code.trim().length() == 0)
...@@ -396,6 +400,21 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -396,6 +400,21 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
errFields.add("state_code"); errFields.add("state_code");
} }
} }
//Added by sarita on 4AUG2017
else if("I".equalsIgnoreCase(gst_type))
{
if("DE".equalsIgnoreCase(doc_type) || "Z".equalsIgnoreCase(doc_type))
{
state_code = gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom1)).trim();
loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
if((state_code != null) && (state_code.equalsIgnoreCase(loginSiteCode)))
{
errCode = "INVDPLSUPP";
errList.add(errCode);
errFields.add("state_code");
}
}
}
// *************************** Validation for Place of Supply [end] ********************************* // *************************** Validation for Place of Supply [end] *********************************
// *************************** Validation for Document Number [start] ******************************** // *************************** Validation for Document Number [start] ********************************
...@@ -425,8 +444,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -425,8 +444,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
// Added by sarita on 14/07/2017 [start] // Added by sarita on 14/07/2017 [start]
else if(doc_date != null && doc_date.trim().length() > 0) else if(doc_date != null && doc_date.trim().length() > 0)
{ {
finalCode = checkNull(genericUtility.getColumnValue("prd_code", dom)); finalCode = gstUtility.checkNull(genericUtility.getColumnValue("prd_code", dom));
rec_type = checkNull(genericUtility.getColumnValue("rec_type", dom)); rec_type = gstUtility.checkNull(genericUtility.getColumnValue("rec_type", dom));
System.out.println("finalCode::["+finalCode+"]"+"loginSiteCode ::["+loginSite+"]"); System.out.println("finalCode::["+finalCode+"]"+"loginSiteCode ::["+loginSite+"]");
sql = "select count(*) as cnt from gst_data_hdr where prd_code=? and rec_type=? and site_code=? and submit_status=?"; sql = "select count(*) as cnt from gst_data_hdr where prd_code=? and rec_type=? and site_code=? and submit_status=?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -474,22 +493,6 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -474,22 +493,6 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
// ************************* Validation for Amount [end] ********************************************* // ************************* Validation for Amount [end] *********************************************
// ******************* Validation for Ecommerce GTIN Number [start] ***************************
// Commented by sarita on 28JUL2017
/* if("I".equalsIgnoreCase(gst_type))
{
if("DE".equalsIgnoreCase(doc_type) || "Z".equalsIgnoreCase(doc_type))
{
if(ecomRegNo == null || ecomRegNo.trim().length() == 0)
{
errCode = "NULLECOMNO";
errList.add(errCode);
errFields.add("ecom_reg_no");
}
}
}*/
// ******************* Validation for Ecommerce GTIN Number [end] ***************************
// ************************* Validation for ref_id__inv [start] ************************************** // ************************* Validation for ref_id__inv [start] **************************************
if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type)) if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type))
{ {
...@@ -570,113 +573,113 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -570,113 +573,113 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
System.out.println("childNodeNameForDetail2:::"+childNodeName+"childNode["+childNode+"]"); System.out.println("childNodeNameForDetail2:::"+childNodeName+"childNode["+childNode+"]");
if("gs_code".equalsIgnoreCase(childNodeName)) if("gs_code".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
gs_code = checkNull(genericUtility.getColumnValue("gs_code", dom)).trim(); gs_code = gstUtility.checkNull(genericUtility.getColumnValue("gs_code", dom)).trim();
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"gs_code["+gs_code+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"gs_code["+gs_code+"]");
}//end of if block for GS Code }//end of if block for GS Code
else if("quantity".equalsIgnoreCase(childNodeName)) else if("quantity".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
quantity = checkNull(genericUtility.getColumnValue("quantity", dom)).trim(); quantity = gstUtility.checkNull(genericUtility.getColumnValue("quantity", dom)).trim();
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"quantity["+quantity+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"quantity["+quantity+"]");
}//end of if block for quantity }//end of if block for quantity
else if("unit".equalsIgnoreCase(childNodeName)) else if("unit".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
unit = checkNull(genericUtility.getColumnValue("unit", dom)).trim(); unit = gstUtility.checkNull(genericUtility.getColumnValue("unit", dom)).trim();
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"unit["+unit+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"unit["+unit+"]");
}//end of if block for unit }//end of if block for unit
else if("taxable_amt".equalsIgnoreCase(childNodeName)) else if("taxable_amt".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
taxable_amt = checkNull(genericUtility.getColumnValue("taxable_amt", dom)).trim(); taxable_amt = gstUtility.checkNull(genericUtility.getColumnValue("taxable_amt", dom)).trim();
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"taxable_amt["+taxable_amt+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"taxable_amt["+taxable_amt+"]");
}//end of if block for taxable_amt }//end of if block for taxable_amt
else if("gst_rate".equalsIgnoreCase(childNodeName)) else if("gst_rate".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
doc_type = checkNull(genericUtility.getColumnValue("doc_type", dom1)).trim(); doc_type = gstUtility.checkNull(genericUtility.getColumnValue("doc_type", dom1)).trim();
gst_rate = checkNull(genericUtility.getColumnValue("gst_rate", dom)).trim(); gst_rate = gstUtility.checkNull(genericUtility.getColumnValue("gst_rate", dom)).trim();
// Added by sarita on 14/07/2017 // Added by sarita on 14/07/2017
gstRate = converStringToDouble(checkNull(genericUtility.getColumnValue("gst_rate", dom)).trim()); gstRate = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("gst_rate", dom)).trim());
taxable_amt = checkNull(genericUtility.getColumnValue("taxable_amt", dom)).trim(); taxable_amt = gstUtility.checkNull(genericUtility.getColumnValue("taxable_amt", dom)).trim();
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"doc_type["+doc_type+"]"+"gst_rate["+gst_rate+"]"+"gstRate["+gstRate+"]"+"taxable_amt["+taxable_amt+"]"); System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"doc_type["+doc_type+"]"+"gst_rate["+gst_rate+"]"+"gstRate["+gstRate+"]"+"taxable_amt["+taxable_amt+"]");
}//end of if block for gst_rate }//end of if block for gst_rate
else if("igst_perc".equalsIgnoreCase(childNodeName)) else if("igst_perc".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
state_code = checkNull(genericUtility.getColumnValue("gst_code_state", dom1)).trim(); state_code = gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom1)).trim();
loginSiteCode = checkNull(getStateFromLoginSite(loginSite,conn)); loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
igst_perc = checkNull(genericUtility.getColumnValue("igst_perc", dom)).trim(); igst_perc = gstUtility.checkNull(genericUtility.getColumnValue("igst_perc", dom)).trim();
igst_percVal = converStringToDouble(checkNull(genericUtility.getColumnValue("igst_perc", dom)).trim()); igst_percVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("igst_perc", dom)).trim());
state_code_cdn = getGstCodeForCDNR(dom,conn); state_code_cdn = getGstCodeForCDNR(dom,conn);
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"state_code["+state_code+"]"+"loginSiteCode["+loginSiteCode+"]"+"igst_perc["+igst_perc+"]"+"igst_percVal["+igst_percVal+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"state_code["+state_code+"]"+"loginSiteCode["+loginSiteCode+"]"+"igst_perc["+igst_perc+"]"+"igst_percVal["+igst_percVal+"]");
}//end of if block for igst_perc }//end of if block for igst_perc
else if("igst_amt".equalsIgnoreCase(childNodeName)) else if("igst_amt".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
state_code = checkNull(genericUtility.getColumnValue("gst_code_state", dom1)).trim(); state_code = gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom1)).trim();
loginSiteCode = checkNull(getStateFromLoginSite(loginSite,conn)); loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
igst_amt = checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim(); igst_amt = gstUtility.checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim();
igst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim()); igst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim());
state_code_cdn = getGstCodeForCDNR(dom,conn); state_code_cdn = getGstCodeForCDNR(dom,conn);
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"state_code["+state_code+"]"+"loginSiteCode["+loginSiteCode+"]"+"igst_amt["+igst_amt+"]"+"igst_amtVal["+igst_amtVal+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"state_code["+state_code+"]"+"loginSiteCode["+loginSiteCode+"]"+"igst_amt["+igst_amt+"]"+"igst_amtVal["+igst_amtVal+"]");
}//end of if block for igst_amt }//end of if block for igst_amt
else if("cgst_perc".equalsIgnoreCase(childNodeName)) else if("cgst_perc".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
state_code = checkNull(genericUtility.getColumnValue("gst_code_state", dom1)).trim(); state_code = gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom1)).trim();
cgst_perc = checkNull(genericUtility.getColumnValue("cgst_perc", dom)).trim(); cgst_perc = gstUtility.checkNull(genericUtility.getColumnValue("cgst_perc", dom)).trim();
loginSiteCode = checkNull(getStateFromLoginSite(loginSite,conn)); loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
cgst_percVal = converStringToDouble(checkNull(genericUtility.getColumnValue("cgst_perc", dom)).trim()); cgst_percVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("cgst_perc", dom)).trim());
state_code_cdn = getGstCodeForCDNR(dom,conn); state_code_cdn = getGstCodeForCDNR(dom,conn);
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"state_code["+state_code+"]"+"cgst_perc["+cgst_perc+"]"+"loginSiteCode["+loginSiteCode+"]"+"cgst_percVal["+cgst_percVal+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"state_code["+state_code+"]"+"cgst_perc["+cgst_perc+"]"+"loginSiteCode["+loginSiteCode+"]"+"cgst_percVal["+cgst_percVal+"]");
}//end of if block for cgst_perc }//end of if block for cgst_perc
else if("cgst_amt".equalsIgnoreCase(childNodeName)) else if("cgst_amt".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
state_code = checkNull(genericUtility.getColumnValue("gst_code_state", dom1)).trim(); state_code = gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom1)).trim();
cgst_amt = checkNull(genericUtility.getColumnValue("cgst_amt", dom)).trim(); cgst_amt = gstUtility.checkNull(genericUtility.getColumnValue("cgst_amt", dom)).trim();
loginSiteCode = checkNull(getStateFromLoginSite(loginSite,conn)); loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
cgst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("cgst_amt", dom)).trim()); cgst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("cgst_amt", dom)).trim());
state_code_cdn = getGstCodeForCDNR(dom,conn); state_code_cdn = getGstCodeForCDNR(dom,conn);
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"state_code["+state_code+"]"+"cgst_amt["+cgst_amt+"]"+"loginSiteCode["+loginSiteCode+"]"+"cgst_amtVal["+cgst_amtVal+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"state_code["+state_code+"]"+"cgst_amt["+cgst_amt+"]"+"loginSiteCode["+loginSiteCode+"]"+"cgst_amtVal["+cgst_amtVal+"]");
}//end of if block for cgst_amt }//end of if block for cgst_amt
else if("sgst_perc".equalsIgnoreCase(childNodeName)) else if("sgst_perc".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
state_code = checkNull(genericUtility.getColumnValue("gst_code_state", dom1)).trim(); state_code = gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom1)).trim();
sgst_perc = checkNull(genericUtility.getColumnValue("sgst_perc", dom)).trim(); sgst_perc = gstUtility.checkNull(genericUtility.getColumnValue("sgst_perc", dom)).trim();
loginSiteCode = checkNull(getStateFromLoginSite(loginSite,conn)); loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
sgst_percVal = converStringToDouble(checkNull(genericUtility.getColumnValue("sgst_perc", dom)).trim()); sgst_percVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("sgst_perc", dom)).trim());
state_code_cdn = getGstCodeForCDNR(dom,conn); state_code_cdn = getGstCodeForCDNR(dom,conn);
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"state_code["+state_code+"]"+"sgst_perc["+sgst_perc+"]"+"loginSiteCode["+loginSiteCode+"]"+"sgst_percVal["+sgst_percVal+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"state_code["+state_code+"]"+"sgst_perc["+sgst_perc+"]"+"loginSiteCode["+loginSiteCode+"]"+"sgst_percVal["+sgst_percVal+"]");
}//end of if block for sgst_perc }//end of if block for sgst_perc
else if("sgst_amt".equalsIgnoreCase(childNodeName)) else if("sgst_amt".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
state_code = checkNull(genericUtility.getColumnValue("gst_code_state", dom1)).trim(); state_code = gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom1)).trim();
sgst_amt = checkNull(genericUtility.getColumnValue("sgst_amt", dom)).trim(); sgst_amt = gstUtility.checkNull(genericUtility.getColumnValue("sgst_amt", dom)).trim();
loginSiteCode = checkNull(getStateFromLoginSite(loginSite,conn)); loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
sgst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("sgst_amt", dom)).trim()); sgst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("sgst_amt", dom)).trim());
state_code_cdn = getGstCodeForCDNR(dom,conn); state_code_cdn = getGstCodeForCDNR(dom,conn);
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"state_code["+state_code+"]"+"sgst_amt["+sgst_amt+"]"+"loginSiteCode["+loginSiteCode+"]"+"sgst_amtVal["+sgst_amtVal+"]"); //System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"state_code["+state_code+"]"+"sgst_amt["+sgst_amt+"]"+"loginSiteCode["+loginSiteCode+"]"+"sgst_amtVal["+sgst_amtVal+"]");
}//end of if block for sgst_amt }//end of if block for sgst_amt
else if("itc_type".equalsIgnoreCase(childNodeName)) else if("itc_type".equalsIgnoreCase(childNodeName))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim(); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
itc_type = checkNull(genericUtility.getColumnValue("itc_type", dom)).trim(); itc_type = gstUtility.checkNull(genericUtility.getColumnValue("itc_type", dom)).trim();
//System.out.println("gst_type["+gst_type+"]"+"itc_type["+itc_type+"]"); //System.out.println("gst_type["+gst_type+"]"+"itc_type["+itc_type+"]");
}//end of if block for itc_type }//end of if block for itc_type
}//end of for loop }//end of for loop
...@@ -757,13 +760,12 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -757,13 +760,12 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type)) else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type))
{ {
refIdInv = checkNull(genericUtility.getColumnValue("ref_id__inv", dom1)); refIdInv = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom1));
ref_date__inv = checkNull(genericUtility.getColumnValue("ref_date__inv", dom1)).trim(); ref_date__inv = gstUtility.checkNull(genericUtility.getColumnValue("ref_date__inv", dom1)).trim();
refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
String dt = "01/07/2017"; String dt = "01/07/2017";
invDate = Timestamp.valueOf(genericUtility.getValidDateString(dt, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); invDate = Timestamp.valueOf(genericUtility.getValidDateString(dt, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
//System.out.println("Return Value"+"ref_id__inv is ["+refIdInv+"]"+"ref_date__inv["+ref_date__inv+"]"+"refInvDateDate["+refInvDateDate+"]"+"Date1/7/17["+dt+"]"+"invDate["+invDate+"]"); //System.out.println("Return Value"+"ref_id__inv is ["+refIdInv+"]"+"ref_date__inv["+ref_date__inv+"]"+"refInvDateDate["+refInvDateDate+"]"+"Date1/7/17["+dt+"]"+"invDate["+invDate+"]");
//changes by sarita on 28JUL2017
if(refInvDateDate.equals(invDate) || refInvDateDate.after(invDate)) if(refInvDateDate.equals(invDate) || refInvDateDate.after(invDate))
{ {
if(gst_rate == null || gst_rate.trim().length() == 0) if(gst_rate == null || gst_rate.trim().length() == 0)
...@@ -790,8 +792,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -790,8 +792,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
/*if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type) /*if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type)
|| "E".equalsIgnoreCase(gst_type) || "D".equalsIgnoreCase(gst_type) || "E".equalsIgnoreCase(gst_type) || "D".equalsIgnoreCase(gst_type)
|| "C".equalsIgnoreCase(gst_type) || "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type))*/ || "C".equalsIgnoreCase(gst_type) || "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type))*/
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type) if("I".equalsIgnoreCase(gst_type) && ("R".equalsIgnoreCase(doc_type)) || ("DE".equalsIgnoreCase(doc_type)) || "R".equalsIgnoreCase(gst_type)
|| "E".equalsIgnoreCase(gst_type) || "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type)) || "S".equalsIgnoreCase(gst_type) || "E".equalsIgnoreCase(gst_type) || "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type))
{ {
if((state_code != null) && !(state_code.equalsIgnoreCase(loginSiteCode))) if((state_code != null) && !(state_code.equalsIgnoreCase(loginSiteCode)))
{ {
...@@ -807,8 +809,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -807,8 +809,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
errList.add(errCode); errList.add(errCode);
errFields.add("igst_amt"); errFields.add("igst_amt");
} }
cgst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("cgst_amt", dom)).trim()); cgst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("cgst_amt", dom)).trim());
sgst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("sgst_amt", dom)).trim()); sgst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("sgst_amt", dom)).trim());
//changed by sarita on 25JUL2017 //changed by sarita on 25JUL2017
//System.out.println("Return Value"+"cgst_amtVal["+cgst_amtVal+"]"+"sgst_amtVal["+sgst_amtVal+"]"+"cgst_percVal["+cgst_percVal+"]"+"sgst_percVal["+sgst_percVal+"]"); //System.out.println("Return Value"+"cgst_amtVal["+cgst_amtVal+"]"+"sgst_amtVal["+sgst_amtVal+"]"+"cgst_percVal["+cgst_percVal+"]"+"sgst_percVal["+sgst_percVal+"]");
if((cgst_amtVal > 0) || (sgst_amtVal > 0)) if((cgst_amtVal > 0) || (sgst_amtVal > 0))
...@@ -821,13 +823,12 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -821,13 +823,12 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type)) else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type))
{ {
refIdInv = checkNull(genericUtility.getColumnValue("ref_id__inv", dom1)); refIdInv = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom1));
ref_date__inv = checkNull(genericUtility.getColumnValue("ref_date__inv", dom1)).trim(); ref_date__inv = gstUtility.checkNull(genericUtility.getColumnValue("ref_date__inv", dom1)).trim();
refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
String dt = "01/07/2017"; String dt = "01/07/2017";
invDate = Timestamp.valueOf(genericUtility.getValidDateString(dt, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); invDate = Timestamp.valueOf(genericUtility.getValidDateString(dt, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
//System.out.println("Return Value"+"ref_id__inv is ["+refIdInv+"]"+"ref_date__inv["+ref_date__inv+"]"+"refInvDateDate["+refInvDateDate+"]"+"Date1/7/17["+dt+"]"+"invDate["+invDate+"]"); //System.out.println("Return Value"+"ref_id__inv is ["+refIdInv+"]"+"ref_date__inv["+ref_date__inv+"]"+"refInvDateDate["+refInvDateDate+"]"+"Date1/7/17["+dt+"]"+"invDate["+invDate+"]");
//changes by sarita on 28JUL2017
if(refInvDateDate.equals(invDate) || refInvDateDate.after(invDate)) if(refInvDateDate.equals(invDate) || refInvDateDate.after(invDate))
{ {
sql = "select gst_code from gst_data_hdr where doc_no=?"; sql = "select gst_code from gst_data_hdr where doc_no=?";
...@@ -864,8 +865,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -864,8 +865,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
errFields.add("igst_amt"); errFields.add("igst_amt");
} }
//added by sarita on 25JUL2017 //added by sarita on 25JUL2017
cgst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("cgst_amt", dom)).trim()); cgst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("cgst_amt", dom)).trim());
sgst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("sgst_amt", dom)).trim()); sgst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("sgst_amt", dom)).trim());
System.out.println("Return Value"+"cgst_amtVal["+cgst_amtVal+"]"+"sgst_amtVal["+sgst_amtVal+"]"+"cgst_percVal["+cgst_percVal+"]"+"sgst_percVal["+sgst_percVal+"]"); System.out.println("Return Value"+"cgst_amtVal["+cgst_amtVal+"]"+"sgst_amtVal["+sgst_amtVal+"]"+"cgst_percVal["+cgst_percVal+"]"+"sgst_percVal["+sgst_percVal+"]");
if((cgst_amtVal > 0) || (sgst_amtVal > 0)) if((cgst_amtVal > 0) || (sgst_amtVal > 0))
{ {
...@@ -900,7 +901,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -900,7 +901,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
errFields.add("cgst_amt"); errFields.add("cgst_amt");
} }
//changes by sarita on 25JUN2017 //changes by sarita on 25JUN2017
igst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim()); igst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim());
if(igst_amtVal >0) if(igst_amtVal >0)
{ {
errCode = "INVINTERST"; errCode = "INVINTERST";
...@@ -911,13 +912,12 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -911,13 +912,12 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type)) else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type))
{ {
refIdInv = checkNull(genericUtility.getColumnValue("ref_id__inv", dom1)); refIdInv = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom1));
ref_date__inv = checkNull(genericUtility.getColumnValue("ref_date__inv", dom1)).trim(); ref_date__inv = gstUtility.checkNull(genericUtility.getColumnValue("ref_date__inv", dom1)).trim();
refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
String dt = "01/07/2017"; String dt = "01/07/2017";
invDate = Timestamp.valueOf(genericUtility.getValidDateString(dt, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); invDate = Timestamp.valueOf(genericUtility.getValidDateString(dt, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
//System.out.println("Return Value"+"ref_id__inv is ["+refIdInv+"]"+"ref_date__inv["+ref_date__inv+"]"+"refInvDateDate["+refInvDateDate+"]"+"Date1/7/17["+dt+"]"+"invDate["+invDate+"]"); //System.out.println("Return Value"+"ref_id__inv is ["+refIdInv+"]"+"ref_date__inv["+ref_date__inv+"]"+"refInvDateDate["+refInvDateDate+"]"+"Date1/7/17["+dt+"]"+"invDate["+invDate+"]");
//changes by sarita on 28JUL2017
if(refInvDateDate.equals(invDate) || refInvDateDate.after(invDate)) if(refInvDateDate.equals(invDate) || refInvDateDate.after(invDate))
{ {
sql = "select gst_code from gst_data_hdr where doc_no=?"; sql = "select gst_code from gst_data_hdr where doc_no=?";
...@@ -954,7 +954,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -954,7 +954,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
errFields.add("cgst_amt"); errFields.add("cgst_amt");
} }
//added by sarita on 25JUN2017 //added by sarita on 25JUN2017
igst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim()); igst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim());
if(igst_amtVal >0) if(igst_amtVal >0)
{ {
errCode = "INVINTERST"; errCode = "INVINTERST";
...@@ -989,7 +989,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -989,7 +989,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
errFields.add("sgst_amt"); errFields.add("sgst_amt");
} }
//changes by sarita on 25JUN2017 //changes by sarita on 25JUN2017
igst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim()); igst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim());
if(igst_amtVal > 0) if(igst_amtVal > 0)
{ {
errCode = "INVINTERST"; errCode = "INVINTERST";
...@@ -1000,13 +1000,12 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1000,13 +1000,12 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type)) else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type))
{ {
refIdInv = checkNull(genericUtility.getColumnValue("ref_id__inv", dom1)); refIdInv = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom1));
ref_date__inv = checkNull(genericUtility.getColumnValue("ref_date__inv", dom1)).trim(); ref_date__inv = gstUtility.checkNull(genericUtility.getColumnValue("ref_date__inv", dom1)).trim();
refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
String dt = "01/07/2017"; String dt = "01/07/2017";
invDate = Timestamp.valueOf(genericUtility.getValidDateString(dt, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); invDate = Timestamp.valueOf(genericUtility.getValidDateString(dt, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
//System.out.println("Return Value"+"ref_id__inv is ["+refIdInv+"]"+"ref_date__inv["+ref_date__inv+"]"+"refInvDateDate["+refInvDateDate+"]"+"Date1/7/17["+dt+"]"+"invDate["+invDate+"]"); //System.out.println("Return Value"+"ref_id__inv is ["+refIdInv+"]"+"ref_date__inv["+ref_date__inv+"]"+"refInvDateDate["+refInvDateDate+"]"+"Date1/7/17["+dt+"]"+"invDate["+invDate+"]");
//changes by sarita on 28JUL2017
if(refInvDateDate.equals(invDate) || refInvDateDate.after(invDate)) if(refInvDateDate.equals(invDate) || refInvDateDate.after(invDate))
{ {
sql = "select gst_code from gst_data_hdr where doc_no=?"; sql = "select gst_code from gst_data_hdr where doc_no=?";
...@@ -1043,7 +1042,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1043,7 +1042,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
errFields.add("sgst_amt"); errFields.add("sgst_amt");
} }
//added by sarita on 25JUN2017 //added by sarita on 25JUN2017
igst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim()); igst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim());
if(igst_amtVal > 0) if(igst_amtVal > 0)
{ {
errCode = "INVINTERST"; errCode = "INVINTERST";
...@@ -1130,18 +1129,16 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1130,18 +1129,16 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
System.out.println("testing : final errString : " + errString); System.out.println("testing : final errString : " + errString);
return errString; return errString;
}//end of wfValData method.... }//end of wfValData method....
private String checkNull(String input)
{
return input == null ? "" : input.trim();
}
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn,String editFlag, String xtraParams) throws RemoteException,ITMException public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn,String editFlag, String xtraParams) throws RemoteException,ITMException
{ {
Document dom=null; Document dom=null;
Document domhr=null; Document domhr=null;
Document domAll=null; Document domAll=null;
String retString=""; String retString="";
System.out.println("xmlString::"+xmlString);
System.out.println("xmlString1::"+xmlString1);
System.out.println("xmlString2::"+xmlString2);
try try
{ {
System.out.println("************** Inside itemChanged method ****************"); System.out.println("************** Inside itemChanged method ****************");
...@@ -1157,6 +1154,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1157,6 +1154,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
{ {
domAll = genericUtility.parseString(xmlString2); domAll = genericUtility.parseString(xmlString2);
} }
retString = itemChanged(dom,domhr,domAll,objContext,currentColumn,editFlag,xtraParams); retString = itemChanged(dom,domhr,domAll,objContext,currentColumn,editFlag,xtraParams);
//System.out.println("retString::::::::::"+retString); //System.out.println("retString::::::::::"+retString);
} }
...@@ -1186,7 +1184,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1186,7 +1184,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
String tran_id__ref="",rec_type="",tran_type="",state_code="",reco_status="",site_code="",cust_code="",cust_name=""; String tran_id__ref="",rec_type="",tran_type="",state_code="",reco_status="",site_code="",cust_code="",cust_name="";
String sql=""; String sql="";
String doc_no=""; String doc_no="";
String docDateStr=""; String docDateStr="",gst_codeVal="",gstTypeEdit="";
double amount=0.0,taxable_amt=0.0, amt = 0.0,gst_rate=0.0; double amount=0.0,taxable_amt=0.0, amt = 0.0,gst_rate=0.0;
String recDescr ="",tranDescr="",stateDescr="",recoDescr="",siteDescr="",gst_type="",gstDescr=""; String recDescr ="",tranDescr="",stateDescr="",recoDescr="",siteDescr="",gst_type="",gstDescr="";
Timestamp doc_date=null; Timestamp doc_date=null;
...@@ -1264,7 +1262,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1264,7 +1262,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
}//end of if block for obj_name='gstr' }//end of if block for obj_name='gstr'
else if("gstr_purc".equalsIgnoreCase(objName.trim())) /* else if("gstr_purc".equalsIgnoreCase(objName.trim()))
{ {
sql = "select fld_value,descr from gencodes where fld_name='REC_TYPE' and mod_name='W_GSTR_PURC'"; sql = "select fld_value,descr from gencodes where fld_name='REC_TYPE' and mod_name='W_GSTR_PURC'";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -1289,19 +1287,21 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1289,19 +1287,21 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
rs.close(); rs.close();
rs = null; rs = null;
} }
}//end of if block for obj_name='gstr_purc' }//end of if block for obj_name='gstr_purc'*/
//added by sarita on 27JUL2017s
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)); gst_codeVal = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom));
if("L".equalsIgnoreCase(gst_type)) if("L".equalsIgnoreCase(gst_type))
{ {
valueXmlString.append("<submit_status protect = \"0\" visible = \"0\">").append("<![CDATA[P]]>").append("</submit_status>"); valueXmlString.append("<submit_status protect = \"0\" visible = \"0\">").append("<![CDATA[P]]>").append("</submit_status>");
} }
// changes itemdefault to show B2B Invoices fields bydefault by sarita on 21JUL2017 [START] // changes itemdefault to show B2B Invoices fields bydefault by sarita on 21JUL2017 [START]
valueXmlString.append("<doc_type protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_type>"); valueXmlString.append("<doc_type protect = \"0\" visible = \"1\">").append("<![CDATA[R ]]>").append("</doc_type>");
valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</tax_reg_no>"); valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</tax_reg_no>");
valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>"); valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>");
valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</gst_code_state>"); valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA["+gst_codeVal+"]]>").append("</gst_code_state>");
valueXmlString.append("<state_descr protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</state_descr>"); valueXmlString.append("<state_descr protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</state_descr>");
valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_no>"); valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_no>");
valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_date>"); valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_date>");
...@@ -1327,7 +1327,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1327,7 +1327,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
else if("itm_defaultedit".equalsIgnoreCase(currentColumn.trim())) else if("itm_defaultedit".equalsIgnoreCase(currentColumn.trim()))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom));
//System.out.println("Return Value"+"gst_type ::::::::::"+gst_type); //System.out.println("Return Value"+"gst_type ::::::::::"+gst_type);
sql = "select descr from gencodes where fld_name='GST_TYPE' and fld_value=?"; sql = "select descr from gencodes where fld_name='GST_TYPE' and fld_value=?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -1350,38 +1350,49 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1350,38 +1350,49 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
valueXmlString.append("<gst_type_descr>").append("<![CDATA["+gstDescr+"]]>").append("</gst_type_descr>"); valueXmlString.append("<gst_type_descr>").append("<![CDATA["+gstDescr+"]]>").append("</gst_type_descr>");
taxRegNoEdit = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)); gstTypeEdit = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom));
docTypeEdit= checkNull(genericUtility.getColumnValue("doc_type", dom)); taxRegNoEdit = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom));
docNoEdit = checkNull(genericUtility.getColumnValue("doc_no", dom)); docTypeEdit= gstUtility.checkNull(genericUtility.getColumnValue("doc_type", dom));
docDateEdit = checkNull(genericUtility.getColumnValue("doc_date", dom)); docNoEdit = gstUtility.checkNull(genericUtility.getColumnValue("doc_no", dom));
amountEdit = checkNull(genericUtility.getColumnValue("amount", dom)); docDateEdit = gstUtility.checkNull(genericUtility.getColumnValue("doc_date", dom));
gstCodeEdit = checkNull(genericUtility.getColumnValue("gst_code_state", dom)); amountEdit = gstUtility.checkNull(genericUtility.getColumnValue("amount", dom));
stateDescEdit = checkNull(genericUtility.getColumnValue("state_descr", dom)); gstCodeEdit = gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom));
ecomRegEdit = checkNull(genericUtility.getColumnValue("ecom_reg_no", dom)); stateDescEdit = gstUtility.checkNull(genericUtility.getColumnValue("state_descr", dom));
revChrEdit = checkNull(genericUtility.getColumnValue("reverse_chrg", dom)); ecomRegEdit = gstUtility.checkNull(genericUtility.getColumnValue("ecom_reg_no", dom));
refIfInvEdit = checkNull(genericUtility.getColumnValue("ref_id__inv", dom)); revChrEdit = gstUtility.checkNull(genericUtility.getColumnValue("reverse_chrg", dom));
refDateInvEdit = checkNull(genericUtility.getColumnValue("ref_date__inv", dom)); refIfInvEdit = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom));
lrNoEdit = checkNull(genericUtility.getColumnValue("lr_no", dom)); refDateInvEdit = gstUtility.checkNull(genericUtility.getColumnValue("ref_date__inv", dom));
lrDateEdit = checkNull(genericUtility.getColumnValue("lr_date", dom)); lrNoEdit = gstUtility.checkNull(genericUtility.getColumnValue("lr_no", dom));
nameEdit = checkNull(genericUtility.getColumnValue("name", dom)); lrDateEdit = gstUtility.checkNull(genericUtility.getColumnValue("lr_date", dom));
addr1Edit = checkNull(genericUtility.getColumnValue("addr1", dom)); nameEdit = gstUtility.checkNull(genericUtility.getColumnValue("name", dom));
addr2Edit = checkNull(genericUtility.getColumnValue("addr2", dom)); addr1Edit = gstUtility.checkNull(genericUtility.getColumnValue("addr1", dom));
addr3Edit = checkNull(genericUtility.getColumnValue("addr3", dom)); addr2Edit = gstUtility.checkNull(genericUtility.getColumnValue("addr2", dom));
cityEdit = checkNull(genericUtility.getColumnValue("city", dom)); addr3Edit = gstUtility.checkNull(genericUtility.getColumnValue("addr3", dom));
stateEdit = checkNull(genericUtility.getColumnValue("gst_state_code", dom)); cityEdit = gstUtility.checkNull(genericUtility.getColumnValue("city", dom));
pinEdit = checkNull(genericUtility.getColumnValue("pin", dom)); stateEdit = gstUtility.checkNull(genericUtility.getColumnValue("gst_state_code", dom));
orderNoEdit = checkNull(genericUtility.getColumnValue("order_no", dom)); pinEdit = gstUtility.checkNull(genericUtility.getColumnValue("pin", dom));
reasonCdEdit = checkNull(genericUtility.getColumnValue("reas_code", dom)); orderNoEdit = gstUtility.checkNull(genericUtility.getColumnValue("order_no", dom));
custNameEdit = checkNull(genericUtility.getColumnValue("cust_name", dom)); reasonCdEdit = gstUtility.checkNull(genericUtility.getColumnValue("reas_code", dom));
custNameEdit = gstUtility.checkNull(genericUtility.getColumnValue("cust_name", dom));
System.out.println("Value of dom2:::::"+dom2.getElementsByTagName("Detail2").getLength());
//Added by sarita on 4AUG2017
if(dom2.getElementsByTagName("Detail2") != null && dom2.getElementsByTagName("Detail2").getLength() > 0)
{
System.out.println("in detail 1");
valueXmlString.append("<gst_type protect = \"1\" visible = \"1\">").append("<![CDATA["+gstTypeEdit+"]]>").append("</gst_type>");
valueXmlString.append("<doc_type protect = \"1\" visible = \"1\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>");
valueXmlString.append("<tax_reg_no protect = \"1\" visible = \"1\">").append("<![CDATA["+taxRegNoEdit+"]]>").append("</tax_reg_no>");
valueXmlString.append("<gst_code_state protect = \"1\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code_state>");
}
if("I".equalsIgnoreCase(gst_type)) if("I".equalsIgnoreCase(gst_type))
{ {
if(taxRegNoEdit == null || taxRegNoEdit.trim().length()== 0) if(taxRegNoEdit == null || taxRegNoEdit.trim().length()== 0)
{ {
valueXmlString.append("<doc_type protect = \"0\" visible = \"1\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>"); //valueXmlString.append("<doc_type protect = \"0\" visible = \"1\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>");
valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+taxRegNoEdit+"]]>").append("</tax_reg_no>"); //valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+taxRegNoEdit+"]]>").append("</tax_reg_no>");
valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>"); valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>");
valueXmlString.append("<gst_code_state protect = \"1\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code_state>"); //valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code_state>");
valueXmlString.append("<state_descr protect = \"0\" visible = \"0\">").append("<![CDATA["+stateDescEdit+"]]>").append("</state_descr>"); valueXmlString.append("<state_descr protect = \"0\" visible = \"0\">").append("<![CDATA["+stateDescEdit+"]]>").append("</state_descr>");
valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA["+docNoEdit+"]]>").append("</doc_no>"); valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA["+docNoEdit+"]]>").append("</doc_no>");
valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>"); valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>");
...@@ -1405,10 +1416,10 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1405,10 +1416,10 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
else else
{ {
valueXmlString.append("<doc_type protect = \"0\" visible = \"1\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>"); //valueXmlString.append("<doc_type protect = \"0\" visible = \"1\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>");
valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+taxRegNoEdit+"]]>").append("</tax_reg_no>"); //valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+taxRegNoEdit+"]]>").append("</tax_reg_no>");
valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>"); valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>");
valueXmlString.append("<gst_code_state protect = \"1\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code_state>"); //valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code_state>");
valueXmlString.append("<state_descr protect = \"0\" visible = \"0\">").append("<![CDATA["+stateDescEdit+"]]>").append("</state_descr>"); valueXmlString.append("<state_descr protect = \"0\" visible = \"0\">").append("<![CDATA["+stateDescEdit+"]]>").append("</state_descr>");
valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA["+docNoEdit+"]]>").append("</doc_no>"); valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA["+docNoEdit+"]]>").append("</doc_no>");
valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>"); valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>");
...@@ -1435,10 +1446,10 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1435,10 +1446,10 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
{ {
if(taxRegNoEdit == null || taxRegNoEdit.trim().length()== 0) if(taxRegNoEdit == null || taxRegNoEdit.trim().length()== 0)
{ {
valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>"); //valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>");
valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+taxRegNoEdit+"]]>").append("</tax_reg_no>"); //valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+taxRegNoEdit+"]]>").append("</tax_reg_no>");
valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>"); valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>");
valueXmlString.append("<gst_code_state protect = \"1\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code_state>"); //valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code_state>");
valueXmlString.append("<state_descr protect = \"0\" visible = \"0\">").append("<![CDATA["+stateDescEdit+"]]>").append("</state_descr>"); valueXmlString.append("<state_descr protect = \"0\" visible = \"0\">").append("<![CDATA["+stateDescEdit+"]]>").append("</state_descr>");
valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA["+docNoEdit+"]]>").append("</doc_no>"); valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA["+docNoEdit+"]]>").append("</doc_no>");
valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>"); valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>");
...@@ -1462,10 +1473,10 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1462,10 +1473,10 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
else else
{ {
valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>"); //valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>");
valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+taxRegNoEdit+"]]>").append("</tax_reg_no>"); //valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+taxRegNoEdit+"]]>").append("</tax_reg_no>");
valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>"); valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>");
valueXmlString.append("<gst_code_state protect = \"1\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code_state>"); //valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code_state>");
valueXmlString.append("<state_descr protect = \"0\" visible = \"0\">").append("<![CDATA["+stateDescEdit+"]]>").append("</state_descr>"); valueXmlString.append("<state_descr protect = \"0\" visible = \"0\">").append("<![CDATA["+stateDescEdit+"]]>").append("</state_descr>");
valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA["+docNoEdit+"]]>").append("</doc_no>"); valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA["+docNoEdit+"]]>").append("</doc_no>");
valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>"); valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>");
...@@ -1490,10 +1501,10 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1490,10 +1501,10 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
if("S".equalsIgnoreCase(gst_type)) if("S".equalsIgnoreCase(gst_type))
{ {
valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>"); //valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>");
valueXmlString.append("<cust_name protect = \"0\" visible = \"1\">").append("<![CDATA["+custNameEdit+"]]>").append("</cust_name>"); valueXmlString.append("<cust_name protect = \"0\" visible = \"1\">").append("<![CDATA["+custNameEdit+"]]>").append("</cust_name>");
valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</tax_reg_no>"); valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</tax_reg_no>");
valueXmlString.append("<gst_code_state protect = \"1\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code_state>"); //valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code_state>");
valueXmlString.append("<state_descr protect = \"0\" visible = \"0\">").append("<![CDATA["+stateDescEdit+"]]>").append("</state_descr>"); valueXmlString.append("<state_descr protect = \"0\" visible = \"0\">").append("<![CDATA["+stateDescEdit+"]]>").append("</state_descr>");
valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA["+docNoEdit+"]]>").append("</doc_no>"); valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA["+docNoEdit+"]]>").append("</doc_no>");
valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>"); valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>");
...@@ -1574,7 +1585,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1574,7 +1585,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
if(taxRegNoEdit == null || taxRegNoEdit.trim().length()== 0) if(taxRegNoEdit == null || taxRegNoEdit.trim().length()== 0)
{ {
valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>"); valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>");
valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+taxRegNoEdit+"]]>").append("</tax_reg_no>"); //valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+taxRegNoEdit+"]]>").append("</tax_reg_no>");
valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>"); valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>");
valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA["+docNoEdit+"]]>").append("</doc_no>"); valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA["+docNoEdit+"]]>").append("</doc_no>");
valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>"); valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>");
...@@ -1601,7 +1612,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1601,7 +1612,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
else else
{ {
valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>"); valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>");
valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+taxRegNoEdit+"]]>").append("</tax_reg_no>"); //valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+taxRegNoEdit+"]]>").append("</tax_reg_no>");
valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>"); valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>");
valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA["+docNoEdit+"]]>").append("</doc_no>"); valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA["+docNoEdit+"]]>").append("</doc_no>");
valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>"); valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>");
...@@ -1631,7 +1642,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1631,7 +1642,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
if(taxRegNoEdit == null || taxRegNoEdit.trim().length()== 0) if(taxRegNoEdit == null || taxRegNoEdit.trim().length()== 0)
{ {
valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>"); valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>");
valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+taxRegNoEdit+"]]>").append("</tax_reg_no>"); //valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+taxRegNoEdit+"]]>").append("</tax_reg_no>");
valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>"); valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>");
valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA["+docNoEdit+"]]>").append("</doc_no>"); valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA["+docNoEdit+"]]>").append("</doc_no>");
valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>"); valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>");
...@@ -1658,7 +1669,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1658,7 +1669,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
else else
{ {
valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>"); valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>");
valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+taxRegNoEdit+"]]>").append("</tax_reg_no>"); //valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+taxRegNoEdit+"]]>").append("</tax_reg_no>");
valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>"); valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>");
valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA["+docNoEdit+"]]>").append("</doc_no>"); valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA["+docNoEdit+"]]>").append("</doc_no>");
valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>"); valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>");
...@@ -1685,7 +1696,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1685,7 +1696,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
else if("A".equalsIgnoreCase(gst_type)) else if("A".equalsIgnoreCase(gst_type))
{ {
valueXmlString.append("<gst_code_state protect = \"1\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code_state>"); //valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code_state>");
valueXmlString.append("<state_descr protect = \"1\" visible = \"0\">").append("<![CDATA["+stateDescEdit+"]]>").append("</state_descr>"); valueXmlString.append("<state_descr protect = \"1\" visible = \"0\">").append("<![CDATA["+stateDescEdit+"]]>").append("</state_descr>");
valueXmlString.append("<amount protect = \"0\" visible = \"1\">").append("<![CDATA["+amountEdit+"]]>").append("</amount>"); valueXmlString.append("<amount protect = \"0\" visible = \"1\">").append("<![CDATA["+amountEdit+"]]>").append("</amount>");
valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>"); valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>");
...@@ -1713,7 +1724,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1713,7 +1724,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
else if("T".equalsIgnoreCase(gst_type)) else if("T".equalsIgnoreCase(gst_type))
{ {
valueXmlString.append("<gst_code_state protect = \"1\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code_state>"); //valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code_state>");
valueXmlString.append("<state_descr protect = \"0\" visible = \"0\">").append("<![CDATA["+stateDescEdit+"]]>").append("</state_descr>"); valueXmlString.append("<state_descr protect = \"0\" visible = \"0\">").append("<![CDATA["+stateDescEdit+"]]>").append("</state_descr>");
valueXmlString.append("<amount protect = \"0\" visible = \"1\">").append("<![CDATA["+amountEdit+"]]>").append("</amount>"); valueXmlString.append("<amount protect = \"0\" visible = \"1\">").append("<![CDATA["+amountEdit+"]]>").append("</amount>");
valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>"); valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>");
...@@ -1743,9 +1754,10 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1743,9 +1754,10 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
else if("gst_type".equalsIgnoreCase(currentColumn.trim())) else if("gst_type".equalsIgnoreCase(currentColumn.trim()))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom));
gst_codeVal = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
//System.out.println("Input Value::"+"gst_type:::["+gst_type+"]"); //System.out.println("Input Value::"+"gst_type:::["+gst_type+"]");
sql = "select descr from gencodes where fld_name='GST_TYPE' and fld_value=?"; sql = "select descr from gencodes where fld_name='GST_TYPE' and mod_name='W_GSTR' and fld_value=?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,gst_type); pstmt.setString(1,gst_type);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -1768,10 +1780,10 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1768,10 +1780,10 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
if("I".equalsIgnoreCase(gst_type)) if("I".equalsIgnoreCase(gst_type))
{ {
valueXmlString.append("<doc_type protect = \"0\" visible = \"1\">").append("<![CDATA[R]]>").append("</doc_type>"); valueXmlString.append("<doc_type protect = \"0\" visible = \"1\">").append("<![CDATA[R ]]>").append("</doc_type>");
valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</tax_reg_no>"); valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</tax_reg_no>");
valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>"); valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>");
valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA[35]]>").append("</gst_code_state>"); valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA["+gst_codeVal+"]]>").append("</gst_code_state>");
valueXmlString.append("<state_descr protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</state_descr>"); valueXmlString.append("<state_descr protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</state_descr>");
valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_no>"); valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_no>");
valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_date>"); valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_date>");
...@@ -1795,10 +1807,10 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1795,10 +1807,10 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
if("R".equalsIgnoreCase(gst_type)) if("R".equalsIgnoreCase(gst_type))
{ {
valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA[R]]>").append("</doc_type>"); valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</doc_type>");
valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</tax_reg_no>"); valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</tax_reg_no>");
valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>"); valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>");
valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA[35]]>").append("</gst_code_state>"); valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA["+gst_codeVal+"]]>").append("</gst_code_state>");
valueXmlString.append("<state_descr protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</state_descr>"); valueXmlString.append("<state_descr protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</state_descr>");
valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_no>"); valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_no>");
valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_date>"); valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_date>");
...@@ -1822,10 +1834,10 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1822,10 +1834,10 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
if("S".equalsIgnoreCase(gst_type)) if("S".equalsIgnoreCase(gst_type))
{ {
valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA[R]]>").append("</doc_type>"); valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</doc_type>");
valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</tax_reg_no>"); valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</tax_reg_no>");
valueXmlString.append("<cust_name protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</cust_name>"); valueXmlString.append("<cust_name protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</cust_name>");
valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA[35]]>").append("</gst_code_state>"); valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA["+gst_codeVal+"]]>").append("</gst_code_state>");
valueXmlString.append("<state_descr protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</state_descr>"); valueXmlString.append("<state_descr protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</state_descr>");
valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_no>"); valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_no>");
valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_date>"); valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_date>");
...@@ -1957,7 +1969,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1957,7 +1969,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
else if("A".equalsIgnoreCase(gst_type)) else if("A".equalsIgnoreCase(gst_type))
{ {
valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA[35]]>").append("</gst_code_state>"); valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA["+gst_codeVal+"]]>").append("</gst_code_state>");
valueXmlString.append("<state_descr protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</state_descr>"); valueXmlString.append("<state_descr protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</state_descr>");
valueXmlString.append("<amount protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</amount>"); valueXmlString.append("<amount protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</amount>");
valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>"); valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>");
...@@ -1985,7 +1997,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -1985,7 +1997,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
else if("T".equalsIgnoreCase(gst_type)) else if("T".equalsIgnoreCase(gst_type))
{ {
valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA[35]]>").append("</gst_code_state>"); valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA["+gst_codeVal+"]]>").append("</gst_code_state>");
valueXmlString.append("<state_descr protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</state_descr>"); valueXmlString.append("<state_descr protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</state_descr>");
valueXmlString.append("<amount protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</amount>"); valueXmlString.append("<amount protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</amount>");
valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>"); valueXmlString.append("<cust_name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</cust_name>");
...@@ -2015,8 +2027,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2015,8 +2027,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
else if("tax_reg_no".equalsIgnoreCase(currentColumn.trim())) else if("tax_reg_no".equalsIgnoreCase(currentColumn.trim()))
{ {
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1));
tax_reg_no = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)); tax_reg_no = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom));
sql = "select count(*) as cnt from gst_registration where gst_no=?"; sql = "select count(*) as cnt from gst_registration where gst_no=?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tax_reg_no); pstmt.setString(1,tax_reg_no);
...@@ -2091,7 +2103,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2091,7 +2103,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
else else
{ {
tax_reg_no = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)); tax_reg_no = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom));
if(tax_reg_no != null && tax_reg_no.trim().length() > 0) if(tax_reg_no != null && tax_reg_no.trim().length() > 0)
{ {
stCode = tax_reg_no.substring(0,2); stCode = tax_reg_no.substring(0,2);
...@@ -2137,6 +2149,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2137,6 +2149,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
//Added by sarita on 25JUN2017 [START] //Added by sarita on 25JUN2017 [START]
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type)) if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type))
{ {
gst_codeVal = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
if(tax_reg_no != null && tax_reg_no.trim().length() > 0) if(tax_reg_no != null && tax_reg_no.trim().length() > 0)
{ {
String plcOfSupp = tax_reg_no.substring(0,2); String plcOfSupp = tax_reg_no.substring(0,2);
...@@ -2145,7 +2158,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2145,7 +2158,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
else else
{ {
valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA[35]]>").append("</gst_code_state>"); valueXmlString.append("<gst_code_state protect = \"0\" visible = \"1\">").append("<![CDATA["+gst_codeVal+"]]>").append("</gst_code_state>");
} }
} }
//Added by sarita on 25JUN2017 [END] //Added by sarita on 25JUN2017 [END]
...@@ -2153,7 +2166,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2153,7 +2166,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
else if("doc_date".equalsIgnoreCase(currentColumn.trim())) else if("doc_date".equalsIgnoreCase(currentColumn.trim()))
{ {
docDate = checkNull(genericUtility.getColumnValue("doc_date", dom)); docDate = gstUtility.checkNull(genericUtility.getColumnValue("doc_date", dom));
doc_date = Timestamp.valueOf(genericUtility.getValidDateString(docDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); doc_date = Timestamp.valueOf(genericUtility.getValidDateString(docDate, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("docDate:::::::::"+docDate+"doc_date>>>>>>>>>"+doc_date); System.out.println("docDate:::::::::"+docDate+"doc_date>>>>>>>>>"+doc_date);
sql = "select code from period where ? between fr_date and to_date"; sql = "select code from period where ? between fr_date and to_date";
...@@ -2184,7 +2197,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2184,7 +2197,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
else if("gst_code_state".equalsIgnoreCase(currentColumn.trim())) else if("gst_code_state".equalsIgnoreCase(currentColumn.trim()))
{ {
state_code = checkNull(genericUtility.getColumnValue("gst_code_state", dom)); state_code = gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom));
System.out.println("State code value is ====="+state_code); System.out.println("State code value is ====="+state_code);
sql = "select descr from state where gst_code=?"; sql = "select descr from state where gst_code=?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -2226,8 +2239,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2226,8 +2239,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
if("itm_default".equalsIgnoreCase(currentColumn.trim())) if("itm_default".equalsIgnoreCase(currentColumn.trim()))
{ {
ecomRegNo = checkNull(genericUtility.getColumnValue("ecom_reg_no", dom1)); ecomRegNo = gstUtility.checkNull(genericUtility.getColumnValue("ecom_reg_no", dom1));
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1));
//System.out.println("Return Value"+"ecom_reg_no is ====="+ecomRegNo + "gst_type:::::::"+gst_type); //System.out.println("Return Value"+"ecom_reg_no is ====="+ecomRegNo + "gst_type:::::::"+gst_type);
if(ecomRegNo != null && ecomRegNo.trim().length() > 0 && gst_type.equalsIgnoreCase("I")) if(ecomRegNo != null && ecomRegNo.trim().length() > 0 && gst_type.equalsIgnoreCase("I"))
...@@ -2246,15 +2259,57 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2246,15 +2259,57 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
valueXmlString.append("<igst_amt protect = \"1\">").append("<![CDATA[]]>").append("</igst_amt>"); valueXmlString.append("<igst_amt protect = \"1\">").append("<![CDATA[]]>").append("</igst_amt>");
valueXmlString.append("<cgst_amt protect = \"1\">").append("<![CDATA[]]>").append("</cgst_amt>"); valueXmlString.append("<cgst_amt protect = \"1\">").append("<![CDATA[]]>").append("</cgst_amt>");
valueXmlString.append("<sgst_amt protect = \"1\">").append("<![CDATA[]]>").append("</sgst_amt>"); valueXmlString.append("<sgst_amt protect = \"1\">").append("<![CDATA[]]>").append("</sgst_amt>");
//Added by sarita on 4AUG2017
valueXmlString.append("</Detail2>");
valueXmlString.append("<Detail1>");
valueXmlString.append("<gst_type protect = \"1\">").append("<![CDATA["+gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1))+"]]>").append("</gst_type>");
valueXmlString.append("<doc_type protect = \"1\">").append("<![CDATA["+gstUtility.checkNull(genericUtility.getColumnValue("doc_type", dom1))+"]]>").append("</doc_type>");
valueXmlString.append("<tax_reg_no protect = \"1\">").append("<![CDATA["+gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom1))+"]]>").append("</tax_reg_no>");
valueXmlString.append("<gst_code_state protect = \"1\">").append("<![CDATA["+gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom1))+"]]>").append("</gst_code_state>");
valueXmlString.append("</Detail1>");
//valueXmlString.append("<gst_code_state protect = \"1\">").append("<![CDATA["+checkNull(genericUtility.getColumnValue("gst_code_state", dom1))+"]]>").append("</gst_code_state>");
// Added by sarita on 25JUN2017[END] // Added by sarita on 25JUN2017[END]
}//end of if block for itm_default }//end of if block for itm_default
else if("itm_defaultedit".equalsIgnoreCase(currentColumn.trim()))
{
//Added by sarita on 4AUG2017
double igst_amtEdit = gstUtility.getDouble(genericUtility.getColumnValue("igst_amt", dom));
double cgst_amtEdit = gstUtility.getDouble(genericUtility.getColumnValue("cgst_amt", dom));
double sgst_amtEdit = gstUtility.getDouble(genericUtility.getColumnValue("sgst_amt", dom));
if(igst_amtEdit == 0)
{
valueXmlString.append("<igst_amt protect = \"1\">").append("<![CDATA["+igst_amtEdit+"]]>").append("</igst_amt>");
}
else if(cgst_amtEdit == 0 || sgst_amtEdit == 0)
{
valueXmlString.append("<cgst_amt protect = \"1\">").append("<![CDATA["+cgst_amtEdit+"]]>").append("</cgst_amt>");
valueXmlString.append("<sgst_amt protect = \"1\">").append("<![CDATA["+sgst_amtEdit+"]]>").append("</sgst_amt>");
}
//Added by sarita on 4AUG 2017
valueXmlString.append("</Detail2>");
System.out.println("dom2.getElementsByTagName(DEATILS)"+dom2.getElementsByTagName("Detail2"));
System.out.println("Detail2 length::["+dom2.getElementsByTagName("Detail2").getLength()+"]");
int cnt1 = gstUtility.getNumOfNonDelDetail(dom2,currentFormNo);
System.out.println("Detail2 none deleted cnter"+cnt1);
if(cnt1 == 0)
{
System.out.println("in detail 1");
valueXmlString.append("<Detail1>");
valueXmlString.append("<gst_type protect = \"0\">").append("<![CDATA["+gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1))+"]]>").append("</gst_type>");
valueXmlString.append("<doc_type protect = \"0\">").append("<![CDATA["+gstUtility.checkNull(genericUtility.getColumnValue("doc_type", dom1))+"]]>").append("</doc_type>");
valueXmlString.append("<tax_reg_no protect = \"0\">").append("<![CDATA["+gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom1))+"]]>").append("</tax_reg_no>");
valueXmlString.append("<gst_code_state protect = \"0\">").append("<![CDATA["+gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom1))+"]]>").append("</gst_code_state>");
valueXmlString.append("</Detail1>");
}
}
else if("gst_rate".equalsIgnoreCase(currentColumn.trim())) else if("gst_rate".equalsIgnoreCase(currentColumn.trim()))
{ {
gst_rate = getDouble(checkNull(genericUtility.getColumnValue("gst_rate", dom))); gst_rate = gstUtility.getDouble(gstUtility.checkNull(genericUtility.getColumnValue("gst_rate", dom)));
state_code = checkNull(genericUtility.getColumnValue("gst_code_state", dom1)); state_code = gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom1));
loginSiteCode = checkNull(getStateFromLoginSite(loginSite,conn)); loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1));
//Added by sarita on 25JUN2017[START] //Added by sarita on 25JUN2017[START]
rate = (gst_rate); rate = (gst_rate);
igst_amount = getIgst_Amt(rate, dom); igst_amount = getIgst_Amt(rate, dom);
...@@ -2271,13 +2326,12 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2271,13 +2326,12 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
else if("C".equalsIgnoreCase(gst_type) || "D".equalsIgnoreCase(gst_type)) else if("C".equalsIgnoreCase(gst_type) || "D".equalsIgnoreCase(gst_type))
{ {
refIdInv = checkNull(genericUtility.getColumnValue("ref_id__inv", dom1)); refIdInv = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom1));
ref_date__inv = checkNull(genericUtility.getColumnValue("ref_date__inv", dom1)).trim(); ref_date__inv = gstUtility.checkNull(genericUtility.getColumnValue("ref_date__inv", dom1)).trim();
refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
String dt = "01/07/2017"; String dt = "01/07/2017";
invDate = Timestamp.valueOf(genericUtility.getValidDateString(dt, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); invDate = Timestamp.valueOf(genericUtility.getValidDateString(dt, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("ref_id__inv is ["+refIdInv+"]"+"ref_date__inv["+ref_date__inv+"]"+"refInvDateDate["+refInvDateDate+"]"+"Date1/7/17["+dt+"]"+"invDate["+invDate+"]"); System.out.println("ref_id__inv is ["+refIdInv+"]"+"ref_date__inv["+ref_date__inv+"]"+"refInvDateDate["+refInvDateDate+"]"+"Date1/7/17["+dt+"]"+"invDate["+invDate+"]");
//changes by sarita on 28JUL2017
if(refInvDateDate.equals(invDate) || refInvDateDate.after(invDate)) if(refInvDateDate.equals(invDate) || refInvDateDate.after(invDate))
{ {
sql = "select gst_code from gst_data_hdr where doc_no=?"; sql = "select gst_code from gst_data_hdr where doc_no=?";
...@@ -2303,7 +2357,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2303,7 +2357,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
{ {
if(gstCode.equalsIgnoreCase(loginSiteCode)) if(gstCode.equalsIgnoreCase(loginSiteCode))
{ {
igst_amt = checkNull(genericUtility.getColumnValue("igst_amt", dom)); igst_amt = gstUtility.checkNull(genericUtility.getColumnValue("igst_amt", dom));
//changes done by sarita on 21JUL2017 //changes done by sarita on 21JUL2017
valueXmlString.append("<cgst_perc protect = \"1\">").append("<![CDATA["+rate/2+"]]>").append("</cgst_perc>"); valueXmlString.append("<cgst_perc protect = \"1\">").append("<![CDATA["+rate/2+"]]>").append("</cgst_perc>");
valueXmlString.append("<sgst_perc protect = \"1\">").append("<![CDATA["+rate/2+"]]>").append("</sgst_perc>"); valueXmlString.append("<sgst_perc protect = \"1\">").append("<![CDATA["+rate/2+"]]>").append("</sgst_perc>");
...@@ -2341,12 +2395,14 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2341,12 +2395,14 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
valueXmlString.append("<sgst_amt protect = \"1\">").append("<![CDATA[0.0]]>").append("</sgst_amt>"); valueXmlString.append("<sgst_amt protect = \"1\">").append("<![CDATA[0.0]]>").append("</sgst_amt>");
} }
}//end of if block if state_code is not null }//end of if block if state_code is not null
} }
valueXmlString.append("</Detail2>");
}//end of if block for gst_rate }//end of if block for gst_rate
else if("taxable_amt".equalsIgnoreCase(currentColumn.trim())) else if("taxable_amt".equalsIgnoreCase(currentColumn.trim()))
{ {
String taxableAmt = checkNull(genericUtility.getColumnValue("taxable_amt", dom)); String taxableAmt = gstUtility.checkNull(genericUtility.getColumnValue("taxable_amt", dom));
gst_rate = getDouble(checkNull(genericUtility.getColumnValue("gst_rate", dom))); gst_rate = gstUtility.getDouble(gstUtility.checkNull(genericUtility.getColumnValue("gst_rate", dom)));
//System.out.println("INPUT VALUE"+"taxableAmt::["+taxableAmt+"]"+"[AND]"+"gst_rate::["+gst_rate+"]"); //System.out.println("INPUT VALUE"+"taxableAmt::["+taxableAmt+"]"+"[AND]"+"gst_rate::["+gst_rate+"]");
if(gst_rate > 0) if(gst_rate > 0)
{ {
...@@ -2354,9 +2410,9 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2354,9 +2410,9 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
igst_amount = getIgst_Amt(rate, dom); igst_amount = getIgst_Amt(rate, dom);
cgst_amount = getCgst_Amt(rate, dom); cgst_amount = getCgst_Amt(rate, dom);
sgst_amount = getSgst_Amt(rate, dom); sgst_amount = getSgst_Amt(rate, dom);
state_code = checkNull(genericUtility.getColumnValue("gst_code_state", dom1)); state_code = gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom1));
loginSiteCode = checkNull(getStateFromLoginSite(loginSite,conn)); loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1));
if("E".equalsIgnoreCase(gst_type)) if("E".equalsIgnoreCase(gst_type))
{ {
valueXmlString.append("<igst_perc>").append("<![CDATA["+gst_rate+"]]>").append("</igst_perc>"); valueXmlString.append("<igst_perc>").append("<![CDATA["+gst_rate+"]]>").append("</igst_perc>");
...@@ -2366,13 +2422,12 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2366,13 +2422,12 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
else if("C".equalsIgnoreCase(gst_type) || "D".equalsIgnoreCase(gst_type)) else if("C".equalsIgnoreCase(gst_type) || "D".equalsIgnoreCase(gst_type))
{ {
refIdInv = checkNull(genericUtility.getColumnValue("ref_id__inv", dom1)); refIdInv = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom1));
ref_date__inv = checkNull(genericUtility.getColumnValue("ref_date__inv", dom1)).trim(); ref_date__inv = gstUtility.checkNull(genericUtility.getColumnValue("ref_date__inv", dom1)).trim();
refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
String dt = "01/07/2017"; String dt = "01/07/2017";
invDate = Timestamp.valueOf(genericUtility.getValidDateString(dt, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0"); invDate = Timestamp.valueOf(genericUtility.getValidDateString(dt, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("ref_id__inv is ["+refIdInv+"]"+"ref_date__inv["+ref_date__inv+"]"+"refInvDateDate["+refInvDateDate+"]"+"Date1/7/17["+dt+"]"+"invDate["+invDate+"]"); System.out.println("ref_id__inv is ["+refIdInv+"]"+"ref_date__inv["+ref_date__inv+"]"+"refInvDateDate["+refInvDateDate+"]"+"Date1/7/17["+dt+"]"+"invDate["+invDate+"]");
//changes by sarita on 28JUL2017
if(refInvDateDate.equals(invDate) || refInvDateDate.after(invDate)) if(refInvDateDate.equals(invDate) || refInvDateDate.after(invDate))
{ {
sql = "select gst_code from gst_data_hdr where doc_no=?"; sql = "select gst_code from gst_data_hdr where doc_no=?";
...@@ -2398,7 +2453,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2398,7 +2453,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
{ {
if(gstCode.equalsIgnoreCase(loginSiteCode)) if(gstCode.equalsIgnoreCase(loginSiteCode))
{ {
igst_amt = checkNull(genericUtility.getColumnValue("igst_amt", dom)); igst_amt = gstUtility.checkNull(genericUtility.getColumnValue("igst_amt", dom));
//changes done by sarita on 21JUL2017 //changes done by sarita on 21JUL2017
valueXmlString.append("<cgst_perc protect = \"1\">").append("<![CDATA["+rate/2+"]]>").append("</cgst_perc>"); valueXmlString.append("<cgst_perc protect = \"1\">").append("<![CDATA["+rate/2+"]]>").append("</cgst_perc>");
valueXmlString.append("<sgst_perc protect = \"1\">").append("<![CDATA["+rate/2+"]]>").append("</sgst_perc>"); valueXmlString.append("<sgst_perc protect = \"1\">").append("<![CDATA["+rate/2+"]]>").append("</sgst_perc>");
...@@ -2439,8 +2494,13 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2439,8 +2494,13 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
} }
} }
valueXmlString.append("</Detail2>");
}//end of if block for taxable amount
else
{
valueXmlString.append("</Detail2>");
} }
valueXmlString.append("</Detail2>"); //valueXmlString.append("</Detail2>");
break; break;
}//end of case2 }//end of case2
}//end of switch block }//end of switch block
...@@ -2644,8 +2704,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2644,8 +2704,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
ResultSet rs = null; ResultSet rs = null;
try try
{ {
String docNo = checkNull(genericUtility.getColumnValue("ref_id__inv", dom)); String docNo = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom));
String periodCd = checkNull(genericUtility.getColumnValue("ref_date__inv", dom)); String periodCd = gstUtility.checkNull(genericUtility.getColumnValue("ref_date__inv", dom));
sql = "select code from period where '"+periodCd+"' between fr_date and to_date"; sql = "select code from period where '"+periodCd+"' between fr_date and to_date";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
...@@ -2783,7 +2843,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2783,7 +2843,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
double igst_amt = 0.0; double igst_amt = 0.0;
try try
{ {
double taxable_amt = Double.valueOf(checkNull(genericUtility.getColumnValue("taxable_amt", dom))); double taxable_amt = Double.valueOf(gstUtility.checkNull(genericUtility.getColumnValue("taxable_amt", dom)));
igst_amt = (taxable_amt * rate)/100; igst_amt = (taxable_amt * rate)/100;
//System.out.println("RETURN VALUE"+"igst_amt::["+igst_amt+"]"); //System.out.println("RETURN VALUE"+"igst_amt::["+igst_amt+"]");
} }
...@@ -2805,7 +2865,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2805,7 +2865,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
{ {
conn = getConnection(); conn = getConnection();
finCommon = new FinCommon(); finCommon = new FinCommon();
double taxable_amt = Double.valueOf(checkNull(genericUtility.getColumnValue("taxable_amt", dom))); double taxable_amt = Double.valueOf(gstUtility.checkNull(genericUtility.getColumnValue("taxable_amt", dom)));
System.out.println("taxable_amt::["+taxable_amt+"]"); System.out.println("taxable_amt::["+taxable_amt+"]");
cgst_sgst_val = finCommon.getFinparams("999999", "CGST_SGST_RATIO_VAL", conn); cgst_sgst_val = finCommon.getFinparams("999999", "CGST_SGST_RATIO_VAL", conn);
System.out.println("cgst_sgst_val::["+cgst_sgst_val+"]"); System.out.println("cgst_sgst_val::["+cgst_sgst_val+"]");
...@@ -2837,7 +2897,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2837,7 +2897,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
{ {
conn = getConnection(); conn = getConnection();
finCommon = new FinCommon(); finCommon = new FinCommon();
double taxable_amt = Double.valueOf(checkNull(genericUtility.getColumnValue("taxable_amt", dom))); double taxable_amt = Double.valueOf(gstUtility.checkNull(genericUtility.getColumnValue("taxable_amt", dom)));
System.out.println("taxable_amt for SGST::["+taxable_amt+"]"); System.out.println("taxable_amt for SGST::["+taxable_amt+"]");
cgst_sgst_val = finCommon.getFinparams("999999", "CGST_SGST_RATIO_VAL", conn); cgst_sgst_val = finCommon.getFinparams("999999", "CGST_SGST_RATIO_VAL", conn);
System.out.println("cgst_sgst_val::["+cgst_sgst_val+"]"); System.out.println("cgst_sgst_val::["+cgst_sgst_val+"]");
...@@ -2856,12 +2916,5 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal ...@@ -2856,12 +2916,5 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
e.printStackTrace(); e.printStackTrace();
} }
return sgst_amt; return sgst_amt;
} }
private double getDouble(String amount)
{
double result = 0.0;
result = Double.parseDouble((amount==null||amount.equals("")) ? "0" : amount);
return result;
}
} }
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