Commit d83cc1a7 authored by spawar's avatar spawar

Added changes to save gstr3b custom records


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106559 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 14f74d2f
...@@ -41,7 +41,7 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB ...@@ -41,7 +41,7 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
} }
@Override @Override
public String saveRecord(String objName,String tranXml, UserInfoBean userInfo) throws RemoteException, ITMException public String saveRecord(String objName,String tranXml,String gsttype, UserInfoBean userInfo) throws RemoteException, ITMException
{ {
Connection conn = null; Connection conn = null;
String sql = ""; String sql = "";
...@@ -53,7 +53,6 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB ...@@ -53,7 +53,6 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB
boolean isErrorExist = false; boolean isErrorExist = false;
String dbDateStr = ""; String dbDateStr = "";
String valSql = ""; String valSql = "";
PreparedStatement vPstmt = null;
ResultSet vRs = null; ResultSet vRs = null;
String tranid = null,trandate = null,tranidref= null,sitecode = null,prdcode = null, String tranid = null,trandate = null,tranidref= null,sitecode = null,prdcode = null,
rectype= null,trantype = null,custcode= null,custname= null,submissiontype= null, rectype= null,trantype = null,custcode= null,custname= null,submissiontype= null,
...@@ -62,7 +61,7 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB ...@@ -62,7 +61,7 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB
refdateinv= null,provassmnt= null,orderno= null,orderdate= null,remarks = null, refdateinv= null,provassmnt= null,orderno= null,orderdate= null,remarks = null,
submitstatus = null,submitdate= null,adduser = null,adddate= null,addterm = null, submitstatus = null,submitdate= null,adduser = null,adddate= null,addterm = null,
chguser = null,chgdate= null,chgterm= null,taxregno = null,recostatus= null, chguser = null,chgdate= null,chgterm= null,taxregno = null,recostatus= null,
ecomregno= null,refser= null,gstcode= null,gsttype= null,refid= null; ecomregno= null,refser= null,gstcode= null,refid= null;
int lineno = 0; int lineno = 0;
String status = null, srnoold = null, linetype = null, gscode = null, String status = null, srnoold = null, linetype = null, gscode = null,
...@@ -92,7 +91,7 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB ...@@ -92,7 +91,7 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB
} }
if(prdcode == null || prdcode.length() == 0) if(prdcode == null || prdcode.length() == 0)
{ {
errString = getErrorString("doc_date", "INVGSTPCOD", userInfo.getLoginCode()); errString = getErrorString("doc_date", "INVDOCDATE", userInfo.getLoginCode());
isErrorExist = true; isErrorExist = true;
return errString; return errString;
} }
...@@ -100,20 +99,24 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB ...@@ -100,20 +99,24 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB
{ {
valSql = "select tran_id from gst_data_hdr where gst_type = ? and prd_code = ? and rec_type = ?"; valSql = "select tran_id from gst_data_hdr where gst_type = ? and prd_code = ? and rec_type = ?";
vPstmt = conn.prepareStatement(valSql); pstmt = conn.prepareStatement(valSql);
vPstmt.setString(1, gsttype); pstmt.setString(1, gsttype);
vPstmt.setString(2, prdcode); pstmt.setString(2, prdcode);
if(objName != null && objName.equalsIgnoreCase("gstr"))
if("gstr".equalsIgnoreCase(objName))
{ {
vPstmt.setString(3, "1"); pstmt.setString(3, "1");
} }
else else if(objName != null && objName.equalsIgnoreCase("gstr_purc"))
{ {
vPstmt.setString(3, "2"); pstmt.setString(3, "2");
} }
else if(objName != null && objName.equalsIgnoreCase("gstr3b"))
vRs = vPstmt.executeQuery(); {
pstmt.setString(3, "6");
}
vRs = pstmt.executeQuery();
System.out.println(vRs.getFetchSize()); System.out.println(vRs.getFetchSize());
if(vRs.next()) if(vRs.next())
{ {
...@@ -122,6 +125,11 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB ...@@ -122,6 +125,11 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB
isErrorExist = true; isErrorExist = true;
return errString; return errString;
} }
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
} }
...@@ -129,6 +137,7 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB ...@@ -129,6 +137,7 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB
{ {
Node detailNodePatent = detailNodeList.item(i); Node detailNodePatent = detailNodeList.item(i);
Node detailNode = null; Node detailNode = null;
double totalAmount = 0.00;
tranid = null; tranid = null;
tranid = gstUtility.generateTranId("w_"+objName, userInfo.getSiteCode(), conn); tranid = gstUtility.generateTranId("w_"+objName, userInfo.getSiteCode(), conn);
lineno = 0; lineno = 0;
...@@ -272,7 +281,7 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB ...@@ -272,7 +281,7 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB
itccgst = genericUtility.getColumnValueFromNode("itc_cgst", detailNode); itccgst = genericUtility.getColumnValueFromNode("itc_cgst", detailNode);
itcsgst = genericUtility.getColumnValueFromNode("itc_sgst", detailNode); itcsgst = genericUtility.getColumnValueFromNode("itc_sgst", detailNode);
itccess = genericUtility.getColumnValueFromNode("itc_cess", detailNode); itccess = genericUtility.getColumnValueFromNode("itc_cess", detailNode);
gstrate = genericUtility.getColumnValueFromNode("gst_rate", detailNode);; gstrate = genericUtility.getColumnValueFromNode("gst_rate", detailNode);
sql = "insert into gst_data_det(TRAN_ID,LINE_NO,STATUS,SR_NO__OLD,LINE_TYPE,GS_CODE,TAXABLE_AMT,IGST_PERC,IGST_AMT," sql = "insert into gst_data_det(TRAN_ID,LINE_NO,STATUS,SR_NO__OLD,LINE_TYPE,GS_CODE,TAXABLE_AMT,IGST_PERC,IGST_AMT,"
...@@ -312,6 +321,24 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB ...@@ -312,6 +321,24 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
totalAmount = totalAmount + getDouble(igstamt) + getDouble(cgstamt) + getDouble(sgstamt) + getDouble(cessamt) + getDouble(taxableamt);
}
}
if(("gstr_purc".equalsIgnoreCase(objName) && "V".equalsIgnoreCase(gsttype)) || ("gstr3b".equalsIgnoreCase(objName) && "O".equalsIgnoreCase(gsttype)))
{
sql = "UPDATE GST_DATA_HDR SET AMOUNT = ? WHERE TRAN_ID = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, totalAmount);
pstmt.setString(2, tranid);
int rowsUpdated = pstmt.executeUpdate();
if(rowsUpdated == 0)
{
System.out.println("Record not found.......");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
} }
} }
} }
...@@ -379,7 +406,7 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB ...@@ -379,7 +406,7 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB
@Override @Override
public String updateRecord(String objName,String tranXml, UserInfoBean userInfo) throws RemoteException, ITMException public String updateRecord(String objName,String tranXml,String gstType, UserInfoBean userInfo) throws RemoteException, ITMException
{ {
Connection conn = null; Connection conn = null;
String sql = ""; String sql = "";
...@@ -411,6 +438,7 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB ...@@ -411,6 +438,7 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB
for(int i = 0; i < detailNodeList.getLength() && !isErrorExist; i++) for(int i = 0; i < detailNodeList.getLength() && !isErrorExist; i++)
{ {
Double totalAmount = 0.00;
Node detailNodePatent = detailNodeList.item(i); Node detailNodePatent = detailNodeList.item(i);
for(int detCntr = 0; detCntr < detailNodePatent.getChildNodes().getLength(); detCntr++) for(int detCntr = 0; detCntr < detailNodePatent.getChildNodes().getLength(); detCntr++)
{ {
...@@ -476,15 +504,16 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB ...@@ -476,15 +504,16 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB
itccess = genericUtility.getColumnValueFromNode("itc_cess", detailNode); itccess = genericUtility.getColumnValueFromNode("itc_cess", detailNode);
gstrate = genericUtility.getColumnValueFromNode("gst_rate", detailNode);; gstrate = genericUtility.getColumnValueFromNode("gst_rate", detailNode);;
sql = "UPDATE GST_DATA_DET SET IGST_AMT = ? ,CGST_AMT = ? ,SGST_AMT = ?,CESS_AMT = ? WHERE TRAN_ID = ? AND LINE_NO = ?"; sql = "UPDATE GST_DATA_DET SET IGST_AMT = ? ,CGST_AMT = ? ,SGST_AMT = ?,CESS_AMT = ?,TAXABLE_AMT = ? WHERE TRAN_ID = ? AND LINE_NO = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, getDouble(igstamt)); pstmt.setDouble(1, getDouble(igstamt));
pstmt.setDouble(2, getDouble(cgstamt)); pstmt.setDouble(2, getDouble(cgstamt));
pstmt.setDouble(3, getDouble(sgstamt)); pstmt.setDouble(3, getDouble(sgstamt));
pstmt.setDouble(4, getDouble(cessamt)); pstmt.setDouble(4, getDouble(cessamt));
pstmt.setDouble(5, getDouble(taxableamt));
pstmt.setString(5, tranid); pstmt.setString(6, tranid);
pstmt.setString(6, lineno); pstmt.setString(7, lineno);
int rowsUpdated = pstmt.executeUpdate(); int rowsUpdated = pstmt.executeUpdate();
if(rowsUpdated == 0) if(rowsUpdated == 0)
...@@ -496,7 +525,24 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB ...@@ -496,7 +525,24 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
totalAmount = totalAmount + getDouble(igstamt) + getDouble(cgstamt) + getDouble(sgstamt) + getDouble(cessamt) + getDouble(taxableamt);
}
}
if(("gstr_purc".equalsIgnoreCase(objName) && "V".equalsIgnoreCase(gstType)) || ("gstr3b".equalsIgnoreCase(objName) && "O".equalsIgnoreCase(gstType)))
{
sql = "UPDATE GST_DATA_HDR SET AMOUNT = ? WHERE TRAN_ID = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, totalAmount);
pstmt.setString(2, tranid);
int rowsUpdated = pstmt.executeUpdate();
if(rowsUpdated == 0)
{
System.out.println("Record not found.......");
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
} }
} }
retXmlString = retXmlString + "<tran_id>"+tranid+"</tran_id>"; retXmlString = retXmlString + "<tran_id>"+tranid+"</tran_id>";
...@@ -595,10 +641,14 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB ...@@ -595,10 +641,14 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB
{ {
pstmt.setString(3, "1"); pstmt.setString(3, "1");
} }
else else if(objName != null && objName.equalsIgnoreCase("gstr_purc"))
{ {
pstmt.setString(3, "2"); pstmt.setString(3, "2");
} }
else if(objName != null && objName.equalsIgnoreCase("gstr3b"))
{
pstmt.setString(3, "6");
}
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
System.out.println(rs.getFetchSize()); System.out.println(rs.getFetchSize());
...@@ -611,7 +661,7 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB ...@@ -611,7 +661,7 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB
retXmlString = retXmlString + "<amount>"+rs.getDouble("amount")+"</amount>"; retXmlString = retXmlString + "<amount>"+rs.getDouble("amount")+"</amount>";
retXmlString = retXmlString + "</detail1>"; retXmlString = retXmlString + "</detail1>";
sql = "select igst_amt, cgst_amt, sgst_amt, cess_amt, tran_id, line_no from gst_data_det where tran_id = ?"; sql = "select igst_amt, cgst_amt, sgst_amt, cess_amt, tran_id, line_no, taxable_amt from gst_data_det where tran_id = ?";
pstmtDet = conn.prepareStatement(sql); pstmtDet = conn.prepareStatement(sql);
pstmtDet.setString(1, rs.getString("tran_id")); pstmtDet.setString(1, rs.getString("tran_id"));
rsDet = pstmtDet.executeQuery(); rsDet = pstmtDet.executeQuery();
...@@ -625,6 +675,7 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB ...@@ -625,6 +675,7 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB
retXmlString = retXmlString + "<cgst_amt>"+rsDet.getDouble("cgst_amt")+"</cgst_amt>"; retXmlString = retXmlString + "<cgst_amt>"+rsDet.getDouble("cgst_amt")+"</cgst_amt>";
retXmlString = retXmlString + "<sgst_amt>"+rsDet.getDouble("sgst_amt")+"</sgst_amt>"; retXmlString = retXmlString + "<sgst_amt>"+rsDet.getDouble("sgst_amt")+"</sgst_amt>";
retXmlString = retXmlString + "<cess_amt>"+rsDet.getDouble("cess_amt")+"</cess_amt>"; retXmlString = retXmlString + "<cess_amt>"+rsDet.getDouble("cess_amt")+"</cess_amt>";
retXmlString = retXmlString + "<taxable_amt>"+rsDet.getDouble("taxable_amt")+"</taxable_amt>";
retXmlString = retXmlString + "</detail2>"; retXmlString = retXmlString + "</detail2>";
} }
retXmlString = retXmlString + "</detail>"; retXmlString = retXmlString + "</detail>";
...@@ -663,4 +714,6 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB ...@@ -663,4 +714,6 @@ public class GstrCustomTranEJB extends ValidatorEJB implements GstrCustomTranEJB
return null; return null;
} }
} }
//<prd_code/><rec_type/><tran_type/><cust_code/><cust_name/><submission_type/><doc_checksum/><doc_type>R</doc_type><amount/><reverse_chrg>N</reverse_chrg><lr_no/><lr_date/><ref_id__inv/><ref_date__inv/><prov_assmnt>Y</prov_assmnt><order_no/><order_date/><remarks/><submit_status>P</submit_status><submit_date/><add_user/><add_date/><add_term/><chg_user/><chg_date/><chg_term/><tax_reg_no/><tran_date/><reco_status/><doc_no/><doc_date/><doc_no_old/><doc_date_1/><amount_1/><gst_code_state/><site_code/><site_descr/><reco_status_descr/><tran_type_descr/><rec_type_descr/><state_descr/><ecom_reg_no/><gst_code/><name/><addr1/><addr2/><addr3/><city/><gst_state_code/><pin/><tran_id/><tran_id__ref/><gst_type/><gst_type_descr/><doc_type_descr/><reas_code/></Detail1></Header0></group0></DocumentRoot>
} }
...@@ -16,9 +16,9 @@ import javax.ejb.Local; ...@@ -16,9 +16,9 @@ import javax.ejb.Local;
@Local @Local
public interface GstrCustomTranEJBLocal extends ValidatorLocal public interface GstrCustomTranEJBLocal extends ValidatorLocal
{ {
public String saveRecord(String objName, String tranXml, UserInfoBean userInfo) throws RemoteException,ITMException; public String saveRecord(String objName, String tranXml,String gstType, UserInfoBean userInfo) throws RemoteException,ITMException;
String updateRecord(String objName, String tranXml, UserInfoBean userInfo) throws RemoteException, ITMException; String updateRecord(String objName, String tranXml,String gstType, UserInfoBean userInfo) throws RemoteException, ITMException;
String getRecords(String objName, String prdCode,String gstType, UserInfoBean userInfo) throws RemoteException, ITMException; String getRecords(String objName, String prdCode,String gstType, UserInfoBean userInfo) throws RemoteException, ITMException;
} }
...@@ -14,9 +14,9 @@ import javax.ejb.Remote; ...@@ -14,9 +14,9 @@ import javax.ejb.Remote;
@Remote @Remote
public interface GstrCustomTranEJBRemote extends ValidatorRemote public interface GstrCustomTranEJBRemote extends ValidatorRemote
{ {
public String saveRecord(String objName, String tranXml, UserInfoBean userInfo) throws RemoteException,ITMException; public String saveRecord(String objName, String tranXml, String gstType, UserInfoBean userInfo) throws RemoteException,ITMException;
String updateRecord(String objName, String tranXml, UserInfoBean userInfo) throws RemoteException, ITMException; String updateRecord(String objName, String tranXml,String gstType, UserInfoBean userInfo) throws RemoteException, ITMException;
String getRecords(String objName, String prdCode, String gstType, UserInfoBean userInfo) throws RemoteException, ITMException; String getRecords(String objName, String prdCode, String gstType, UserInfoBean userInfo) throws RemoteException, ITMException;
} }
...@@ -58,6 +58,13 @@ function onLoad() ...@@ -58,6 +58,13 @@ function onLoad()
openExtraContainer("V"); openExtraContainer("V");
} }
} }
else if(global_obj_name == "gstr3b")
{
if( gstType.value == "O" || (global_edit_mode == "V" && ($(gstType).text() == "Outward and Inward Supplay Details") ) )
{
openExtraContainer("O");
}
}
// } // }
...@@ -104,6 +111,13 @@ function openExtraContainer(gstType) ...@@ -104,6 +111,13 @@ function openExtraContainer(gstType)
iframe.src = "/ibase/webitm/jsp/GSTITCReversalSupplies.jsp"; iframe.src = "/ibase/webitm/jsp/GSTITCReversalSupplies.jsp";
} }
} }
else if(global_obj_name == "gstr3b")
{
if( gstType == "O" )
{
iframe.src = "/ibase/webitm/jsp/GST3OutInlSupplies.jsp";
}
}
global_gst_type = gstType; global_gst_type = gstType;
extraCont.appendChild(iframe); extraCont.appendChild(iframe);
saveData = saveDataCustom; saveData = saveDataCustom;
...@@ -115,6 +129,8 @@ function openExtraContainer(gstType) ...@@ -115,6 +129,8 @@ function openExtraContainer(gstType)
} }
window.parent.document.getElementById("E12TransEditorContainer-layoutBtn").style.display = "none"; window.parent.document.getElementById("E12TransEditorContainer-layoutBtn").style.display = "none";
// alert(saveData); // alert(saveData);
// $('#gstExtraFrame').contents().find(':input[type="number"]').click(function () { alert('hello'); });
} }
function hideItemDefaultEdit() function hideItemDefaultEdit()
...@@ -282,6 +298,10 @@ function getRecordsCallBackFn(retVal) ...@@ -282,6 +298,10 @@ function getRecordsCallBackFn(retVal)
domNum = +tranTypeAttr - 25; domNum = +tranTypeAttr - 25;
} }
} }
else
{
domNum = +tranTypeAttr;
}
//alert(domNum); //alert(domNum);
for(dNodeCntr = 0; dNodeCntr < detailParentNode.childNodes.length; dNodeCntr++) //Errors Node for(dNodeCntr = 0; dNodeCntr < detailParentNode.childNodes.length; dNodeCntr++) //Errors Node
{ {
...@@ -339,6 +359,7 @@ function getRecordsCallBackFn(retVal) ...@@ -339,6 +359,7 @@ function getRecordsCallBackFn(retVal)
var cgstAmt = ""; var cgstAmt = "";
var sgstAmt = ""; var sgstAmt = "";
var cessAmt = ""; var cessAmt = "";
var taxableAmt = "";
for(ctr = 0 ; ctr < colCount; ctr++) for(ctr = 0 ; ctr < colCount; ctr++)
{ {
var colNode = colNodeList.item(ctr); var colNode = colNodeList.item(ctr);
...@@ -369,19 +390,27 @@ function getRecordsCallBackFn(retVal) ...@@ -369,19 +390,27 @@ function getRecordsCallBackFn(retVal)
{ {
cessAmt = colNode.firstChild.nodeValue; cessAmt = colNode.firstChild.nodeValue;
} }
else if(colNode.nodeName == "taxable_amt")
{
taxableAmt = colNode.firstChild.nodeValue;
}
} }
else else
{ {
} }
} }
// alert('Detail2.'+domNum+'.tran_id'+domNum+''); //alert('Detail2.'+domNum+'.tran_id'+domNum+'');
innerDoc.getElementById('Detail2.'+domNum+'.tran_id'+domNum+'').value = tranId; innerDoc.getElementById('Detail2.'+domNum+'.tran_id'+domNum+'').value = tranId;
innerDoc.getElementById('Detail2.'+domNum+'.line_no'+domNum+'').value = lineNo; innerDoc.getElementById('Detail2.'+domNum+'.line_no'+domNum+'').value = lineNo;
innerDoc.getElementById('Detail2.'+domNum+'.igst_amt'+domNum+'').value = igstAmt; innerDoc.getElementById('Detail2.'+domNum+'.igst_amt'+domNum+'').value = igstAmt;
innerDoc.getElementById('Detail2.'+domNum+'.cgst_amt'+domNum+'').value = cgstAmt; innerDoc.getElementById('Detail2.'+domNum+'.cgst_amt'+domNum+'').value = cgstAmt;
innerDoc.getElementById('Detail2.'+domNum+'.sgst_amt'+domNum+'').value = sgstAmt; innerDoc.getElementById('Detail2.'+domNum+'.sgst_amt'+domNum+'').value = sgstAmt;
innerDoc.getElementById('Detail2.'+domNum+'.cess_amt'+domNum+'').value = cessAmt; innerDoc.getElementById('Detail2.'+domNum+'.cess_amt'+domNum+'').value = cessAmt;
if(innerDoc.getElementById('Detail2.'+domNum+'.taxable_amt'+domNum+'') != null)
{
innerDoc.getElementById('Detail2.'+domNum+'.taxable_amt'+domNum+'').value = taxableAmt;
}
if(global_edit_mode == "V") if(global_edit_mode == "V")
{ {
innerDoc.getElementById('Detail2.'+domNum+'.igst_amt'+domNum+'').setAttribute("readonly","true"); innerDoc.getElementById('Detail2.'+domNum+'.igst_amt'+domNum+'').setAttribute("readonly","true");
...@@ -392,6 +421,11 @@ function getRecordsCallBackFn(retVal) ...@@ -392,6 +421,11 @@ function getRecordsCallBackFn(retVal)
innerDoc.getElementById('Detail2.'+domNum+'.cgst_amt'+domNum+'').style.color = "blue"; innerDoc.getElementById('Detail2.'+domNum+'.cgst_amt'+domNum+'').style.color = "blue";
innerDoc.getElementById('Detail2.'+domNum+'.sgst_amt'+domNum+'').style.color = "blue"; innerDoc.getElementById('Detail2.'+domNum+'.sgst_amt'+domNum+'').style.color = "blue";
innerDoc.getElementById('Detail2.'+domNum+'.cess_amt'+domNum+'').style.color = "blue"; innerDoc.getElementById('Detail2.'+domNum+'.cess_amt'+domNum+'').style.color = "blue";
if(innerDoc.getElementById('Detail2.'+domNum+'.taxable_amt'+domNum+'') != null)
{
innerDoc.getElementById('Detail2.'+domNum+'.taxable_amt'+domNum+'').setAttribute("readonly","true");
innerDoc.getElementById('Detail2.'+domNum+'.taxable_amt'+domNum+'').style.color = "blue";
}
} }
} }
} }
...@@ -440,11 +474,11 @@ function save2DBCustom(pkValues) ...@@ -440,11 +474,11 @@ function save2DBCustom(pkValues)
var url = ""; var url = "";
if( getUserLang() == "en" ) if( getUserLang() == "en" )
{ {
url = "/ibase/GstrCustomTranServlet?action="+action+"&EDITOR_ID="+coreMdlId+"&OBJ_NAME="+global_obj_name+"&pkValues="+pkValues+"&XML_STR="+escape(saveString)+"&"+allElements; url = "/ibase/GstrCustomTranServlet?action="+action+"&EDITOR_ID="+coreMdlId+"&OBJ_NAME="+global_obj_name+"&pkValues="+pkValues+"&XML_STR="+escape(saveString)+"&"+allElements+"&GST_TYPE="+global_gst_type;
} }
else else
{ {
url = encodeURI( "/ibase/GstrCustomTranServlet?action="+action+"&EDITOR_ID="+coreMdlId+"&OBJ_NAME="+global_obj_name+"&pkValues="+pkValues+"&XML_STR="+saveString+"&"+allElements ); url = encodeURI( "/ibase/GstrCustomTranServlet?action="+action+"&EDITOR_ID="+coreMdlId+"&OBJ_NAME="+global_obj_name+"&pkValues="+pkValues+"&XML_STR="+saveString+"&"+allElements+"&GST_TYPE="+global_gst_type );
} }
var argArr = new Array(); var argArr = new Array();
argArr[0] = "save2DBCustom"; argArr[0] = "save2DBCustom";
...@@ -531,6 +565,14 @@ function getqueryStringCustom(formname) ...@@ -531,6 +565,14 @@ function getqueryStringCustom(formname)
onlyHeader = false; onlyHeader = false;
} }
} }
else if(global_obj_name == "gstr3b")
{
if(global_gst_type == "O")
{
noOfRec = 5;
onlyHeader = false;
}
}
for ( var i = 1; i <= noOfRec; i++) for ( var i = 1; i <= noOfRec; i++)
...@@ -558,6 +600,10 @@ function getqueryStringCustom(formname) ...@@ -558,6 +600,10 @@ function getqueryStringCustom(formname)
qstr = qstr + " <amount><![CDATA["+innerDoc.getElementById('Detail1.'+i+'.amount'+i+'').value+"]]></amount>"; qstr = qstr + " <amount><![CDATA["+innerDoc.getElementById('Detail1.'+i+'.amount'+i+'').value+"]]></amount>";
qstr = qstr + " <tran_type><![CDATA["+innerDoc.getElementById('Detail1.'+i+'.tran_type'+i+'').value+"]]></tran_type>"; qstr = qstr + " <tran_type><![CDATA["+innerDoc.getElementById('Detail1.'+i+'.tran_type'+i+'').value+"]]></tran_type>";
qstr = qstr + " <tran_id><![CDATA["+innerDoc.getElementById('Detail1.'+i+'.tran_id'+i+'').value+"]]></tran_id>"; qstr = qstr + " <tran_id><![CDATA["+innerDoc.getElementById('Detail1.'+i+'.tran_id'+i+'').value+"]]></tran_id>";
if(innerDoc.getElementById('Detail1.'+i+'.doc_type'+i+'') != null || innerDoc.getElementById('Detail1.'+i+'.doc_type'+i+'') != undefined)
{
qstr = qstr + " <doc_type><![CDATA["+innerDoc.getElementById('Detail1.'+i+'.doc_type'+i+'').value+"]]></doc_type>";
}
} }
else else
{ {
...@@ -572,6 +618,11 @@ function getqueryStringCustom(formname) ...@@ -572,6 +618,11 @@ function getqueryStringCustom(formname)
tempQstr = tempQstr + " <sgst_amt><![CDATA["+innerDoc.getElementById('Detail2.'+i+'.sgst_amt'+i+'').value+"]]></sgst_amt>"; tempQstr = tempQstr + " <sgst_amt><![CDATA["+innerDoc.getElementById('Detail2.'+i+'.sgst_amt'+i+'').value+"]]></sgst_amt>";
tempQstr = tempQstr + " <cgst_amt><![CDATA["+innerDoc.getElementById('Detail2.'+i+'.cgst_amt'+i+'').value+"]]></cgst_amt>"; tempQstr = tempQstr + " <cgst_amt><![CDATA["+innerDoc.getElementById('Detail2.'+i+'.cgst_amt'+i+'').value+"]]></cgst_amt>";
tempQstr = tempQstr + " <cess_amt><![CDATA["+innerDoc.getElementById('Detail2.'+i+'.cess_amt'+i+'').value+"]]></cess_amt>"; tempQstr = tempQstr + " <cess_amt><![CDATA["+innerDoc.getElementById('Detail2.'+i+'.cess_amt'+i+'').value+"]]></cess_amt>";
// alert(innerDoc.getElementById('Detail2.'+i+'.taxable_amt'+i+''));
if(innerDoc.getElementById('Detail2.'+i+'.taxable_amt'+i+'') != null || innerDoc.getElementById('Detail2.'+i+'.taxable_amt'+i+'') != undefined)
{
tempQstr = tempQstr + " <taxable_amt><![CDATA["+innerDoc.getElementById('Detail2.'+i+'.taxable_amt'+i+'').value+"]]></taxable_amt>";
}
} }
qstr += "</Detail1> "; qstr += "</Detail1> ";
...@@ -634,4 +685,17 @@ function custValidateFld(obj) ...@@ -634,4 +685,17 @@ function custValidateFld(obj)
validateFld(obj); validateFld(obj);
} }
} }
else if(global_obj_name == "gstr3b")
{
if( obj.value == "O" )
{
validateFld(obj);
openExtraContainer(obj.value);
}
else
{
hideExtraContainer();
validateFld(obj);
}
}
} }
\ No newline at end of file
<html>
<head>
<link type="text/css" rel="stylesheet" href="/ibase/webitm/css/GstCustomTransaction.css"/>
<script>
</script>
<title></title>
<meta content="">
<style></style>
</head>
<body>
<table class="gstTableClass">
<thead class="table-head">
<tr>
<th align="left" valign="top" >Description</th>
<th align="right" valign="top" >Taxable Amount</th>
<th align="right" valign="top" >IGST Amount</th>
<th align="right" valign="bottom" >SGST Amount</th>
<th align="right" valign="top">CGST Amount</th>
<th align="right" valign="top">CESS Amount</th>
</tr>
</thead>
<tbody class="table-body">
<tr>
<td align="left" valign="bottom">GSTR3B Outward taxable supplies (other than zero)</td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.1.taxable_amt1" name="Detail2.1.taxable_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.1.igst_amt1" name="Detail2.1.igst_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.1.sgst_amt1" name="Detail2.1.sgst_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.1.cgst_amt1" name="Detail2.1.cgst_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.1.cess_amt1" name="Detail2.1.cess_amt" type="text" value="0.00" > </td>
<input type="hidden" id="Detail1.1.tran_type1" name="Detail1.1.tran_type" type="text" value="1" >
<input type="hidden" id="Detail1.1.tran_id1" name="Detail1.1.tran_id" type="text" >
<input type="hidden" id="Detail1.1.amount1" name="Detail1.1.amount" type="text" >
<input type="hidden" id="Detail1.1.doc_type1" name="Detail1.1.doc_type" type="text" value="T" >
<input type="hidden" id="Detail2.1.tran_id1" name="Detail2.1.tran_id" type="text" >
<input type="hidden" id="Detail2.1.line_no1" name="Detail2.1.line_no" type="text" >
</tr>
<tr>
<td align="left" valign="bottom">Outward taxable supplies (zero rated )</td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.2.taxable_amt2" name="Detail2.2.taxable_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.2.igst_amt2" name="Detail2.2.igst_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.2.sgst_amt2" name="Detail2.2.sgst_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.2.cgst_amt2" name="Detail2.2.cgst_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.2.cess_amt2" name="Detail2.2.cess_amt" type="text" value="0.00" > </td>
<input type="hidden" id="Detail1.2.tran_type2" name="Detail1.2.tran_type" type="text" value="2" >
<input type="hidden" id="Detail1.2.tran_id2" name="Detail1.2.tran_id" type="text" >
<input type="hidden" id="Detail1.2.amount2" name="Detail1.2.amount" type="text" >
<input type="hidden" id="Detail1.2.doc_type2" name="Detail1.2.doc_type" type="text" value="Z">
<input type="hidden" id="Detail2.2.tran_id2" name="Detail2.2.tran_id" type="text" >
<input type="hidden" id="Detail2.2.line_no2" name="Detail2.2.line_no" type="text" >
</tr>
<tr>
<td align="left" valign="bottom">Other outward supplies (Nil rated, exempted)</td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.3.taxable_amt3" name="Detail2.3.taxable_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.3.igst_amt3" name="Detail2.3.igst_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.3.sgst_amt3" name="Detail2.3.sgst_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.3.cgst_amt3" name="Detail2.3.cgst_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.3.cess_amt3" name="Detail2.3.cess_amt" type="text" value="0.00" > </td>
<input type="hidden" id="Detail1.3.tran_type3" name="Detail1.3.tran_type" type="text" value="3" >
<input type="hidden" id="Detail1.3.tran_id3" name="Detail1.3.tran_id" type="text" >
<input type="hidden" id="Detail1.3.amount3" name="Detail1.3.amount" type="text" >
<input type="hidden" id="Detail1.3.doc_type3" name="Detail1.3.doc_type" type="text" value="N" >
<input type="hidden" id="Detail2.3.tran_id3" name="Detail2.3.tran_id" type="text" >
<input type="hidden" id="Detail2.3.line_no3" name="Detail2.3.line_no" type="text" >
</tr>
<tr>
<td align="left" valign="bottom">Inward supplies (liable to reverse charge)</td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.4.taxable_amt4" name="Detail2.4.taxable_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.4.igst_amt4" name="Detail2.4.igst_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.4.sgst_amt4" name="Detail2.4.sgst_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.4.cgst_amt4" name="Detail2.4.cgst_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.4.cess_amt4" name="Detail2.4.cess_amt" type="text" value="0.00" > </td>
<input type="hidden" id="Detail1.4.tran_type4" name="Detail1.4.tran_type" type="text" value="4" >
<input type="hidden" id="Detail1.4.tran_id4" name="Detail1.4.tran_id" type="text" >
<input type="hidden" id="Detail1.4.amount4" name="Detail1.4.amount" type="text" >
<input type="hidden" id="Detail1.4.doc_type4" name="Detail1.4.doc_type" type="text" value="R">
<input type="hidden" id="Detail2.4.tran_id4" name="Detail2.4.tran_id" type="text" >
<input type="hidden" id="Detail2.4.line_no4" name="Detail2.4.line_no" type="text" >
</tr>
<tr>
<td align="left" valign="bottom">Non-GST outward supplies </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.5.taxable_amt5" name="Detail2.5.taxable_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.5.igst_amt5" name="Detail2.5.igst_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.5.sgst_amt5" name="Detail2.5.sgst_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.5.cgst_amt5" name="Detail2.5.cgst_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.5.cess_amt5" name="Detail2.5.cess_amt" type="text" value="0.00" > </td>
<input type="hidden" id="Detail1.5.tran_type5" name="Detail1.5.tran_type" type="text" value="5" >
<input type="hidden" id="Detail1.5.tran_id5" name="Detail1.5.tran_id" type="text" >
<input type="hidden" id="Detail1.5.amount5" name="Detail1.5.amount" type="text" >
<input type="hidden" id="Detail1.5.doc_type5" name="Detail1.5.doc_type" type="text" value="G">
<input type="hidden" id="Detail2.5.tran_id5" name="Detail2.5.tran_id" type="text" >
<input type="hidden" id="Detail2.5.line_no5" name="Detail2.5.line_no" type="text" >
</tr>
</tbody>
</table>
</body>
</html>
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
<thead class="table-head"> <thead class="table-head">
<tr> <tr>
<th align="left" valign="top" >Description</th> <th align="left" valign="top" >Description</th>
<th align="right" valign="top" >IGST Rate</th> <th align="right" valign="top" >IGST Amount</th>
<th align="right" valign="bottom" >SGST Rate</th> <th align="right" valign="bottom" >SGST Amount</th>
<th align="right" valign="top">CGST Rate</th> <th align="right" valign="top">CGST Amount</th>
<th align="right" valign="top">CESS Rate</th> <th align="right" valign="top">CESS Amount</th>
</tr> </tr>
</thead> </thead>
<tbody class="table-body"> <tbody class="table-body">
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
<input type="hidden" id="Detail2.4.line_no4" name="Detail2.4.line_no" type="text" > <input type="hidden" id="Detail2.4.line_no4" name="Detail2.4.line_no" type="text" >
</tr> </tr>
<tr> <tr>
<td align="left" valign="bottom">ITC Rule 7 (2) (b))</td> <td align="left" valign="bottom">ITC Rule 7 (2) (b)</td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.5.igst_amt5" name="Detail2.5.igst_amt" type="text" value="0.00" > </td> <td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.5.igst_amt5" name="Detail2.5.igst_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.5.sgst_amt5" name="Detail2.5.sgst_amt" type="text" value="0.00" > </td> <td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.5.sgst_amt5" name="Detail2.5.sgst_amt" type="text" value="0.00" > </td>
<td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.5.cgst_amt5" name="Detail2.5.cgst_amt" type="text" value="0.00" > </td> <td> <input type="number" style="position:relative;;TYPE:number;text-align:RIGHT" class="tableInputField" required="" id="Detail2.5.cgst_amt5" name="Detail2.5.cgst_amt" type="text" value="0.00" > </td>
......
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