Commit 606fe686 authored by ssalve's avatar ssalve

Removed validation for taxable amt. done rev_charge non-editable in case of gst_type R on 14AUG2017


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106598 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d0e536d4
......@@ -81,7 +81,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
NodeList childNodeList = null;
Node childNode = null;
int childNodeLength = 0;
int ctr = 0, cnt = 0,ctr2=0;
int ctr = 0, cnt = 0,cnt2=0,finalGstRate=0;
String childNodeName = "";
String errorType = "",errString="",cust_name="";
String errCode = "";
......@@ -95,7 +95,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
String ref_id__inv="",ref_date__inv="",lr_no="",lr_date="",supply_type="",cgst_perc="",sgst_perc="",reverse_chrg="";
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;
double igst_percVal=0.0,igst_amtVal=0.0,gstRate=0.0,finalAmt=0.0;
String refIdInv="",gstCode="",itc_igst = "",itc_cgst="",itc_sgst="",itc_cess="";
Timestamp refInvDateDate = null,invDate = null;
......@@ -134,7 +134,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
else
{
gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom)).trim();
sql = "select count(*) as cnt from gencodes where fld_name='GST_TYPE' and fld_value=?";
sql = "select count(*) as cnt from gencodes where fld_name='GST_TYPE' and mod_name='W_GSTR_PURC' and fld_value=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,gst_type);
rs = pstmt.executeQuery();
......@@ -372,7 +372,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
errFields.add("state_code");
}
}
else if("I".equalsIgnoreCase(gst_type))
//commented validation for doc type DE and SEZ on 14AUG2017[START]
/* else if("I".equalsIgnoreCase(gst_type))
{
if("DE".equalsIgnoreCase(doc_type) || "Z".equalsIgnoreCase(doc_type))
{
......@@ -385,7 +386,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
errFields.add("state_code");
}
}
}
}*/
//commented validation for doc type DE and SEZ on 14AUG2017[END]
// *************************** Validation for Place of Supply [end] *********************************
// *************************** Validation for Document Number [start] ********************************
......@@ -576,6 +578,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
{
gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
taxable_amt = gstUtility.checkNull(genericUtility.getColumnValue("taxable_amt", dom)).trim();//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"taxable_amt["+taxable_amt+"]");
amount = gstUtility.checkNull(genericUtility.getColumnValue("amount", dom1)).trim();
}//end of if block for taxable_amt
else if("gst_rate".equalsIgnoreCase(childNodeName))
......@@ -728,13 +731,22 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
errList.add(errCode);
errFields.add("taxable_amt");
}
//commented by sarita on 14AUG2017
/* System.out.println("Entered Amount is ======"+amount);
finalAmt = gstUtility.gettaxableAmtForAllDetail(dom2);
if(finalAmt > Double.valueOf(amount))
{
errCode = "INVDTAXAMT";
errList.add(errCode);
errFields.add("taxable_amt");
}*/
}
// *********************************** Validation for taxable_amt [END]***************************************
// *********************************** Validation for gst_rate [START]****************************************
// Removed validation for gst_type A and T for gst_rate on 14AUG2017
if(("I".equalsIgnoreCase(gst_type) && ("R".equalsIgnoreCase(doc_type)) || ("DE".equalsIgnoreCase(doc_type))) || "R".equalsIgnoreCase(gst_type) || "U".equalsIgnoreCase(gst_type)
|| "A".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type) || "G".equalsIgnoreCase(gst_type)
|| "T".equalsIgnoreCase(gst_type))
|| "S".equalsIgnoreCase(gst_type) || "G".equalsIgnoreCase(gst_type))
{
if(gst_rate == null || gst_rate.trim().length() == 0)
{
......@@ -749,6 +761,19 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
errFields.add("gst_rate");
}
}
//Added by sarita on 14AUG2017
else if("I".equalsIgnoreCase(gst_type) && ("Z".equalsIgnoreCase(doc_type)))
{
int cnt1 = gstUtility.getNumOfNonDelDetail(dom2,currentFormNo);
System.out.println("cnt1 is===="+cnt1);
boolean gstCheck = gstUtility.getRateValueForAllDetail(dom2);
if(gstCheck)
{
errCode = "INVRATESEZ";
errList.add(errCode);
errFields.add("gst_rate");
}
}
else if("D".equalsIgnoreCase(gst_type) || "C".equalsIgnoreCase(gst_type))
{
refIdInv = gstUtility.checkNull(genericUtility.getColumnValue("ref_id__inv", dom1));
......@@ -758,7 +783,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
invDate = Timestamp.valueOf(genericUtility.getValidDateString(dt, genericUtility.getApplDateFormat(), genericUtility.getDBDateFormat()) + " 00:00:00.0");
//System.out.println("Return Value"+"ref_id__inv is ["+refIdInv+"]"+"ref_date__inv["+ref_date__inv+"]"+"refInvDateDate["+refInvDateDate+"]"+"Date1/7/17["+dt+"]"+"invDate["+invDate+"]");
if(refInvDateDate.equals(invDate) || refInvDateDate.after(invDate))
{
{
if(gst_rate == null || gst_rate.trim().length() == 0)
{
errCode = "NULLIGSTPC";
......@@ -777,8 +802,9 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
// *********************************** Validation for gst_rate [END]******************************************
// *********************************** Validation for igst_amt [END]*********************************************
//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)
|| "U".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type) || "G".equalsIgnoreCase(gst_type) || "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type))
|| "U".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type) || "G".equalsIgnoreCase(gst_type))
{
if((state_code != null) && !(state_code.equalsIgnoreCase(loginSiteCode)))
{
......@@ -863,9 +889,9 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
// ************************************ Validation for igst_amt [END]*******************************************
// ************************************ Validation for cgst_amt [START]******************************************
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type) || "U".equalsIgnoreCase(gst_type)
|| "S".equalsIgnoreCase(gst_type) || "G".equalsIgnoreCase(gst_type)
|| "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type))
//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)
|| "S".equalsIgnoreCase(gst_type) || "G".equalsIgnoreCase(gst_type))
{
if((state_code != null) && (state_code.equalsIgnoreCase(loginSiteCode)))
{
......@@ -946,9 +972,8 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
// ********************************** Validation for cgst_amt [END]********************************************
// ************************** Validation for sgst_amt [START]**************************************************
if("I".equalsIgnoreCase(gst_type) || "R".equalsIgnoreCase(gst_type) || "U".equalsIgnoreCase(gst_type)
|| "S".equalsIgnoreCase(gst_type) || "G".equalsIgnoreCase(gst_type)
|| "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type))
if(("I".equalsIgnoreCase(gst_type) && ("R".equalsIgnoreCase(doc_type))) || "R".equalsIgnoreCase(gst_type) || "U".equalsIgnoreCase(gst_type)
|| "S".equalsIgnoreCase(gst_type) || "G".equalsIgnoreCase(gst_type))
{
if((state_code != null) && (state_code.equalsIgnoreCase(loginSiteCode)))
{
......@@ -1219,7 +1244,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
int childNodeListLength = 0,cnt=0;
String tran_id__ref="",rec_type="",tran_type="",state_code="",reco_status="",site_code="",cust_code="",cust_name="";
String sql="";
String doc_no="",itc_type="",gst_codeVal="",gstTypeEdit="";
String doc_no="",itc_type="",gst_codeVal="",gstTypeEdit="",doc_type="";
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;
String recDescr ="",tranDescr="",stateDescr="",recoDescr="",siteDescr="",gst_type="",gstDescr="";
......@@ -1333,7 +1358,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
else if("itm_defaultedit".equalsIgnoreCase(currentColumn.trim()))
{
gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom));//System.out.println("Return Value"+"gst_type ::::::::::"+gst_type);
sql = "select descr from gencodes where fld_name='GST_TYPE' and fld_value=?";
sql = "select descr from gencodes where fld_name='GST_TYPE' and mod_name='W_GSTR_PURC' and fld_value=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,gst_type);
rs = pstmt.executeQuery();
......@@ -1459,7 +1484,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
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 = \"1\" visible = \"1\">").append("<![CDATA["+revChrEdit+"]]>").append("</reverse_chrg>");
valueXmlString.append("<ecom_reg_no protect = \"0\" visible = \"0\">").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>");
......@@ -1486,7 +1511,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
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 = \"1\" visible = \"1\">").append("<![CDATA["+revChrEdit+"]]>").append("</reverse_chrg>");
valueXmlString.append("<ecom_reg_no protect = \"0\" visible = \"0\">").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>");
......@@ -1906,7 +1931,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
valueXmlString.append("<doc_no protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_no>");
valueXmlString.append("<doc_date protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</doc_date>");
valueXmlString.append("<amount protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</amount>");
valueXmlString.append("<reverse_chrg protect = \"0\" visible = \"1\">").append("<![CDATA[Y]]>").append("</reverse_chrg>");
valueXmlString.append("<reverse_chrg protect = \"1\" visible = \"1\">").append("<![CDATA[Y]]>").append("</reverse_chrg>");
valueXmlString.append("<ecom_reg_no protect = \"0\" visible = \"0\">").append("<![CDATA[]]>").append("</ecom_reg_no>");
valueXmlString.append("<gst_code protect = \"0\" visible = \"1\">").append("<![CDATA[]]>").append("</gst_code>");
valueXmlString.append("<ref_id__inv protect = \"1\" visible = \"0\">").append("<![CDATA[]]>").append("</ref_id__inv>");
......@@ -2495,13 +2520,14 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
state_code = gstUtility.checkNull(genericUtility.getColumnValue("gst_code_state", dom1));
loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1));
doc_type = gstUtility.checkNull(genericUtility.getColumnValue("doc_type", dom1)).trim();
rate = (gst_rate);
igst_amount = getIgst_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+"]");
if("G".equalsIgnoreCase(gst_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_amt protect = \"0\">").append("<![CDATA["+igst_amount+"]]>").append("</igst_amt>");
......@@ -2586,6 +2612,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
{
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+"]");
doc_type = gstUtility.checkNull(genericUtility.getColumnValue("doc_type", dom1)).trim();
if(gst_rate > 0)
{
rate = (gst_rate);
......@@ -2596,7 +2623,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
loginSiteCode = gstUtility.checkNull(getStateFromLoginSite(loginSite,conn));
gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1));
if("G".equalsIgnoreCase(gst_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_amt protect = \"0\">").append("<![CDATA["+igst_amount+"]]>").append("</igst_amt>");
......@@ -2688,10 +2715,10 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
itc_cess = gstUtility.checkNull(genericUtility.getColumnValue("itc_cess", dom)).trim();
if(!("NO".equalsIgnoreCase(itc_type)))
{
valueXmlString.append("<itc_igst protect = \"0\">").append("<![CDATA[]]>").append("</itc_igst>");
valueXmlString.append("<itc_cgst protect = \"0\">").append("<![CDATA[]]>").append("</itc_cgst>");
valueXmlString.append("<itc_sgst protect = \"0\">").append("<![CDATA[]]>").append("</itc_sgst>");
valueXmlString.append("<itc_cess protect = \"0\">").append("<![CDATA[]]>").append("</itc_cess>");
valueXmlString.append("<itc_igst protect = \"0\">").append("<![CDATA[0]]>").append("</itc_igst>");
valueXmlString.append("<itc_cgst protect = \"0\">").append("<![CDATA[0]]>").append("</itc_cgst>");
valueXmlString.append("<itc_sgst protect = \"0\">").append("<![CDATA[0]]>").append("</itc_sgst>");
valueXmlString.append("<itc_cess protect = \"0\">").append("<![CDATA[0]]>").append("</itc_cess>");
}
else
{
......@@ -2800,7 +2827,7 @@ public class GstrPurchaseIC extends ValidatorEJB implements GstrPurchaseICRemote
return msgType;
}
private String getObjNameFromDom( Document dom, String attribute, String objContext ) throws RemoteException,ITMException
private String getObjNameFromDom(Document dom, String attribute, String objContext ) throws RemoteException,ITMException
{
System.out.println("Inside getObjNameFromDom method");
NodeList detailList = null;
......
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