Commit 1c575a14 authored by ssalve's avatar ssalve

changes done for B2B Invoices , credit note and debit note to check gstin...

changes done for B2B Invoices , credit note and debit note to check gstin number gstcode and tax_reg_no gstcode on 30.08.2017


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106719 ce508802-f39f-4f6c-b175-0d175dae99d5
parent cbc9f7da
...@@ -88,7 +88,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -88,7 +88,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
ArrayList<String> errList = new ArrayList<String>(); ArrayList<String> errList = new ArrayList<String>();
ArrayList<String> errFields = new ArrayList<String>(); ArrayList<String> errFields = new ArrayList<String>();
String tran_type="",gst_type="",gst_rate="",finalCode="",rec_type=""; String tran_type="",gst_type="",gst_rate="",finalCode="",rec_type="";
String state_code="",tax_reg_no = "",itc_type="",state_code_cdn=""; String state_code="",tax_reg_no = "",itc_type="",state_code_cdn="",gstnStateCode="";
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>"); StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
String doc_type="",doc_date="",amount="",doc_no="",ecom_reg_no="",loginSite="",gs_code="",gs_descr=""; String doc_type="",doc_date="",amount="",doc_no="",ecom_reg_no="",loginSite="",gs_code="",gs_descr="";
String quantity="",unit="",taxable_amt="",igst_perc="",igst_amt="",cgst_amt="",sgst_amt="",cess_amt=""; String quantity="",unit="",taxable_amt="",igst_perc="",igst_amt="",cgst_amt="",sgst_amt="",cess_amt="";
...@@ -597,6 +597,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -597,6 +597,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn)); loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
igst_perc = gstUtility.checkNull(genericUtility.getColumnValue("igst_perc", dom)).trim(); igst_perc = gstUtility.checkNull(genericUtility.getColumnValue("igst_perc", dom)).trim();
igst_percVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("igst_perc", dom)).trim()); igst_percVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("igst_perc", dom)).trim());
//Added by sarita on 30.08.2017
gstnStateCode = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom1)).substring(0,2);//Value of StateCode set by using Supplier GSTIN number first 2digit.
//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+"]"); //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+"]");
}//end of if block for igst_perc }//end of if block for igst_perc
...@@ -607,7 +609,10 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -607,7 +609,10 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn)); loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
igst_amt = gstUtility.checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim(); igst_amt = gstUtility.checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim();
igst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim()); igst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim());
//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+"]"); //Added by sarita on 30.08.2017
gstnStateCode = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom1)).substring(0,2);//Value of StateCode set by using Supplier GSTIN number first 2digit.
//state_code_cdn = getGstCodeForCDNR(dom,conn);
System.out.println("INPUT VALUE in Validation"+"gst_type["+gst_type+"]"+"state_code["+state_code+"]"+"loginSiteCode["+loginSiteCode+"]"+"igst_amt["+igst_amt+"]"+"igst_amtVal["+igst_amtVal+"]"+"gstnStateCode["+gstnStateCode+"]");
}//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))
...@@ -617,6 +622,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -617,6 +622,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
cgst_perc = gstUtility.checkNull(genericUtility.getColumnValue("cgst_perc", dom)).trim(); cgst_perc = gstUtility.checkNull(genericUtility.getColumnValue("cgst_perc", dom)).trim();
loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn)); loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
cgst_percVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("cgst_perc", dom)).trim()); cgst_percVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("cgst_perc", dom)).trim());
//Added by sarita on 30.08.2017
gstnStateCode = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom1)).substring(0,2);//Value of StateCode set by using Supplier GSTIN number first 2digit.
//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+"]"); //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+"]");
}//end of if block for cgst_perc }//end of if block for cgst_perc
...@@ -627,7 +634,10 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -627,7 +634,10 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
cgst_amt = gstUtility.checkNull(genericUtility.getColumnValue("cgst_amt", dom)).trim(); cgst_amt = gstUtility.checkNull(genericUtility.getColumnValue("cgst_amt", dom)).trim();
loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn)); loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
cgst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("cgst_amt", dom)).trim()); cgst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("cgst_amt", dom)).trim());
//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+"]"); //Added by sarita on 30.08.2017
gstnStateCode = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom1)).substring(0,2);//Value of StateCode set by using Supplier GSTIN number first 2digit.
//state_code_cdn = getGstCodeForCDNR(dom,conn);
System.out.println("INPUT VALUE in Validation"+"gst_type["+gst_type+"]"+"state_code["+state_code+"]"+"cgst_amt["+cgst_amt+"]"+"loginSiteCode["+loginSiteCode+"]"+"cgst_amtVal["+cgst_amtVal+"]"+"gstnStateCode["+gstnStateCode+"]");
}//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))
...@@ -637,6 +647,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -637,6 +647,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
sgst_perc = gstUtility.checkNull(genericUtility.getColumnValue("sgst_perc", dom)).trim(); sgst_perc = gstUtility.checkNull(genericUtility.getColumnValue("sgst_perc", dom)).trim();
loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn)); loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
sgst_percVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("sgst_perc", dom)).trim()); sgst_percVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("sgst_perc", dom)).trim());
//Added by sarita on 30.08.2017
gstnStateCode = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom1)).substring(0,2);//Value of StateCode set by using Supplier GSTIN number first 2digit.
//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+"]"); //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+"]");
}//end of if block for sgst_perc }//end of if block for sgst_perc
...@@ -647,7 +659,10 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -647,7 +659,10 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
sgst_amt = gstUtility.checkNull(genericUtility.getColumnValue("sgst_amt", dom)).trim(); sgst_amt = gstUtility.checkNull(genericUtility.getColumnValue("sgst_amt", dom)).trim();
loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn)); loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
sgst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("sgst_amt", dom)).trim()); sgst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("sgst_amt", dom)).trim());
//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+"]"); //Added by sarita on 30.08.2017
gstnStateCode = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom1)).substring(0,2);//Value of StateCode set by using Supplier GSTIN number first 2digit.
//state_code_cdn = getGstCodeForCDNR(dom,conn);
System.out.println("INPUT VALUE in Validation"+"gst_type["+gst_type+"]"+"state_code["+state_code+"]"+"sgst_amt["+sgst_amt+"]"+"loginSiteCode["+loginSiteCode+"]"+"sgst_amtVal["+sgst_amtVal+"]"+"gstnStateCode["+gstnStateCode+"]");
}//end of if block for sgst_amt }//end of if block for sgst_amt
else if("itc_igst".equalsIgnoreCase(childNodeName)) else if("itc_igst".equalsIgnoreCase(childNodeName))
...@@ -803,7 +818,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -803,7 +818,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
// *********************************** Validation for igst_amt [END]********************************************* // *********************************** Validation for igst_amt [END]*********************************************
//removed validation for gst_type A and T for igst_amt //removed validation for gst_type A and T for igst_amt
if("I".equalsIgnoreCase(gst_type) && ("R".equalsIgnoreCase(doc_type)) || ("DE".equalsIgnoreCase(doc_type)) || "R".equalsIgnoreCase(gst_type) //changed by sarita on 30.08.2017
if("I".equalsIgnoreCase(gst_type) && ("Z".equalsIgnoreCase(doc_type)) || ("DE".equalsIgnoreCase(doc_type)) || "R".equalsIgnoreCase(gst_type)
|| "U".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type) || "G".equalsIgnoreCase(gst_type)) || "U".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type) || "G".equalsIgnoreCase(gst_type))
{ {
if((state_code != null) && !(state_code.equalsIgnoreCase(loginSiteCode))) if((state_code != null) && !(state_code.equalsIgnoreCase(loginSiteCode)))
...@@ -830,6 +846,34 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -830,6 +846,34 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
} }
} }
} }
//Added by sarita on 30.08.2017[start]
else if("I".equalsIgnoreCase(gst_type) && ("R".equalsIgnoreCase(doc_type)))
{
if((state_code != null) && !(state_code.equalsIgnoreCase(gstnStateCode)))
{
if(igst_amt == null || igst_amt.trim().length() == 0)
{
errCode = "NULLIGSTAM";
errList.add(errCode);
errFields.add("igst_amt");
}
else if(igst_amtVal == 0)
{
errCode = "INVZEROVAL";
errList.add(errCode);
errFields.add("igst_amt");
}
cgst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("cgst_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+"]");
if((cgst_amtVal > 0) || (sgst_amtVal > 0))
{
errCode = "INVINTRAST";
errList.add(errCode);
errFields.add("igst_amt");
}
}
}
//Added by sarita on 30.08.2017[end]
else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type)) else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type))
{ {
refIdInv = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom1)); refIdInv = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom1));
...@@ -859,7 +903,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -859,7 +903,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
rs.close(); rs.close();
rs = null; rs = null;
} }
if((gstCode != null) && !(gstCode.equalsIgnoreCase(loginSiteCode))) //Added by sarita on 30.08.2017
if((gstCode != null) && !(gstCode.equalsIgnoreCase(gstnStateCode)))
{ {
if(igst_amt == null || igst_amt.trim().length() == 0) if(igst_amt == null || igst_amt.trim().length() == 0)
{ {
...@@ -890,8 +935,9 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -890,8 +935,9 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
// ************************************ Validation for cgst_amt [START]****************************************** // ************************************ Validation for cgst_amt [START]******************************************
//removed validation for gst_type A and T for igst_amt //removed validation for gst_type A and T for igst_amt
if(("I".equalsIgnoreCase(gst_type) && ("R".equalsIgnoreCase(doc_type))) || "R".equalsIgnoreCase(gst_type) || "U".equalsIgnoreCase(gst_type) //Added by sarita on 30.08.2017
|| "S".equalsIgnoreCase(gst_type) || "G".equalsIgnoreCase(gst_type)) if(("R".equalsIgnoreCase(gst_type) || "U".equalsIgnoreCase(gst_type)
|| "S".equalsIgnoreCase(gst_type) || "G".equalsIgnoreCase(gst_type)))
{ {
if((state_code != null) && (state_code.equalsIgnoreCase(loginSiteCode))) if((state_code != null) && (state_code.equalsIgnoreCase(loginSiteCode)))
{ {
...@@ -917,6 +963,35 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -917,6 +963,35 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
} }
} }
} }
//Added by sarita on 30.08.2017[start]
else if("I".equalsIgnoreCase(gst_type) && ("R".equalsIgnoreCase(doc_type)))
{
if((state_code != null) && !(state_code.equalsIgnoreCase(gstnStateCode)))
{
if(igst_amt == null || igst_amt.trim().length() == 0)
{
errCode = "NULLIGSTAM";
errList.add(errCode);
errFields.add("igst_amt");
}
else if(igst_amtVal == 0)
{
errCode = "INVZEROVAL";
errList.add(errCode);
errFields.add("igst_amt");
}
cgst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("cgst_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+"]");
if((cgst_amtVal > 0) || (sgst_amtVal > 0))
{
errCode = "INVINTRAST";
errList.add(errCode);
errFields.add("igst_amt");
}
}
}
//Added by sarita on 30.08.2017[end]
else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type)) else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type))
{ {
refIdInv = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom1)); refIdInv = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom1));
...@@ -945,7 +1020,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -945,7 +1020,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
rs.close(); rs.close();
rs = null; rs = null;
} }
if((gstCode != null) && (gstCode.equalsIgnoreCase(loginSiteCode))) //changes by sarita on 30.08.2017
if((gstCode != null) && (gstCode.equalsIgnoreCase(gstnStateCode)))
{ {
if(cgst_amt == null || cgst_amt.trim().length() == 0) if(cgst_amt == null || cgst_amt.trim().length() == 0)
{ {
...@@ -972,10 +1048,11 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -972,10 +1048,11 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
// ********************************** Validation for cgst_amt [END]******************************************** // ********************************** Validation for cgst_amt [END]********************************************
// ************************** Validation for sgst_amt [START]************************************************** // ************************** Validation for sgst_amt [START]**************************************************
if(("I".equalsIgnoreCase(gst_type) && ("R".equalsIgnoreCase(doc_type))) || "R".equalsIgnoreCase(gst_type) || "U".equalsIgnoreCase(gst_type) if(("R".equalsIgnoreCase(gst_type) || "U".equalsIgnoreCase(gst_type)
|| "S".equalsIgnoreCase(gst_type) || "G".equalsIgnoreCase(gst_type)) || "S".equalsIgnoreCase(gst_type) || "G".equalsIgnoreCase(gst_type)))
{ {
if((state_code != null) && (state_code.equalsIgnoreCase(loginSiteCode))) //changes by sarita on 30.08.2017
if((state_code != null) && (state_code.equalsIgnoreCase(gstnStateCode)))
{ {
if(sgst_amt == null || sgst_amt.trim().length() == 0) if(sgst_amt == null || sgst_amt.trim().length() == 0)
{ {
...@@ -998,6 +1075,34 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -998,6 +1075,34 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
} }
} }
} }
//Added by sarita on 30.08.2017[start]
else if("I".equalsIgnoreCase(gst_type) && ("R".equalsIgnoreCase(doc_type)))
{
if((state_code != null) && !(state_code.equalsIgnoreCase(gstnStateCode)))
{
if(igst_amt == null || igst_amt.trim().length() == 0)
{
errCode = "NULLIGSTAM";
errList.add(errCode);
errFields.add("igst_amt");
}
else if(igst_amtVal == 0)
{
errCode = "INVZEROVAL";
errList.add(errCode);
errFields.add("igst_amt");
}
cgst_amtVal = converStringToDouble(gstUtility.checkNull(genericUtility.getColumnValue("cgst_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+"]");
if((cgst_amtVal > 0) || (sgst_amtVal > 0))
{
errCode = "INVINTRAST";
errList.add(errCode);
errFields.add("igst_amt");
}
}
}
//Added by sarita on 30.08.2017[end]
else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type)) else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type))
{ {
refIdInv = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom1)); refIdInv = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom1));
...@@ -1026,7 +1131,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -1026,7 +1131,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
rs.close(); rs.close();
rs = null; rs = null;
} }
if((gstCode != null) && (gstCode.equalsIgnoreCase(loginSiteCode))) //changes by sarita on 30.08.2017
if((gstCode != null) && (gstCode.equalsIgnoreCase(gstnStateCode)))
{ {
if(sgst_amt == null || sgst_amt.trim().length() == 0) if(sgst_amt == null || sgst_amt.trim().length() == 0)
{ {
...@@ -1247,7 +1353,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -1247,7 +1353,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
String doc_no="",itc_type="",gst_codeVal="",gstTypeEdit="",doc_type=""; String doc_no="",itc_type="",gst_codeVal="",gstTypeEdit="",doc_type="";
String docDateStr="",itc_igst = "",itc_cgst="",itc_sgst="",itc_cess=""; String docDateStr="",itc_igst = "",itc_cgst="",itc_sgst="",itc_cess="";
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="",gstnStateCode="";
Timestamp doc_date=null; Timestamp doc_date=null;
String loginSite = "",state1="",stCode="",refIdInv="",ref_date__inv="",cgst_amt="",sgst_amt="",igst_amt; String loginSite = "",state1="",stCode="",refIdInv="",ref_date__inv="",cgst_amt="",sgst_amt="",igst_amt;
Timestamp refInvDateDate=null,invDate=null; Timestamp refInvDateDate=null,invDate=null;
...@@ -2517,7 +2623,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -2517,7 +2623,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
else if("gst_rate".equalsIgnoreCase(currentColumn.trim())) else if("gst_rate".equalsIgnoreCase(currentColumn.trim()))
{ {
gst_rate = gstUtility.getDouble(gstUtility.checkNull(genericUtility.getColumnValue("gst_rate", dom))); gst_rate = gstUtility.getDouble(gstUtility.checkNull(genericUtility.getColumnValue("gst_rate", dom)));
state_code = gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom1)); state_code = gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom1)); // value of PlaceOfSupply
gstnStateCode = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom1)).substring(0,2);//Value of StateCode set by using Supplier GSTIN number first 2digit.
loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn)); loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1)); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1));
doc_type = gstUtility.checkNull(genericUtility.getColumnValue("doc_type", dom1)).trim(); doc_type = gstUtility.checkNull(genericUtility.getColumnValue("doc_type", dom1)).trim();
...@@ -2525,7 +2632,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -2525,7 +2632,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
rate = (gst_rate); rate = (gst_rate);
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);//System.out.println("Input Value::"+"gst_rate["+gst_rate+"]"+"state_code["+state_code+"]"+"loginSiteCode["+loginSiteCode+"]"+"gst_type["+gst_type+"]"); sgst_amount = getSgst_Amt(rate, dom);
System.out.println("Input Value::"+"gst_rate["+gst_rate+"]"+"state_code["+state_code+"]"+"loginSiteCode["+loginSiteCode+"]"+"gst_type["+gst_type+"]"+"gstnStateCode["+gstnStateCode+"]");
if("G".equalsIgnoreCase(gst_type) || ("I".equalsIgnoreCase(gst_type) && ("DE".equalsIgnoreCase(doc_type)) || ("Z".equalsIgnoreCase(doc_type)))) if("G".equalsIgnoreCase(gst_type) || ("I".equalsIgnoreCase(gst_type) && ("DE".equalsIgnoreCase(doc_type)) || ("Z".equalsIgnoreCase(doc_type))))
{ {
...@@ -2534,6 +2642,29 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -2534,6 +2642,29 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
valueXmlString.append("<cgst_amt protect = \"1\">").append("<![CDATA[0.0]]>").append("</cgst_amt>"); valueXmlString.append("<cgst_amt protect = \"1\">").append("<![CDATA[0.0]]>").append("</cgst_amt>");
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>");
} }
//Added by sarita on 30.08.2017[start]
else if("I".equalsIgnoreCase(gst_type) && ("R".equalsIgnoreCase(doc_type)))
{
if(state_code != null && state_code.trim().length() > 0)
{
if(state_code.equalsIgnoreCase(gstnStateCode))
{
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("<igst_amt protect = \"1\">").append("<![CDATA[0.0]]>").append("</igst_amt>");
valueXmlString.append("<cgst_amt protect = \"0\">").append("<![CDATA["+cgst_amount+"]]>").append("</cgst_amt>");
valueXmlString.append("<sgst_amt protect = \"0\">").append("<![CDATA["+sgst_amount+"]]>").append("</sgst_amt>");
}
else if(!(state_code.equalsIgnoreCase(gstnStateCode)))
{
valueXmlString.append("<igst_perc>").append("<![CDATA["+gst_rate+"]]>").append("</igst_perc>");
valueXmlString.append("<igst_amt protect = \"0\">").append("<![CDATA["+igst_amount+"]]>").append("</igst_amt>");
valueXmlString.append("<cgst_amt protect = \"1\">").append("<![CDATA[0.0]]>").append("</cgst_amt>");
valueXmlString.append("<sgst_amt protect = \"1\">").append("<![CDATA[0.0]]>").append("</sgst_amt>");
}
}//end of if block if state_code is not null
}
//Added by sarita on 30.08.2017[end]
else if("C".equalsIgnoreCase(gst_type) || "D".equalsIgnoreCase(gst_type)) else if("C".equalsIgnoreCase(gst_type) || "D".equalsIgnoreCase(gst_type))
{ {
refIdInv = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom1)); refIdInv = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom1));
...@@ -2587,8 +2718,9 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -2587,8 +2718,9 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
else else
{ {
if(state_code != null && state_code.trim().length() > 0) if(state_code != null && state_code.trim().length() > 0)
{ {
if(state_code.equalsIgnoreCase(loginSiteCode)) //changes by sarita on 30.08.2017
if(state_code.equalsIgnoreCase(gstnStateCode))
{ {
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>");
...@@ -2596,7 +2728,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -2596,7 +2728,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
valueXmlString.append("<cgst_amt protect = \"0\">").append("<![CDATA["+cgst_amount+"]]>").append("</cgst_amt>"); valueXmlString.append("<cgst_amt protect = \"0\">").append("<![CDATA["+cgst_amount+"]]>").append("</cgst_amt>");
valueXmlString.append("<sgst_amt protect = \"0\">").append("<![CDATA["+sgst_amount+"]]>").append("</sgst_amt>"); valueXmlString.append("<sgst_amt protect = \"0\">").append("<![CDATA["+sgst_amount+"]]>").append("</sgst_amt>");
} }
else if(!(state_code.equalsIgnoreCase(loginSiteCode))) else if(!(state_code.equalsIgnoreCase(gstnStateCode)))
{ {
valueXmlString.append("<igst_perc>").append("<![CDATA["+gst_rate+"]]>").append("</igst_perc>"); valueXmlString.append("<igst_perc>").append("<![CDATA["+gst_rate+"]]>").append("</igst_perc>");
valueXmlString.append("<igst_amt protect = \"0\">").append("<![CDATA["+igst_amount+"]]>").append("</igst_amt>"); valueXmlString.append("<igst_amt protect = \"0\">").append("<![CDATA["+igst_amount+"]]>").append("</igst_amt>");
...@@ -2612,17 +2744,17 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -2612,17 +2744,17 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
{ {
String taxableAmt = gstUtility.checkNull(genericUtility.getColumnValue("taxable_amt", dom)); String taxableAmt = gstUtility.checkNull(genericUtility.getColumnValue("taxable_amt", dom));
gst_rate = gstUtility.getDouble(gstUtility.checkNull(genericUtility.getColumnValue("gst_rate", dom)));//System.out.println("INPUT VALUE"+"taxableAmt::["+taxableAmt+"]"+"[AND]"+"gst_rate::["+gst_rate+"]"); gst_rate = gstUtility.getDouble(gstUtility.checkNull(genericUtility.getColumnValue("gst_rate", dom)));//System.out.println("INPUT VALUE"+"taxableAmt::["+taxableAmt+"]"+"[AND]"+"gst_rate::["+gst_rate+"]");
doc_type = gstUtility.checkNull(genericUtility.getColumnValue("doc_type", dom1)).trim(); doc_type = gstUtility.checkNull(genericUtility.getColumnValue("doc_type", dom1)).trim();
if(gst_rate > 0) if(gst_rate > 0)
{ {
rate = (gst_rate); rate = (gst_rate);
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 = gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom1)); state_code = gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom1));//Value of Place of Supply
loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn)); loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1)); gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1));
gstnStateCode = gstUtility.checkNull(genericUtility.getColumnValue("tax_reg_no", dom1)).substring(0,2);//Value of StateCode set by using Supplier GSTIN number first 2digit.
if("G".equalsIgnoreCase(gst_type) || ("I".equalsIgnoreCase(gst_type) && ("DE".equalsIgnoreCase(doc_type)) || ("Z".equalsIgnoreCase(doc_type)))) if("G".equalsIgnoreCase(gst_type) || ("I".equalsIgnoreCase(gst_type) && ("DE".equalsIgnoreCase(doc_type)) || ("Z".equalsIgnoreCase(doc_type))))
{ {
valueXmlString.append("<igst_perc>").append("<![CDATA["+gst_rate+"]]>").append("</igst_perc>"); valueXmlString.append("<igst_perc>").append("<![CDATA["+gst_rate+"]]>").append("</igst_perc>");
...@@ -2630,6 +2762,27 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -2630,6 +2762,27 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
valueXmlString.append("<cgst_amt protect = \"1\">").append("<![CDATA[0.0]]>").append("</cgst_amt>"); valueXmlString.append("<cgst_amt protect = \"1\">").append("<![CDATA[0.0]]>").append("</cgst_amt>");
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>");
} }
else if("I".equalsIgnoreCase(gst_type) && ("R".equalsIgnoreCase(doc_type)))
{
if(state_code != null && state_code.trim().length() > 0)
{
if(state_code.equalsIgnoreCase(gstnStateCode))
{
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("<igst_amt protect = \"1\">").append("<![CDATA[0.0]]>").append("</igst_amt>");
valueXmlString.append("<cgst_amt protect = \"0\">").append("<![CDATA["+cgst_amount+"]]>").append("</cgst_amt>");
valueXmlString.append("<sgst_amt protect = \"0\">").append("<![CDATA["+sgst_amount+"]]>").append("</sgst_amt>");
}
else if(!(state_code.equalsIgnoreCase(gstnStateCode)))
{
valueXmlString.append("<igst_perc>").append("<![CDATA["+gst_rate+"]]>").append("</igst_perc>");
valueXmlString.append("<igst_amt protect = \"0\">").append("<![CDATA["+igst_amount+"]]>").append("</igst_amt>");
valueXmlString.append("<cgst_amt protect = \"1\">").append("<![CDATA[0.0]]>").append("</cgst_amt>");
valueXmlString.append("<sgst_amt protect = \"1\">").append("<![CDATA[0.0]]>").append("</sgst_amt>");
}
}//end of if block if state_code is not null
}
else if("C".equalsIgnoreCase(gst_type) || "D".equalsIgnoreCase(gst_type)) else if("C".equalsIgnoreCase(gst_type) || "D".equalsIgnoreCase(gst_type))
{ {
refIdInv = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom1)); refIdInv = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom1));
...@@ -2661,7 +2814,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -2661,7 +2814,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
} }
if(gstCode != null && gstCode.trim().length() > 0) if(gstCode != null && gstCode.trim().length() > 0)
{ {
if(gstCode.equalsIgnoreCase(loginSiteCode)) if(gstCode.equalsIgnoreCase(gstnStateCode))
{ {
igst_amt = gstUtility.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
...@@ -2671,7 +2824,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote ...@@ -2671,7 +2824,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
valueXmlString.append("<cgst_amt protect = \"0\">").append("<![CDATA["+cgst_amount+"]]>").append("</cgst_amt>"); valueXmlString.append("<cgst_amt protect = \"0\">").append("<![CDATA["+cgst_amount+"]]>").append("</cgst_amt>");
valueXmlString.append("<sgst_amt protect = \"0\">").append("<![CDATA["+sgst_amount+"]]>").append("</sgst_amt>"); valueXmlString.append("<sgst_amt protect = \"0\">").append("<![CDATA["+sgst_amount+"]]>").append("</sgst_amt>");
} }
else if(!(state_code.equalsIgnoreCase(loginSiteCode))) else if(!(state_code.equalsIgnoreCase(gstnStateCode)))
{ {
valueXmlString.append("<igst_perc>").append("<![CDATA["+gst_rate+"]]>").append("</igst_perc>"); valueXmlString.append("<igst_perc>").append("<![CDATA["+gst_rate+"]]>").append("</igst_perc>");
valueXmlString.append("<igst_amt protect = \"0\">").append("<![CDATA["+igst_amount+"]]>").append("</igst_amt>"); valueXmlString.append("<igst_amt protect = \"0\">").append("<![CDATA["+igst_amount+"]]>").append("</igst_amt>");
......
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