Edit case issues fixed - Now add case and edit case are working fine
This commit is contained in:
@@ -13,43 +13,42 @@
|
||||
<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/appjs/editcases.js" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/edp/punching/edit-cases.js?ver=1" type="text/javascript"></script>
|
||||
|
||||
<link href="/matrix/css/div.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/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/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
|
||||
<link href="/matrix/css/edit-cases-v1.css?v=1" rel="stylesheet" type="text/css" />
|
||||
|
||||
<title>Cygnus 1.0 | Edit Cases</title>
|
||||
<link href="/matrix/css/table.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/tool-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
|
||||
<title>Cygnus 1.0 | Edit Cases</title>
|
||||
<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" />
|
||||
<link href="/matrix/css/edit-cases-v1.css?v=8" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body class="matrix-shell matrix-v2 matrix-tool-workspace matrix-edit-cases">
|
||||
<body class="matrix-shell matrix-v2 matrix-tool-workspace matrix-edit-cases">
|
||||
<div id='PageFrame'>
|
||||
<!-- Title Bar -->
|
||||
<%@ include file="/WEB-INF/app/fragments/app-title.jspf" %>
|
||||
<%@ include file="/WEB-INF/app/fragments/app-title.jspf" %>
|
||||
<!-- -->
|
||||
<div id="formcontainer" class="matrix-tool-workspace__content">
|
||||
<form:form method="post" name="caseGrid" id="caseGrid" modelAttribute="caseGrid" target="_blank">
|
||||
<div id="formcontainer" class="matrix-tool-workspace__content">
|
||||
<form:form method="post" name="caseGrid" id="caseGrid" modelAttribute="caseGrid" target="_parent">
|
||||
<!-- Common Details (Section1) Visible for all portfolios-->
|
||||
<div>
|
||||
<!-- Title -->
|
||||
<div class="title">
|
||||
<img class="matrix-title-icon" src="/matrix/images/commondet.png" align="absmiddle" />
|
||||
<span class="matrix-title-text" align="absmiddle">List of Cases</span>
|
||||
<div class="divselect" id="divportfolio" style="width:167px;position:absolute;top:3px;right:30px;">
|
||||
<form:select path="PortfolioId" multiple="false" id="portlist" style="width:185px" onchange="SubmitForm('caselist','_parent','caseGrid')">
|
||||
<form:option value="-1" label="SELECT PORTFOLIO" selected="true"/>
|
||||
<c:forEach items="${portlist}" var="port">
|
||||
<form:option value="${port[0]}" label="${port[1]}" />
|
||||
</c:forEach>
|
||||
</form:select>
|
||||
</div>
|
||||
<img class="matrix-title-action" src="/matrix/images/reload.png" title="Refresh Grid" onclick="SubmitForm('caselist','_parent','caseGrid')"/>
|
||||
</div>
|
||||
<img class="matrix-title-icon" src="/matrix/images/commondet.png" align="absmiddle" />
|
||||
<span class="matrix-title-text" align="absmiddle">List of Cases</span>
|
||||
<form:select path="PortfolioId" multiple="false" id="portlist" cssClass="matrix-edit-cases__portfolio-select" onchange="SubmitForm('caselist','_parent','caseGrid')">
|
||||
<form:option value="-1" label="SELECT PORTFOLIO" selected="true"/>
|
||||
<c:forEach items="${portlist}" var="port">
|
||||
<form:option value="${port.value}" label="${port.label}" />
|
||||
</c:forEach>
|
||||
</form:select>
|
||||
<button class="matrix-edit-cases__refresh" type="button" title="Refresh Grid" onclick="SubmitForm('caselist','_parent','caseGrid')">
|
||||
<img src="/matrix/images/reload.png" alt="" />
|
||||
</button>
|
||||
</div>
|
||||
<!-- -->
|
||||
<div id="TablePanel" class="tableContainer">
|
||||
<table border="0" cellspacing="0" width="100%" id="casetable">
|
||||
@@ -69,19 +68,19 @@
|
||||
</thead>
|
||||
<tbody class="scrollContent">
|
||||
<c:forEach items="${caseList}" var="casedet" varStatus="status">
|
||||
<tr id="row${status.count}" tabindex="0" title="Open this case for editing">
|
||||
<tr id="row${status.count}" tabindex="0" title="Open this case for editing">
|
||||
<td>
|
||||
<input type="hidden" name="row${status.count}uuid" id="row${status.count}uuid" value="${casedet[0]}" />
|
||||
<input type="hidden" name="row${status.count}portid" id="row${status.count}portid" value="${casedet[9]}" />
|
||||
<input type="hidden" name="row${status.count}uuid" id="row${status.count}uuid" value="${casedet.documentCaseId}" />
|
||||
<input type="hidden" name="row${status.count}portid" id="row${status.count}portid" value="${casedet.portfolioId}" />
|
||||
${status.count}</td>
|
||||
<td>${casedet[1]}</td>
|
||||
<td>${casedet[2]}</td>
|
||||
<td>${casedet[3]}</td>
|
||||
<td>${casedet[4]}</td>
|
||||
<td>${casedet[5]}</td>
|
||||
<td>${casedet[6]}</td>
|
||||
<td>${casedet[7]}</td>
|
||||
<td>${casedet[8]}</td>
|
||||
<td>${casedet.mvCode}</td>
|
||||
<td>${casedet.fileNumber}</td>
|
||||
<td>${casedet.customerName}</td>
|
||||
<td>${casedet.applicationType}</td>
|
||||
<td>${casedet.product}</td>
|
||||
<td>${casedet.receivedOn}</td>
|
||||
<td>${casedet.punchedBy}</td>
|
||||
<td>${casedet.branchCode}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
@@ -103,4 +102,4 @@
|
||||
<script language="javascript" type="text/javascript"> CallMessage('${msg}',3000,200,300); </script>
|
||||
</c:if>
|
||||
<!-- -->
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -17,18 +17,17 @@
|
||||
<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/lib/notifications.js?ver=1" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/lib/payload-crypto.js?ver=1" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/lib/form-validation.js?ver=1" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/ui/msgdialog.js" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/lib/jsfuncs.js" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/lib/notifications.js?ver=1" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/lib/payload-crypto.js?ver=1" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/lib/form-validation.js?ver=1" 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/edp/punching/initiation.js?ver=8" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/edp/punching/initiation-validation.js?ver=1" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/edp/punching/application-save.js?ver=2" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/edp/punching/initiation.js?ver=8" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/edp/punching/initiation-validation.js?ver=1" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/edp/punching/application-save.js?ver=2" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/validator.js?ver=2" 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?ver=1" type="text/javascript"></script>
|
||||
<script language="javascript" src="/matrix/js/ajax-dynamic-list.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" />
|
||||
@@ -37,11 +36,11 @@
|
||||
<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=7" rel="stylesheet" type="text/css" />
|
||||
<link href="/matrix/css/matrix-v2.css?v=7" 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=2" rel="stylesheet" type="text/css" />
|
||||
<link href="/matrix/css/add-cases-v4.css?v=5" rel="stylesheet" type="text/css" />
|
||||
<link href="/matrix/css/punch-workspace-v3.css?v=2" rel="stylesheet" type="text/css" />
|
||||
<link href="/matrix/css/add-cases-v4.css?v=6" 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" />
|
||||
@@ -58,7 +57,7 @@
|
||||
<c:if test="${pageFormMode!=2}">
|
||||
<!-- Dynamic Menu -->
|
||||
<nav class="matrix-shell__navigation" aria-label="Primary navigation">
|
||||
<c:out value="${sessionScope.userSession.menuHtml}" escapeXml="false" />
|
||||
<c:out value="${sessionScope.userSession.menuHtml}" escapeXml="false" />
|
||||
</nav>
|
||||
<!-- -->
|
||||
</c:if>
|
||||
@@ -77,16 +76,19 @@
|
||||
<label class="matrix-form-title__check"><input type="checkbox" name="autocut" checked id="autocut" /> Auto Cut-Off</label>
|
||||
<c:if test="${pageFormMode==2}">
|
||||
<input type="hidden" id="portfolio_id" name="portfolioId" value="${pagePortfolioId}" />
|
||||
<button type="button" class="matrix-edit-back" onclick="history.back()" title="Back to case list">
|
||||
<span aria-hidden="true">←</span> Back
|
||||
</button>
|
||||
</c:if>
|
||||
<c:if test="${pageFormMode!=2}">
|
||||
<div class="divselect matrix-form-title__end" id="divportfolio" style="width:297px;">
|
||||
<select id="portfolio_id" name="portfolioId" style="width:315px" onchange="SubmitForm('caseadd','_parent','casedetails')">
|
||||
<select id="portfolio_id" name="portfolioId" style="width:315px" onchange="SubmitForm('caseadd','_parent','casedetails')">
|
||||
<option value="-1" selected >SELECT PORTFOLIO</option>
|
||||
<c:choose>
|
||||
<c:when test="${not empty model}">
|
||||
<c:forEach items="${model.options['portfolio.']}" var="port">
|
||||
<option value="${port.value}"><c:out value="${port.label}" /></option>
|
||||
</c:forEach>
|
||||
<c:forEach items="${model.options['portfolio.']}" var="port">
|
||||
<option value="${port.value}"><c:out value="${port.label}" /></option>
|
||||
</c:forEach>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<c:forEach items="${portlist}" var="port">
|
||||
@@ -117,7 +119,7 @@
|
||||
Appl No.
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<input type="text" id="applno" name="applno" maxlength="25" style="width:115px;text-transform:uppercase" value="" onblur="if(CygnusInitiationValidation.validateField(this)){FindSameDet(this,'A','customername');}" />
|
||||
<input type="text" id="applno" name="applno" maxlength="25" style="width:115px;text-transform:uppercase" value="" onblur="if(CygnusInitiationValidation.validateField(this)){FindSameDet(this,'A','customername');}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget">
|
||||
@@ -125,7 +127,7 @@
|
||||
Bank Code
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<input type="text" maxlength="25" id="bankcode" name="bankcode" style="width:70px;text-transform:uppercase" value="" onblur="CygnusInitiationValidation.validateField(this);" />
|
||||
<input type="text" maxlength="25" id="bankcode" name="bankcode" style="width:70px;text-transform:uppercase" value="" onblur="CygnusInitiationValidation.validateField(this);" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget">
|
||||
@@ -134,13 +136,13 @@
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<div class="divselect" id="divbranch" style="width:135px;">
|
||||
<select id="bank_branch_id" name="bank_branch_id" style="width:153px" onblur="CygnusInitiationValidation.validateField(this);">
|
||||
<select id="bank_branch_id" name="bank_branch_id" style="width:153px" onblur="CygnusInitiationValidation.validateField(this);">
|
||||
<option value="-1" selected >SELECT</option>
|
||||
<c:choose>
|
||||
<c:when test="${not empty model}">
|
||||
<c:forEach items="${model.options['branch.']}" var="option">
|
||||
<option value="${option.value}"><c:out value="${option.label}" /></option>
|
||||
</c:forEach>
|
||||
<c:forEach items="${model.options['branch.']}" var="option">
|
||||
<option value="${option.value}"><c:out value="${option.label}" /></option>
|
||||
</c:forEach>
|
||||
</c:when>
|
||||
<c:otherwise><c:forEach items="${branchlist}" var="brnch"><option value="${brnch[0]}"><c:out value="${brnch[1]}" /></option></c:forEach></c:otherwise>
|
||||
</c:choose>
|
||||
@@ -154,10 +156,10 @@
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<div class="divselect" id="divproduct" style="width:132px;">
|
||||
<select id="product" name="product" style="width:150px" onblur="CygnusInitiationValidation.validateField(this);">
|
||||
<select id="product" name="product" style="width:150px" onblur="CygnusInitiationValidation.validateField(this);">
|
||||
<option value="-1" selected >SELECT</option>
|
||||
<c:choose>
|
||||
<c:when test="${not empty model}"><c:forEach items="${model.options['product.']}" var="option"><option value="${option.value}"><c:out value="${option.label}" /></option></c:forEach></c:when>
|
||||
<c:when test="${not empty model}"><c:forEach items="${model.options['product.']}" var="option"><option value="${option.value}"><c:out value="${option.label}" /></option></c:forEach></c:when>
|
||||
<c:otherwise><c:forEach items="${prodlist}" var="prod"><option value="${prod[0]}"><c:out value="${prod[1]}" /></option></c:forEach></c:otherwise>
|
||||
</c:choose>
|
||||
</select>
|
||||
@@ -169,7 +171,7 @@
|
||||
Name
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<input type="text" id="customername" name="customername" maxlength="100" style="width:200px" value="" onblur="CygnusInitiationValidation.validateField(this);" />
|
||||
<input type="text" id="customername" name="customername" maxlength="100" style="width:200px" value="" onblur="CygnusInitiationValidation.validateField(this);" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget">
|
||||
@@ -186,10 +188,10 @@
|
||||
</div>
|
||||
<div class="inputcontainer">
|
||||
<div class="divselect" id="divapptype" style="width:135px;">
|
||||
<select id="apptype" name="apptype" style="width:153px" onchange="ToggleChks((this.value.toUpperCase()!='APPLICANT' && this.value.toUpperCase()!='-1'),['sradd','soadd','spadd'])" onblur="CygnusInitiationValidation.validateField(this);">
|
||||
<select id="apptype" name="apptype" style="width:153px" onchange="ToggleChks((this.value.toUpperCase()!='APPLICANT' && this.value.toUpperCase()!='-1'),['sradd','soadd','spadd'])" onblur="CygnusInitiationValidation.validateField(this);">
|
||||
<option value="-1" selected>SELECT</option>
|
||||
<c:choose>
|
||||
<c:when test="${not empty model}"><c:forEach items="${model.options['applicationType.']}" var="option"><option value="${option.value}"><c:out value="${option.label}" /></option></c:forEach></c:when>
|
||||
<c:when test="${not empty model}"><c:forEach items="${model.options['applicationType.']}" var="option"><option value="${option.value}"><c:out value="${option.label}" /></option></c:forEach></c:when>
|
||||
<c:otherwise><c:forEach items="${typelist}" var="type"><option value="${type[0]}"><c:out value="${type[1]}" /></option></c:forEach></c:otherwise>
|
||||
</c:choose>
|
||||
</select>
|
||||
@@ -205,7 +207,7 @@
|
||||
<select id="category" name="category" style="width:133px">
|
||||
<option value="-1" selected>SELECT</option>
|
||||
<c:choose>
|
||||
<c:when test="${not empty model}"><c:forEach items="${model.options['category.']}" var="option"><option value="${option.value}"><c:out value="${option.label}" /></option></c:forEach></c:when>
|
||||
<c:when test="${not empty model}"><c:forEach items="${model.options['category.']}" var="option"><option value="${option.value}"><c:out value="${option.label}" /></option></c:forEach></c:when>
|
||||
<c:otherwise><c:forEach items="${catlist}" var="cat"><option value="${cat[0]}"><c:out value="${cat[1]}" /></option></c:forEach></c:otherwise>
|
||||
</c:choose>
|
||||
</select>
|
||||
@@ -266,10 +268,10 @@
|
||||
<div class="title">
|
||||
<img class="matrix-title-icon" src="/matrix/images/resdet.png" />
|
||||
<span class="matrix-title-text">Residence Details</span>
|
||||
<div class="divchk ctrldiv">
|
||||
<input type="checkbox" id="rv" name="rv" onclick="HandleClick(this)" />RVR
|
||||
<input type="checkbox" id="sradd" name="sradd" onclick="return FindSameDet(this,'R','rphone')" /><span id="sradd-label">Same Resi</span>
|
||||
<input type="checkbox" id="rtv" name="rtv" onclick="HandleClick(this)" /><span id="rtv-label">RTV</span>
|
||||
<div class="divchk ctrldiv">
|
||||
<input type="checkbox" id="rv" name="rv" onclick="HandleClick(this)" />RVR
|
||||
<input type="checkbox" id="sradd" name="sradd" onclick="return FindSameDet(this,'R','rphone')" /><span id="sradd-label">Same Resi</span>
|
||||
<input type="checkbox" id="rtv" name="rtv" onclick="HandleClick(this)" /><span id="rtv-label">RTV</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- -->
|
||||
@@ -316,7 +318,7 @@
|
||||
<option value="-1">Select</option>
|
||||
<option value="Unknown">Unknown</option>
|
||||
<c:choose>
|
||||
<c:when test="${not empty model}"><c:forEach items="${model.options['city.']}" var="option"><option value="${option.value}"><c:out value="${option.label}" /></option></c:forEach></c:when>
|
||||
<c:when test="${not empty model}"><c:forEach items="${model.options['city.']}" var="option"><option value="${option.value}"><c:out value="${option.label}" /></option></c:forEach></c:when>
|
||||
<c:otherwise><c:forEach items="${citylist}" var="city"><option value="${city[0]}"><c:out value="${city[1]}" /></option></c:forEach></c:otherwise>
|
||||
</c:choose>
|
||||
</select>
|
||||
@@ -374,11 +376,11 @@
|
||||
<div class="title">
|
||||
<img class="matrix-title-icon" src="/matrix/images/optmale.png" />
|
||||
<span class="matrix-title-text">Office Details</span>
|
||||
<div class="divchk ctrldiv">
|
||||
<input type="checkbox" id="ov" onclick="HandleClick(this)" />OVR
|
||||
<input type="checkbox" id="rco" style="display:none" onclick="HandleClick(this)" /><span id="rco-label">RCO </span>
|
||||
<input type="checkbox" id="soadd" onclick="return FindSameDet(this,'O','ophone')" /><span id="soadd-label">Same Office</span>
|
||||
<input type="checkbox" id="otv" onclick="HandleClick(this)" /><span id="otv-label">OTV</span>
|
||||
<div class="divchk ctrldiv">
|
||||
<input type="checkbox" id="ov" onclick="HandleClick(this)" />OVR
|
||||
<input type="checkbox" id="rco" style="display:none" onclick="HandleClick(this)" /><span id="rco-label">RCO </span>
|
||||
<input type="checkbox" id="soadd" onclick="return FindSameDet(this,'O','ophone')" /><span id="soadd-label">Same Office</span>
|
||||
<input type="checkbox" id="otv" onclick="HandleClick(this)" /><span id="otv-label">OTV</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- -->
|
||||
@@ -434,7 +436,7 @@
|
||||
<option value="-1">Select</option>
|
||||
<option value="Unknown">Unknown</option>
|
||||
<c:choose>
|
||||
<c:when test="${not empty model}"><c:forEach items="${model.options['city.']}" var="option"><option value="${option.value}"><c:out value="${option.label}" /></option></c:forEach></c:when>
|
||||
<c:when test="${not empty model}"><c:forEach items="${model.options['city.']}" var="option"><option value="${option.value}"><c:out value="${option.label}" /></option></c:forEach></c:when>
|
||||
<c:otherwise><c:forEach items="${citylist}" var="city"><option value="${city[0]}"><c:out value="${city[1]}" /></option></c:forEach></c:otherwise>
|
||||
</c:choose>
|
||||
</select>
|
||||
@@ -475,7 +477,7 @@
|
||||
</div>
|
||||
<br >
|
||||
<div class="inputcontainer" style="padding:1px">
|
||||
<input type="text" id="department" name="department" maxlength="50" style="width:100px" value="" onblur="validate(this,'f','SplInstruction')" />
|
||||
<input type="text" id="department" name="department" maxlength="50" style="width:100px" value="" onblur="validate(this,'f','SplInstruction')" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget" style="margin-left:2px">
|
||||
@@ -492,8 +494,10 @@
|
||||
Office Phone-Extn
|
||||
</div>
|
||||
<br >
|
||||
<div class="inputcontainer" style="padding:1px">
|
||||
<input type="text" id="ophone" name="ophone" maxlength="25" style="width:100px" value="" onblur="validate(this,document.getElementById('otv').checked ? 't':'f','Phone')" />-<input type="text" id="extension" name="extension" style="width:23px" maxlength="10" value="" onblur="validate(this,'f','Extension')" />
|
||||
<div class="inputcontainer matrix-phone-extension" style="padding:1px">
|
||||
<input type="text" id="ophone" name="ophone" maxlength="25" value="" onblur="validate(this,document.getElementById('otv').checked ? 't':'f','Phone')" />
|
||||
<span aria-hidden="true">-</span>
|
||||
<input type="text" id="extension" name="extension" maxlength="10" value="" aria-label="Office phone extension" onblur="validate(this,'f','Extension')" />
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
@@ -510,11 +514,11 @@
|
||||
<div class="title">
|
||||
<img class="matrix-title-icon" src="/matrix/images/resdet.png" />
|
||||
<span class="matrix-title-text">Property Details</span>
|
||||
<div class="divchk ctrldiv">
|
||||
<input type="checkbox" id="pv" onclick="HandleClick(this)" />PVR
|
||||
<input type="checkbox" id="rcp" style="display:none" onclick="HandleClick(this)" /><span id="rcp-label">RCP </span>
|
||||
<input type="checkbox" id="ocp" style="display:none" onclick="HandleClick(this)" /><span id="ocp-label">OCP </span>
|
||||
<input type="checkbox" id="spadd" onclick="return FindSameDet(this,'P','ppincode')" /><span id="spadd-label">Same Property</span>
|
||||
<div class="divchk ctrldiv">
|
||||
<input type="checkbox" id="pv" onclick="HandleClick(this)" />PVR
|
||||
<input type="checkbox" id="rcp" style="display:none" onclick="HandleClick(this)" /><span id="rcp-label">RCP </span>
|
||||
<input type="checkbox" id="ocp" style="display:none" onclick="HandleClick(this)" /><span id="ocp-label">OCP </span>
|
||||
<input type="checkbox" id="spadd" onclick="return FindSameDet(this,'P','ppincode')" /><span id="spadd-label">Same Property</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- -->
|
||||
@@ -529,7 +533,7 @@
|
||||
</div>
|
||||
<br >
|
||||
<div class="inputcontainer" style="padding:1px">
|
||||
<input type="text" id="paddr1" name="paddr1" readonly="readonly" maxlength="40" style="width:90px" value="" onblur="CygnusInitiationValidation.validateField(this);" />
|
||||
<input type="text" id="paddr1" name="paddr1" readonly="readonly" maxlength="40" style="width:90px" value="" onblur="CygnusInitiationValidation.validateField(this);" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget" style="margin-left:2px">
|
||||
@@ -561,7 +565,7 @@
|
||||
<option value="-1">Select</option>
|
||||
<option value="Unknown">Unknown</option>
|
||||
<c:choose>
|
||||
<c:when test="${not empty model}"><c:forEach items="${model.options['city.']}" var="option"><option value="${option.value}"><c:out value="${option.label}" /></option></c:forEach></c:when>
|
||||
<c:when test="${not empty model}"><c:forEach items="${model.options['city.']}" var="option"><option value="${option.value}"><c:out value="${option.label}" /></option></c:forEach></c:when>
|
||||
<c:otherwise><c:forEach items="${citylist}" var="city"><option value="${city[0]}"><c:out value="${city[1]}" /></option></c:forEach></c:otherwise>
|
||||
</c:choose>
|
||||
</select>
|
||||
@@ -584,7 +588,7 @@
|
||||
</div>
|
||||
<br >
|
||||
<div class="inputcontainer" style="padding:1px">
|
||||
<input type="text" id="ppincode" name="colp_pincode" readonly="readonly" maxlength="6" style="width:45px" value="" onblur="CygnusInitiationValidation.validateField(this);" />
|
||||
<input type="text" id="ppincode" name="colp_pincode" readonly="readonly" maxlength="6" style="width:45px" value="" onblur="CygnusInitiationValidation.validateField(this);" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="widget" style="margin-left:2px">
|
||||
@@ -610,7 +614,7 @@
|
||||
<div class="title">
|
||||
<img class="matrix-title-icon" src="/matrix/images/ref.png" />
|
||||
<span class="matrix-title-text">Reference Details</span>
|
||||
<div class="divchk ctrldiv">
|
||||
<div class="divchk ctrldiv">
|
||||
<input type="checkbox" id="refv" name="refv" onclick="HandleClick(this)" />Ref Check
|
||||
</div>
|
||||
</div>
|
||||
@@ -675,7 +679,7 @@
|
||||
<div class="title">
|
||||
<img class="matrix-title-icon" src="/matrix/images/documents.png" />
|
||||
<span class="matrix-title-text">Document Details</span>
|
||||
<div class="divchk ctrldiv">
|
||||
<div class="divchk ctrldiv">
|
||||
<input type="checkbox" name="docv" id="docv" />Doc VR
|
||||
</div>
|
||||
</div>
|
||||
@@ -694,17 +698,17 @@
|
||||
</c:if>
|
||||
<input type="hidden" id="uuid" name="uuid" value="${pageDocumentCaseId}" />
|
||||
<input type="hidden" id="case_id" name="case_id" value="" />
|
||||
<input type="hidden" id="company_id" name="company_id" value="${sessionScope.userSession.companyId}" />
|
||||
<input type="hidden" id="branch_id" name="branch_id" value="${sessionScope.userSession.branchId}" />
|
||||
<input type="hidden" id="company_id" name="company_id" value="${sessionScope.userSession.companyId}" />
|
||||
<input type="hidden" id="branch_id" name="branch_id" value="${sessionScope.userSession.branchId}" />
|
||||
<input type="hidden" id="status" name="status" value="" />
|
||||
<!-- -->
|
||||
<c:if test="${pageFormMode gt 0}">
|
||||
<div style="position:fixed;text-align:right;bottom:0px;width:980px;" class="buttonbar">
|
||||
<c:if test="${pageFormMode gt 0}">
|
||||
<div style="position:fixed;text-align:right;bottom:0px;width:980px;" class="buttonbar">
|
||||
<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="btnsave" style="float:right" value="Save" id="btnsave" accesskey="S" onclick="return CygnusInitiation.save(event);" />
|
||||
<input type="button" class="button" name="btnsave" style="float:right" value="Save" id="btnsave" accesskey="S" onclick="return CygnusInitiation.save(event);" />
|
||||
<c:if test="${pageFormMode!=2}">
|
||||
<input type="button" class="button" name="btnadd" style="float:right" value="Add" id="btnadd" accesskey="A" onclick="return AddNewRecord();" />
|
||||
</c:if>
|
||||
@@ -722,9 +726,9 @@
|
||||
</body>
|
||||
<!-- Page Load Javascript -->
|
||||
<script language="javascript" type="text/javascript">
|
||||
(function () {
|
||||
CygnusInitiationValidation.bind(document.getElementById("casedetails"));
|
||||
var sectionFields = document.querySelectorAll(".model-visible-section");
|
||||
(function () {
|
||||
CygnusInitiationValidation.bind(document.getElementById("casedetails"));
|
||||
var sectionFields = document.querySelectorAll(".model-visible-section");
|
||||
if (sectionFields.length > 0) {
|
||||
document.getElementById("visiblecontents").value = Array.prototype.map.call(
|
||||
sectionFields, function (field) { return field.textContent; }
|
||||
@@ -735,10 +739,10 @@
|
||||
var code = document.getElementById("page-error-code");
|
||||
var errorMessage = document.getElementById("page-error-message");
|
||||
if (code && errorMessage) {
|
||||
CygnusNotifications.show({
|
||||
type: "danger", code: code.textContent,
|
||||
message: errorMessage.textContent, duration: 3000
|
||||
});
|
||||
CygnusNotifications.show({
|
||||
type: "danger", code: code.textContent,
|
||||
message: errorMessage.textContent, duration: 3000
|
||||
});
|
||||
}
|
||||
}());
|
||||
</script>
|
||||
|
||||
@@ -66,6 +66,40 @@
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.matrix-add-cases .matrix-phone-extension {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) auto 48px;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.matrix-add-cases .matrix-phone-extension > input {
|
||||
width: 100% !important;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.matrix-add-cases .matrix-edit-back {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
min-height: 28px;
|
||||
margin-left: auto;
|
||||
padding: 3px 10px;
|
||||
color: #245f91;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
border: 1px solid #9eb5c8;
|
||||
border-radius: 4px;
|
||||
background: #f6f9fb;
|
||||
}
|
||||
|
||||
.matrix-add-cases .matrix-edit-back:hover,
|
||||
.matrix-add-cases .matrix-edit-back:focus-visible {
|
||||
color: #fff;
|
||||
border-color: #28699d;
|
||||
background: #28699d;
|
||||
}
|
||||
|
||||
.matrix-add-cases .matrix-form-controls .widget:has(#splist),
|
||||
.matrix-add-cases .matrix-form-controls .widget:has(textarea),
|
||||
.matrix-add-cases .matrix-form-controls .widget:has(input[id*="Address"]),
|
||||
|
||||
@@ -4,19 +4,66 @@
|
||||
background: #f4f8fb;
|
||||
}
|
||||
|
||||
.matrix-edit-cases .matrix-tool-workspace__content > .title .divselect {
|
||||
width: min(330px, 38vw) !important;
|
||||
margin-left: auto;
|
||||
position: static !important;
|
||||
.matrix-edit-cases #caseGrid > div > .title {
|
||||
display: flex !important;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap !important;
|
||||
gap: 7px;
|
||||
}
|
||||
|
||||
.matrix-edit-cases .matrix-tool-workspace__content > .title select {
|
||||
width: 100% !important;
|
||||
min-height: 28px;
|
||||
padding: 3px 28px 3px 7px;
|
||||
border: 1px solid #9fb1c1;
|
||||
border-radius: 3px;
|
||||
background-color: #fff;
|
||||
.matrix-edit-cases #caseGrid > div > .title > .matrix-title-text {
|
||||
flex: 0 0 auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.matrix-edit-cases #caseGrid > div > .title > .matrix-edit-cases__portfolio-select {
|
||||
width: 0 !important;
|
||||
min-width: 0;
|
||||
flex: 1 1 auto;
|
||||
margin: 0 !important;
|
||||
font-family: Tahoma, Arial, sans-serif;
|
||||
font-size: 10pt;
|
||||
font-weight: 400;
|
||||
padding: 2px 30px 2px 7px !important;
|
||||
}
|
||||
|
||||
.matrix-edit-cases #caseGrid > div > .title > .matrix-edit-cases__refresh {
|
||||
box-sizing: border-box !important;
|
||||
width: 27px !important;
|
||||
height: 27px !important;
|
||||
min-width: 27px !important;
|
||||
min-height: 27px !important;
|
||||
margin: 0 !important;
|
||||
flex: 0 0 27px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 !important;
|
||||
border: 0 !important;
|
||||
border-radius: 0 !important;
|
||||
outline: 0 !important;
|
||||
appearance: none;
|
||||
background: transparent !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.matrix-edit-cases #caseGrid > div > .title > .matrix-edit-cases__refresh:hover,
|
||||
.matrix-edit-cases #caseGrid > div > .title > .matrix-edit-cases__refresh:focus,
|
||||
.matrix-edit-cases #caseGrid > div > .title > .matrix-edit-cases__refresh:focus-visible,
|
||||
.matrix-edit-cases #caseGrid > div > .title > .matrix-edit-cases__refresh:active {
|
||||
width: 27px !important;
|
||||
height: 27px !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
border: 0 !important;
|
||||
outline: 0 !important;
|
||||
background: transparent !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.matrix-edit-cases .matrix-edit-cases__refresh img {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.matrix-edit-cases .tableContainer {
|
||||
@@ -55,12 +102,4 @@
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.matrix-edit-cases .matrix-tool-workspace__content > .title {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.matrix-edit-cases .matrix-tool-workspace__content > .title .divselect {
|
||||
width: 100% !important;
|
||||
order: 3;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,8 +31,7 @@ Owner of DHTMLgoodies.com
|
||||
var ajax_list_externalFile = 'getlocality'; // Path to external file
|
||||
var minimumLettersBeforeLookup = 1; // Number of letters entered before a lookup is performed.
|
||||
|
||||
var ajax_list_objects = new Array();
|
||||
var ajax_list_cachedLists = new Array();
|
||||
var ajax_list_cachedLists = new Array();
|
||||
var ajax_list_activeInput = false;
|
||||
var ajax_list_activeItem;
|
||||
var ajax_list_optionDivFirstItem = false;
|
||||
@@ -75,11 +74,11 @@ Owner of DHTMLgoodies.com
|
||||
ajax_list_activeInput.value = tmpValue;
|
||||
if(document.getElementsByName(ajax_list_activeInput.name + '_hidden')[0])
|
||||
{
|
||||
document.getElementsByName(ajax_list_activeInput.name + '_hidden')[0].value = inputObj.id.split("#-#")[0];
|
||||
if(ajax_list_externalFile == 'getlocality')
|
||||
{
|
||||
document.getElementsByName(ajax_list_activeInput.name + '_pincode')[0].value = inputObj.id.split("#-#")[1];
|
||||
document.getElementsByName(ajax_list_activeInput.name + '_citylist')[0].value = inputObj.id.split("#-#")[2];
|
||||
document.getElementsByName(ajax_list_activeInput.name + '_hidden')[0].value = inputObj.dataset.localityId;
|
||||
if(ajax_list_externalFile == 'getlocality')
|
||||
{
|
||||
document.getElementsByName(ajax_list_activeInput.name + '_pincode')[0].value = inputObj.dataset.pincode;
|
||||
document.getElementsByName(ajax_list_activeInput.name + '_citylist')[0].value = inputObj.dataset.city;
|
||||
}
|
||||
}
|
||||
ajax_options_hide();
|
||||
@@ -113,7 +112,7 @@ Owner of DHTMLgoodies.com
|
||||
|
||||
ajax_optionDiv.innerHTML = '';
|
||||
ajax_list_activeItem = false;
|
||||
if(ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()].length<=1){
|
||||
if(ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()].length===0){
|
||||
ajax_options_hide();
|
||||
return;
|
||||
}
|
||||
@@ -123,19 +122,20 @@ Owner of DHTMLgoodies.com
|
||||
ajax_list_optionDivFirstItem = false;
|
||||
var optionsAdded = false;
|
||||
for(var no=0;no<ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()].length;no++){
|
||||
if(ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()][no].length==0)continue;
|
||||
optionsAdded = true;
|
||||
var div = document.createElement('DIV');
|
||||
var items = ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()][no].split(/!C0L!/gi);
|
||||
|
||||
if(ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()].length==1 && ajax_list_activeInput.value == items[0]){
|
||||
ajax_options_hide();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
div.innerHTML = items[items.length-1];
|
||||
div.id = items[0];
|
||||
var locality = ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()][no];
|
||||
if(!locality || !locality.location)continue;
|
||||
optionsAdded = true;
|
||||
var div = document.createElement('DIV');
|
||||
|
||||
if(ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()].length==1 && ajax_list_activeInput.value == locality.location){
|
||||
ajax_options_hide();
|
||||
return;
|
||||
}
|
||||
|
||||
div.textContent = locality.location;
|
||||
div.dataset.localityId = locality.id;
|
||||
div.dataset.pincode = locality.pincode || '';
|
||||
div.dataset.city = locality.city || '';
|
||||
div.className='optionDiv';
|
||||
div.onmouseover = function(){ ajax_options_rollOverActiveItem(this,false); };
|
||||
div.onclick = ajax_option_setValue;
|
||||
@@ -150,17 +150,6 @@ Owner of DHTMLgoodies.com
|
||||
|
||||
}
|
||||
|
||||
function ajax_option_list_showContent(ajaxIndex,inputObj,paramToExternalFile,whichIndex)
|
||||
{
|
||||
if(whichIndex!=currentListIndex)return;
|
||||
var letters = inputObj.value;
|
||||
var content = ajax_list_objects[ajaxIndex].response;
|
||||
var elements = content.split('!R0W!');
|
||||
ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()] = elements;
|
||||
ajax_option_list_buildList(letters,paramToExternalFile);
|
||||
|
||||
}
|
||||
|
||||
function ajax_option_resize(inputObj)
|
||||
{
|
||||
ajax_optionDiv.style.top = (ajax_getTopPos(inputObj) + inputObj.offsetHeight + ajaxBox_offsetY) + 'px';
|
||||
@@ -244,18 +233,27 @@ Owner of DHTMLgoodies.com
|
||||
if(ajax_list_cachedLists[paramToExternalFile][inputObj.value.toLowerCase()]){
|
||||
ajax_option_list_buildList(inputObj.value,paramToExternalFile,currentListIndex);
|
||||
}else{
|
||||
var tmpIndex=currentListIndex/1;
|
||||
ajax_optionDiv.innerHTML = '';
|
||||
var ajaxIndex = ajax_list_objects.length;
|
||||
ajax_list_objects[ajaxIndex] = new sack();
|
||||
if(cityval.toUpperCase() == "GURGAON") {
|
||||
cityval = "Gurugram";
|
||||
}
|
||||
//var url = ajax_list_externalFile + '?' + paramToExternalFile + '='+cityval+'&letters=' + inputObj.value.replace(" ","+");
|
||||
var url = ajax_list_externalFile + '?city='+cityval+'&letters=' + inputObj.value.replace(" ","+");
|
||||
ajax_list_objects[ajaxIndex].requestFile = url; // Specifying which file to get
|
||||
ajax_list_objects[ajaxIndex].onCompletion = function(){ ajax_option_list_showContent(ajaxIndex,inputObj,paramToExternalFile,tmpIndex); }; // Specify function that will be executed after file has been found
|
||||
ajax_list_objects[ajaxIndex].runAJAX(); // Execute AJAX function
|
||||
var tmpIndex=currentListIndex/1;
|
||||
ajax_optionDiv.innerHTML = '';
|
||||
if(cityval.toUpperCase() == "GURGAON") {
|
||||
cityval = "Gurugram";
|
||||
}
|
||||
var letters=inputObj.value;
|
||||
var url=ajax_list_externalFile+'?'+new URLSearchParams({city:cityval,letters:letters}).toString();
|
||||
fetch(url,{method:'GET',credentials:'same-origin',headers:{Accept:'application/json'}})
|
||||
.then(function(response){return response.json().then(function(body){return {response:response,body:body};});})
|
||||
.then(function(result){
|
||||
if(!result.response.ok || !result.body || !result.body.success) throw result.body && result.body.message ? result.body.message : {};
|
||||
var localities=Array.isArray(result.body.data && result.body.data.localities) ? result.body.data.localities : [];
|
||||
ajax_list_cachedLists[paramToExternalFile][letters.toLowerCase()]=localities;
|
||||
if(tmpIndex==currentListIndex) ajax_option_list_buildList(letters,paramToExternalFile);
|
||||
})
|
||||
.catch(function(error){
|
||||
if(tmpIndex!=currentListIndex)return;
|
||||
ajax_options_hide();
|
||||
CygnusNotifications.show({type:'danger',code:error.code || 'APP-5002',
|
||||
message:error.message || 'Cygnus could not load localities.',referenceId:error.referenceId});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
var currow=0;
|
||||
var lastrow=0;
|
||||
function InitPage()
|
||||
{
|
||||
$('form tbody.scrollContent tr').hover(function () {
|
||||
$('#row'+lastrow).removeClass('rowhover');
|
||||
ResetRow();
|
||||
$(this).addClass('rowhover');
|
||||
}, function () {
|
||||
$(this).removeClass('rowhover');
|
||||
});
|
||||
$('form tbody.scrollContent tr').click(function () {
|
||||
GetRowData(this);
|
||||
});
|
||||
}
|
||||
function ResetRow()
|
||||
{
|
||||
currow=0;
|
||||
lastrow=$('#casetable tr').length-1;
|
||||
}
|
||||
function GetRowData(SelectedRow)
|
||||
{
|
||||
/*QueryStr="rand="+Math.round(Math.random()*4+1)+"&uuid="+$("#"+SelectedRow.id+"uuid").val()+"&pid="+$("#"+SelectedRow.id+"portid").val();
|
||||
var retVal=0; // Legacy commented example retained without removed browser API.
|
||||
if(retVal==1)
|
||||
{
|
||||
$("#"+SelectedRow.id+"col").html("<img src='/matrix/images/edited.png' title='Details has been edited successfully. Please click refresh button to see the changes' />");
|
||||
}*/
|
||||
$("#uuid").val($("#"+SelectedRow.id+"uuid").val());
|
||||
SubmitForm("caseedit", "_blank", "caseGrid");
|
||||
}
|
||||
function keyListen(param1,param2,e) {
|
||||
var keycode = e.keyCode;
|
||||
if(keycode==13)
|
||||
{
|
||||
GetRowData(document.getElementById("row"+currow));
|
||||
}
|
||||
else
|
||||
{
|
||||
if(keycode==40)
|
||||
{
|
||||
currow=currow+1;
|
||||
if(currow>=$('#casetable tr').length){currow=1;lastrow=$('#casetable tr').length-1;}
|
||||
}
|
||||
if(keycode==38)
|
||||
{
|
||||
currow=currow-1;
|
||||
if(currow<=0){currow=$('#casetable tr').length-1;lastrow=1;}
|
||||
}
|
||||
$('#row'+currow).addClass('rowhover');
|
||||
$('#row'+lastrow).removeClass('rowhover');
|
||||
document.getElementById('row'+currow).focus();
|
||||
lastrow=currow;
|
||||
}
|
||||
}
|
||||
|
||||
function callkeydownhandler(evnt) {
|
||||
var ev = evnt;
|
||||
var focusedRow = ev.target && ev.target.tagName === "TR" ? ev.target : null;
|
||||
if ((ev.key === "Enter" || ev.keyCode === 13) && focusedRow) {
|
||||
ev.preventDefault();
|
||||
GetRowData(focusedRow);
|
||||
return;
|
||||
}
|
||||
keyListen('','',ev);
|
||||
}
|
||||
|
||||
window.document.addEventListener("keydown", callkeydownhandler, false);
|
||||
112
cygnus-onprem-app/build/WebContent/js/edp/punching/edit-cases.js
Normal file
112
cygnus-onprem-app/build/WebContent/js/edp/punching/edit-cases.js
Normal file
@@ -0,0 +1,112 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
var currentRow = 0;
|
||||
var lastRow = 0;
|
||||
|
||||
function rows() {
|
||||
return Array.prototype.slice.call(document.querySelectorAll("#casetable tbody tr"));
|
||||
}
|
||||
|
||||
function rowNumber(row) {
|
||||
return Number((row.id || "").replace("row", "")) || 0;
|
||||
}
|
||||
|
||||
function setActiveRow(row) {
|
||||
if (!row) {
|
||||
return;
|
||||
}
|
||||
rows().forEach(function (item) {
|
||||
item.classList.remove("rowhover");
|
||||
});
|
||||
row.classList.add("rowhover");
|
||||
currentRow = rowNumber(row);
|
||||
lastRow = currentRow;
|
||||
row.focus();
|
||||
}
|
||||
|
||||
function hiddenValue(row, suffix) {
|
||||
var input = document.getElementById(row.id + suffix);
|
||||
return input ? input.value : "";
|
||||
}
|
||||
|
||||
function submitForm(action, target, formId) {
|
||||
if (typeof SubmitForm === "function") {
|
||||
SubmitForm(action, target, formId);
|
||||
return;
|
||||
}
|
||||
var form = document.getElementById(formId);
|
||||
if (!form) {
|
||||
return;
|
||||
}
|
||||
form.action = action;
|
||||
form.target = target;
|
||||
form.submit();
|
||||
}
|
||||
|
||||
function openRow(row) {
|
||||
if (!row) {
|
||||
return;
|
||||
}
|
||||
var uuid = hiddenValue(row, "uuid");
|
||||
var portfolioId = hiddenValue(row, "portid");
|
||||
if (!uuid || !portfolioId) {
|
||||
return;
|
||||
}
|
||||
document.getElementById("uuid").value = uuid;
|
||||
document.getElementById("portlist").value = portfolioId;
|
||||
submitForm("caseedit", "_parent", "caseGrid");
|
||||
}
|
||||
|
||||
function moveSelection(direction) {
|
||||
var allRows = rows();
|
||||
if (allRows.length === 0) {
|
||||
return;
|
||||
}
|
||||
var nextIndex = currentRow > 0 ? currentRow - 1 + direction : 0;
|
||||
if (nextIndex < 0) {
|
||||
nextIndex = allRows.length - 1;
|
||||
}
|
||||
if (nextIndex >= allRows.length) {
|
||||
nextIndex = 0;
|
||||
}
|
||||
setActiveRow(allRows[nextIndex]);
|
||||
}
|
||||
|
||||
function handleKeydown(event) {
|
||||
var row = event.target && event.target.closest ? event.target.closest("#casetable tbody tr") : null;
|
||||
if (event.key === "Enter" && row) {
|
||||
event.preventDefault();
|
||||
openRow(row);
|
||||
return;
|
||||
}
|
||||
if (event.key === "ArrowDown") {
|
||||
event.preventDefault();
|
||||
moveSelection(1);
|
||||
return;
|
||||
}
|
||||
if (event.key === "ArrowUp") {
|
||||
event.preventDefault();
|
||||
moveSelection(-1);
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
rows().forEach(function (row) {
|
||||
row.addEventListener("mouseenter", function () {
|
||||
setActiveRow(row);
|
||||
});
|
||||
row.addEventListener("click", function () {
|
||||
openRow(row);
|
||||
});
|
||||
});
|
||||
document.addEventListener("keydown", handleKeydown, false);
|
||||
}
|
||||
|
||||
window.CygnusEditCases = {
|
||||
init: init,
|
||||
openRow: openRow
|
||||
};
|
||||
|
||||
window.InitPage = init;
|
||||
}());
|
||||
@@ -95,21 +95,6 @@ public class Ajax {
|
||||
}
|
||||
return response;
|
||||
}
|
||||
@RequestMapping(value="getlocality",method=RequestMethod.POST )
|
||||
public @ResponseBody String GetLocality(@RequestParam String city, @RequestParam String letters)
|
||||
{
|
||||
DBFunctions DBF=new DBFunctions("1001");
|
||||
DBF.setProcessFlag(true);
|
||||
|
||||
String val1="and 1=1";
|
||||
if(!(city.toUpperCase().equals("-1") || city.toUpperCase().equals("UNKNOWN")))
|
||||
{
|
||||
val1="and upper(city)=upper('"+city+"')";
|
||||
}
|
||||
String response= DBF.FetchRunQuery(13, (letters.toUpperCase()+GlobalClass.ColDelim+val1+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
|
||||
response=response.replace(GlobalClass.ColDelim+GlobalClass.RowDelim, GlobalClass.RowDelim);
|
||||
return response;
|
||||
}
|
||||
@RequestMapping(value="listservprovider",method=RequestMethod.POST )
|
||||
public @ResponseBody String ListServProvider(@RequestParam String city, @RequestParam String letters)
|
||||
{
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
package matrix.nimble.edp.punching.controllers;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import matrix.nimble.edp.punching.model.CaseGrid;
|
||||
import matrix.nimble.model.Session;
|
||||
import matrix.nimble.utilities.GlobalClass;
|
||||
import matrix.nimble.utilities.ModuleFunctions;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.SessionAttributes;
|
||||
|
||||
@Controller
|
||||
@SessionAttributes({ "Sessvals" })
|
||||
public class EditCasesGrid {
|
||||
@RequestMapping(value = "editgrid", method = RequestMethod.POST)
|
||||
public String OpenEditGrid(ModelMap model, HttpServletRequest request,
|
||||
@ModelAttribute(value = "Sessvals") Session Sessvals) {
|
||||
String[][] CaseList = null;
|
||||
CaseGrid CG = new CaseGrid();
|
||||
model.addAttribute("Sessvals", Sessvals);
|
||||
model.addAttribute("caseList", CaseList);
|
||||
model.addAttribute("caseGrid", CG);
|
||||
model.addAttribute("portlist", FillPortList(Sessvals.getBranchID(), Sessvals.getUserID()));
|
||||
return "edp/punching/editcases";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "caselist", method = RequestMethod.POST)
|
||||
public String ListCases(ModelMap model, HttpServletRequest request,
|
||||
@ModelAttribute(value = "Sessvals") Session Sessvals,
|
||||
@ModelAttribute(value = "caseGrid") CaseGrid caseGrid) {
|
||||
CaseGrid CG = new CaseGrid();
|
||||
CG.setErrCode("1002");
|
||||
CG.setPortfolioId(caseGrid.getPortfolioId());
|
||||
String[][] CaseList = CG.FillCaseList(caseGrid.getPortfolioId(), Sessvals.getBranchID());
|
||||
if (CG.isProcessFlag()) {
|
||||
model.addAttribute("caseList", CaseList);
|
||||
model.addAttribute("caseGrid", CG);
|
||||
} else {
|
||||
caseGrid.setErrMsg(CG.getErrMsg());
|
||||
model.addAttribute("caseList", CaseList);
|
||||
model.addAttribute("caseGrid", caseGrid);
|
||||
}
|
||||
model.addAttribute("Sessvals", Sessvals);
|
||||
model.addAttribute("portlist", FillPortList(Sessvals.getBranchID(), Sessvals.getUserID()));
|
||||
return "edp/punching/editcases";
|
||||
}
|
||||
|
||||
public String[][] FillPortList(String BranchId, String userId) {
|
||||
return new ModuleFunctions("1002").GetResultArray(249,
|
||||
(BranchId + GlobalClass.ColDelim + userId + GlobalClass.ColDelim).split(GlobalClass.ColDelim));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,6 +27,8 @@ import lib.models.CaseSaveRequest;
|
||||
import lib.models.MessageDetails;
|
||||
import lib.models.PunchedRecordsData;
|
||||
import lib.models.DuplicateDetailsData;
|
||||
import lib.models.LocalityData;
|
||||
import matrix.nimble.edp.punching.model.CaseGrid;
|
||||
import lib.constants.ApplicationMessage;
|
||||
import matrix.nimble.security.PayloadCryptoService;
|
||||
import lib.exceptions.ApplicationException;
|
||||
@@ -42,6 +44,8 @@ public class PunchingController extends AbstractAuthenticatedController {
|
||||
private static final String CASE_ADD_ROUTE = "caseadd";
|
||||
private static final String CASE_EDIT_ROUTE = "caseedit";
|
||||
private static final String DUPLICATE_DETAILS_ROUTE = "findsdet";
|
||||
private static final String LOCALITY_ROUTE = "getlocality";
|
||||
private static final String EDIT_GRID_ROUTE = "editgrid";
|
||||
private final PunchingService punchingService;
|
||||
private final PayloadCryptoService cryptoService;
|
||||
|
||||
@@ -121,6 +125,33 @@ public class PunchingController extends AbstractAuthenticatedController {
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = LOCALITY_ROUTE, method = RequestMethod.GET,
|
||||
produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@ResponseBody
|
||||
public ResponseEntity<ApiResponse<LocalityData>> findLocalities(
|
||||
@RequestParam("city") String city,
|
||||
@RequestParam("letters") String letters,
|
||||
HttpSession httpSession) {
|
||||
ApiAuthorization authorization = authorizeApiPage(INIT_VIEW_ROUTE, httpSession);
|
||||
if (!authorization.isGranted()) {
|
||||
return ResponseEntity.status(authorization.error().getHttpStatus())
|
||||
.body(ApiResponse.failure(authorization.error()));
|
||||
}
|
||||
try {
|
||||
LocalityData data = punchingService.findLocalities(city, letters, authorization.session());
|
||||
return ResponseEntity.ok(ApiResponse.success(
|
||||
data, new MessageDetails(ApplicationMessage.APPLICATIONS_LOADED)));
|
||||
} catch (ApplicationException exception) {
|
||||
LOGGER.log(Level.WARNING, "Locality search was rejected", exception);
|
||||
MessageDetails details = new MessageDetails(exception.getApplicationMessage());
|
||||
return ResponseEntity.status(details.getHttpStatus()).body(ApiResponse.failure(details));
|
||||
} catch (RuntimeException exception) {
|
||||
LOGGER.log(Level.SEVERE, "Unable to search localities", exception);
|
||||
MessageDetails details = new MessageDetails(ApplicationMessage.INTERNAL_SERVER_ERROR);
|
||||
return ResponseEntity.status(details.getHttpStatus()).body(ApiResponse.failure(details));
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "application-save", method = RequestMethod.POST,
|
||||
consumes = MediaType.APPLICATION_JSON_VALUE,
|
||||
produces = MediaType.APPLICATION_JSON_VALUE)
|
||||
@@ -207,4 +238,52 @@ public class PunchingController extends AbstractAuthenticatedController {
|
||||
session.getCompanyId(), session.getUserId()));
|
||||
return "edp/punching/initcase";
|
||||
}
|
||||
|
||||
@RequestMapping(value = EDIT_GRID_ROUTE, method = RequestMethod.POST)
|
||||
public String openEditGrid(
|
||||
ModelMap model,
|
||||
HttpSession httpSession,
|
||||
HttpServletResponse response) {
|
||||
PageAuthorization authorization = authorizePage(
|
||||
EDIT_GRID_ROUTE, model, httpSession, response);
|
||||
if (!authorization.isGranted()) {
|
||||
return authorization.viewName();
|
||||
}
|
||||
populateEditGrid(model, new CaseGrid(), authorization.session(), false);
|
||||
return "edp/punching/editcases";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "caselist", method = RequestMethod.POST)
|
||||
public String listEditableCases(
|
||||
@ModelAttribute("caseGrid") CaseGrid caseGrid,
|
||||
ModelMap model,
|
||||
HttpSession httpSession,
|
||||
HttpServletResponse response) {
|
||||
PageAuthorization authorization = authorizePage(
|
||||
EDIT_GRID_ROUTE, model, httpSession, response);
|
||||
if (!authorization.isGranted()) {
|
||||
return authorization.viewName();
|
||||
}
|
||||
populateEditGrid(model, caseGrid, authorization.session(), true);
|
||||
return "edp/punching/editcases";
|
||||
}
|
||||
|
||||
private void populateEditGrid(
|
||||
ModelMap model, CaseGrid caseGrid, UserSession session, boolean loadCases) {
|
||||
Short portfolioId = selectedPortfolio(caseGrid);
|
||||
model.addAttribute("caseGrid", caseGrid);
|
||||
model.addAttribute("portlist", punchingService.loadEditCasePortfolios(session));
|
||||
model.addAttribute("caseList", loadCases && portfolioId != null
|
||||
? punchingService.loadEditableCases(portfolioId, session)
|
||||
: java.util.List.of());
|
||||
}
|
||||
|
||||
private Short selectedPortfolio(CaseGrid caseGrid) {
|
||||
try {
|
||||
short portfolioId = Short.parseShort(caseGrid.getPortfolioId());
|
||||
return portfolioId > 0 ? portfolioId : null;
|
||||
} catch (NumberFormatException | NullPointerException ignored) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
package matrix.nimble.edp.punching.model;
|
||||
|
||||
import matrix.nimble.utilities.DBFunctions;
|
||||
import matrix.nimble.utilities.GlobalClass;
|
||||
import matrix.nimble.utilities.StringFunctions;
|
||||
|
||||
public class CaseGrid {
|
||||
public class CaseGrid {
|
||||
private String ErrMsg;
|
||||
private String ErrDesc;
|
||||
private String ErrCode;
|
||||
@@ -48,23 +44,4 @@ public class CaseGrid {
|
||||
public void setCaseID(String caseID) {
|
||||
CaseID = caseID;
|
||||
}
|
||||
public String[][] FillCaseList(String PortfolioID,String CompBranchId)
|
||||
{
|
||||
String [][]CaseList=null;
|
||||
DBFunctions DBF=new DBFunctions(getErrCode());
|
||||
DBF.setProcessFlag(true);
|
||||
String ResultData=DBF.FetchRunQuery(23, (PortfolioID+GlobalClass.ColDelim+CompBranchId+GlobalClass.ColDelim).split(GlobalClass.ColDelim));
|
||||
if(DBF.isProcessFlag())
|
||||
{
|
||||
setProcessFlag(DBF.isProcessFlag());
|
||||
CaseList=new StringFunctions(getErrCode()).ConverTo2DArray(ResultData, GlobalClass.RowDelim, GlobalClass.ColDelim);
|
||||
}
|
||||
else
|
||||
{
|
||||
setProcessFlag(false);
|
||||
setErrMsg(DBF.getErrMsg());
|
||||
setErrDesc(DBF.getErrDesc());
|
||||
}
|
||||
return CaseList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package matrix.nimble.query;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public final class DirectQueryProvider implements QueryProvider {
|
||||
private final QuerySource source;
|
||||
|
||||
public DirectQueryProvider(QuerySource source) {
|
||||
this.source = Objects.requireNonNull(source, "source");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getQuery(int queryId) {
|
||||
return source.fetch(queryId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getQuery(String queryKey) {
|
||||
return source.fetch(queryKey);
|
||||
}
|
||||
}
|
||||
@@ -23,12 +23,14 @@ public class QueryProviderConfiguration implements DisposableBean {
|
||||
OnPremRedisCacheService cache,
|
||||
CloudIdentityClient cloudClient,
|
||||
CloudClientProperties cloudProperties,
|
||||
@Value("${CYGNUS_QUERY_CACHE_ENABLED:true}") boolean cacheEnabled,
|
||||
@Value("${CYGNUS_QUERY_CACHE_AES_KEY:}") String configuredKey) {
|
||||
byte[] key = queryCacheKey(configuredKey, cloudProperties.clientAssertion());
|
||||
installed = new RedisCachingQueryProvider(
|
||||
cache,
|
||||
new CloudQuerySource(cloudClient),
|
||||
new AesGcmQueryCipher(key));
|
||||
QuerySource cloudSource = new CloudQuerySource(cloudClient);
|
||||
installed = cacheEnabled
|
||||
? new RedisCachingQueryProvider(
|
||||
cache, cloudSource, new AesGcmQueryCipher(
|
||||
queryCacheKey(configuredKey, cloudProperties.clientAssertion())))
|
||||
: new DirectQueryProvider(cloudSource);
|
||||
QueryProviders.install(installed);
|
||||
return installed;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ import lib.models.MessageDetails;
|
||||
import lib.models.Option;
|
||||
import lib.models.PunchedRecordsData;
|
||||
import lib.models.DuplicateDetailsData;
|
||||
import lib.models.EditCaseSummary;
|
||||
import lib.models.LocalityData;
|
||||
import lib.models.LocalityOption;
|
||||
import lib.models.UserSession;
|
||||
import lib.constants.ApplicationMessage;
|
||||
import lib.exceptions.ApplicationException;
|
||||
@@ -45,6 +48,9 @@ public class PunchingService {
|
||||
|
||||
private static final Short ACTIVE = Short.valueOf((short) 1);
|
||||
private static final int PUNCHED_RECORDS_QUERY = 24;
|
||||
private static final int EDIT_CASES_QUERY = 23;
|
||||
private static final int EDIT_CASE_PORTFOLIOS_QUERY = 249;
|
||||
private static final int LOCALITY_QUERY = 13;
|
||||
private static final int RESIDENCE_DETAILS_QUERY = 19;
|
||||
private static final int OFFICE_DETAILS_QUERY = 20;
|
||||
private static final int PROPERTY_DETAILS_QUERY = 21;
|
||||
@@ -100,6 +106,40 @@ public class PunchingService {
|
||||
}
|
||||
}
|
||||
|
||||
public List<Option> loadEditCasePortfolios(UserSession session) {
|
||||
requireSessionScope(session);
|
||||
return commonService.getOptions(EDIT_CASE_PORTFOLIOS_QUERY, new Object[] {
|
||||
session.getCompanyId(), session.getBranchId(), session.getUserId(),
|
||||
session.getUserId(), ACTIVE
|
||||
});
|
||||
}
|
||||
|
||||
public List<EditCaseSummary> loadEditableCases(Short portfolioId, UserSession session) {
|
||||
requireSessionScope(session);
|
||||
if (portfolioId == null || portfolioId <= 0) {
|
||||
throw new ApplicationException(
|
||||
ApplicationMessage.APPLICATION_VALIDATION_FAILED, "Portfolio is required");
|
||||
}
|
||||
try {
|
||||
return dbExecutor.query(EDIT_CASES_QUERY, new Object[] {
|
||||
portfolioId, session.getCompanyId(), session.getBranchId()
|
||||
}, EditCaseSummary.class);
|
||||
} catch (RuntimeException exception) {
|
||||
throw databaseFailure(exception);
|
||||
}
|
||||
}
|
||||
|
||||
private void requireSessionScope(UserSession session) {
|
||||
if (session == null || session.getCompanyId() == null || session.getBranchId() == null
|
||||
|| session.getUserId() == null) {
|
||||
throw new ApplicationException(
|
||||
ApplicationMessage.SESSION_REQUIRED, "Authenticated session scope is required");
|
||||
}
|
||||
if (dbExecutor == null) {
|
||||
throw new IllegalStateException("Database dependencies are not configured");
|
||||
}
|
||||
}
|
||||
|
||||
public PunchedRecordsData loadPunchedRecords(
|
||||
Short portfolioId, String documentCaseId, UserSession session) {
|
||||
if (dbExecutor == null || objectMapper == null) {
|
||||
@@ -120,7 +160,7 @@ public class PunchingService {
|
||||
} catch (ApplicationException exception) {
|
||||
throw exception;
|
||||
} catch (RuntimeException exception) {
|
||||
throw databaseFailure(exception);
|
||||
throw databaseReadFailure(exception);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,6 +203,37 @@ public class PunchingService {
|
||||
}
|
||||
}
|
||||
|
||||
public LocalityData findLocalities(String city, String letters, UserSession session) {
|
||||
if (dbExecutor == null) {
|
||||
throw new IllegalStateException("Locality dependencies are not configured");
|
||||
}
|
||||
String normalizedCity = city == null ? "-1" : city.trim();
|
||||
String prefix = letters == null ? "" : letters.trim();
|
||||
if (session == null || session.getBranchId() == null || prefix.isEmpty()
|
||||
|| prefix.length() > 50 || normalizedCity.length() > 100) {
|
||||
throw new ApplicationException(
|
||||
ApplicationMessage.APPLICATION_VALIDATION_FAILED, "Locality search details are invalid");
|
||||
}
|
||||
try {
|
||||
List<LocalityOption> localities = dbExecutor.query(LOCALITY_QUERY, new Object[] {
|
||||
session.getBranchId(), prefix, normalizedCity, normalizedCity
|
||||
}).stream().map(row -> new LocalityOption(
|
||||
row.get("id", Integer.class), rowText(row, "location"),
|
||||
rowText(row, "pincode").trim(), rowText(row, "city"))).toList();
|
||||
return new LocalityData(localities);
|
||||
} catch (ApplicationException exception) {
|
||||
throw exception;
|
||||
} catch (RuntimeException exception) {
|
||||
throw new ApplicationException(
|
||||
ApplicationMessage.INTERNAL_SERVER_ERROR, "Locality lookup failed", exception);
|
||||
}
|
||||
}
|
||||
|
||||
private String rowText(RowView row, String column) {
|
||||
Object value = row.get(column);
|
||||
return value == null ? "" : value.toString();
|
||||
}
|
||||
|
||||
private Map<String, Object> toPunchedRecord(RowView row) {
|
||||
Map<String, Object> record = new LinkedHashMap<>();
|
||||
row.asMap().forEach((name, value) -> {
|
||||
@@ -249,6 +320,12 @@ public class PunchingService {
|
||||
ApplicationMessage.APPLICATION_SAVE_FAILED, "Database save failed", exception);
|
||||
}
|
||||
|
||||
private ApplicationException databaseReadFailure(RuntimeException exception) {
|
||||
return new ApplicationException(
|
||||
ApplicationMessage.APPLICATION_LOAD_FAILED,
|
||||
"Database read failed", exception);
|
||||
}
|
||||
|
||||
private boolean blank(String value) { return value == null || value.isBlank(); }
|
||||
|
||||
public CasePunching init(
|
||||
|
||||
@@ -55,6 +55,37 @@ class PunchingServiceTest {
|
||||
() -> service.findDuplicateDetails("APP-1", (short) 38, 23, session));
|
||||
}
|
||||
|
||||
@Test
|
||||
void derivesLocalityCompanyScopeFromSessionBranch() {
|
||||
AtomicReference<Object[]> parameters = new AtomicReference<>();
|
||||
Map<String, Object> columns = new LinkedHashMap<>();
|
||||
columns.put("id", 42);
|
||||
columns.put("location", "Sector 14");
|
||||
columns.put("pincode", "122001 ");
|
||||
columns.put("city", "Gurugram");
|
||||
CygnusDbExecutor executor = (CygnusDbExecutor) Proxy.newProxyInstance(
|
||||
getClass().getClassLoader(), new Class<?>[] {CygnusDbExecutor.class},
|
||||
(proxy, method, args) -> {
|
||||
if (method.getName().equals("query") && args.length == 2) {
|
||||
assertEquals(13, args[0]);
|
||||
parameters.set(((Object[]) args[1]).clone());
|
||||
return List.of(row(columns));
|
||||
}
|
||||
throw new UnsupportedOperationException(method.toString());
|
||||
});
|
||||
PunchingService service = new PunchingService(
|
||||
new CommonService(), executor, new ObjectMapper());
|
||||
UserSession session = UserSession.builder()
|
||||
.companyId((short) 3).branchId((short) 7).build();
|
||||
|
||||
var result = service.findLocalities(" Gurugram ", " Sec ", session);
|
||||
|
||||
assertArrayEquals(new Object[] {(short) 7, "Sec", "Gurugram", "Gurugram"},
|
||||
parameters.get());
|
||||
assertEquals(42, result.localities().getFirst().id());
|
||||
assertEquals("122001", result.localities().getFirst().pincode());
|
||||
}
|
||||
|
||||
@Test
|
||||
void loadsPunchedRecordsAsFormShapedObjectsAndMergesDynamicFields() {
|
||||
AtomicReference<Object[]> parameters = new AtomicReference<>();
|
||||
|
||||
Reference in New Issue
Block a user