Commit d1b01783 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@106245 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 556a655c
This diff is collapsed.
This diff is collapsed.
......@@ -373,7 +373,7 @@ function showAutoSerach(element)
}
function generateOTP()
{
if(document.getElementById("Detail1.1.period_code").value == undefined || document.getElementById("Detail1.1.period_code").value == null || document.getElementById("Detail1.1.period_code").value.trim() == "" )
/*if(document.getElementById("yearMonthInput").value == undefined || document.getElementById("yearMonthInput").value == null || document.getElementById("yearMonthInput").value.trim() == "" )
{
alert("Please enter period code.");
document.getElementById("Detail1.1.period_code").value = document.getElementById("Detail1.1.period_code").value.trim();
......@@ -381,18 +381,20 @@ function generateOTP()
}
else
{
displayWaitImg();
document.getElementById("Detail1.1.otp").value = "";
var userName = document.getElementById("Detail1.1.username").value.trim();
var stateCode = document.getElementById("Detail1.1.state_code").value.trim();
var gstinNo = document.getElementById("Detail1.1.gstin").value.trim();
var periodCode = document.getElementById("Detail1.1.period_code").value.trim();
var siteCode = document.getElementById("Detail1.1.site_code").value.trim();
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);
}
displayWaitImg();
document.getElementById("Detail1.1.otp").value = "";
var userName = document.getElementById("Detail1.1.username").value.trim();
var stateCode = document.getElementById("Detail1.1.state_code").value.trim();
var gstinNo = document.getElementById("Detail1.1.gstin").value.trim();
var periodCode = document.getElementById("yearMonthInput").value.trim();
var siteCode = document.getElementById("Detail1.1.site_code").value.trim();
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);
}
function OTPGenerated(retVal)
......@@ -401,7 +403,6 @@ function OTPGenerated(retVal)
var xmlDoc = loadXMLString(retVal);
var msgNode = xmlDoc.getElementsByTagName("message")[0];
var msg = msgNode.childNodes[0].nodeValue;
alert(msg);
if(msg.indexOf("Error") == -1)
{
......@@ -410,17 +411,18 @@ function OTPGenerated(retVal)
isOtpGenerated = true;
startTimer(10);
}
alert(msg);
}
function validateHeaderForm()
{
if(document.getElementById("Detail1.1.period_code").value == undefined || document.getElementById("Detail1.1.period_code").value == null || document.getElementById("Detail1.1.period_code").value.trim() == "" )
/*if(document.getElementById("Detail1.1.period_code").value == undefined || document.getElementById("Detail1.1.period_code").value == null || document.getElementById("Detail1.1.period_code").value.trim() == "" )
{
alert("Please enter period code.");
document.getElementById("Detail1.1.period_code").value = document.getElementById("Detail1.1.period_code").value.trim();
document.getElementById("Detail1.1.period_code").focus();
return false;
}
else if(document.getElementById("Detail1.1.site_code").value == undefined || document.getElementById("Detail1.1.site_code").value == null || document.getElementById("Detail1.1.site_code").value.trim() == "" )
else*/ if(document.getElementById("Detail1.1.site_code").value == undefined || document.getElementById("Detail1.1.site_code").value == null || document.getElementById("Detail1.1.site_code").value.trim() == "" )
{
alert("Please enter site code.");
document.getElementById("Detail1.1.site_code").value = document.getElementById("Detail1.1.site_code").value.trim();
......@@ -584,8 +586,14 @@ function setTitlenImg(retVal)
}
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();
document.getElementById("returnMonthLbl").innerHTML = returnMonthLbl;
$(document).ready(function() {
var $dataRows = $("#dataSummaryTable tr:not('.titleRow, .totalRow')");
......@@ -628,4 +636,52 @@ function validateDetailForm()
return false;
}
}
}
function getSignedData()
{
callSignService("asasa","GSTR1",signedDataReceived);
}
function signedDataReceived(signedData)
{
alert(signedData);
}
function returnPeriodDropdown()
{
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var monthCode = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
var selectedMonthCode = "";
var curDate = new Date();
var prevMonth = new Date().addMonths(-1);
selectedMonthCode = monthCode[prevMonth.getMonth()]+prevMonth.getFullYear();
var prevdate = curDate.addMonths(-3);
for(var i=0; i<5; i++)
{
var nextDate = prevdate.addMonths(1);
$('#yearMonthInput').append($('<option />').val(monthCode[nextDate.getMonth()] + nextDate.getFullYear()).html(months[nextDate.getMonth()] + " " + nextDate.getFullYear()));
if(monthCode[nextDate.getMonth()]+nextDate.getFullYear() == selectedMonthCode)
{
$('#yearMonthInput').val(monthCode[curDate.getMonth()]+""+curDate.getFullYear()).change();
}
prevdate = nextDate;
}
}
function showDocTextbox(selectBox)
{
var selectValue = selectBox.value;
if(selectValue == "D")
{
document.getElementById("panTextbox").style.display = "block";
document.getElementById("aadhaarTextbox").style.display = "none";
}
else if(selectValue == "E")
{
document.getElementById("aadhaarTextbox").style.display = "block";
document.getElementById("panTextbox").style.display = "none";
}
}
\ No newline at end of file
......@@ -7,7 +7,7 @@
<html>
<body onload="getTitlenImg('gstsalesdata_file')">
<body onload="getTitlenImg('gstsalesdata_file');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>
......@@ -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>
......@@ -176,7 +180,7 @@
<div class="eachLineFields" style="text-align:center;">
<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>
<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>
<div id="timerDiv" style="display: none;margin-left: 20px;font-size:13px;float:none;"> OTP Expires in <span id="timerVal">10:00</span></div>
</div>
</div>
......
......@@ -7,7 +7,7 @@
<html>
<body onload="getTitlenImg('gstsalesdata_save')">
<body onload="getTitlenImg('gstsalesdata_save');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>
......@@ -147,10 +147,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>
......@@ -183,7 +187,7 @@
<div class="eachLineFields" style="text-align:center;">
<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>
<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>
<div id="timerDiv" style="display: none;margin-left: 20px;font-size:13px;float:none;"> OTP Expires in <span id="timerVal">10:00</span></div>
</div>
</div>
......
......@@ -7,7 +7,7 @@
<html>
<body onload="getTitlenImg('gstsalesdata_submit')">
<body onload="getTitlenImg('gstsalesdata_submit');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>
......@@ -138,10 +138,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>
......@@ -174,7 +178,7 @@
<div class="eachLineFields" style="text-align:center;">
<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>
<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>
<div id="timerDiv" style="display: none;margin-left: 20px;font-size:13px;float:none;"> OTP Expires in <span id="timerVal">10:00</span></div>
</div>
</div>
......
......@@ -222,47 +222,7 @@
<button class="accordion1" type="button" expanded="false">
<div class="iconDiv">S</div>
<div style="margin-left:40px;">
<div class="invTypDiv">Summary of documents till date saved on GSTN server for
<xsl:variable name="retPeriod"><xsl:value-of select="ret_period"/></xsl:variable>
<xsl:variable name="monthCode"><xsl:value-of select="substring($retPeriod,1,2)"/></xsl:variable>
<xsl:if test="$monthCode=01">
January
</xsl:if>
<xsl:if test="$monthCode=02">
February
</xsl:if>
<xsl:if test="$monthCode=03">
March
</xsl:if>
<xsl:if test="$monthCode=04">
April
</xsl:if>
<xsl:if test="$monthCode=05">
May
</xsl:if>
<xsl:if test="$monthCode=06">
June
</xsl:if>
<xsl:if test="$monthCode=07">
July
</xsl:if>
<xsl:if test="$monthCode=08">
August
</xsl:if>
<xsl:if test="$monthCode=09">
September
</xsl:if>
<xsl:if test="$monthCode=10">
October
</xsl:if>
<xsl:if test="$monthCode=11">
November
</xsl:if>
<xsl:if test="$monthCode=12">
December
</xsl:if>
<xsl:value-of select="substring($retPeriod,3,4 )"/>
</div>
<div class="invTypDiv">Summary of documents till date saved on GSTN server for <span id="returnMonthLbl"></span></div>
</div>
</button>
<div class="panel1" style="overflow-x:auto;">
......@@ -270,9 +230,9 @@
<thead class="table-head">
<tr class="titleRow">
<th nowrap="true" style="border-left:0px solid black !important;" align="left">Section</th>
<th nowrap="true" align="right">Count</th>
<th nowrap="true" align="right">Value</th>
<th nowrap="true" align="right">Taxable value</th>
<th nowrap="true" align="right">No. Invoices</th>
<th nowrap="true" align="right">Amount</th>
<th nowrap="true" align="right">Taxable amount</th>
<th nowrap="true" align="right">IGST</th>
<th nowrap="true" align="right">CGST</th>
<th nowrap="true" align="right">SGST</th>
......@@ -281,85 +241,141 @@
</thead>
<tbody class="table-body">
<xsl:for-each select="sec_sum">
<xsl:variable name="sectionName"><xsl:value-of select="sec_nm"/></xsl:variable>
<xsl:if test="not($sectionName='HSN') and not($sectionName='DOC_ISSUE') and not($sectionName='NIL')">
<tr>
<td style="border-left:0px solid black !important;" class="titleColumn">
<xsl:variable name="sectionName"><xsl:value-of select="sec_nm"/></xsl:variable>
<xsl:if test="$sectionName='B2BT'">
<xsl:if test="$sectionName='B2B'">
Invoices for outward supply (B2B)
</xsl:if>
<xsl:if test="$sectionName='B2BAT'">
<xsl:if test="$sectionName='B2BA'">
Revised invoices (B2B)
</xsl:if>
<xsl:if test="$sectionName='B2CLT'">
<xsl:if test="$sectionName='B2CL'">
Invoices for outward supply (B2CL)
</xsl:if>
<xsl:if test="$sectionName='B2CLAT'">
<xsl:if test="$sectionName='B2CLA'">
Revised invoices (B2CL)
</xsl:if>
<xsl:if test="$sectionName='B2CST'">
<xsl:if test="$sectionName='B2CS'">
Invoices for outward supply (B2CS)
</xsl:if>
<xsl:if test="$sectionName='B2CSAT'">
<xsl:if test="$sectionName='B2CSA'">
Revised invoices (B2CS)
</xsl:if>
<xsl:if test="$sectionName='CDNT'">
<xsl:if test="$sectionName='CDNR'">
Credit/Debit note
</xsl:if>
<xsl:if test="$sectionName='CDNAT'">
<xsl:if test="$sectionName='CDNRA'">
Revised Credit/Debit note
</xsl:if>
<xsl:if test="$sectionName='ATT'">
<xsl:if test="$sectionName='CDNUR'">
Credit/Debit note unregistered
</xsl:if>
<xsl:if test="$sectionName='CDNURA'">
Revised Credit/Debit note
</xsl:if>
<xsl:if test="$sectionName='AT'">
Advance received
</xsl:if>
<xsl:if test="$sectionName='ATAT'">
<xsl:if test="$sectionName='ATA'">
Advance received amendment
</xsl:if>
<xsl:if test="$sectionName='TXPDT'">
<xsl:if test="$sectionName='TXPD'">
Tax paid on advance received
</xsl:if>
<xsl:if test="$sectionName='NILT'">
<xsl:if test="$sectionName='NIL'">
Nil supplies
</xsl:if>
<xsl:if test="$sectionName='EXPWPT'">
Exports with tax payment
</xsl:if>
<xsl:if test="$sectionName='EXPWOPT'">
Exports without tax payment
</xsl:if>
<xsl:if test="$sectionName='EXPWPAT'">
Exports with tax payment amendment
</xsl:if>
<xsl:if test="$sectionName='EXPWOPAT'">
Exports without tax payment amendment
</xsl:if>
<xsl:if test="$sectionName='ECOMINTRAT'">
Intra state e-commerce supplies amendments
</xsl:if>
<xsl:if test="$sectionName='ECOMINTRT'">
Inter state e-commerce supplies
<xsl:if test="$sectionName='EXP'">
Export supplies
</xsl:if>
<xsl:if test="$sectionName='HSNT'">
HSN summary
<xsl:if test="$sectionName='EXPA'">
Revised Export supplies
</xsl:if>
</td>
<td align="right"><xsl:value-of select="ttl_rec"/></td>
<td align="right"><xsl:value-of select="ttl_val"/></td>
<td align="right"><xsl:value-of select="ttl_tax"/></td>
<td align="right"><xsl:value-of select="ttl_igst"/></td>
<td align="right"><xsl:value-of select="ttl_cgst"/></td>
<td align="right"><xsl:value-of select="ttl_sgst"/></td>
<td style="border-right:0px solid black !important;" align="right"><xsl:value-of select="ttl_cess"/></td>
<td align="right"><xsl:value-of select="ttl_rec"/>
<xsl:choose>
<xsl:when test="ttl_rec">
<xsl:value-of select="ttl_rec"/>
</xsl:when>
<xsl:otherwise>
0
</xsl:otherwise>
</xsl:choose>
</td>
<td align="right">
<xsl:choose>
<xsl:when test="ttl_val">
<xsl:value-of select="ttl_val"/>
</xsl:when>
<xsl:otherwise>
0
</xsl:otherwise>
</xsl:choose>
</td>
<td align="right">
<xsl:choose>
<xsl:when test="ttl_tax">
<xsl:value-of select="ttl_tax"/>
</xsl:when>
<xsl:otherwise>
0
</xsl:otherwise>
</xsl:choose>
</td>
<td align="right">
<xsl:choose>
<xsl:when test="ttl_igst">
<xsl:value-of select="ttl_igst"/>
</xsl:when>
<xsl:otherwise>
0
</xsl:otherwise>
</xsl:choose>
</td>
<td align="right">
<xsl:choose>
<xsl:when test="ttl_cgst">
<xsl:value-of select="ttl_cgst"/>
</xsl:when>
<xsl:otherwise>
0
</xsl:otherwise>
</xsl:choose>
</td>
<td align="right">
<xsl:choose>
<xsl:when test="ttl_sgst">
<xsl:value-of select="ttl_sgst"/>
</xsl:when>
<xsl:otherwise>
0
</xsl:otherwise>
</xsl:choose>
</td>
<td style="border-right:0px solid black !important;" align="right">
<xsl:choose>
<xsl:when test="ttl_cess">
<xsl:value-of select="ttl_cess"/>
</xsl:when>
<xsl:otherwise>
0
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</xsl:if>
</xsl:for-each>
<tr class="totalRow">
<td style="border-left:0px solid black !important;"><b>Total</b></td>
<td align="right" class="totalCol"><xsl:value-of select="ttl_rec"/></td>
<td align="right" class="totalCol"><xsl:value-of select="ttl_val"/></td>
<td align="right" class="totalCol"><xsl:value-of select="ttl_tax"/></td>
<td align="right" class="totalCol"><xsl:value-of select="ttl_igst"/></td>
<td align="right" class="totalCol"><xsl:value-of select="ttl_cgst"/></td>
<td align="right" class="totalCol"><xsl:value-of select="ttl_sgst"/></td>
<td style="border-right:0px solid black !important;" align="right" class="totalCol"><xsl:value-of select="ttl_cess"/></td>
<td align="right" class="totalCol"></td>
<td align="right" class="totalCol"></td>
<td align="right" class="totalCol"></td>
<td align="right" class="totalCol"></td>
<td align="right" class="totalCol"></td>
<td align="right" class="totalCol"></td>
<td style="border-right:0px solid black !important;" align="right" class="totalCol"></td>
</tr>
</tbody>
</table>
......
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