Commit 3e4acd09 authored by steurwadkar's avatar steurwadkar

F17ABAS001 GST API calling web part commit


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@106323 ce508802-f39f-4f6c-b175-0d175dae99d5
parent ec307524
......@@ -9,6 +9,7 @@ var xmlHTTPResponse;
var timeoutHandle;
var isOtpGenerated = false;
var oldFldVal ;
var preErrData = "";
if (window.ActiveXObject) /*code for IE6, IE5*/
{
......@@ -25,7 +26,7 @@ function makeRequest(url, callBackFunction)
if( ! isServerBusy )
{
isServerBusy = true;
httpRequest.open("POST", url, true);
httpRequest.open("POST", url, false);
httpRequest.onreadystatechange = function()
{
receiveResponse(callBackFunction);
......@@ -383,7 +384,7 @@ function generateOTP()
{
}*/
timeoutHandle = null;
displayWaitImg();
document.getElementById("Detail1.1.otp").value = "";
var userName = document.getElementById("Detail1.1.username").value.trim();
......@@ -394,7 +395,7 @@ function generateOTP()
var recType = document.getElementById("Detail1.1.returns_type").value.trim();
var url = "/ibase/GSTDataSubmitWizServlet?action=GENERATE_OTP&user_name="+escape(userName)+"&state_code="+stateCode+"&gstin_no="+escape(gstinNo)+"&period_code="+escape(periodCode)+"&site_code="+escape(siteCode)+"&rec_type="+escape(recType)+"";
makeRequest( url, OTPGenerated);
setTimeout(function (){makeRequest( url, OTPGenerated);},100);
}
function OTPGenerated(retVal)
......@@ -411,7 +412,15 @@ function OTPGenerated(retVal)
isOtpGenerated = true;
startTimer(10);
}
alert(msg);
if("1" == msg)
{
alert("OTP has been sent successfully to mobile number registerd with GSTN.");
}
else
{
alert(msg);
}
}
function validateHeaderForm()
{
......@@ -467,6 +476,7 @@ function validateHeaderForm()
}
function displayWaitImg()
{
document.getElementById("buttonreplacement").style.display = "block";
var overlay = document.getElementById( "overlay" );
overlay.setAttribute( "style", "position: fixed; top: 0; right: 0; bottom: 0; left: 0; background-color:#000; opacity: .45; z-index:1003; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;");
......@@ -588,9 +598,11 @@ function setSummaryTotal()
{
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var totalsByCol = [0, 0, 0, 0, 0, 0, 0];
var dateObj = new Date().addMonths(-1);
var returnMonthLbl = months[dateObj.getMonth()]+" "+dateObj.getFullYear();
var retPeriod = document.getElementById("summaryRetPeriod").value;
var monthCode = parseInt(retPeriod.substring(0,2))-1;
var year = retPeriod.substring(2);
var returnMonthLbl = months[monthCode]+" "+year;
document.getElementById("returnMonthLbl").innerHTML = returnMonthLbl;
......@@ -636,15 +648,87 @@ function validateDetailForm()
return false;
}
}
var htmlBody = document.getElementsByTagName("html")[0];
var htmlData = htmlBody.innerHTML;
var url = "/ibase/GSTDataSubmitWizServlet?action=SAVE_HTML_DATA&HTML_DATA="+encodeURIComponent(htmlData)+"";
makeRequest(url, dataSavedInSess);
}
function getSignedData()
function getSignedData(docType)
{
callSignService("asasa","GSTR1",signedDataReceived);
var summaryData = document.getElementById("Detail2.1.summary_data").value;
var pan = document.getElementById("Detail2.1.pan_no").value;
var aadhaar = document.getElementById("Detail2.1.aadhar_no").value;
var signMethod = document.getElementById("Detail2.1.sign_method").value;
if(signMethod == null || signMethod == undefined || signMethod.trim() == "")
{
alert("Please select sign method.");
document.getElementById("Detail2.1.sign_method").focus();
return false;
}
else
{
if(signMethod == "D")
{
if(pan == null || pan == undefined || pan.trim() == "")
{
alert("Please enter PAN.");
document.getElementById("Detail2.1.pan_no").focus();
return false;
}
}
else if(signMethod == "E")
{
if(aadhaar == null || aadhaar == undefined || aadhaar.trim() == "")
{
alert("Please enter Aadhaar number.");
document.getElementById("Detail2.1.aadhar_no").focus();
return false;
}
}
var overlay = document.getElementById( "overlay" );
overlay.setAttribute( "style", "position: fixed; top: 0; right: 0; bottom: 0; left: 0; background-color:#000; opacity: .45; z-index:2; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;");
var signConfig = {
"doc_type" : docType,
"pan" : pan,
"aadhaar" : aadhaar,
"sign_method" : signMethod
};
callSignService(summaryData, signConfig, signedDataReceived);
}
}
function signedDataReceived(signedData)
{
alert(signedData);
if( signedData != "FAILED")
{
document.getElementById("Detail2.1.signed_data").value = signedData ;
var htmlBody = document.getElementsByTagName("html")[0];
var htmlData = htmlBody.innerHTML;
var url = "/ibase/GSTDataSubmitWizServlet?action=SAVE_HTML_DATA&HTML_DATA="+encodeURIComponent(htmlData)+"";
makeRequest(url, dataSavedInSess);
document.getElementById("gstdataSubmitForm2").action = "/ibase/ITMWizardHandlerServlet";
document.getElementById("gstdataSubmitForm2").submit();
}
}
function formatDetailWithErr()
{
preErrData = document.getElementById("innerDiv").innerHTML;
var url = "/ibase/GSTDataSubmitWizServlet?action=DISPLAY_HTML_DATA";
makeRequest(url,displayDataFromSession);
}
function displayDataFromSession(retHtmlData)
{
var htmlBody = document.getElementsByTagName("html")[0];
htmlBody.innerHTML = retHtmlData;
if(document.getElementById("innerDiv") != null)
{
document.getElementById("innerDiv").innerHTML = preErrData;
}
var overlay = document.getElementById( "overlay" );
overlay.removeAttribute('style');
document.getElementById("buttonreplacement").style.display = "none";
}
function returnPeriodDropdown()
{
......@@ -684,4 +768,8 @@ function showDocTextbox(selectBox)
document.getElementById("aadhaarTextbox").style.display = "block";
document.getElementById("panTextbox").style.display = "none";
}
}
function dataSavedInSess(retVal)
{
console.log("Data saved in Session!");
}
\ No newline at end of file
......@@ -119,7 +119,7 @@
<div class="eachLineFields">
<div class="eachField">
<div class="labelDiv">GSTIN : </div>
<div class="inputDiv"><input type="text" class="editDisplayClass" value="{$gstin}" name="Detail1.{normalize-space($dbID)}.gstin" id="Detail1.{normalize-space($dbID)}.gstin" tabIndex="-1"/></div>
<div class="inputDiv"><input type="text" class="editDisplayClass" value="{$gstin}" name="Detail1.{normalize-space($dbID)}.gstin" id="Detail1.{normalize-space($dbID)}.gstin" tabIndex="-1" readOnly="true"/></div>
</div>
<div class="eachField">
<div class="labelDiv">User name : </div>
......@@ -172,12 +172,12 @@
</div>
</div>
</div>
<div class="eachLineFields" style="text-align:center;margin-top:10px;">
<div class="eachLineFields" style="margin-top:10px;margin-left:60px;">
<div class="eachField">
<div class="inputDiv"><input type="button" class="button" value="Generate OTP" title="Generate OTP" onClick="generateOTP();" tabIndex="-1" style="margin-right:0px;"/></div>
</div>
</div>
<div class="eachLineFields" style="text-align:center;">
<div class="eachLineFields">
<div class="eachField" style="margin-left:12px;display:none;" id="otpInputDiv">
<div class="labelDiv" style="width:50px;float:none;">OTP<span style="color:red;">*</span> : </div>
<div class="inputDiv" style="float:none;"><input type="text" class="input_editable" name="Detail1.{normalize-space($dbID)}.otp" id="Detail1.{normalize-space($dbID)}.otp" tabIndex="60" style="width:80px;" /></div>
......
......@@ -148,6 +148,7 @@
<td class="tdss_leftAlign" style="background: rgba(255, 204, 0, 0.66);" >
</td>
</tr>
<script><![CDATA[]]>formatDetailWithErr();</script>
</xsl:for-each>
<xsl:for-each select="//error">
......@@ -209,6 +210,8 @@
<button class="accordion1" type="button" expanded="false">
<div class="iconDiv">S</div>
<div style="margin-left:40px;">
<xsl:variable name="summaryRetPeriod"><xsl:value-of select="ret_period"/></xsl:variable>
<input type="hidden" id="summaryRetPeriod" value="{$summaryRetPeriod}"/>
<div class="invTypDiv">Summary of documents till date saved on GSTN server for <span id="returnMonthLbl"></span></div>
</div>
</button>
......@@ -281,7 +284,7 @@
Revised Export supplies
</xsl:if>
</td>
<td align="right"><xsl:value-of select="ttl_rec"/>
<td align="right">
<xsl:choose>
<xsl:when test="ttl_rec">
<xsl:value-of select="ttl_rec"/>
......@@ -863,8 +866,8 @@
<div id="btnDiv">
<input type="hidden" value="2" name="FORM_NO" ID="FORM_NO" />
<input type="hidden" value="gstsalesdata_file" name="OBJ_NAME" />
<input type="hidden" value="" name="action" id="action" />
<input type="button" style="cursor:hand;margin-left:20px;" value="Finish" onclick="getSignedData();" class="button" title='Finish' id="finish"/>
<input type="hidden" value="finish" name="action" id="action" />
<input type="button" style="cursor:hand;margin-left:20px;" value="Finish" onclick="getSignedData('GSTR1');" class="button" title='Finish' id="finish"/>
</div>
</div>
<div id="buttonreplacement">
......
......@@ -7,7 +7,7 @@
<html>
<body onload="getTitlenImg('gstsalesdata_getinv')">
<body onload="getTitlenImg('gstsalesdata_getinv');returnPeriodDropdown();">
<script type="text/javascript" src="/ibase/webitm/js/GSTDataSubmitWiz.js"></script>
<script type="text/javascript" src="/ibase/webitm/js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="/ibase/webitm/js/jquery-ui-1.10.4.custom.min.js"></script>
......@@ -119,7 +119,7 @@
<div class="eachLineFields">
<div class="eachField">
<div class="labelDiv">GSTIN : </div>
<div class="inputDiv"><input type="text" class="editDisplayClass" value="{$gstin}" name="Detail1.{normalize-space($dbID)}.gstin" id="Detail1.{normalize-space($dbID)}.gstin" tabIndex="-1"/></div>
<div class="inputDiv"><input type="text" class="editDisplayClass" value="{$gstin}" name="Detail1.{normalize-space($dbID)}.gstin" id="Detail1.{normalize-space($dbID)}.gstin" tabIndex="-1" readOnly="true"/></div>
</div>
<div class="eachField">
<div class="labelDiv">User name : </div>
......@@ -140,10 +140,14 @@
</div>
</div>
<div class="eachLineFields">
<div class="eachField">
<!-- <div class="eachField">
<div class="labelDiv">Month<span style="color:red;">*</span> : </div>
<div class="inputDiv"><input type="text" class="input_editable" value="{$period_code}" name="Detail1.{normalize-space($dbID)}.period_code" id="Detail1.{normalize-space($dbID)}.period_code" tabIndex="10" style="width:60px;" popupFldName="PERIOD_CODE" onkeyup="getAutoPopupData(this);" onfocus="displayPopUpIcon('popUpIcon1');"/></div>
<div class="popHelpIconDiv"><a href="javascript:getListOfValues('PERIOD_CODE','Detail1.{normalize-space($dbID)}.period_code','{$site_code}');" id="popUpIcon1" tabIndex="-1"><img src="/ibase/webitm/images/pophelp.png"/></a></div>
</div> -->
<div class="eachField">
<div class="labelDiv">Month<span style="color:red;">*</span> : </div>
<div class="inputDiv"><select class="input_editable" id="yearMonthInput" name="Detail1.{normalize-space($dbID)}.period_code"></select></div>
</div>
<div class="eachField" style="display:none;">
<div class="labelDiv">Site code<span style="color:red;">*</span> : </div>
......@@ -168,12 +172,12 @@
</div>
</div>
</div>
<div class="eachLineFields" style="text-align:center;margin-top:10px;">
<div class="eachLineFields" style=";margin-top:10px;margin-left:60px;">
<div class="eachField">
<div class="inputDiv"><input type="button" class="button" value="Generate OTP" title="Generate OTP" onClick="generateOTP();" tabIndex="-1" style="margin-right:0px;"/></div>
</div>
</div>
<div class="eachLineFields" style="text-align:center;">
<div class="eachLineFields">
<div class="eachField" style="margin-left:12px;display:none;" id="otpInputDiv">
<div class="labelDiv" style="width:50px;float:none;">OTP<span style="color:red;">*</span> : </div>
<div class="inputDiv" style="float:none;"><input type="text" class="input_editable" name="Detail1.{normalize-space($dbID)}.otp" id="Detail1.{normalize-space($dbID)}.otp" tabIndex="60" style="width:80px;text-align:right;padding-right:4px;" onblur="checkValidInput(this);" onkeypress="return isNumberKey(event);"/></div>
......
......@@ -179,12 +179,12 @@
</div>
</div>
</div>
<div class="eachLineFields" style="text-align:center;margin-top:10px;">
<div class="eachLineFields" style="margin-top:10px;margin-left:60px;">
<div class="eachField">
<div class="inputDiv"><input type="button" class="button" value="Generate OTP" title="Generate OTP" onClick="generateOTP();" tabIndex="-1" style="margin-right:0px;"/></div>
</div>
</div>
<div class="eachLineFields" style="text-align:center;">
<div class="eachLineFields">
<div class="eachField" style="margin-left:12px;display:none;" id="otpInputDiv">
<div class="labelDiv" style="width:50px;float:none;">OTP<span style="color:red;">*</span> : </div>
<div class="inputDiv" style="float:none;"><input type="text" class="input_editable" name="Detail1.{normalize-space($dbID)}.otp" id="Detail1.{normalize-space($dbID)}.otp" tabIndex="60" style="width:80px;"/></div>
......@@ -204,7 +204,7 @@
<input type="hidden" value="1" name="FORM_NO" ID="FORM_NO" />
<input type="hidden" value="gstsalesdata_save" name="OBJ_NAME" />
<input type="hidden" value="" name="action" id="action" />
<input type="submit" style="cursor:hand;margin-left:20px;" value="Finish" onclick="setActionVal('finish');return validateHeaderForm();displayWaitImg();" class="button" title='Finish' id="finish"/>
<input type="submit" style="cursor:hand;margin-left:20px;" value="Finish" onclick="setActionVal('finish');displayWaitImg();return validateHeaderForm();" class="button" title='Finish' id="finish"/>
</div>
</div>
<div id="buttonreplacement">
......
......@@ -117,7 +117,7 @@
<div class="eachLineFields">
<div class="eachField">
<div class="labelDiv">GSTIN : </div>
<div class="inputDiv"><input type="text" class="editDisplayClass" value="{$gstin}" name="Detail1.{normalize-space($dbID)}.gstin" id="Detail1.{normalize-space($dbID)}.gstin" tabIndex="-1"/></div>
<div class="inputDiv"><input type="text" class="editDisplayClass" value="{$gstin}" name="Detail1.{normalize-space($dbID)}.gstin" id="Detail1.{normalize-space($dbID)}.gstin" tabIndex="-1" readOnly="true"/></div>
</div>
<div class="eachField">
<div class="labelDiv">User name : </div>
......@@ -170,12 +170,12 @@
</div>
</div>
</div>
<div class="eachLineFields" style="text-align:center;margin-top:10px;">
<div class="eachLineFields" style="margin-top:10px;margin-left:60px">
<div class="eachField">
<div class="inputDiv"><input type="button" class="button" value="Generate OTP" title="Generate OTP" onClick="generateOTP();" tabIndex="-1" style="margin-right:0px;"/></div>
</div>
</div>
<div class="eachLineFields" style="text-align:center;">
<div class="eachLineFields">
<div class="eachField" style="margin-left:12px;display:none;" id="otpInputDiv">
<div class="labelDiv" style="width:50px;float:none;">OTP<span style="color:red;">*</span> : </div>
<div class="inputDiv" style="float:none;"><input type="text" class="input_editable" name="Detail1.{normalize-space($dbID)}.otp" id="Detail1.{normalize-space($dbID)}.otp" tabIndex="60" style="width:80px;"/></div>
......
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