Migrated Query - 24 find punchedrecords
This commit is contained in:
@@ -1,329 +0,0 @@
|
||||
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
|
||||
pageEncoding="ISO-8859-1"%>
|
||||
<%@page language="java" session="true" %>
|
||||
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
|
||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Cygnus 1.0 | Document Initiation </title>
|
||||
<script language="javascript" src="/matrix/js/lib/constants.js" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/jquery1.7.2.js" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/ui/uifuncs.js" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/lib/jsfuncs.js" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/ui/msgdialog.js" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/ui/select.js" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/ajax.js" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/ajax-dynamic-list.js" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/appjs/punchingdoc.js" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/validator.js?ver=2" type="text/javascript"></script>
|
||||
|
||||
<link href="/matrix/css/button.css" rel="stylesheet" type="text/css" />
|
||||
<link href="/matrix/css/div.css" rel="stylesheet" type="text/css" />
|
||||
<link href="/matrix/css/textbox.css" rel="stylesheet" type="text/css" />
|
||||
<link href="/matrix/css/select.css" rel="stylesheet" type="text/css" />
|
||||
<link href="/matrix/css/table.css" rel="stylesheet" type="text/css" />
|
||||
<link href="/matrix/css/autocomplete.css" rel="stylesheet" type="text/css" />
|
||||
<link href="/matrix/css/bootstrap-5.3.8.min.css" rel="stylesheet" type="text/css" />
|
||||
<link href="/matrix/css/matrix-v2.css?v=6" rel="stylesheet" type="text/css" />
|
||||
<link href="/matrix/css/matrix-shell-v2.css?v=7" rel="stylesheet" type="text/css" />
|
||||
<link href="/matrix/css/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
|
||||
<link href="/matrix/css/punch-workspace-v3.css?v=1" rel="stylesheet" type="text/css" />
|
||||
<link href="/matrix/css/add-cases-v4.css?v=5" rel="stylesheet" type="text/css" />
|
||||
<script src="/matrix/js/bootstrap-5.3.8.bundle.min.js" defer></script>
|
||||
<script src="/matrix/js/matrix-shell-v2.js" defer></script>
|
||||
<link href="/matrix/css/matrix-frame-dialog.css?v=6" rel="stylesheet" type="text/css" />
|
||||
<script src="/matrix/js/matrix-frame-dialog.js?v=2" defer></script>
|
||||
<script src="/matrix/js/matrix-accessibility-v1.js?v=1" defer></script>
|
||||
<link href="/matrix/css/matrix-theme-v2.css?v=4" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
|
||||
<body class="matrix-v2 matrix-shell matrix-tool-workspace matrix-punch-workspace matrix-add-cases">
|
||||
<div id='PageFrame'>
|
||||
<%@ include file="/WEB-INF/app/fragments/app-shell-header.jspf" %>
|
||||
<%-- Shared shell owns ${Sessvals.menuHtml}. --%>
|
||||
<div id="formcontainer" class="matrix-tool-workspace__content">
|
||||
<form method="post" name="docdetails" id="docdetails" >
|
||||
<!-- Common Details (Section1) Visible for all portfolios-->
|
||||
<div>
|
||||
<!-- Title -->
|
||||
<div class="title matrix-form-title">
|
||||
<img class="matrix-title-icon" src="/matrix/images/commondet.png" align="absmiddle" />
|
||||
<span class="matrix-title-text matrix-form-title__heading">Common Details <span id='recfound'></span></span>
|
||||
<label class="matrix-form-title__field">Skip To <input type="text" class="textbox" style="width:30px" onkeypress="return NumberOnly(event)" onblur="GotoRecord(this)"></label>
|
||||
<label class="matrix-form-title__field">Search by File No <input type="text" class="textbox" style="width:200px" onblur="SearchRecord(this)"></label>
|
||||
<!-- Checkbox for AUTO CUT diabled for now -->
|
||||
<!-- <input type="checkbox" name="autocut" id="autocut" /> Automatic Cut-Off -->
|
||||
<div class="divselect matrix-form-title__end" id="divportfolio" style="width:167px;">
|
||||
<select id="portfolio_id" name="portfolio_id" style="width:185px" onchange="SubmitForm('docadd','_parent','docdetails')">
|
||||
<option value="-1" selected >SELECT PORTFOLIO</option>
|
||||
<c:forEach items="${portlist}" var="port">
|
||||
<option value="${port[0]}">${port[1]}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- -->
|
||||
<!-- Form (Section1) -->
|
||||
<div id="FormPanel1" class="FormPanel">
|
||||
<table align="center" class="matrix-form-controls" width="99%">
|
||||
<tr>
|
||||
<td>
|
||||
<div style="height:auto;width:16px;float:right;margin-top:4px;">
|
||||
<div id="btnbedit" onclick="EditBasicDetails()" title="edit basic details" style="background:url('/matrix/images/edit_form.png');height:auto;width:16px;cursor:pointer;margin-top:2px"> </div>
|
||||
<div id="btnbsave" onclick="SaveBasicDetails()" title="save details" style="background:url('/matrix/images/disk.png');height:auto;width:16px;cursor:pointer;margin-top:2px"> </div>
|
||||
<div id="btnbcancel" onclick="CancelEdit()" title="cancel" style="background:url('/matrix/images/msgerror.png');height:auto;width:16px;cursor:pointer;margin-top:6px"> </div>
|
||||
</div>
|
||||
<div class="widget">
|
||||
<div class="lblcontainer">
|
||||
Appl No.
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<input type="text" id="applno" name="applno" maxlength="25" style="width:150px;text-transform:uppercase" value="" disabled="disabled" onblur="if(validate(this,'t','AlphaNumeric')){FindSameDet(this,'A','customername');}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget">
|
||||
<div class="lblcontainer">
|
||||
Name
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<input type="text" id="customername" name="customername" maxlength="100" style="width:275px" value="" onblur="validate(this,'t','AlphaSpace');" disabled="disabled" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget">
|
||||
<div class="lblcontainer">
|
||||
DOB
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<input type="text" id="dob" name="dob" maxlength="10" style="width:80px" value="" onkeydown="return addSlashes(this,event)" onblur="validate(this,'f','Date')" disabled="disabled" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget">
|
||||
<div class="lblcontainer">
|
||||
Loan Amt
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<input type="text" id="loanamount" name="loanamount" maxlength="15" style="width:115px" value="" onblur="validate(this,'f','LoanAmount');" disabled="disabled" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget">
|
||||
<div class="lblcontainer">
|
||||
Branch
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<div class="divselect" id="divbranch" style="width:235px;">
|
||||
<select id="bank_branch_id" name="bank_branch_id" style="width:253px" onblur="validate(this,'t','');" disabled="disabled">
|
||||
<option value="-1" selected >SELECT</option>
|
||||
<c:forEach items="${branchlist}" var="brnch">
|
||||
<option value="${brnch[0]}">${brnch[1]}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget">
|
||||
<div class="lblcontainer">
|
||||
Product
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<div class="divselect" id="divproduct" style="width:132px;">
|
||||
<select id="product" name="product" style="width:150px" onblur="validate(this,'t','');" disabled="disabled">
|
||||
<option value="-1" selected >SELECT</option>
|
||||
<c:forEach items="${prodlist}" var="prod">
|
||||
<option value="${prod[0]}">${prod[1]}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget">
|
||||
<div class="lblcontainer">
|
||||
App Type
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<div class="divselect" id="divapptype" style="width:135px;">
|
||||
<select id="apptype" name="apptype" style="width:153px" onblur="validate(this,'t','');" disabled="disabled">
|
||||
<option value="-1" selected>SELECT</option>
|
||||
<c:forEach items="${typelist}" var="type">
|
||||
<option value="${type[0]}">${type[1]}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget">
|
||||
<div class="lblcontainer">
|
||||
Category
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<div class="divselect" id="divcategory" style="width:115px;">
|
||||
<select id="category" name="category" style="width:133px" disabled="disabled">
|
||||
<option value="-1" selected>SELECT</option>
|
||||
<c:forEach items="${catlist}" var="cat">
|
||||
<option value="${cat[0]}">${cat[1]}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
${dynamichtml}
|
||||
<input type="button" class="button" name="btnsave" style="float:right" value="Add Docs" id="btnsave" onclick="return AddDocs();" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- -->
|
||||
</div>
|
||||
<!-- -->
|
||||
<!-- Document Details Visible for portfolios in which document verification could be done-->
|
||||
<div id="section7">
|
||||
<!-- Title -->
|
||||
<div class="title">
|
||||
<img class="matrix-title-icon" src="/matrix/images/documents.png" />
|
||||
<span class="matrix-title-text">Document Details</span>
|
||||
</div>
|
||||
<!-- -->
|
||||
<!-- Form (Section1) -->
|
||||
<div id="FormPanel1" class="FormPanel">
|
||||
<table align="center" class="matrix-form-controls" width="99%">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="widget">
|
||||
<div class="lblcontainer">
|
||||
Document
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<div class="divselect" id="divdoctype" style="width:170px;">
|
||||
<select id="doctype" name="doctype" style="width:188px" onchange="changeLabel(this)" onblur="validate(this,'t','')">
|
||||
<option value="-1" uniqueidentifier="Unique No." sprovider="Service Provider" validuno="xxx" ymon="A.Y/Month" validymon="" defsprovider="" genlist="0" selected>SELECT</option>
|
||||
<c:forEach items="${doclist}" var="doc">
|
||||
<option value="${doc[0]}" uniqueidentifier="${doc[2]}" sprovider="${doc[3]}" validuno="${doc[4]}" ymon="${doc[5]}" validymon="${doc[6]}" defsprovider="${doc[7]}" genlist="${doc[8]}">${doc[1]}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget">
|
||||
<div class="lblcontainer">
|
||||
Name
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<input type="text" id="docholdername" name="docholdername" maxlength="100" style="width:200px" value="" onblur="validate(this,'t','AlphaSpace');" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget">
|
||||
<div class="lblcontainer" id="sprovider">
|
||||
Serivce Provider
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<input type="text" id="serviceprovider" name="serviceprovider" maxlength="100" style="width:200px" value="" onblur="validate(this,'t','SplInstruction');" />
|
||||
<input type="hidden" id="bank_id" name="serviceprovider_hidden" value="0" />
|
||||
<input type="hidden" id="serviceprovider_citylist" name="serviceprovider_citylist" value="0" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget">
|
||||
<div class="lblcontainer" id="uniqueidentifier">
|
||||
Unique No.
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<input type="text" id="uniqueno" name="uniqueno" maxlength="50" style="width:140px" value="" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget">
|
||||
<div class="lblcontainer" id="yearmon">
|
||||
A.Y/Month
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<input type="text" id="yearmonth" name="yearmonth" maxlength="100" style="width:180px" value="" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget">
|
||||
<div class="lblcontainer">
|
||||
Location
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<div class="divselect" id="divcity" style="width:120px;" >
|
||||
<select id="city" name="city" style="width:138px" onblur="validate(this,'t','');">
|
||||
<option value="-1" selected>SELECT</option>
|
||||
<option value="CITY" selected>CITY</option>
|
||||
<option value="SATELLITE CITY">SATELLITE CITY</option>
|
||||
<option value="OUT STATION">OUT STATION</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget">
|
||||
<div class="lblcontainer">
|
||||
Vendor
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<div class="divselect" id="divvendor" style="width:120px;">
|
||||
<select id="vendor_id" name="vendor_id" style="width:138px" onblur="validate(this,'f','');">
|
||||
<option value="-1" selected>SELECT</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
${docdynamichtml}
|
||||
<input type="button" class="button" name="btnadd" style="float:right" value="Add" id="btnadd" onclick="return AddNewDoc();" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="FormPanel2" class="FormPanel">
|
||||
<table border="0" cellspacing="0" width="100%" id="casetable">
|
||||
<thead class="thead">
|
||||
<tr title="Row Title" id="rowtitle">
|
||||
<td style="font-size:12px;width:20px">S.No</td>
|
||||
<td style="font-size:12px;width:150px">Name</td>
|
||||
<td style="font-size:12px;width:150px">Document</td>
|
||||
<td style="font-size:12px;width:150px">Provider</td>
|
||||
<td style="font-size:12px;width:150px">Unique No.</td>
|
||||
<td style="font-size:12px;width:100px">Extra</td>
|
||||
<td style="font-size:12px;width:50px">Location</td>
|
||||
<td style="font-size:12px;width:50px">Vendor</td>
|
||||
<td style="font-size:12px">Action</td>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<!-- -->
|
||||
</div>
|
||||
<input type="hidden" id="dynamicfields" name="dynamicfields" value="${dynamicfields}" />
|
||||
<input type="hidden" id="docdynamicfields" name="dynamicfields" value="${docdynamicfields}" />
|
||||
<input type="hidden" id="uuid" name="uuid" value="" />
|
||||
<input type="hidden" id="case_id" name="case_id" value="" />
|
||||
<input type="hidden" id="company_id" name="company_id" value="${Sessvals.getCompanyID()}" />
|
||||
<input type="hidden" id="branch_id" name="branch_id" value="${Sessvals.getBranchID()}" />
|
||||
<input type="hidden" id="status" name="status" value="" />
|
||||
<input type="hidden" id="docv" name="docv" value="0" />
|
||||
<!-- -->
|
||||
<input type="hidden" id="invalidfields" value="0" />
|
||||
<c:if test="${formmode gt 0}">
|
||||
<div style="position:fixed;text-align:right;bottom:0px;width:980px;" class="buttonbar">
|
||||
<input type="hidden" id="invalidfields" value="0" />
|
||||
<input type="button" class="button" name="btnfirst" style="margin-left:5px;margin-top:-2px;float:left;width:80px" value="" id="btnfirst" accesskey="F" onclick="findRecord(1)" />
|
||||
<input type="button" class="button" name="btnprev" style="margin-top:-2px;float:left;width:80px" value="" id="btnprev" accesskey="P" onclick="findRecord(2)" />
|
||||
<input type="button" class="button" name="btnnext" style="margin-top:-2px;float:left;width:80px" value="" id="btnnext" accesskey="N" onclick="findRecord(3)" />
|
||||
<input type="button" class="button" name="btnlast" style="margin-top:-2px;float:left;width:80px" value="" id="btnlast" accesskey="L" onclick="findRecord(4)" />
|
||||
<input type="button" class="button" name="btnadd" style="float:right" value="Add New Record" id="btnadd" accesskey="A" onclick="return AddNewRecord();" />
|
||||
</div>
|
||||
</c:if>
|
||||
</form>
|
||||
<input type="hidden" id="formmode" name="formmode" value="${formmode}" />
|
||||
<input type="hidden" id="usid" name="usid" value="${usid}" />
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<!-- Page Load Javascript -->
|
||||
<script language="javascript" type="text/javascript">
|
||||
InitPage('${portfolio_id}');
|
||||
</script>
|
||||
<!-- -->
|
||||
<!-- Process Message -->
|
||||
<c:if test="${not empty msg}">
|
||||
<script language="javascript" type="text/javascript"> CallMessage('${msg}',3000,200,300); </script>
|
||||
</c:if>
|
||||
<!-- -->
|
||||
</html>
|
||||
@@ -1,403 +0,0 @@
|
||||
var records=new Array(1);
|
||||
var fields=new Array(1);
|
||||
var recIndx = 0;
|
||||
var recpos = 0;
|
||||
var FocusAfter="customername";
|
||||
ajax_list_externalFile = "listservprovider";
|
||||
var validateHidden = false;
|
||||
function InitPage(port)
|
||||
{
|
||||
centerDivBoth("formcontainer","H");
|
||||
$("#portfolio_id").val(port);
|
||||
ManageButtons(true);
|
||||
$("#btnsave").hide();
|
||||
if(port>0)
|
||||
{
|
||||
if(document.getElementById("ajaxmsg") !== null)
|
||||
{
|
||||
CallMessage('1001AJX:warning:Another operation is being processed, please wait..',3000,200,300);
|
||||
return;
|
||||
}
|
||||
LoadingMsg("Fetching records, please wait...","ajaxmsg");
|
||||
RunAjax("GET","puncheddocrecs","val0="+port+"&val1="+($("#dynamicfields").val()),1);
|
||||
}
|
||||
}
|
||||
|
||||
function PrepareQStr()
|
||||
{
|
||||
var val0='';
|
||||
var val1='';
|
||||
var indx=2;
|
||||
autocut=0;
|
||||
var lindx=fields[0].length-1;
|
||||
var cid=$("#case_id").val();
|
||||
var temp='';
|
||||
|
||||
for(indx;indx<lindx;indx++)
|
||||
{
|
||||
temp='';
|
||||
if($("#"+fields[0][indx]).length > 0)
|
||||
{
|
||||
if(fields[0][indx]=='docv' || fields[0][indx]=='status')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
temp="''"+$("#"+fields[0][indx]).val().replace(/,/g, ' ')+"''";
|
||||
}
|
||||
val0=val0+fields[0][indx]+',';
|
||||
val1=val1+temp+",";
|
||||
records[recpos][indx]=temp.replace(/\'/g,'');
|
||||
}
|
||||
else
|
||||
{
|
||||
val0=val0+fields[0][indx]+',';
|
||||
val1=val1+"NULL,";
|
||||
records[recpos][indx]=temp.replace(/\'/g,'');
|
||||
}
|
||||
}
|
||||
val1=val1.replace(/&/g,'~AmP~');
|
||||
return "val0="+val0+"&val1="+val1+"&val2="+cid+"&val3="+($("#uuid").val())+"&val4="+autocut+"&val5="+($("#usid").val())+"&val6="+($("#portfolio_id").val());
|
||||
}
|
||||
function GotoRecord(el)
|
||||
{
|
||||
recno=el.value;
|
||||
if(recno!='')
|
||||
{
|
||||
if(recno > recIndx || recno <=0)
|
||||
{
|
||||
CallMessage('1001IRNG:error:Invalid input. Out of range',3000,200,300);
|
||||
}
|
||||
else
|
||||
{
|
||||
recpos=recno-1;
|
||||
FillDetails(recpos);
|
||||
}
|
||||
}
|
||||
}
|
||||
function AddNewRecord()
|
||||
{
|
||||
if(recIndx== 0 || records[recIndx-1][0]!='0')
|
||||
{
|
||||
var cols=fields[0].length;
|
||||
recIndx = recIndx+1;
|
||||
recpos = recIndx-1;
|
||||
records[recpos]=new Array(cols);
|
||||
records[recpos][0]='0';
|
||||
records[recpos][1]=$("#portfolio_id").val();
|
||||
records[recpos][cols-4]='0';
|
||||
records[recpos][cols-3]=$("#company_id").val();
|
||||
records[recpos][cols-2]=$("#branch_id").val();
|
||||
records[recpos][cols-1]='';
|
||||
}
|
||||
else
|
||||
{
|
||||
recpos=recIndx-1;
|
||||
}
|
||||
FillDetails(recpos);
|
||||
}
|
||||
function AfterResponse(response,oprID)
|
||||
{
|
||||
var rindx=0;
|
||||
if(oprID==1)
|
||||
{
|
||||
$("#ajaxmsg").remove();
|
||||
if(response.trim().search('Error')==-1)
|
||||
{
|
||||
var rows=response.split(RowDelim);
|
||||
for(rindx=0;rindx<rows.length-1;rindx++)
|
||||
{
|
||||
var cindx=0;
|
||||
var cols=rows[rindx].split(ColDelim);
|
||||
if(rindx==0)
|
||||
{
|
||||
fields[rindx]=new Array(cols.length);
|
||||
}
|
||||
else
|
||||
{
|
||||
records[rindx-1]=new Array(cols.length);
|
||||
}
|
||||
for(cindx=0;cindx<cols.length;cindx++)
|
||||
{
|
||||
if(rindx==0)
|
||||
{
|
||||
fields[rindx][cindx]=cols[cindx];
|
||||
}
|
||||
else
|
||||
{
|
||||
records[rindx-1][cindx]=cols[cindx];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
CallMessage(response,3000,200,300);
|
||||
}
|
||||
recIndx= rindx==0 ? rindx : rindx-1;
|
||||
$("#recfound").html("<b>( 0 / "+(recIndx==0 ? "0" : recIndx)+" )</b>");
|
||||
recpos=0;
|
||||
FillDetails(recpos);
|
||||
}
|
||||
else if(oprID==2)
|
||||
{
|
||||
$("#ajaxmsg").remove();
|
||||
collen=fields[0].length;
|
||||
if(response.trim().search('Error')==-1)
|
||||
{
|
||||
if(autocut==1)
|
||||
{
|
||||
records[recpos][collen-4]='1';
|
||||
}
|
||||
if($("#case_id").val()!='0')
|
||||
{
|
||||
findRecord(3);
|
||||
}
|
||||
else
|
||||
{
|
||||
records[recpos][0]=response.split(ColDelim)[0];
|
||||
records[recpos][collen-1]=response.split(ColDelim)[1];
|
||||
AddNewRecord();
|
||||
}
|
||||
CallMessage('1001IRNG:info:Record updated successfully',3000,200,300);
|
||||
}
|
||||
else
|
||||
{
|
||||
records[recpos][collen-4]='-1';
|
||||
CallMessage(response,3000,200,300);
|
||||
}
|
||||
}
|
||||
else if(oprID==3)
|
||||
{
|
||||
$("#ajaxmsg").remove();
|
||||
if(response.trim().search('Error')==-1)
|
||||
{
|
||||
CallMessage('1001IRNG:info:Record updated successfully',3000,200,300);
|
||||
}
|
||||
else
|
||||
{
|
||||
CallMessage(response,3000,200,300);
|
||||
}
|
||||
}
|
||||
else if(oprID==4)
|
||||
{
|
||||
if(response.trim().search('Error')==-1)
|
||||
{
|
||||
FillDD("vendor_id",response,RowDelim,ColDelim);
|
||||
if(currow != null)
|
||||
{
|
||||
$("#vendor_id").val($("#doclist tr:eq("+currow+")").find('td').eq(6).attr("id"));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CallMessage(response,3000,200,300);
|
||||
}
|
||||
}
|
||||
else if(oprID==5)
|
||||
{
|
||||
if(response.trim().search('Error')==-1)
|
||||
{
|
||||
alert(response);
|
||||
}
|
||||
else
|
||||
{
|
||||
CallMessage(response,3000,200,300);
|
||||
}
|
||||
}
|
||||
}
|
||||
function findRecord(arrOpr)
|
||||
{
|
||||
tempPos= recpos;
|
||||
maxLen= recIndx-1;
|
||||
if(arrOpr==1) tempPos=0;
|
||||
if(arrOpr==2)
|
||||
{
|
||||
if(tempPos>0) tempPos=tempPos-1;
|
||||
else return false;
|
||||
}
|
||||
if(arrOpr==3)
|
||||
{
|
||||
if(tempPos<maxLen) tempPos=tempPos+1;
|
||||
else return false;
|
||||
}
|
||||
if(arrOpr==4) tempPos=maxLen;
|
||||
recpos= tempPos;
|
||||
FillDetails(recpos);
|
||||
}
|
||||
function SearchRecord(elm)
|
||||
{
|
||||
var found=false;
|
||||
var skey=elm.value.trim().toLowerCase();
|
||||
for(rindx=0;rindx<records.length;rindx++)
|
||||
{
|
||||
if(records[rindx][3].trim().toLowerCase().search(skey)>-1)
|
||||
{
|
||||
recpos=rindx;
|
||||
found=true;
|
||||
FillDetails(recpos);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!found)
|
||||
{
|
||||
CallMessage('NOREC1001:error:No record found.',3000,200,300);
|
||||
}
|
||||
}
|
||||
function FillDetails(indx)
|
||||
{
|
||||
if(recIndx > 0)
|
||||
{
|
||||
CancelEdit();
|
||||
document.forms['casedetails'].reset();
|
||||
$("#doclist").html('');
|
||||
resetDocForm();
|
||||
$("#recfound").html("<b>( "+(indx+1)+" / "+(recIndx==0 ? "0" : recIndx)+" )</b>");
|
||||
var cols = fields[0].length;
|
||||
var findx=0;
|
||||
for(findx=0;findx < cols;findx++)
|
||||
{
|
||||
if($("#"+fields[0][findx]).length > 0)
|
||||
{
|
||||
$("#"+fields[0][findx]).val(records[indx][findx]);
|
||||
}
|
||||
}
|
||||
var data = jQuery.parseJSON(records[indx][cols-5].replace('},]}','}]}'));
|
||||
var tdocs = data.docs.length;
|
||||
for(indx = 0;indx < tdocs; indx++)
|
||||
{
|
||||
var did = data.docs[indx].doc_id;
|
||||
data.docs[indx].doc_id="0";
|
||||
AddDocRow(data.docs[indx],did,data.docs[indx].docvendor);
|
||||
}
|
||||
document.getElementById("applno").focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
CallMessage('5005MQRY:error:No records found',3000,200,300);
|
||||
AddNewRecord();
|
||||
}
|
||||
}
|
||||
function EditBasicDetails()
|
||||
{
|
||||
EnableDisableFields(false);
|
||||
ManageButtons(false);
|
||||
}
|
||||
function SaveBasicDetails()
|
||||
{
|
||||
if(confirm("Are you sure to update the details?"))
|
||||
{
|
||||
var QStr=PrepareQStr();
|
||||
QStr=QStr+"&val7=2";
|
||||
if(document.getElementById("ajaxmsg") !== null)
|
||||
{
|
||||
CallMessage('1001AJX:warning:Another operation is being processed, please wait..',3000,200,300);
|
||||
return;
|
||||
}
|
||||
LoadingMsg("Updating details, please wait...","ajaxmsg");
|
||||
RunAjax("POST","updatebdetails",QStr,3);
|
||||
EnableDisableFields(true);
|
||||
ManageButtons(true);
|
||||
|
||||
}
|
||||
}
|
||||
function CancelEdit()
|
||||
{
|
||||
SetPrevValues();
|
||||
EnableDisableFields(true);
|
||||
ManageButtons(true);
|
||||
}
|
||||
function EnableDisableFields(isEnabled)
|
||||
{
|
||||
var indx=2;
|
||||
if(typeof fields[0]!=='undefined')
|
||||
{
|
||||
var lindx=fields[0].length-1;
|
||||
for(indx;indx<lindx;indx++)
|
||||
{
|
||||
$("#"+fields[0][indx]).prop("disabled",isEnabled);
|
||||
}
|
||||
}
|
||||
indx=0;
|
||||
/*$("#applno").prop("disabled",isEnabled);
|
||||
$("#customername").prop("disabled",isEnabled);
|
||||
$("#dob").prop("disabled",isEnabled);
|
||||
$("#loanamount").prop("disabled",isEnabled);
|
||||
$("#bank_branch_id").prop("disabled",isEnabled);
|
||||
$("#product").prop("disabled",isEnabled);
|
||||
$("#apptype").prop("disabled",isEnabled);
|
||||
$("#category").prop("disabled",isEnabled);*/
|
||||
}
|
||||
function SetPrevValues()
|
||||
{
|
||||
$("#applno").val(records[recpos][3]);
|
||||
$("#customername").val(records[recpos][6]);
|
||||
$("#dob").val(records[recpos][9]);
|
||||
$("#loanamount").val(records[recpos][5]);
|
||||
$("#bank_branch_id").val(records[recpos][2]);
|
||||
$("#product").val(records[recpos][4]);
|
||||
$("#apptype").val(records[recpos][7]);
|
||||
$("#category").val(records[recpos][8]);
|
||||
}
|
||||
function ManageButtons(bmode)
|
||||
{
|
||||
if(bmode)
|
||||
{
|
||||
if($("#applno").val().length > 0)
|
||||
{
|
||||
$("#btnbedit").show();
|
||||
$("#btnsave").hide();
|
||||
$("#section7").show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#btnbedit").hide();
|
||||
$("#btnsave").show();
|
||||
$("#section7").hide();
|
||||
EnableDisableFields(false);
|
||||
}
|
||||
$("#btnbsave").hide();
|
||||
$("#btnbcancel").hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#btnbedit").hide();
|
||||
$("#btnbsave").show();
|
||||
$("#btnbcancel").show();
|
||||
}
|
||||
}
|
||||
function changeLabel(el)
|
||||
{
|
||||
$("#uniqueidentifier").html($('option:selected',el).attr("uniqueidentifier"));
|
||||
$("#sprovider").html($('option:selected',el).attr("sprovider"));
|
||||
$("#serviceprovider").val($('option:selected',el).attr("defsprovider"));
|
||||
$("#serviceprovider_hidden").val("0");
|
||||
if($('option:selected',el).attr("genlist")>0)
|
||||
{
|
||||
$("#serviceprovider_citylist").val($('option:selected',el).attr("genlist"));
|
||||
$("#serviceprovider").attr('onkeyup',"ajax_showOptions(this,event)");
|
||||
validateHidden = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#serviceprovider_citylist").val("0");
|
||||
$("#serviceprovider").removeAttr('onkeyup');
|
||||
validateHidden = false;
|
||||
}
|
||||
$("#uniqueno").attr("onblur","validate(this,'t','"+$('option:selected',el).attr("validuno")+"')");
|
||||
$("#yearmon").html($('option:selected',el).attr("ymon"));
|
||||
$("#yearmonth").attr("onblur","validate(this,'f','"+$('option:selected',el).attr("validymon")+"')");
|
||||
ValidateEntry('f');
|
||||
GetVerifierList(el);
|
||||
}
|
||||
function GetVerifierList(el)
|
||||
{
|
||||
$("#vendor_id").empty().append('<option value="-1" selected>SELECT</option>');
|
||||
if(el.value != '-1')
|
||||
{
|
||||
RunAjax("POST","getdocverlist","val0="+el.value,4);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
function collectDynamicFields() {
|
||||
const names = value("dynamicfields").split(window.ColDelim || "!C0L!").filter(Boolean);
|
||||
return names.reduce((result, name) => {
|
||||
if (/^(?:field(?:[1-9]|1[0-2])|dtfield1)$/.test(name) && element(name)) {
|
||||
if (/^(?:field(?:[1-9]|1[0-2]|150(?:_2)?)|dtfield1)$/i.test(name) && element(name)) {
|
||||
result[name] = value(name);
|
||||
}
|
||||
return result;
|
||||
@@ -99,11 +99,10 @@
|
||||
function applyResult(result, originalApplicationId) {
|
||||
element("case_id").value = result.applicationId;
|
||||
if (element("mvcode")) element("mvcode").value = result.mvCode || "";
|
||||
if (Array.isArray(window.fields?.[0]) && Array.isArray(window.records?.[window.recpos])) {
|
||||
[["case_id", result.applicationId], ["mvcode", result.mvCode]].forEach(([name, fieldValue]) => {
|
||||
const index = window.fields[0].indexOf(name);
|
||||
if (index >= 0) window.records[window.recpos][index] = fieldValue;
|
||||
});
|
||||
const currentRecord = window.records?.[window.recpos];
|
||||
if (currentRecord && !Array.isArray(currentRecord)) {
|
||||
currentRecord.case_id = result.applicationId;
|
||||
currentRecord.mvcode = result.mvCode;
|
||||
}
|
||||
notify("success", "APP-2001", `Application ${result.mvCode || result.applicationId} saved successfully.`);
|
||||
if (originalApplicationId === 0 && typeof window.AddNewRecord === "function") window.AddNewRecord();
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
* workflow is intentionally isolated in application-save.js.
|
||||
*/
|
||||
var records=[];
|
||||
var fields=[[]];
|
||||
var recIndx = 0;
|
||||
var recpos = 0;
|
||||
var SameAddr=[];
|
||||
@@ -20,6 +19,7 @@ var selectedAddr=-1;
|
||||
var FocusAfter="customername";
|
||||
var CHECKBOX_FIELDS=new Set(["rv","sradd","rtv","ov","soadd","otv","rco","pv","rcp","ocp","spadd","refv","docv"]);
|
||||
var DUPLICATE_OPERATION={R:19,O:20,P:21,A:22};
|
||||
var PUNCHED_RECORDS_URL="punchedrecs";
|
||||
|
||||
function InitPage()
|
||||
{
|
||||
@@ -48,7 +48,7 @@ function InitPage()
|
||||
return;
|
||||
}
|
||||
LoadingMsg("Fetching records, please wait...","ajaxmsg");
|
||||
RunAjax("GET","punchedrecs","val0="+encodeURIComponent(port)+"&val1="+encodeURIComponent($("#dynamicfields").val())+"&val2="+encodeURIComponent($("#uuid").val()),1);
|
||||
loadPunchedRecords(port,$("#uuid").val());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -74,7 +74,7 @@ if(recno!='')
|
||||
{
|
||||
for(var index = 0; index < records.length; index++ )
|
||||
{
|
||||
if( records[index][4] === recno ) {
|
||||
if( records[index].applno === recno ) {
|
||||
recpos = index;
|
||||
FillDetails(recpos);
|
||||
break;
|
||||
@@ -85,19 +85,12 @@ if(recno!='')
|
||||
}
|
||||
function AddNewRecord()
|
||||
{
|
||||
if(recIndx== 0 || records[recIndx-1][0]!='0')
|
||||
if(recIndx==0 || String(records[recIndx-1].case_id)!='0')
|
||||
{
|
||||
var cols=fields[0].length;
|
||||
recIndx = recIndx+1;
|
||||
recpos = recIndx-1;
|
||||
records[recpos]=Array(cols);
|
||||
records[recpos][0]='0';
|
||||
records[recpos][1]=$("#portfolio_id").val();
|
||||
records[recpos][cols-4]='0';
|
||||
records[recpos][cols-3]=$("#company_id").val();
|
||||
records[recpos][cols-2]=$("#branch_id").val();
|
||||
records[recpos][cols-1]='';
|
||||
records[recpos][2]='******';
|
||||
records[recpos]={case_id:'0',portfolio_id:$("#portfolio_id").val(),status:'0',
|
||||
company_id:$("#company_id").val(),branch_id:$("#branch_id").val(),uuid:'',mvcode:'******'};
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -107,26 +100,31 @@ function AddNewRecord()
|
||||
}
|
||||
function AfterResponse(response,oprID)
|
||||
{
|
||||
if(oprID==1) handleRecordsResponse(response);
|
||||
else if(oprID>=19 && oprID<=22) handleDuplicateDetailsResponse(response,oprID);
|
||||
if(oprID>=19 && oprID<=22) handleDuplicateDetailsResponse(response,oprID);
|
||||
}
|
||||
function handleRecordsResponse(response)
|
||||
async function loadPunchedRecords(portfolioId,documentCaseId)
|
||||
{
|
||||
$("#ajaxmsg").remove();
|
||||
var rowCount=0;
|
||||
if(response.trim().search('Error')==-1)
|
||||
try
|
||||
{
|
||||
var rows=response.split(RowDelim);
|
||||
fields[0]=rows[0].split(ColDelim);
|
||||
records=[];
|
||||
for(var index=1;index<rows.length-1;index++) records.push(rows[index].split(ColDelim));
|
||||
rowCount=rows.length-1;
|
||||
var query=new URLSearchParams({portfolioId:portfolioId,documentCaseId:documentCaseId || ""});
|
||||
var response=await fetch(PUNCHED_RECORDS_URL+"?"+query.toString(),{
|
||||
method:"GET",credentials:"same-origin",headers:{Accept:"application/json"}
|
||||
});
|
||||
var body=await response.json().catch(function(){return null;});
|
||||
if(!response.ok || !body || !body.success) throw body && body.message ? body.message : {};
|
||||
records=Array.isArray(body.data && body.data.records) ? body.data.records : [];
|
||||
recIndx=records.length;
|
||||
updateRecordCounter(0,recIndx);
|
||||
recpos=recIndx==0 ? 0 : recIndx-1;
|
||||
FillDetails(recpos);
|
||||
}
|
||||
else CygnusNotifications.showLegacy(response,{duration:3000});
|
||||
recIndx=rowCount==0 ? 0 : rowCount-1;
|
||||
updateRecordCounter(0,recIndx);
|
||||
recpos=recIndx==0 ? 0 : recIndx-1;
|
||||
FillDetails(recpos);
|
||||
catch(error)
|
||||
{
|
||||
CygnusNotifications.show({type:"danger",code:error.code || "APP-5002",
|
||||
message:error.message || "Cygnus could not load punched records.",referenceId:error.referenceId});
|
||||
records=[];recIndx=0;recpos=0;FillDetails(0);
|
||||
}
|
||||
finally{$("#ajaxmsg").remove();}
|
||||
}
|
||||
function handleDuplicateDetailsResponse(response,oprID)
|
||||
{
|
||||
@@ -172,8 +170,7 @@ function FillDetails(indx)
|
||||
{
|
||||
document.forms['casedetails'].reset();
|
||||
updateRecordCounter(indx+1,recIndx);
|
||||
for(var fieldIndex=0;fieldIndex<fields[0].length;fieldIndex++)
|
||||
fillRecordField(fields[0][fieldIndex],records[indx][fieldIndex]);
|
||||
Object.keys(records[indx]).forEach(function(fieldName){fillRecordField(fieldName,records[indx][fieldName]);});
|
||||
$("#btnsave").toggle($("#status").val()!='1');
|
||||
FireClickEvents();
|
||||
document.getElementById("applno").focus();
|
||||
@@ -186,7 +183,7 @@ function FillDetails(indx)
|
||||
}
|
||||
function fillRecordField(fieldName,fieldValue)
|
||||
{
|
||||
var field=document.getElementById(fieldName);
|
||||
var field=document.getElementById(fieldName) || dynamicFieldElement(fieldName);
|
||||
if(!field) return;
|
||||
if(CHECKBOX_FIELDS.has(fieldName))
|
||||
{
|
||||
@@ -195,6 +192,13 @@ function fillRecordField(fieldName,fieldValue)
|
||||
}
|
||||
field.value=fieldValue;
|
||||
}
|
||||
function dynamicFieldElement(fieldName)
|
||||
{
|
||||
var dynamicFields=document.querySelectorAll("#FormPanel6 [id]");
|
||||
for(var index=0;index<dynamicFields.length;index++)
|
||||
if(dynamicFields[index].id.toLowerCase()==fieldName.toLowerCase()) return dynamicFields[index];
|
||||
return null;
|
||||
}
|
||||
function updateRecordCounter(current,total)
|
||||
{
|
||||
$("#recfound").html("<b>( "+current+" / "+total+" )</b>");
|
||||
|
||||
Reference in New Issue
Block a user