Commit d0e536d4 authored by ssalve's avatar ssalve

removed validation for taxable amt. if doc type id DE or SEX and done...

removed validation for taxable amt. if doc type id DE or SEX and done non-editable reverse charge and removed validation for gst_type A and T for igst_amt,cgst_amt and sgst_amt on 14AUG2017


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106597 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 13be0c5f
......@@ -95,7 +95,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
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="";
Timestamp refInvDateDate = null,invDate = null;
......@@ -361,7 +361,15 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
// *************************** Validation for tax_reg_no [end] ***************************************
// Removed validation for name , state, city and pin by sarita on 20-07-2017
// *************************** Validation for name [start] *******************************************
if(tax_reg_no != null && tax_reg_no.trim().length() > 0)
{
if(name == null || name.trim().length() == 0)
{
errCode = "VMCNAMENLL";
errList.add(errCode);
errFields.add("name");
}
}
// *************************** Validation for name [end] *********************************************
// *************************** Validation for city [start] *******************************************
......@@ -400,8 +408,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
errFields.add("state_code");
}
}
//Added by sarita on 4AUG2017
else if("I".equalsIgnoreCase(gst_type))
//committed by sarita on 14AUG2017
/* else if("I".equalsIgnoreCase(gst_type))
{
if("DE".equalsIgnoreCase(doc_type) || "Z".equalsIgnoreCase(doc_type))
{
......@@ -414,7 +422,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
errFields.add("state_code");
}
}
}
}*/
// *************************** Validation for Place of Supply [end] *********************************
// *************************** Validation for Document Number [start] ********************************
......@@ -492,6 +500,21 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
}
}
// ************************* Validation for Amount [end] *********************************************
//committed by sarita on 14AUG2017
// ******************* 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))
......@@ -596,6 +619,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
{
gst_type = gstUtility.checkNull(genericUtility.getColumnValue("gst_type", dom1)).trim();
taxable_amt = gstUtility.checkNull(genericUtility.getColumnValue("taxable_amt", dom)).trim();
amount = gstUtility.checkNull(genericUtility.getColumnValue("amount", dom1)).trim();
//System.out.println("INPUT VALUE"+"gst_type["+gst_type+"]"+"taxable_amt["+taxable_amt+"]");
}//end of if block for taxable_amt
......@@ -735,13 +759,21 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
errList.add(errCode);
errFields.add("taxable_amt");
}
//committed 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]****************************************
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))
// removed validation for gst_rate for gst_type A and T
if(("I".equalsIgnoreCase(gst_type) && ("R".equalsIgnoreCase(doc_type)) || ("DE".equalsIgnoreCase(doc_type))) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type))
{
if(gst_rate == null || gst_rate.trim().length() == 0)
{
......@@ -789,11 +821,9 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
// *********************************** 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))*/
// removed validation for gst_rate for gst_type A and T
if("I".equalsIgnoreCase(gst_type) && ("R".equalsIgnoreCase(doc_type)) || ("DE".equalsIgnoreCase(doc_type)) || "R".equalsIgnoreCase(gst_type)
|| "S".equalsIgnoreCase(gst_type) || "E".equalsIgnoreCase(gst_type) || "A".equalsIgnoreCase(gst_type) || "T".equalsIgnoreCase(gst_type))
|| "S".equalsIgnoreCase(gst_type) || "E".equalsIgnoreCase(gst_type))
{
if((state_code != null) && !(state_code.equalsIgnoreCase(loginSiteCode)))
{
......@@ -883,8 +913,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
// ************************************ Validation for cgst_perc [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))
// removed validation for gst_rate for gst_type A and T
if(("I".equalsIgnoreCase(gst_type) && ("R".equalsIgnoreCase(doc_type))) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type))
{
if((state_code != null) && (state_code.equalsIgnoreCase(loginSiteCode)))
{
......@@ -971,8 +1001,8 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
// ************************** Validation for sgst_perc [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))
// removed validation for gst_rate for gst_type A and T
if(("I".equalsIgnoreCase(gst_type) && ("R".equalsIgnoreCase(doc_type))) || "R".equalsIgnoreCase(gst_type) || "S".equalsIgnoreCase(gst_type))
{
if((state_code != null) && (state_code.equalsIgnoreCase(loginSiteCode)))
{
......@@ -1129,7 +1159,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
System.out.println("testing : final errString : " + errString);
return errString;
}//end of wfValData method....
public String itemChanged(String xmlString, String xmlString1,String xmlString2, String objContext, String currentColumn,String editFlag, String xtraParams) throws RemoteException,ITMException
{
Document dom=null;
......@@ -1181,7 +1211,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
String childNodeName = "";
String columnValue="";
int childNodeListLength = 0,cnt=0;
String tran_id__ref="",rec_type="",tran_type="",state_code="",reco_status="",site_code="",cust_code="",cust_name="";
String tran_id__ref="",rec_type="",tran_type="",state_code="",reco_status="",site_code="",cust_code="",cust_name="",doc_type="";
String sql="";
String doc_no="";
String docDateStr="",gst_codeVal="",gstTypeEdit="";
......@@ -1454,7 +1484,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 = \"1\" 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>");
......@@ -1481,7 +1511,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 = \"1\" 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>");
......@@ -1815,7 +1845,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
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 = \"1\">").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>");
......@@ -2273,7 +2303,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
}//end of if block for itm_default
else if("itm_defaultedit".equalsIgnoreCase(currentColumn.trim()))
{
//Added by sarita on 4AUG2017
//Added by sarita on 4AUG2017s
double igst_amtEdit = gstUtility.getDouble(genericUtility.getColumnValue("igst_amt", dom));
double cgst_amtEdit = gstUtility.getDouble(genericUtility.getColumnValue("cgst_amt", dom));
double sgst_amtEdit = gstUtility.getDouble(genericUtility.getColumnValue("sgst_amt", dom));
......@@ -2310,14 +2340,15 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
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();
//Added by sarita on 25JUN2017[START]
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+"]");
System.out.println("Input Value::"+"gst_rate["+gst_rate+"]"+"state_code["+state_code+"]"+"loginSiteCode["+loginSiteCode+"]"+"gst_type["+gst_type+"]"+"doc_type["+doc_type+"]");
//Added by sarita on 25JUN2017[END]
if("E".equalsIgnoreCase(gst_type))
if("E".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>");
......@@ -2413,7 +2444,7 @@ public class GstrIC extends ValidatorEJB implements GstrICRemote, GstrICLocal
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));
if("E".equalsIgnoreCase(gst_type))
if("E".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>");
......
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