Commit 7033f0e6 authored by ssalve's avatar ssalve

Updated GstrIC.java code 20JUL2017


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106329 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 85eb95d7
......@@ -13,6 +13,7 @@ import java.util.Date;
import javax.ejb.Stateless;
import org.apache.log4j.spi.ErrorCode;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
......@@ -92,6 +93,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
String name="",addr1="",addr2="",addr3="",city="",state="",pin="",loginSiteCode="",ecomRegNo="",orderNo="";
double cgst_amtVal=0.0,sgst_amtVal=0.0,cgst_percVal=0.0,sgst_percVal=0.0;
double igst_percVal=0.0,igst_amtVal=0.0,gstRate=0.0;
String refIdInv="",gstCode="";
Timestamp refInvDateDate = null,invDate = null;
try
......@@ -102,9 +104,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
//System.out.println("currentFormNo:::"+currentFormNo);
currentFormNo = Integer.parseInt(objContext); //System.out.println("currentFormNo:::"+currentFormNo);
switch(currentFormNo)
{
case 1:
......@@ -118,11 +119,10 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
{
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
System.out.println("childNodeName:::"+childNodeName);
if("gst_type".equalsIgnoreCase(childNodeName))
if("gst_type".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
System.out.println("gst_type Type ======"+gst_type);
//System.out.println("childNodeName:::"+childNodeName+"childNode["+childNode+"]"+"gst_type["+gst_type+"]");
if(gst_type == null || gst_type.trim().length() == 0)
{
errCode = "NULLDOCTYP";
......@@ -163,15 +163,14 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
{
doc_type = checkNull(genericUtility.getColumnValue("doc_type", dom)).trim();
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
//System.out.println("Document Type is ["+doc_type+"]");
//System.out.println("Selected Transaction Type is["+gst_type+"]");
System.out.println("Document Type is ["+doc_type+"]"+"gst_type["+gst_type+"]");
}//end of if block for doc_type
else if("tax_reg_no".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
tax_reg_no = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]");
System.out.println("tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]");
}//end of if block for tax_reg_no
else if("name".equalsIgnoreCase(childNodeName))
......@@ -179,7 +178,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
tax_reg_no = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim();
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
name = checkNull(genericUtility.getColumnValue("name", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]");
System.out.println("tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"name["+name+"]");
}//end of if block for name
else if("addr1".equalsIgnoreCase(childNodeName))
......@@ -187,7 +186,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
tax_reg_no = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim();
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
addr1 = checkNull(genericUtility.getColumnValue("addr1", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]");
System.out.println("tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"addr1["+addr1+"]");
}//end of if block for addr1
else if("addr2".equalsIgnoreCase(childNodeName))
......@@ -195,7 +194,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
tax_reg_no = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim();
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
addr2 = checkNull(genericUtility.getColumnValue("addr2", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]");
System.out.println("tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"addr2["+addr2+"]");
}//end of if block for addr2
else if("addr3".equalsIgnoreCase(childNodeName))
......@@ -203,7 +202,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
tax_reg_no = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim();
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
addr3 = checkNull(genericUtility.getColumnValue("addr3", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]");
System.out.println("tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"addr3["+addr3+"]");
}//end of if block for addr3
else if("city".equalsIgnoreCase(childNodeName))
......@@ -211,7 +210,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
tax_reg_no = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim();
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
city = checkNull(genericUtility.getColumnValue("city", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]");
System.out.println("tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"city["+city+"]");
}//end of if block for city
else if("gst_state_code".equalsIgnoreCase(childNodeName))
......@@ -219,7 +218,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
tax_reg_no = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim();
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
state = checkNull(genericUtility.getColumnValue("gst_state_code", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]");
System.out.println("tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"state["+state+"]");
}//end of if block for state
else if("pin".equalsIgnoreCase(childNodeName))
......@@ -227,85 +226,86 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
tax_reg_no = checkNull(genericUtility.getColumnValue("tax_reg_no", dom)).trim();
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
pin = checkNull(genericUtility.getColumnValue("pin", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]");
System.out.println("tax_reg_no["+tax_reg_no+"]"+"gst_type["+gst_type+"]"+"pin["+pin+"]");
}//end of if block for pin
else if("gst_code_state".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
state_code = checkNull(genericUtility.getColumnValue("gst_code_state", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]");
System.out.println("gst_type["+gst_type+"]"+"gst_code_state["+state_code+"]");
}//end of if block for gst_code_state
else if("doc_no".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
doc_no = checkNull(genericUtility.getColumnValue("doc_no", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]");
System.out.println("gst_type["+gst_type+"]"+"doc_no["+doc_no+"]");
}//end of if block for doc_no
else if("doc_date".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
doc_date = checkNull(genericUtility.getColumnValue("doc_date", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]");
System.out.println("gst_type["+gst_type+"]"+"doc_date["+doc_date+"]");
}//end of if block for doc_date
else if("amount".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
amount = checkNull(genericUtility.getColumnValue("amount", dom)).trim();
//System.out.println("Selected Transaction for Amount Type is["+gst_type+"]");
System.out.println("gst_type["+gst_type+"]"+"amount["+amount+"]");
}//end of if block for amount
else if("reverse_chrg".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
reverse_chrg = checkNull(genericUtility.getColumnValue("reverse_chrg", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]");
System.out.println("gst_type["+gst_type+"]"+"reverse_chrg["+reverse_chrg+"]");
}//end of if block for reverse_chrg
else if("ecom_reg_no".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
doc_type = checkNull(genericUtility.getColumnValue("doc_type", dom)).trim();
ecomRegNo = checkNull(genericUtility.getColumnValue("ecom_reg_no", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]");
System.out.println("gst_type["+gst_type+"]"+"doc_type["+doc_type+"]"+"ecomRegNo["+ecomRegNo+"]");
}//end of if block for ecom_reg_no
else if("ref_id__inv".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
ref_id__inv = checkNull(genericUtility.getColumnValue("ref_id__inv", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]");
System.out.println("gst_type["+gst_type+"]"+"ref_id__inv["+ref_id__inv+"]");
}//end of if block for ref_id__inv
else if("ref_date__inv".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
ref_date__inv = checkNull(genericUtility.getColumnValue("ref_date__inv", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]");s
System.out.println("gst_type["+gst_type+"]"+"ref_date__inv["+ref_date__inv+"]");
}//end of if block for ref_date__inv
else if("order_no".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
orderNo = checkNull(genericUtility.getColumnValue("order_no", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]");
System.out.println("gst_type["+gst_type+"]"+"orderNo["+orderNo+"]");
}//end of if block for order_no
else if("lr_no".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
lr_no = checkNull(genericUtility.getColumnValue("lr_no", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]");
System.out.println("gst_type["+gst_type+"]"+"lr_no["+lr_no+"]");
}//end of if block for lr_no
else if("lr_date".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
lr_date = checkNull(genericUtility.getColumnValue("lr_date", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]"); }//end of if block for lr_date
}
System.out.println("gst_type["+gst_type+"]"+"lr_date["+lr_date+"]");
}//end of if block for lr_date
}//end of for loop
......@@ -319,66 +319,12 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
errFields.add(childNodeName.toLowerCase());
}
}
/*else if(doc_type != null && doc_type.trim().length() > 0)
{
if("I".equalsIgnoreCase(gst_type))
{
if(doc_type.equalsIgnoreCase("WPAY") || doc_type.equalsIgnoreCase("WOPAY")
|| doc_type.equalsIgnoreCase("SEWP") || doc_type.equalsIgnoreCase("SEWOP")
|| doc_type.equalsIgnoreCase("DE") || doc_type.equalsIgnoreCase("D")
|| doc_type.equalsIgnoreCase("C") || doc_type.equalsIgnoreCase("NRATD")
|| doc_type.equalsIgnoreCase("EXEMP")|| doc_type.equalsIgnoreCase("NOGST"))
{
errCode = "INVDOCUTYP";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if("E".equalsIgnoreCase(gst_type))
{
if(doc_type.equalsIgnoreCase("R") || doc_type.equalsIgnoreCase("D")
|| doc_type.equalsIgnoreCase("C") || doc_type.equalsIgnoreCase("NRATD")
|| doc_type.equalsIgnoreCase("EXEMP")|| doc_type.equalsIgnoreCase("NOGST"))
{
errCode = "INVDOCUTYP";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if("L".equalsIgnoreCase(gst_type))
{
if(doc_type.equalsIgnoreCase("R") || doc_type.equalsIgnoreCase("D")
|| doc_type.equalsIgnoreCase("C") || doc_type.equalsIgnoreCase("WPAY")
|| doc_type.equalsIgnoreCase("WOPAY") || doc_type.equalsIgnoreCase("SEWP")
|| doc_type.equalsIgnoreCase("SEWOP") || doc_type.equalsIgnoreCase("DE")
)
{
errCode = "INVDOCUTYP";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if("N".equalsIgnoreCase(gst_type))
{
if(doc_type.equalsIgnoreCase("R") || doc_type.equalsIgnoreCase("WPAY")
|| doc_type.equalsIgnoreCase("WOPAY") || doc_type.equalsIgnoreCase("SEWP")
|| doc_type.equalsIgnoreCase("SEWOP") || doc_type.equalsIgnoreCase("DE")
|| doc_type.equalsIgnoreCase("NRATD")
|| doc_type.equalsIgnoreCase("EXEMP")|| doc_type.equalsIgnoreCase("NOGST"))
{
errCode = "INVDOCUTYP";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
}*/
// *************************** Validation for DOC_TYPE [end] ****************************************
// *************************** Validation for tax_reg_no [start] ************************************
//Added by sarita on 14/07/2017 [START]
if("I".equalsIgnoreCase(gst_type))
{
System.out.println("Customer GSTIN Number is ["+tax_reg_no+"]");
if(tax_reg_no == null || tax_reg_no.trim().length() == 0)
{
errCode = "VTNLGSTIN";
......@@ -390,7 +336,6 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type)
|| "D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type)||"E".equalsIgnoreCase(gst_type))
{
System.out.println("Customer GSTIN Number is ["+tax_reg_no+"]");
if(tax_reg_no != null && tax_reg_no.trim().length() > 0)
{
boolean gstinNum = validGSTIN(tax_reg_no,conn);
......@@ -470,8 +415,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type)
|| "E".equalsIgnoreCase(gst_type) || "D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type))
{
//System.out.println("Document Number is ["+doc_no+"]");
if(doc_no == null || doc_no.trim().length() == 0)
if(doc_no == null || doc_no.trim().length() == 0)
{
errCode = "NULLDOCNUM";
errList.add(errCode);
......@@ -485,8 +429,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
|| "E".equalsIgnoreCase(gst_type) || "D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type)
|| "L".equalsIgnoreCase(gst_type) || "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type))
{
//System.out.println("Document Date is ["+doc_date+"]");
if(doc_date == null || doc_date.trim().length() == 0)
if(doc_date == null || doc_date.trim().length() == 0)
{
errCode = "INVDOCDATE";
errList.add(errCode);
......@@ -495,11 +438,9 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
// Added by sarita on 14/07/2017 [start]
else if(doc_date != null && doc_date.trim().length() > 0)
{
System.out.println("Selected doc Date is ::::["+doc_date+"]");
finalCode = checkNull(genericUtility.getColumnValue("prd_code", dom));
rec_type = checkNull(genericUtility.getColumnValue("rec_type", dom));
System.out.println("finalCode::["+finalCode+"]");
System.out.println("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=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,finalCode);
......@@ -537,8 +478,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
|| "E".equalsIgnoreCase(gst_type) || "D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type)
|| "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type))
{
//System.out.println("Document Amount is ["+amount+"]");
if(amount == null || amount.trim().length() == 0)
if(amount == null || amount.trim().length() == 0)
{
errCode = "VTAMTNULL";
errList.add(errCode);
......@@ -546,19 +486,26 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
}
}
// ************************* Validation for Amount [end] *********************************************
// ******************* Validation for Ecommerce GTIN Number [start] ***************************
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] **************************************
if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type))
{
//ref_date__inv = checkNull(genericUtility.getColumnValue("ref_date__inv", dom)).trim();
//refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("ref_id__inv is ["+ref_id__inv+"]");
System.out.println("ref_date__inv is ["+ref_date__inv+"]");
System.out.println("refInvDateDate ["+refInvDateDate+"]");
String dt = "01/07/2017";
//invDate = Timestamp.valueOf(genericUtility.getValidDateString(dt, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("Date is :::::::["+dt+"]"+"invDate::::::::::::["+invDate+"]");
if(ref_id__inv == null || ref_id__inv.trim().length() == 0)
if(ref_id__inv == null || ref_id__inv.trim().length() == 0)
{
errCode = "NULLINVCNM";
errList.add(errCode);
......@@ -598,7 +545,6 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
// ************************* Validation for ref_date_inv [start] *******************************************
if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type))
{
//System.out.println("ref_date__inv is ["+tax_reg_no+"]");
if(ref_date__inv == null || ref_date__inv.trim().length() == 0)
{
errCode = "NULLINVCDT";
......@@ -621,6 +567,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
// ************************* Validation for Shipping Port Code(order_no) [end] ******************************
}//end of case1
break;
case 2:
{
parentNodeList = dom.getElementsByTagName("Detail2");
......@@ -632,48 +579,44 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
{
childNode = childNodeList.item(ctr1);
childNodeName = childNode.getNodeName();
//System.out.println("childNodeNameForDetail2:::"+childNodeName);
System.out.println("childNodeNameForDetail2:::"+childNodeName+"childNode["+childNode+"]");
if("gs_code".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
gs_code = checkNull(genericUtility.getColumnValue("gs_code", dom)).trim();
//System.out.println("Selected Transaction Type is["+tran_type+"]");
//System.out.println("gs_code is===="+gs_code);
System.out.println("gst_type["+gst_type+"]"+"gs_code["+gs_code+"]");
}//end of if block for GS Code
else if("quantity".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
quantity = checkNull(genericUtility.getColumnValue("quantity", dom)).trim();
//System.out.println("Selected Transaction Type is["+gst_type+"]");
//System.out.println("quantity is===="+quantity);
System.out.println("gst_type["+gst_type+"]"+"quantity["+quantity+"]");
}//end of if block for quantity
else if("unit".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
unit = checkNull(genericUtility.getColumnValue("unit", dom)).trim();
//System.out.println("Selected Transaction Type is["+tran_type+"]");
//System.out.println("unit is===="+unit);
System.out.println("gst_type["+gst_type+"]"+"unit["+unit+"]");
}//end of if block for unit
else if("taxable_amt".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
taxable_amt = checkNull(genericUtility.getColumnValue("taxable_amt", dom)).trim();
//System.out.println("Selected Transaction Type is["+tran_type+"]");
//System.out.println("taxable_amt is===="+taxable_amt);
System.out.println("gst_type["+gst_type+"]"+"taxable_amt["+taxable_amt+"]");
}//end of if block for taxable_amt
else if("gst_rate".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
doc_type = checkNull(genericUtility.getColumnValue("doc_type", dom1)).trim();
gst_rate = checkNull(genericUtility.getColumnValue("gst_rate", dom)).trim();
// Added by sarita on 14/07/2017
gstRate = converStringToDouble(checkNull(genericUtility.getColumnValue("gst_rate", dom)).trim());
taxable_amt = checkNull(genericUtility.getColumnValue("taxable_amt", dom)).trim();
System.out.println("gst_rate::::["+gst_rate+"]");
//System.out.println("Taxable Amount is:::::["+taxable_amt+"]");
System.out.println("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
else if("igst_perc".equalsIgnoreCase(childNodeName))
......@@ -684,12 +627,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
igst_perc = checkNull(genericUtility.getColumnValue("igst_perc", dom)).trim();
igst_percVal = converStringToDouble(checkNull(genericUtility.getColumnValue("igst_perc", dom)).trim());
state_code_cdn = getGstCodeForCDNR(dom,conn);
System.out.println("Selected Transaction Type is["+tran_type+"]");
System.out.println("gst_code_state>>>"+state_code);
System.out.println("loginSite>>>>"+loginSite);
System.out.println("igst_perc>>>>"+igst_perc);
System.out.println("loginSiteCode>>>>>"+loginSiteCode);
System.out.println("**** igst_percVal*****"+igst_percVal);
System.out.println("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
else if("igst_amt".equalsIgnoreCase(childNodeName))
......@@ -700,10 +638,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
igst_amt = checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim();
igst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim());
state_code_cdn = getGstCodeForCDNR(dom,conn);
System.out.println("Selected Transaction Type is["+tran_type+"]");
System.out.println("state_code>>>"+state_code);
System.out.println("loginSite>>>>"+loginSite);
System.out.println("****igst_amtVal *******"+igst_amtVal);
System.out.println("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
else if("cgst_perc".equalsIgnoreCase(childNodeName))
......@@ -713,11 +648,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
cgst_perc = checkNull(genericUtility.getColumnValue("cgst_perc", dom)).trim();
loginSiteCode = checkNull(getStateFromLoginSite(loginSite,conn));
cgst_percVal = converStringToDouble(checkNull(genericUtility.getColumnValue("cgst_perc", dom)).trim());
//state_code_cdn = getGstCodeForCDNR(dom,conn);
//System.out.println("Selected Transaction Type is["+tran_type+"]");
//System.out.println("state_code>>>"+state_code);
//System.out.println("loginSite>>>>"+loginSiteCode);
//System.out.println("**** cgst_amtVal ******"+cgst_percVal);
state_code_cdn = getGstCodeForCDNR(dom,conn);
System.out.println("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
else if("cgst_amt".equalsIgnoreCase(childNodeName))
......@@ -727,14 +659,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
cgst_amt = checkNull(genericUtility.getColumnValue("cgst_amt", dom)).trim();
loginSiteCode = checkNull(getStateFromLoginSite(loginSite,conn));
cgst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("cgst_amt", dom)).trim());
//state_code_cdn = getGstCodeForCDNR(dom,conn);
System.out.println("Selected Transaction Type is["+gst_type+"]");
System.out.println("state_code>>>"+state_code);
System.out.println("loginSite>>>>"+loginSite);
System.out.println("cgst_amt>>>>"+cgst_amt);
System.out.println("loginSiteCode>>>>"+loginSiteCode);
System.out.println("**** cgst_amtVal*****"+cgst_amtVal);
System.out.println("**** state_code_cdn*****"+state_code_cdn);
state_code_cdn = getGstCodeForCDNR(dom,conn);
System.out.println("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
else if("sgst_perc".equalsIgnoreCase(childNodeName))
......@@ -744,11 +670,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
sgst_perc = checkNull(genericUtility.getColumnValue("sgst_perc", dom)).trim();
loginSiteCode = checkNull(getStateFromLoginSite(loginSite,conn));
sgst_percVal = converStringToDouble(checkNull(genericUtility.getColumnValue("sgst_perc", dom)).trim());
//state_code_cdn = getGstCodeForCDNR(dom,conn);
//System.out.println("Selected Transaction Type is["+tran_type+"]");
//System.out.println("state_code>>>"+state_code);
//System.out.println("loginSite>>>>"+loginSite);
//System.out.println("**** sgst_percVal ******"+sgst_percVal);
state_code_cdn = getGstCodeForCDNR(dom,conn);
System.out.println("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
else if("sgst_amt".equalsIgnoreCase(childNodeName))
......@@ -758,18 +681,15 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
sgst_amt = checkNull(genericUtility.getColumnValue("sgst_amt", dom)).trim();
loginSiteCode = checkNull(getStateFromLoginSite(loginSite,conn));
sgst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("sgst_amt", dom)).trim());
//state_code_cdn = getGstCodeForCDNR(dom,conn);
//System.out.println("Selected Transaction Type is["+tran_type+"]");
//System.out.println("state_code>>>"+state_code);
//System.out.println("loginSite>>>>"+loginSite);
//System.out.println("**** sgst_amtVal *******"+sgst_amtVal);
state_code_cdn = getGstCodeForCDNR(dom,conn);
System.out.println("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
else if("itc_type".equalsIgnoreCase(childNodeName))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
itc_type = checkNull(genericUtility.getColumnValue("itc_type", dom)).trim();
//System.out.println("Selected Transaction Type is["+tran_type+"]");
System.out.println("gst_type["+gst_type+"]"+"itc_type["+itc_type+"]");
}//end of if block for itc_type
}//end of for loop
......@@ -784,173 +704,337 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
errFields.add("gs_code");
}
}
// ********************************** Validation for gs_code [END]*****************************************
// ********************************** Validation for gs_code [END]*****************************************
// ********************************** Validation for quantity [START]**************************************
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type)
|| "S".equalsIgnoreCase(gst_type) || "E".equalsIgnoreCase(gst_type))
{
if(quantity == null || quantity.trim().length() == 0)
{
errCode = "VTQUNT2";
errList.add(errCode);
errFields.add("quantity");
}
}
// *********************************** Validation for quantity [END]****************************************
// ********************************** Validation for quantity [START]**************************************
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type)
|| "S".equalsIgnoreCase(gst_type) || "E".equalsIgnoreCase(gst_type))
{
if(quantity == null || quantity.trim().length() == 0)
{
errCode = "VTQUNT2";
errList.add(errCode);
errFields.add("quantity");
}
}
// *********************************** Validation for quantity [END]****************************************
// *********************************** Validation for unit [START]******************************************
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type)
|| "S".equalsIgnoreCase(gst_type) || "E".equalsIgnoreCase(gst_type))
{
if(unit == null || unit.trim().length() == 0)
{
errCode = "VTINVUNT01";
errList.add(errCode);
errFields.add("unit");
}
}
// ********************************** Validation for unit [END]**********************************************
// *********************************** Validation for unit [START]******************************************
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type)
|| "S".equalsIgnoreCase(gst_type) || "E".equalsIgnoreCase(gst_type))
{
if(unit == null || unit.trim().length() == 0)
{
errCode = "VTINVUNT01";
errList.add(errCode);
errFields.add("unit");
}
}
// ********************************** Validation for unit [END]**********************************************
// ********************************** Validation for taxable_amt [START]*************************************
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type)
|| "E".equalsIgnoreCase(gst_type) || "N".equalsIgnoreCase(gst_type))
{
if(taxable_amt == null || taxable_amt.trim().length() == 0)
{
errCode = "NULLTAXAMT";
errList.add(errCode);
errFields.add("taxable_amt");
}
}
// *********************************** Validation for taxable_amt [END]***************************************
// ********************************** Validation for taxable_amt [START]*************************************
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type)
|| "E".equalsIgnoreCase(gst_type) || "N".equalsIgnoreCase(gst_type))
{
if(taxable_amt == null || taxable_amt.trim().length() == 0)
{
errCode = "NULLTAXAMT";
errList.add(errCode);
errFields.add("taxable_amt");
}
}
// *********************************** Validation for taxable_amt [END]***************************************
// *********************************** Validation for gst_rate [START]****************************************
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type)
|| "E".equalsIgnoreCase(gst_type) || "D".equalsIgnoreCase(gst_type)
|| "C".equalsIgnoreCase(gst_type) || "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type))
{
if(gst_rate == null || gst_rate.trim().length() == 0)
{
errCode = "NULLIGSTPC";
errList.add(errCode);
errFields.add("gst_rate");
}
//Added by sarita on 14/07/2017 [start]
else if(gstRate ==0)
{
errCode = "INVZEROVAL";
errList.add(errCode);
errFields.add("gst_rate");
}
//Added by sarita on 14/07/2017 [end]
}
// *********************************** Validation for gst_rate [END]******************************************
// *********************************** Validation for gst_rate [START]****************************************
if(("I".equalsIgnoreCase(gst_type) && ("R".equalsIgnoreCase(doc_type)) || ("DE".equalsIgnoreCase(doc_type))) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type)
|| "A".equalsIgnoreCase(gst_type)
|| "T".equalsIgnoreCase(gst_type))
{
if(gst_rate == null || gst_rate.trim().length() == 0)
{
errCode = "NULLIGSTPC";
errList.add(errCode);
errFields.add("gst_rate");
}
//Added by sarita on 14/07/2017 [start]
else if(gstRate ==0)
{
errCode = "INVZEROVAL";
errList.add(errCode);
errFields.add("gst_rate");
}
//Added by sarita on 14/07/2017 [end]
}
else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type))
{
refIdInv = checkNull(genericUtility.getColumnValue("ref_id__inv", dom1));
ref_date__inv = checkNull(genericUtility.getColumnValue("ref_date__inv", dom1)).trim();
refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
String dt = "01/07/2017";
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+"]");
if(refInvDateDate.after(invDate))
{
if(gst_rate == null || gst_rate.trim().length() == 0)
{
errCode = "NULLIGSTPC";
errList.add(errCode);
errFields.add("gst_rate");
}
//Added by sarita on 14/07/2017 [start]
else if(gstRate ==0)
{
errCode = "INVZEROVAL";
errList.add(errCode);
errFields.add("gst_rate");
}
}
}
// *********************************** Validation for gst_rate [END]******************************************
// *********************************** Validation for igst_perc [START]*****************************************
// *********************************** Validation for igst_perc [END]********************************************
// *********************************** Validation for igst_perc [START]*****************************************
// *********************************** Validation for igst_perc [END]********************************************
// *********************************** Validation for igst_amt [END]*********************************************
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type)
|| "E".equalsIgnoreCase(gst_type) || "D".equalsIgnoreCase(gst_type)
|| "C".equalsIgnoreCase(gst_type) || "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type))
{
if((state_code != null) && !(state_code.equalsIgnoreCase(loginSiteCode)))
{
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(checkNull(genericUtility.getColumnValue("cgst_amt", dom)).trim());
sgst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("sgst_amt", dom)).trim());
cgst_percVal = converStringToDouble(checkNull(genericUtility.getColumnValue("cgst_perc", dom)).trim());
sgst_percVal = converStringToDouble(checkNull(genericUtility.getColumnValue("sgst_perc", dom)).trim());
//System.out.println("cgst_amtVal["+cgst_amtVal+"]"+"sgst_amtVal["+sgst_amtVal+"]"+"cgst_percVal["+cgst_percVal+"]"+"sgst_percVal["+sgst_percVal+"]");
if((cgst_amtVal > 0) || (sgst_amtVal > 0) || (cgst_percVal > 0) || (sgst_percVal > 0))
{
errCode = "INVINTRAST";
errList.add(errCode);
errFields.add("igst_amt");
}
}
}
// ************************************ Validation for igst_amt [END]*******************************************
// *********************************** Validation for igst_amt [END]*********************************************
/*if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type)
|| "E".equalsIgnoreCase(gst_type) || "D".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)
|| "E".equalsIgnoreCase(gst_type) || "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type))
{
if((state_code != null) && !(state_code.equalsIgnoreCase(loginSiteCode)))
{
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(checkNull(genericUtility.getColumnValue("cgst_amt", dom)).trim());
sgst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("sgst_amt", dom)).trim());
cgst_percVal = converStringToDouble(checkNull(genericUtility.getColumnValue("cgst_perc", dom)).trim());
sgst_percVal = converStringToDouble(checkNull(genericUtility.getColumnValue("sgst_perc", dom)).trim());
//System.out.println("cgst_amtVal["+cgst_amtVal+"]"+"sgst_amtVal["+sgst_amtVal+"]"+"cgst_percVal["+cgst_percVal+"]"+"sgst_percVal["+sgst_percVal+"]");
if((cgst_amtVal > 0) || (sgst_amtVal > 0) || (cgst_percVal > 0) || (sgst_percVal > 0))
{
errCode = "INVINTRAST";
errList.add(errCode);
errFields.add("igst_amt");
}
}
}
else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type))
{
refIdInv = checkNull(genericUtility.getColumnValue("ref_id__inv", dom1));
ref_date__inv = checkNull(genericUtility.getColumnValue("ref_date__inv", dom1)).trim();
refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
String dt = "01/07/2017";
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+"]");
if(refInvDateDate.after(invDate))
{
sql = "select gst_code from gst_data_hdr where doc_no=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refIdInv);
rs = pstmt.executeQuery();
if(rs.next())
{
gstCode = rs.getString("gst_code");
System.out.println("gstCode::::::::::["+gstCode+"]");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if((gstCode != null) && !(gstCode.equalsIgnoreCase(loginSiteCode)))
{
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");
}
}
}
}
// ************************************ Validation for igst_amt [END]*******************************************
// ************************************ Validation for cgst_perc [START]*****************************************
// ************************************ Validation for cgst_perc [END]*******************************************
// ************************************ Validation for cgst_perc [START]*****************************************
// ************************************ Validation for cgst_perc [END]*******************************************
// ************************************ Validation for cgst_amt [START]******************************************
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type)
|| "D".equalsIgnoreCase(gst_type)
|| "C".equalsIgnoreCase(gst_type) || "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type))
{
if((state_code != null) && (state_code.equalsIgnoreCase(loginSiteCode)))
{
if(cgst_amt == null || cgst_amt.trim().length() == 0)
{
errCode = "NULLCGSTAM";
errList.add(errCode);
errFields.add("cgst_amt");
}
else if(cgst_amtVal == 0)
{
errCode = "INVZEROVAL";
errList.add(errCode);
errFields.add("cgst_amt");
}
igst_percVal = converStringToDouble(checkNull(genericUtility.getColumnValue("igst_perc", dom)).trim());
igst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim());
if((igst_percVal > 0) || (igst_amtVal >0))
{
errCode = "INVINTERST";
errList.add(errCode);
errFields.add("cgst_amt");
}
}
}
// ********************************** Validation for cgst_amt [END]********************************************
// ************************************ Validation for cgst_amt [START]******************************************
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type)
|| "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type))
{
if((state_code != null) && (state_code.equalsIgnoreCase(loginSiteCode)))
{
if(cgst_amt == null || cgst_amt.trim().length() == 0)
{
errCode = "NULLCGSTAM";
errList.add(errCode);
errFields.add("cgst_amt");
}
else if(cgst_amtVal == 0)
{
errCode = "INVZEROVAL";
errList.add(errCode);
errFields.add("cgst_amt");
}
igst_percVal = converStringToDouble(checkNull(genericUtility.getColumnValue("igst_perc", dom)).trim());
igst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim());
if((igst_percVal > 0) || (igst_amtVal >0))
{
errCode = "INVINTERST";
errList.add(errCode);
errFields.add("cgst_amt");
}
}
}
else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type))
{
refIdInv = checkNull(genericUtility.getColumnValue("ref_id__inv", dom1));
ref_date__inv = checkNull(genericUtility.getColumnValue("ref_date__inv", dom1)).trim();
refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
String dt = "01/07/2017";
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+"]");
if(refInvDateDate.after(invDate))
{
sql = "select gst_code from gst_data_hdr where doc_no=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refIdInv);
rs = pstmt.executeQuery();
if(rs.next())
{
gstCode = rs.getString("gst_code");
System.out.println("gstCode::::::::::["+gstCode+"]");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if((gstCode != null) && (gstCode.equalsIgnoreCase(loginSiteCode)))
{
if(cgst_amt == null || cgst_amt.trim().length() == 0)
{
errCode = "NULLCGSTAM";
errList.add(errCode);
errFields.add("cgst_amt");
}
else if(cgst_amtVal == 0)
{
errCode = "INVZEROVAL";
errList.add(errCode);
errFields.add("cgst_amt");
}
}
}
}
// ********************************** Validation for cgst_amt [END]********************************************
// ********************************** Validation for sgst_perc [START]*****************************************
// ************************** Validation for sgst_perc [END]***************************************************
// ********************************** Validation for sgst_perc [START]*****************************************
// ************************** Validation for sgst_perc [END]***************************************************
// ************************** Validation for sgst_amt [START]**************************************************
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type)
|| "D".equalsIgnoreCase(gst_type)
|| "C".equalsIgnoreCase(gst_type) || "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type))
{
if((state_code != null) && (state_code.equalsIgnoreCase(loginSiteCode)))
{
if(sgst_amt == null || sgst_amt.trim().length() == 0)
{
errCode = "NULLSGSTAM";
errList.add(errCode);
errFields.add("sgst_amt");
}
else if(sgst_amtVal == 0)
{
errCode = "INVZEROVAL";
errList.add(errCode);
errFields.add("sgst_amt");
}
igst_percVal = converStringToDouble(checkNull(genericUtility.getColumnValue("igst_perc", dom)).trim());
igst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim());
if((igst_percVal > 0) || (igst_amtVal > 0))
{
errCode = "INVINTERST";
errList.add(errCode);
errFields.add("sgst_amt");
}
}
}
// ************************** Validation for sgst_amt [END]*****************************************************
// ************************** Validation for sgst_amt [START]**************************************************
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type)
|| "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type))
{
if((state_code != null) && (state_code.equalsIgnoreCase(loginSiteCode)))
{
if(sgst_amt == null || sgst_amt.trim().length() == 0)
{
errCode = "NULLSGSTAM";
errList.add(errCode);
errFields.add("sgst_amt");
}
else if(sgst_amtVal == 0)
{
errCode = "INVZEROVAL";
errList.add(errCode);
errFields.add("sgst_amt");
}
igst_percVal = converStringToDouble(checkNull(genericUtility.getColumnValue("igst_perc", dom)).trim());
igst_amtVal = converStringToDouble(checkNull(genericUtility.getColumnValue("igst_amt", dom)).trim());
if((igst_percVal > 0) || (igst_amtVal > 0))
{
errCode = "INVINTERST";
errList.add(errCode);
errFields.add("sgst_amt");
}
}
}
else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type))
{
refIdInv = checkNull(genericUtility.getColumnValue("ref_id__inv", dom1));
ref_date__inv = checkNull(genericUtility.getColumnValue("ref_date__inv", dom1)).trim();
refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
String dt = "01/07/2017";
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+"]");
if(refInvDateDate.after(invDate))
{
sql = "select gst_code from gst_data_hdr where doc_no=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refIdInv);
rs = pstmt.executeQuery();
if(rs.next())
{
gstCode = rs.getString("gst_code");
System.out.println("gstCode::::::::::["+gstCode+"]");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if((gstCode != null) && (gstCode.equalsIgnoreCase(loginSiteCode)))
{
if(sgst_amt == null || sgst_amt.trim().length() == 0)
{
errCode = "NULLSGSTAM";
errList.add(errCode);
errFields.add("sgst_amt");
}
else if(sgst_amtVal == 0)
{
errCode = "INVZEROVAL";
errList.add(errCode);
errFields.add("sgst_amt");
}
}
}
}
// ************************** Validation for sgst_amt [END]*****************************************************
}//end of case2
break;
}//end of switch statement
......@@ -965,9 +1049,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
{
errCode = errList.get(count);
errFldName = errFields.get(count);
System.out.println(" testing :errCode .:" + errCode);
System.out.println(" testing :errCode .:" + errCode+"errString>>>>>>>>>"+errString);
errString = getErrorString(errFldName, errCode, userId);
System.out.println("errString>>>>>>>>>"+errString);
errorType = errorType(conn, errCode);
if (errString.length() > 0)
{
......@@ -1056,7 +1139,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
domAll = genericUtility.parseString(xmlString2);
}
retString = itemChanged(dom,domhr,domAll,objContext,currentColumn,editFlag,xtraParams);
System.out.println("retString::::::::::"+retString);
//System.out.println("retString::::::::::"+retString);
}
catch(Exception e)
{
......@@ -1088,7 +1171,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
double amount=0.0;
String recDescr ="",tranDescr="",stateDescr="",recoDescr="",siteDescr="",gst_type="",gstDescr="";
Timestamp doc_date=null;
String loginSite = "",state1="",stCode="",gst_rate="",refIdInv="",ref_date__inv="";
String loginSite = "",state1="",stCode="",gst_rate="",refIdInv="",ref_date__inv="",cgst_amt="",sgst_amt="",igst_amt;
Timestamp refInvDateDate=null,invDate=null;
SimpleDateFormat sdf;
NodeList parentList = null;
......@@ -1118,14 +1201,14 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
parentNodeList = dom.getElementsByTagName("Detail1");
parentList = dom.getElementsByTagName( "Detail" + currentFormNo );
objName = getObjNameFromDom( dom, "objName", "1" );
System.out.println("Inside Itemchange OBJ Name="+objName);
parentNode = parentNodeList.item(0);
childNodeList = parentNode.getChildNodes();
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
valueXmlString.append("<Detail1>");
childNodeListLength = childNodeList.getLength();
//System.out.println("currentColumn-------->>[" + currentColumn + "]");
System.out.println("currentColumn-------->>[" + currentColumn + "]"+"objName["+objName+"]");
if("itm_default".equalsIgnoreCase(currentColumn.trim()))
{
loginSite = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
......@@ -1133,7 +1216,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
valueXmlString.append("<tran_date>").append("<![CDATA[" + sdf.format(new Date())+ "]]>").append("</tran_date>");
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom));
System.out.println("gst_type in item_default is ===="+gst_type);
System.out.println("loginSite["+loginSite+"]"+"gst_type["+gst_type+"]");
if("gstr".equalsIgnoreCase(objName.trim()))
{
sql = "select fld_value,descr from gencodes where fld_name='REC_TYPE' and mod_name='W_GSTR'";
......@@ -1191,7 +1274,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
valueXmlString.append("<gst_type protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</gst_type>");
valueXmlString.append("<tran_type protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</tran_type>");
valueXmlString.append("<doc_type protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</doc_type>");
valueXmlString.append("<doc_type protect = \"1\" visible = \"0\">").append("<![CDATA[R]]>").append("</doc_type>");
valueXmlString.append("<doc_no protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</doc_no>");
valueXmlString.append("<doc_date protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</doc_date>");
valueXmlString.append("<amount protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</amount>");
......@@ -1219,8 +1302,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
else if("itm_defaultedit".equalsIgnoreCase(currentColumn.trim()))
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom));
System.out.println("gst_type ::::::::::"+gst_type);
System.out.println("gst_type ::::::::::"+gst_type);
sql = "select descr from gencodes where fld_name='GST_TYPE' and fld_value=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,gst_type);
......@@ -1228,7 +1310,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
if(rs.next())
{
gstDescr = rs.getString("descr");
System.out.println("descr>>"+gstDescr);
System.out.println("gstDescr["+gstDescr+"]");
}
if(pstmt != null)
{
......@@ -1265,34 +1347,33 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
orderNoEdit = checkNull(genericUtility.getColumnValue("order_no", dom));
reasonCdEdit = checkNull(genericUtility.getColumnValue("reas_code", dom));
System.out.println("Doc Type in View mode ["+docTypeEdit+"]");
if("I".equalsIgnoreCase(gst_type))
{
if(taxRegNoEdit == null || taxRegNoEdit.trim().length()== 0)
{
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("<gst_code_state protect = \"1\" 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("<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("<amount protect = \"0\" visible = \"1\">").append("<![CDATA["+amountEdit+"]]>").append("</amount>");
valueXmlString.append("<reverse_chrg protect = \"0\" visible = \"1\">").append("<![CDATA["+revChrEdit+"]]>").append("</reverse_chrg>");
valueXmlString.append("<ecom_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+ecomRegEdit+"]]>").append("</ecom_reg_no>");
valueXmlString.append("<gst_code protect = \"0\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code>");
valueXmlString.append("<ref_id__inv protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</ref_id__inv>");
valueXmlString.append("<ref_date__inv protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</ref_date__inv>");
valueXmlString.append("<lr_no protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</lr_no>");
valueXmlString.append("<lr_date protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</lr_date>");
valueXmlString.append("<name protect = \"0\" visible = \"0\">").append("<![CDATA["+nameEdit+"]]>").append("</name>");
valueXmlString.append("<addr1 protect = \"0\" visible = \"0\">").append("<![CDATA["+addr1Edit+"]]>").append("</addr1>");
valueXmlString.append("<addr2 protect = \"0\" visible = \"0\">").append("<![CDATA["+addr2Edit+"]]>").append("</addr2>");
valueXmlString.append("<addr3 protect = \"0\" visible = \"0\">").append("<![CDATA["+addr3Edit+"]]>").append("</addr3>");
valueXmlString.append("<city protect = \"0\" visible = \"0\">").append("<![CDATA["+cityEdit+"]]>").append("</city>");
valueXmlString.append("<gst_state_code protect = \"0\" visible = \"0\">").append("<![CDATA["+stateEdit+"]]>").append("</gst_state_code>");
valueXmlString.append("<pin protect = \"0\" visible = \"0\">").append("<![CDATA["+pinEdit+"]]>").append("</pin>");
valueXmlString.append("<order_no protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</order_no>");
valueXmlString.append("<reas_code protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</reas_code>");
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("<gst_code_state protect = \"1\" 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("<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("<amount protect = \"0\" visible = \"1\">").append("<![CDATA["+amountEdit+"]]>").append("</amount>");
valueXmlString.append("<reverse_chrg protect = \"0\" visible = \"0\">").append("<![CDATA["+revChrEdit+"]]>").append("</reverse_chrg>");
valueXmlString.append("<ecom_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+ecomRegEdit+"]]>").append("</ecom_reg_no>");
valueXmlString.append("<gst_code protect = \"0\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code>");
valueXmlString.append("<ref_id__inv protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</ref_id__inv>");
valueXmlString.append("<ref_date__inv protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</ref_date__inv>");
valueXmlString.append("<lr_no protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</lr_no>");
valueXmlString.append("<lr_date protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</lr_date>");
valueXmlString.append("<name protect = \"0\" visible = \"0\">").append("<![CDATA["+nameEdit+"]]>").append("</name>");
valueXmlString.append("<addr1 protect = \"0\" visible = \"0\">").append("<![CDATA["+addr1Edit+"]]>").append("</addr1>");
valueXmlString.append("<addr2 protect = \"0\" visible = \"0\">").append("<![CDATA["+addr2Edit+"]]>").append("</addr2>");
valueXmlString.append("<addr3 protect = \"0\" visible = \"0\">").append("<![CDATA["+addr3Edit+"]]>").append("</addr3>");
valueXmlString.append("<city protect = \"0\" visible = \"0\">").append("<![CDATA["+cityEdit+"]]>").append("</city>");
valueXmlString.append("<gst_state_code protect = \"0\" visible = \"0\">").append("<![CDATA["+stateEdit+"]]>").append("</gst_state_code>");
valueXmlString.append("<pin protect = \"0\" visible = \"0\">").append("<![CDATA["+pinEdit+"]]>").append("</pin>");
valueXmlString.append("<order_no protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</order_no>");
valueXmlString.append("<reas_code protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</reas_code>");
}
else
{
......@@ -1303,7 +1384,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
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("<amount protect = \"0\" visible = \"1\">").append("<![CDATA["+amountEdit+"]]>").append("</amount>");
valueXmlString.append("<reverse_chrg protect = \"0\" visible = \"1\">").append("<![CDATA["+revChrEdit+"]]>").append("</reverse_chrg>");
valueXmlString.append("<reverse_chrg protect = \"0\" visible = \"0\">").append("<![CDATA["+revChrEdit+"]]>").append("</reverse_chrg>");
valueXmlString.append("<ecom_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+ecomRegEdit+"]]>").append("</ecom_reg_no>");
valueXmlString.append("<gst_code protect = \"0\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code>");
valueXmlString.append("<ref_id__inv protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</ref_id__inv>");
......@@ -1325,29 +1406,29 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
{
if(taxRegNoEdit == null || taxRegNoEdit.trim().length()== 0)
{
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("<gst_code_state protect = \"1\" 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("<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("<amount protect = \"0\" visible = \"1\">").append("<![CDATA["+amountEdit+"]]>").append("</amount>");
valueXmlString.append("<reverse_chrg protect = \"0\" visible = \"1\">").append("<![CDATA["+revChrEdit+"]]>").append("</reverse_chrg>");
valueXmlString.append("<ecom_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+ecomRegEdit+"]]>").append("</ecom_reg_no>");
valueXmlString.append("<gst_code protect = \"0\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code>");
valueXmlString.append("<ref_id__inv protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</ref_id__inv>");
valueXmlString.append("<ref_date__inv protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</ref_date__inv>");
valueXmlString.append("<lr_no protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</lr_no>");
valueXmlString.append("<lr_date protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</lr_date>");
valueXmlString.append("<name protect = \"0\" visible = \"0\">").append("<![CDATA["+nameEdit+"]]>").append("</name>");
valueXmlString.append("<addr1 protect = \"0\" visible = \"0\">").append("<![CDATA["+addr1Edit+"]]>").append("</addr1>");
valueXmlString.append("<addr2 protect = \"0\" visible = \"0\">").append("<![CDATA["+addr2Edit+"]]>").append("</addr2>");
valueXmlString.append("<addr3 protect = \"0\" visible = \"0\">").append("<![CDATA["+addr3Edit+"]]>").append("</addr3>");
valueXmlString.append("<city protect = \"0\" visible = \"0\">").append("<![CDATA["+cityEdit+"]]>").append("</city>");
valueXmlString.append("<gst_state_code protect = \"0\" visible = \"0\">").append("<![CDATA["+stateEdit+"]]>").append("</gst_state_code>");
valueXmlString.append("<pin protect = \"0\" visible = \"0\">").append("<![CDATA["+pinEdit+"]]>").append("</pin>");
valueXmlString.append("<order_no protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</order_no>");
valueXmlString.append("<reas_code protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</reas_code>");
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("<gst_code_state protect = \"1\" 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("<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("<amount protect = \"0\" visible = \"1\">").append("<![CDATA["+amountEdit+"]]>").append("</amount>");
valueXmlString.append("<reverse_chrg protect = \"0\" visible = \"1\">").append("<![CDATA["+revChrEdit+"]]>").append("</reverse_chrg>");
valueXmlString.append("<ecom_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+ecomRegEdit+"]]>").append("</ecom_reg_no>");
valueXmlString.append("<gst_code protect = \"0\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code>");
valueXmlString.append("<ref_id__inv protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</ref_id__inv>");
valueXmlString.append("<ref_date__inv protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</ref_date__inv>");
valueXmlString.append("<lr_no protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</lr_no>");
valueXmlString.append("<lr_date protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</lr_date>");
valueXmlString.append("<name protect = \"0\" visible = \"0\">").append("<![CDATA["+nameEdit+"]]>").append("</name>");
valueXmlString.append("<addr1 protect = \"0\" visible = \"0\">").append("<![CDATA["+addr1Edit+"]]>").append("</addr1>");
valueXmlString.append("<addr2 protect = \"0\" visible = \"0\">").append("<![CDATA["+addr2Edit+"]]>").append("</addr2>");
valueXmlString.append("<addr3 protect = \"0\" visible = \"0\">").append("<![CDATA["+addr3Edit+"]]>").append("</addr3>");
valueXmlString.append("<city protect = \"0\" visible = \"0\">").append("<![CDATA["+cityEdit+"]]>").append("</city>");
valueXmlString.append("<gst_state_code protect = \"0\" visible = \"0\">").append("<![CDATA["+stateEdit+"]]>").append("</gst_state_code>");
valueXmlString.append("<pin protect = \"0\" visible = \"0\">").append("<![CDATA["+pinEdit+"]]>").append("</pin>");
valueXmlString.append("<order_no protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</order_no>");
valueXmlString.append("<reas_code protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</reas_code>");
}
else
{
......@@ -1385,7 +1466,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
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("<amount protect = \"0\" visible = \"1\">").append("<![CDATA["+amountEdit+"]]>").append("</amount>");
valueXmlString.append("<reverse_chrg protect = \"0\" visible = \"1\">").append("<![CDATA["+revChrEdit+"]]>").append("</reverse_chrg>");
valueXmlString.append("<reverse_chrg protect = \"0\" visible = \"0\">").append("<![CDATA["+revChrEdit+"]]>").append("</reverse_chrg>");
valueXmlString.append("<ecom_reg_no protect = \"0\" visible = \"1\">").append("<![CDATA["+ecomRegEdit+"]]>").append("</ecom_reg_no>");
valueXmlString.append("<gst_code protect = \"0\" visible = \"1\">").append("<![CDATA["+gstCodeEdit+"]]>").append("</gst_code>");
valueXmlString.append("<ref_id__inv protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</ref_id__inv>");
......@@ -1459,29 +1540,29 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
}
else if("L".equalsIgnoreCase(gst_type))
{
valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>");
valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</tax_reg_no>");
valueXmlString.append("<gst_code_state protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</gst_code_state>");
valueXmlString.append("<state_descr protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</state_descr>");
valueXmlString.append("<doc_no protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</doc_no>");
valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>");
valueXmlString.append("<amount protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</amount>");
valueXmlString.append("<reverse_chrg protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</reverse_chrg>");
valueXmlString.append("<ecom_reg_no protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</ecom_reg_no>");
valueXmlString.append("<gst_code protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</gst_code>");
valueXmlString.append("<ref_id__inv protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</ref_id__inv>");
valueXmlString.append("<ref_date__inv protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</ref_date__inv>");
valueXmlString.append("<name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</name>");
valueXmlString.append("<addr1 protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</addr1>");
valueXmlString.append("<addr2 protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</addr2>");
valueXmlString.append("<addr3 protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</addr3>");
valueXmlString.append("<city protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</city>");
valueXmlString.append("<gst_state_code protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</gst_state_code>");
valueXmlString.append("<pin protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</pin>");
valueXmlString.append("<reas_code protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</reas_code>");
valueXmlString.append("<order_no protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</order_no>");
valueXmlString.append("<lr_no protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</lr_no>");
valueXmlString.append("<lr_date protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</lr_date>");
valueXmlString.append("<doc_type protect = \"0\" visible = \"0\">").append("<![CDATA["+docTypeEdit+"]]>").append("</doc_type>");
valueXmlString.append("<tax_reg_no protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</tax_reg_no>");
valueXmlString.append("<gst_code_state protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</gst_code_state>");
valueXmlString.append("<state_descr protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</state_descr>");
valueXmlString.append("<doc_no protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</doc_no>");
valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>");
valueXmlString.append("<amount protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</amount>");
valueXmlString.append("<reverse_chrg protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</reverse_chrg>");
valueXmlString.append("<ecom_reg_no protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</ecom_reg_no>");
valueXmlString.append("<gst_code protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</gst_code>");
valueXmlString.append("<ref_id__inv protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</ref_id__inv>");
valueXmlString.append("<ref_date__inv protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</ref_date__inv>");
valueXmlString.append("<name protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</name>");
valueXmlString.append("<addr1 protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</addr1>");
valueXmlString.append("<addr2 protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</addr2>");
valueXmlString.append("<addr3 protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</addr3>");
valueXmlString.append("<city protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</city>");
valueXmlString.append("<gst_state_code protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</gst_state_code>");
valueXmlString.append("<pin protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</pin>");
valueXmlString.append("<reas_code protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</reas_code>");
valueXmlString.append("<order_no protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</order_no>");
valueXmlString.append("<lr_no protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</lr_no>");
valueXmlString.append("<lr_date protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</lr_date>");
}
else if("D".equalsIgnoreCase(gst_type))
{
......@@ -1644,7 +1725,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
valueXmlString.append("<lr_date protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</lr_date>");
valueXmlString.append("<tax_reg_no protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</tax_reg_no>");
valueXmlString.append("<doc_no protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</doc_no>");
valueXmlString.append("<doc_date protect = \"1\" visible = \"0\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>");
valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA["+docDateEdit+"]]>").append("</doc_date>");
valueXmlString.append("<doc_type protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</doc_type>");
}
}//end of item_defaultedit
......@@ -1653,7 +1734,6 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
{
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom));
System.out.println("gst_type:::["+gst_type+"]");
sql = "select descr from gencodes where fld_name='GST_TYPE' and fld_value=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,gst_type);
......@@ -1962,8 +2042,9 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
rs.close();
rs = null;
}
System.out.println("name = ["+name+"]"+"addr1["+addr1+"]"+"addr2["+addr2+"]");
if((name != null && name.trim().length() >0) && (addr1 != null && addr1.trim().length()>0) && (addr2 != null && addr2.trim().length()>0) && (addr3 != null && addr3.trim().length() >0) && (city != null && city.trim().length()>0) && (state != null && state.trim().length()>0) && (pin != null && pin.trim().length()>0) )
System.out.println("name = ["+name+"]"+"addr1["+addr1+"]"+"addr2["+addr2+"]"+"addr3["+addr3+"]"+"city["+city+"]"+"state["+state+"]"+"pin["+pin+"]");
//if((name != null && name.trim().length() >0) && (addr1 != null && addr1.trim().length()>0) && (addr2 != null && addr2.trim().length()>0) && (addr3 != null && addr3.trim().length() >0) && (city != null && city.trim().length()>0) && (state != null && state.trim().length()>0) && (pin != null && pin.trim().length()>0) )
if((name != null && name.trim().length() >0) || (addr1 != null && addr1.trim().length()>0) || (addr2 != null && addr2.trim().length()>0) || (addr3 != null && addr3.trim().length() >0) || (city != null && city.trim().length()>0) || (state != null && state.trim().length()>0) || (pin != null && pin.trim().length()>0) )
{
System.out.println("Inside if block !!!!!1");
valueXmlString.append("<name protect = \"1\" visible = \"1\">").append("<![CDATA["+name+"]]>").append("</name>");
......@@ -2028,8 +2109,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
{
docDate = checkNull(genericUtility.getColumnValue("doc_date", dom));
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";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1,doc_date);
......@@ -2080,44 +2160,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
rs = null;
}
valueXmlString.append("<state_descr>").append("<![CDATA["+stateDescr+"]]>").append("</state_descr>");
}//end of if block for gst_code_state
else if("ref_date__inv".equalsIgnoreCase(currentColumn.trim()))
{
refIdInv = checkNull(genericUtility.getColumnValue("ref_id__inv", dom));
System.out.println("refIdInv::::::::::::::::["+refIdInv+"]");
ref_date__inv = checkNull(genericUtility.getColumnValue("ref_date__inv", dom)).trim();
refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("ref_id__inv is ["+refIdInv+"]");
System.out.println("ref_date__inv is ["+ref_date__inv+"]");
System.out.println("refInvDateDate ["+refInvDateDate+"]");
String dt = "01/07/2017";
invDate = Timestamp.valueOf(genericUtility.getValidDateString(dt, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
System.out.println("Date is :::::::["+dt+"]"+"invDate::::::::::::["+invDate+"]");
if(refInvDateDate.after(invDate))
{
sql = "select gst_code from gst_data_hdr where doc_no=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refIdInv);
rs = pstmt.executeQuery();
if(rs.next())
{
gstCode = rs.getString("gst_code");
System.out.println("gstCode::::::::::["+gstCode+"]");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
valueXmlString.append("<gst_code_state protect = \"1\" visible = \"0\">").append("<![CDATA["+gstCode+"]]>").append("</gst_code_state>");
}
}
}//end of if block for gst_code_state
valueXmlString.append("</Detail1>");
break;
}//end of case1
......@@ -2133,8 +2176,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
childNodeName = childNode.getNodeName();
valueXmlString.append("<Detail2>");
childNodeListLength = childNodeList.getLength();
System.out.println("childNodeName-------->>[" + childNodeName + "]");
System.out.println("currentColumn-------->>[" + currentColumn + "]");
System.out.println("childNodeName-------->>[" + childNodeName + "]"+"currentColumn-------->>[" + currentColumn + "]");
if("itm_default".equalsIgnoreCase(currentColumn.trim()))
{
ecomRegNo = checkNull(genericUtility.getColumnValue("ecom_reg_no", dom1));
......@@ -2158,60 +2201,97 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
if("gst_rate".equalsIgnoreCase(currentColumn.trim()))
{
gst_rate = checkNull(genericUtility.getColumnValue("gst_rate", dom));
System.out.println("gst_rate is ["+gst_rate+"]");
state_code = checkNull(genericUtility.getColumnValue("gst_code_state", dom1));
loginSiteCode = checkNull(getStateFromLoginSite(loginSite,conn));
System.out.println("state_code in igst_perc:::["+state_code+"]"+"loginSiteCode:::["+loginSiteCode+"]");
gst_type = checkNull(genericUtility.getColumnValue("gst_type", dom1));
if(!(state_code.equalsIgnoreCase(loginSiteCode)))
System.out.println("gst_rate["+gst_rate+"]"+"state_code["+state_code+"]"+"loginSiteCode["+loginSiteCode+"]"+"gst_type["+gst_type+"]");
if("E".equalsIgnoreCase(gst_type))
{
System.out.println("Export Type...");
valueXmlString.append("<igst_perc>").append("<![CDATA["+gst_rate+"]]>").append("</igst_perc>");
valueXmlString.append("<igst_amt protect = \"0\">").append("<![CDATA[]]>").append("</igst_amt>");
//valueXmlString.append("<igst_amt protect = \"0\">").append("<![CDATA[]]>").append("</igst_amt>");
}
else if(state_code.equalsIgnoreCase(loginSiteCode))
else if("C".equalsIgnoreCase(gst_type) || "D".equalsIgnoreCase(gst_type))
{
double rate = Double.parseDouble(gst_rate);
valueXmlString.append("<cgst_perc protect = \"1\">").append("<![CDATA["+rate/2+"]]>").append("</cgst_perc>");
valueXmlString.append("<cgst_amt protect = \"0\">").append("<![CDATA[]]>").append("</cgst_amt>");
valueXmlString.append("<sgst_perc protect = \"1\">").append("<![CDATA["+rate/2+"]]>").append("</sgst_perc>");
valueXmlString.append("<sgst_amt protect = \"0\">").append("<![CDATA[]]>").append("</sgst_amt>");
}
else if(state_code == null || state_code.trim().length() == 0)
refIdInv = checkNull(genericUtility.getColumnValue("ref_id__inv", dom1));
ref_date__inv = checkNull(genericUtility.getColumnValue("ref_date__inv", dom1)).trim();
refInvDateDate = Timestamp.valueOf(genericUtility.getValidDateString(ref_date__inv, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
String dt = "01/07/2017";
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+"]");
if(refInvDateDate.after(invDate))
{
sql = "select gst_code from gst_data_hdr where doc_no=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,refIdInv);
rs = pstmt.executeQuery();
if(rs.next())
{
gstCode = rs.getString("gst_code");
System.out.println("gstCode::::::::::["+gstCode+"]");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
if(gstCode != null && gstCode.trim().length() > 0)
{
if(gstCode.equalsIgnoreCase(loginSiteCode))
{
double rate = Double.parseDouble(gst_rate);
cgst_amt = checkNull(genericUtility.getColumnValue("cgst_amt", dom));
sgst_amt = checkNull(genericUtility.getColumnValue("sgst_amt", dom));
System.out.println("cgst_amt["+cgst_amt+"]"+"sgst_amt["+sgst_amt+"]");
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("<cgst_amt protect = \"0\">").append("<![CDATA["+cgst_amt+"]]>").append("</cgst_amt>");
valueXmlString.append("<sgst_amt protect = \"0\">").append("<![CDATA["+sgst_amt+"]]>").append("</sgst_amt>");
}
else if(!(state_code.equalsIgnoreCase(loginSiteCode)))
{
igst_amt = checkNull(genericUtility.getColumnValue("igst_amt", dom));
System.out.println("igst_amt["+igst_amt+"]");
valueXmlString.append("<igst_perc>").append("<![CDATA["+gst_rate+"]]>").append("</igst_perc>");
valueXmlString.append("<igst_amt protect = \"0\">").append("<![CDATA["+igst_amt+"]]>").append("</igst_amt>");
//valueXmlString.append("<igst_amt protect = \"0\">").append("<![CDATA[]]>").append("</igst_amt>");
}
}
}//
}
else
{
System.out.println("Inside else block of rate............");
valueXmlString.append("<igst_amt protect = \"1\">").append("<![CDATA[]]>").append("</igst_amt>");
valueXmlString.append("<cgst_amt protect = \"1\">").append("<![CDATA[]]>").append("</cgst_amt>");
valueXmlString.append("<sgst_amt protect = \"1\">").append("<![CDATA[]]>").append("</sgst_amt>");
if(state_code != null && state_code.trim().length() > 0)
{
if(state_code.equalsIgnoreCase(loginSiteCode))
{
double rate = Double.parseDouble(gst_rate);
cgst_amt = checkNull(genericUtility.getColumnValue("cgst_amt", dom));
sgst_amt = checkNull(genericUtility.getColumnValue("sgst_amt", dom));
System.out.println("cgst_amt["+cgst_amt+"]"+"sgst_amt["+sgst_amt+"]");
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("<cgst_amt protect = \"0\">").append("<![CDATA["+cgst_amt+"]]>").append("</cgst_amt>");
valueXmlString.append("<sgst_amt protect = \"0\">").append("<![CDATA["+sgst_amt+"]]>").append("</sgst_amt>");
}
else if(!(state_code.equalsIgnoreCase(loginSiteCode)))
{
igst_amt = checkNull(genericUtility.getColumnValue("igst_amt", dom));
System.out.println("igst_amt["+igst_amt+"]");
valueXmlString.append("<igst_perc>").append("<![CDATA["+gst_rate+"]]>").append("</igst_perc>");
valueXmlString.append("<igst_amt protect = \"0\">").append("<![CDATA["+igst_amt+"]]>").append("</igst_amt>");
//valueXmlString.append("<igst_amt protect = \"0\">").append("<![CDATA[]]>").append("</igst_amt>");
}
}//end of if block if state_code is not null
}
}
else if("itc_type".equalsIgnoreCase(currentColumn.trim()))
{
itcType= checkNull(genericUtility.getColumnValue("itc_type", dom));
System.out.println("ITC TYPE ::::::::::"+itcType);
sql = "select descr from gencodes where fld_name='ITC_TYPE' and MOD_NAME='W_GSTR_PURC' and fld_value=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itcType);
rs = pstmt.executeQuery();
if(rs.next())
{
itcTypeDescr = rs.getString("descr");
System.out.println("descr>>"+tranDescr);
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
{
rs.close();
rs = null;
}
valueXmlString.append("<itc_type_descr protect = \"1\">").append("<![CDATA["+itcTypeDescr+"]]>").append("</itc_type_descr>");
}//end of if block for itc_type
}//end of if block for gst_rate
valueXmlString.append("</Detail2>");
break;
}//end of case2
......
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