var tempEmpId = "";
var tempSiteVisitDate = "";
var similarRecordsCount = 1;
var currentLoopCondition = false;
var projectList_KeyValue_In_Json = 'projectsList';
class SelectedTabRelatedTableDataValueFields {
	constructor() {
		tempEmpId = "";
		tempSiteVisitDate = "";
		currentLoopCondition = false;
	}
    getClaimStatusIconTag(Td_class,customAttributes,claimStatus){
		//changing claiming status icon color
		let claimStatusIconClass;
		let claimStatusTitle;
		switch (claimStatus) {
			case Number(CLAIM_IN_EMP_BUCKET): //pending at emp
			    claimStatusIconClass = 'fa fa-check-square text-secondary sticky-column col3 claimStatusIcon';
				claimStatusTitle="PENDING AT ENGINEER";
				break;
			case Number(CLAIM_PENDING): //pending at TL
				claimStatusIconClass = 'fa fa-check-square text-warning sticky-column col3 claimStatusIcon';
				claimStatusTitle="PENDING AT TL";
				break;
			case Number(CLAIM_TL_APPROVED): //approved  by TL
				claimStatusIconClass = 'fa fa-check-square text-primary sticky-column col3 claimStatusIcon';
				claimStatusTitle="TL APPROVED";
				break;
			case Number(CLAIM_TL_REJECTED): //reject by TL
				claimStatusIconClass = 'fa fa-check-square text-danger sticky-column col3 claimStatusIcon';
				claimStatusTitle="TL REJECTED";
				break;
			case Number(CLAIM_FINANCE_APPROVED): // Finance Approved
				claimStatusIconClass = 'fa fa-check-square text-violate sticky-column col3 claimStatusIcon';
				claimStatusTitle="FINANCE APPROVED";
				break;
			case Number(CLAIM_FINANCE_REJECTED): //reject by finance
				claimStatusIconClass = 'fa fa-check-square text-danger sticky-column col3 claimStatusIcon';
				claimStatusTitle="FINANCE REJECTED";
				break;
			case Number(CLAIM_PERMANENT_TL_REJECT): //permanent reject by TL
			    claimStatusIconClass = 'fa fa-times text-danger sticky-column col3 claimStatusIcon';
				claimStatusTitle="TL PERMANENTLY REJECTED";
			    break;
			case Number(CLAIM_PERMANENT_FINANCE_REJECT): //permanent reject by Finance
				claimStatusIconClass = 'fa fa-times text-danger sticky-column col3 claimStatusIcon';
				claimStatusTitle="FINANCE PERMANENTLY REJECTED";
				break;
			case Number(CLAIM_PAID)://paid
				claimStatusIconClass = 'fa fa-check-square text-success sticky-column col3 claimStatusIcon';
				claimStatusTitle="PAID";
				break;

		}
		let claimstatusIcon="<i id='claimStatus_" + Td_class + "' class='" + claimStatusIconClass+ "' " + customAttributes + " data-claimStatus='" + claimStatus + "' data-toggle='tooltip' title='"+claimStatusTitle+"'></i>";
		return claimstatusIcon;
	}

	employeeImagesProof(employImage) {
		if (employImage) {
			employImage = IMAGE_BASE_URL + employImage; //IMAGE_BASE_URL is constant variable in contant.js
		} else {
			//default image if not found
			employImage = "../defaultImages/noImageFound.png";
		}
		return employImage;

	}
	createNewTableRowStart(rowValues) {
		var Td_class = rowValues.empId + "_" + rowValues.date;
		currentLoopCondition = tempEmpId == rowValues.empId && tempSiteVisitDate == rowValues.date;
		let fakeGpsClass = ((LOGGED_IN_DEPARTMENT == FINANCE_DEPARTMENT) ? rowValues.fakeGps : '');
		switch (currentLoopCondition) {
		    case false: // firt table row
    		    return "<tr class='data-content_" + Td_class + " "+fakeGpsClass+" getGrandTotalReference_class' scop='row' data-commonId='data-content_" + Td_class +"'>";
    		    break;
    		case true:// 2nd table row
    		    return "<tr class='data-content_" + Td_class + " "+fakeGpsClass+"' scop='row' data-commonId='data-content_" + Td_class +"'>";
    		    break;
    		    
		    
		}
	}
	createNewTableRowClose(rowValues, forLoopIndex) {
		tempEmpId = rowValues.empId;
		tempSiteVisitDate = rowValues.date;
		if (rowValues.siteOnOfTheDayVisitCount == similarRecordsCount) {
			similarRecordsCount = 1;
			return "</tr>" + this.createNewTableDataFields_ImageBillsTableRow(rowValues, forLoopIndex);
		} else {
			similarRecordsCount++;
			return "</tr>";
		}

	}

	TL_createNewTableDataFields_CommonUI(rowValues, forLoopIndex) {
		var claimSatus_depend_ui;
		var Td_id = rowValues.empId + "_" + rowValues.date + "_" + forLoopIndex;
		var Td_class = rowValues.empId + "_" + rowValues.date;
		var customAttributes = "data-common-id='" + Td_class + "' data-index='" + forLoopIndex + "'";

		// var reference_emp_index = String(rowValues.empId) + forLoopIndex;
		// var reference_emp_date = String(rowValues.empId) + rowValues.date;
		var commonRowFieldsValues;
		switch (currentLoopCondition) {

			case false:// first row on of the site-visit date (site-visit-order=1)

				commonRowFieldsValues = "<td class='d-none'>" +
					"<input  id='serverId_invisible_" + Td_id + "' class='serverId_invisible_" + Td_class + "' " + customAttributes + "  type='number' value='" + rowValues.tesfId + "'/></td>" + // d-none in ui only for backend
					"<td id='sNo_" + Td_id + "' class='sticky-column td col1 serialNumber sNo_" + Td_class + "' " + customAttributes + ">" + rowValues.sno + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='empId_" + Td_class + "' class='sticky-column col2 border-left' " + customAttributes + ">" + rowValues.empId + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='empName_" + Td_class + "' class='sticky-column col3 border-right' " + customAttributes + ">" + rowValues.empName + "</td>" +
					"<td  class='selfyimg sticky-column col4'><img id='selfyimg_" + Td_id + "' class='selfyimg_" + Td_class + "' " + customAttributes + "  src=" + this.employeeImagesProof(rowValues.employeeImages) + " /></td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "'  class='claimStatusTd sticky-column col5 border-left border-right'>"+ this.getClaimStatusIconTag(Td_class,customAttributes,rowValues.claimstatus) +"</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='siteVisitDate_" + Td_class + "' class='sticky-column col6' " + customAttributes + ">" + rowValues.date + "</td>" +
					"<td>" + rowValues.siteVisitedOrder + "</td>" +
					"<td>" + rowValues.userLocationAddress + "</td>" +
					"<td>" + rowValues.userLat + ", " + rowValues.userLng + "</td>" +
					"<td class='siteID_tableData'>" + rowValues.siteID + "</td>" +
					"<td>" + rowValues.sitelat + ", " + rowValues.siteLong + "</td>" +
					"<td id='getDirectionLatLng_" + Td_id + "' class='getDirectionLatLng_" + Td_class + " d-none'  " + customAttributes + ">" + rowValues.userLat + ", " + rowValues.userLng + "/" + rowValues.sitelat + ", " + rowValues.siteLong + "/</td>" + // no need to print in UI
					"<td><a id='singleTripMap_" + Td_id + "' class='onclickSingleTripMapBtn singleTripMap_" + Td_class + "'  " + customAttributes + "><i class='fa fa-directions'></i></a></td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' class='border-right border-left'><a id='roundTripMap_" + Td_class + "' class='onclickRoundTripMapBtn' " + customAttributes + "><i class='fa fa-directions'></i></a></td>"; // no need to print in UI
				if (rowValues.claimstatus == CLAIM_PENDING) {

					claimSatus_depend_ui = "<td>" + rowValues.project + "</td>" +
						"<td>" + rowValues.stageOfvisit + "</td>" +
						"<td>" + rowValues.siteName + "</td>" +
						"<td>" + rowValues.customer + "</td>" +
						"<td>" + rowValues.siteDistrict + "</td>" +
						"<td>" + rowValues.siteCircle + "</td>" +
						"<td>" + rowValues.from + "</td>" +
						"<td>" + rowValues.to + "</td>" +
						"<td>" + rowValues.modeOfTransport + "</td>" +
						"<td>" + rowValues.supportingBillsAvailable + "</td>" +
						"<td>" + rowValues.reportSubmissionState + "</td>" +
						"<td>" + rowValues.distance + "</td>" +
						"<td>" + rowValues.remark + "</td>" +
						"<td class='engFTAValue_td_class'><input  id='FTAinput_" + Td_id + "' type='number' value=" + rowValues.fta + " class='FTAInputField FTAinput_" + Td_class + "' " + customAttributes + " data-initialValue='"+ rowValues.fta +"'  disabled/><i id='FTAEditBtn_" + Td_id + "' class='fa fa-edit pl-1 ftaEditBtn FTAEditBtn_" + Td_class + "' " + customAttributes + "></i></td>" +
						"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='totalDistance_" + Td_class + "' class='border-right border-left' >" + rowValues.totalDistance + "</td>" +
						"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='engineerDeputation_" + Td_class + "'>" + rowValues.engDeputation + "</td>" +
						"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='engineerDaAmount_" + Td_class + "'>" + rowValues.engDAAmount + "</td>" +
						"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='engineerOther_" + Td_class + "' class='engOtherAmountValue_class'>" + rowValues.engOtherBill + "</td>" +
						"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='engineerHotel_" + Td_class + "' class='engHotelAmountValue_class'>" + rowValues.engHotelBill + "</td>" +
						"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='engineerTotal_" + Td_class + "' class='engTotalAmountValue_class'>" + rowValues.engTotalAmount + "</td>" +
						"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='engineerClaimdate_" + Td_class + "' class='border-right'>" + rowValues.claimdate + "</td>";

				} else {
					claimSatus_depend_ui = "<td>" + rowValues.project + "</td>" +
						"<td>" + rowValues.stageOfvisit + "</td>" +
						"<td>" + rowValues.siteName + "</td>" +
						"<td>" + rowValues.customer + "</td>" +
						"<td>" + rowValues.siteDistrict + "</td>" +
						"<td>" + rowValues.siteCircle + "</td>" +
						"<td>" + rowValues.from + "</td>" +
						"<td>" + rowValues.to + "</td>" +
						"<td>" + rowValues.modeOfTransport + "</td>" +
						"<td>" + rowValues.supportingBillsAvailable + "</td>" +
						"<td>" + rowValues.reportSubmissionState + "</td>" +
						"<td>" + rowValues.distance + "</td>" +
						"<td>" + rowValues.remark + "</td>" +
						"<td class='engFTAValue_td_class'><input  id='FTAinput_" + Td_id + "' type='number' value=" + rowValues.fta + " class='FTAInputField FTAinput_" + Td_class + "' " + customAttributes + " disabled/></td>" +
						"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='totalDistance_" + Td_class + "' class='border-right border-left' >" + rowValues.totalDistance + "</td>" +
						"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='engineerDeputation_" + Td_class + "'>" + rowValues.engDeputation + "</td>" +
						"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='engineerDaAmount_" + Td_class + "'>" + rowValues.engDAAmount + "</td>" +
						"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='engineerOther_" + Td_class + "' class='engOtherAmountValue_class'>" + rowValues.engOtherBill + "</td>" +
						"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='engineerHotel_" + Td_class + "' class='engHotelAmountValue_class'>" + rowValues.engHotelBill + "</td>" +
						"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='engineerTotal_" + Td_class + "' class='engTotalAmountValue_class'>" + rowValues.engTotalAmount + "</td>" +
						"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='engineerClaimdate_" + Td_class + "' class='border-right'>" + rowValues.claimdate + "</td>";


				}
				break;
			case true: // 2nd or 3 or 4 or 5,6..) rows on of the same site-visit date (site-visit-order=2,3,4...)
				commonRowFieldsValues = "<td class='d-none'>" +
					"<input  id='serverId_invisible_" + Td_id + "' class='serverId_invisible_" + Td_class + "' " + customAttributes + "  type='number' value='" + rowValues.tesfId + "'/></td>" + // d-none in ui only for backend
					"<td id='sNo_" + Td_id + "' class='sticky-column td col1 serialNumber sNo_" + Td_class + "' " + customAttributes + ">" + rowValues.sno + "</td>" +
					"<td  class='selfyimg sticky-column col4'><img id='selfyimg_" + Td_id + "' class='selfyimg_" + Td_class + "' " + customAttributes + "  src=" + this.employeeImagesProof(rowValues.employeeImages) + " /></td>" +
					"<td>" + rowValues.siteVisitedOrder + "</td>" +
					"<td>" + rowValues.userLocationAddress + "</td>" +
					"<td>" + rowValues.userLat + ", " + rowValues.userLng + "</td>" +
					"<td class='siteID_tableData'>" + rowValues.siteID + "</td>" +
					"<td>" + rowValues.sitelat + ", " + rowValues.siteLong + "</td>" +
					"<td id='getDirectionLatLng_" + Td_id + "' class='getDirectionLatLng_" + Td_class + " d-none'  " + customAttributes + ">" + rowValues.userLat + ", " + rowValues.userLng + "/" + rowValues.sitelat + ", " + rowValues.siteLong + "/</td>" + // no need to print in UI
					"<td><a id='singleTripMap_" + Td_id + "' class='onclickSingleTripMapBtn singleTripMap_" + Td_class + "'  " + customAttributes + "><i class='fa fa-directions'></i></a></td>";
				if (rowValues.claimstatus == CLAIM_PENDING) {

					claimSatus_depend_ui = "<td>" + rowValues.project + "</td>" +
						"<td>" + rowValues.stageOfvisit + "</td>" +
						"<td>" + rowValues.siteName + "</td>" +
						"<td>" + rowValues.customer + "</td>" +
						"<td>" + rowValues.siteDistrict + "</td>" +
						"<td>" + rowValues.siteCircle + "</td>" +
						"<td>" + rowValues.from + "</td>" +
						"<td>" + rowValues.to + "</td>" +
						"<td>" + rowValues.modeOfTransport + "</td>" +
						"<td>" + rowValues.supportingBillsAvailable + "</td>" +
						"<td>" + rowValues.reportSubmissionState + "</td>" +
						"<td>" + rowValues.distance + "</td>" +
						"<td>" + rowValues.remark + "</td>" +
						"<td class='engFTAValue_td_class'><input  id='FTAinput_" + Td_id + "' type='number' value=" + rowValues.fta + " class='FTAInputField FTAinput_" + Td_class + "' " + customAttributes + " data-initialValue='"+ rowValues.fta +"'  disabled/><i id='FTAEditBtn_" + Td_id + "' class='fa fa-edit pl-1 ftaEditBtn FTAEditBtn_" + Td_class + "' " + customAttributes + "></i></td>";
				} else {
					claimSatus_depend_ui = "<td>" + rowValues.project + "</td>" +
						"<td>" + rowValues.stageOfvisit + "</td>" +
						"<td>" + rowValues.siteName + "</td>" +
						"<td>" + rowValues.customer + "</td>" +
						"<td>" + rowValues.siteDistrict + "</td>" +
						"<td>" + rowValues.siteCircle + "</td>" +
						"<td>" + rowValues.from + "</td>" +
						"<td>" + rowValues.to + "</td>" +
						"<td>" + rowValues.modeOfTransport + "</td>" +
						"<td>" + rowValues.supportingBillsAvailable + "</td>" +
						"<td>" + rowValues.reportSubmissionState + "</td>" +
						"<td>" + rowValues.distance + "</td>" +
						"<td>" + rowValues.remark + "</td>" +
						"<td class='engFTAValue_td_class'><input  id='FTAinput_" + Td_id + "' type='number' value=" + rowValues.fta + " class='FTAInputField FTAinput_" + Td_class + "' " + customAttributes + " disabled/></td>";
			

				}
				break;



		}
		return commonRowFieldsValues + claimSatus_depend_ui;

	}

	finance_createNewTableDataFields_CommonUI(rowValues, forLoopIndex) {
		var claimSatus_depend_ui;
		var Td_id = rowValues.empId + "_" + rowValues.date + "_" + forLoopIndex;
		var Td_class = rowValues.empId + "_" + rowValues.date;
		var customAttributes = "data-common-id='" + Td_class + "' data-index='" + forLoopIndex + "'";
		var commonRowFieldsValues;
		switch (currentLoopCondition) {
			case false: // if above condition false, merged ui fields included with rowspan will be appended.
				commonRowFieldsValues = "<td class='d-none'>" +
					"<input  id='serverId_invisible_" + Td_id + "' class='serverId_invisible_" + Td_class + "' " + customAttributes + "  type='number' value='" + rowValues.tesfId + "'/></td>" + // d-none in ui only for backend
					"<td id='sNo_" + Td_id + "' class='sticky-column td col1 serialNumber sNo_" + Td_class + "' " + customAttributes + ">" + rowValues.sno + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='empId_" + Td_class + "' class='sticky-column col2 border-left' " + customAttributes + ">" + rowValues.empId + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='empName_" + Td_class + "' class='sticky-column col3 border-right' " + customAttributes + ">" + rowValues.empName + "</td>" +
					"<td  class='selfyimg sticky-column col4'><img id='selfyimg_" + Td_id + "' class='selfyimg_" + Td_class + "' " + customAttributes + "  src=" + this.employeeImagesProof(rowValues.employeeImages) + " /></td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "'  class='claimStatusTd sticky-column col5 border-left border-right'>" + this.getClaimStatusIconTag(Td_class,customAttributes,rowValues.claimstatus) + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='siteVisitDate_" + Td_class + "' class='sticky-column col6' " + customAttributes + ">" + rowValues.date + "</td>" +
					"<td>" + rowValues.siteVisitedOrder + "</td>" +
					"<td>" + rowValues.userLocationAddress + "</td>" +
					"<td>" + rowValues.userLat + ", " + rowValues.userLng + "</td>" +
					"<td class='siteID_tableData'>" + rowValues.siteID + "</td>" +
					"<td>" + rowValues.sitelat + ", " + rowValues.siteLong + "</td>" +
					"<td id='getDirectionLatLng_" + Td_id + "' class='getDirectionLatLng_" + Td_class + " d-none'  " + customAttributes + ">" + rowValues.userLat + ", " + rowValues.userLng + "/" + rowValues.sitelat + ", " + rowValues.siteLong + "/</td>" + // no need to print in UI
					"<td><a id='singleTripMap_" + Td_id + "' class='onclickSingleTripMapBtn singleTripMap_" + Td_class + "'  " + customAttributes + "><i class='fa fa-directions'></i></a></td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' class='border-right border-left'><a id='roundTripMap_" + Td_class + "' class='onclickRoundTripMapBtn' " + customAttributes + "><i class='fa fa-directions'></i></a></td>"+
					
					//for calculate grandTotal purpose only
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' class='engOtherAmountValue_class d-none'>"+ rowValues.engOtherBill + "</td>"+ // no need to print in UI
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' class='engHotelAmountValue_class d-none'>"+ rowValues.engHotelBill + "</td>"+ // no need to print in UI
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' class='engTotalAmountValue_class d-none'>"+ rowValues.engTotalAmount + "</td>"; // no need to print in UI
				if (rowValues.claimstatus == CLAIM_TL_APPROVED){ 

					claimSatus_depend_ui = "<td>" + rowValues.project + "</td>" +
						"<td>" + rowValues.stageOfvisit + "</td>" +
						"<td>" + rowValues.siteName + "</td>" +
						"<td>" + rowValues.siteCircle + "</td>" +
						"<td>" + rowValues.from + "</td>" +
						"<td>" + rowValues.to + "</td>" +
						"<td><input id='distanceInput_" + Td_id + "' type='number' value=" + rowValues.distance + " step='0.01' class='distanceInputField distanceInput_" + Td_class + "' " + customAttributes + " disabled/><i id='distanceEditBtn_" + Td_id + "' class='fa fa-edit pl-1 distanceEditBtn' " + customAttributes + "></i></td>" +
						"<td>" + rowValues.remark + "</td>" +
						"<td class='engFTAValue_td_class'><input  id='FTAinput_" + Td_id + "' type='number' value=" + rowValues.fta + " class='FTAInputField FTAinput_" + Td_class + "' " + customAttributes + " data-initialValue='"+ rowValues.fta +"' disabled/><i id='FTAEditBtn_" + Td_id + "' class='fa fa-edit pl-1 ftaEditBtn FTAEditBtn_" + Td_class + "' " + customAttributes + "></i></td>" +
						"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='totalDistance_" + Td_class + "' class='border-right border-left' >" + rowValues.totalDistance + "</td>";

				} else {
				// 	claimSatus_depend_ui = "<td><select>" + rowValues.project + "</td>" +
				// 		"<td>" + rowValues.stageOfvisit + "</td>" +
				// 		"<td>" + rowValues.siteName + "</td>" +
				// 		"<td>" + rowValues.siteCircle + "</td>" +
				// 		"<td>" + rowValues.from + "</td>" +
				// 		"<td>" + rowValues.to + "</td>" +
				// 		"<td>" + rowValues.distance + "</td>" +
				// 		"<td>" + rowValues.remark + "</td>" +
				// 		"<td>" + rowValues.fta + "</td>" +
				// 		"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='totalDistance_" + Td_class + "' class='border-right border-left' >" + rowValues.totalDistance + "</td>";


                    claimSatus_depend_ui = "<td>" + rowValues.project + "</td>" +
						"<td>" + rowValues.stageOfvisit + "</td>" +
						"<td>" + rowValues.siteName + "</td>" +
						"<td>" + rowValues.siteCircle + "</td>" +
						"<td>" + rowValues.from + "</td>" +
						"<td>" + rowValues.to + "</td>" +
						"<td><input id='distanceInput_" + Td_id + "' type='number' value=" + rowValues.distance + " step='0.01' class='distanceInputField distanceInput_" + Td_class + "' " + customAttributes + " disabled/></td>" +
						"<td>" + rowValues.remark + "</td>" +
						"<td class='engFTAValue_td_class'><input  id='FTAinput_" + Td_id + "' type='number' value=" + rowValues.fta + " class='FTAInputField FTAinput_" + Td_class + "' " + customAttributes + " disabled/></td>" +
						"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='totalDistance_" + Td_class + "' class='border-right border-left' >" + rowValues.totalDistance + "</td>";


				}
				break;

			case true: // if above condition true, unmerged ui fields only appended.
				commonRowFieldsValues = "<td class='d-none'>" +
					"<input  id='serverId_invisible_" + Td_id + "' class='serverId_invisible_" + Td_class + "' " + customAttributes + "  type='number' value='" + rowValues.tesfId + "'/></td>" + // d-none in ui only for backend
					"<td id='sNo_" + Td_id + "' class='sticky-column td col1 serialNumber sNo_" + Td_class + "' " + customAttributes + ">" + rowValues.sno + "</td>" +
					"<td  class='selfyimg sticky-column col4'><img id='selfyimg_" + Td_id + "' class='selfyimg_" + Td_class + "' " + customAttributes + "  src=" + this.employeeImagesProof(rowValues.employeeImages) + " /></td>" +
					"<td>" + rowValues.siteVisitedOrder + "</td>" +
					"<td>" + rowValues.userLocationAddress + "</td>" +
					"<td>" + rowValues.userLat + ", " + rowValues.userLng + "</td>" +
					"<td class='siteID_tableData'>" + rowValues.siteID + "</td>" +
					"<td>" + rowValues.sitelat + ", " + rowValues.siteLong + "</td>" +
					"<td id='getDirectionLatLng_" + Td_id + "' class='getDirectionLatLng_" + Td_class + " d-none'  " + customAttributes + ">" + rowValues.userLat + ", " + rowValues.userLng + "/" + rowValues.sitelat + ", " + rowValues.siteLong + "/</td>" + // no need to print in UI
					"<td><a id='singleTripMap_" + Td_id + "' class='onclickSingleTripMapBtn singleTripMap_" + Td_class + "'  " + customAttributes + "><i class='fa fa-directions'></i></a></td>";
				if (rowValues.claimstatus == CLAIM_TL_APPROVED){ 
				//if (rowValues.claimstatus) {

					claimSatus_depend_ui = "<td>" + rowValues.project + "</td>" +
						"<td>" + rowValues.stageOfvisit + "</td>" +
						"<td>" + rowValues.siteName + "</td>" +
						"<td>" + rowValues.siteCircle + "</td>" +
						"<td>" + rowValues.from + "</td>" +
						"<td>" + rowValues.to + "</td>" +
						"<td><input id='distanceInput_" + Td_id + "' type='number' value=" + rowValues.distance + " step='0.01' class='distanceInputField distanceInput_" + Td_class + "' " + customAttributes + " disabled/><i id='distanceEditBtn_" + Td_id + "' class='fa fa-edit pl-1 distanceEditBtn' " + customAttributes + "></i></td>" +
						"<td>" + rowValues.remark + "</td>" +
						"<td class='engFTAValue_td_class'><input  id='FTAinput_" + Td_id + "' type='number' value=" + rowValues.fta + " class='FTAInputField FTAinput_" + Td_class + "' " + customAttributes + " data-initialValue='"+ rowValues.fta +"' disabled/><i id='FTAEditBtn_" + Td_id + "' class='fa fa-edit pl-1 ftaEditBtn FTAEditBtn_" + Td_class + "' " + customAttributes + "></i></td>";

				} else {
					/*claimSatus_depend_ui = "<td>" + rowValues.project + "</td>" +
						"<td>" + rowValues.stageOfvisit + "</td>" +
						"<td>" + rowValues.siteName + "</td>" +
						"<td>" + rowValues.siteCircle + "</td>" +
						"<td>" + rowValues.from + "</td>" +
						"<td>" + rowValues.to + "</td>" +
						"<td>" + rowValues.distance + "</td>" +
						"<td>" + rowValues.remark + "</td>" +
						"<td>" + rowValues.fta + "</td>";*/
						
						
					claimSatus_depend_ui = "<td>" + rowValues.project + "</td>" +
						"<td>" + rowValues.stageOfvisit + "</td>" +
						"<td>" + rowValues.siteName + "</td>" +
						"<td>" + rowValues.siteCircle + "</td>" +
						"<td>" + rowValues.from + "</td>" +
						"<td>" + rowValues.to + "</td>" +
						"<td><input id='distanceInput_" + Td_id + "' type='number' value=" + rowValues.distance + " step='0.01' class='distanceInputField distanceInput_" + Td_class + "' " + customAttributes + " disabled/></td>" +
						"<td>" + rowValues.remark + "</td>" +
						"<td class='engFTAValue_td_class'><input  id='FTAinput_" + Td_id + "' type='number' value=" + rowValues.fta + " class='FTAInputField FTAinput_" + Td_class + "' " + customAttributes + " disabled/></td>";

				}

				break;

		}




		return commonRowFieldsValues + claimSatus_depend_ui;

	}

	createNewTableDataFields_TLNonEditableFields(rowValues) {
		var Td_class = rowValues.empId + "_" + rowValues.date;

		switch (currentLoopCondition) {
			case false:
				var approvedTL;
				if (rowValues.claimstatus == Number(CLAIM_TL_REJECTED)) {
					approvedTL = '';
				} else {
					approvedTL = rowValues.approvedTL;
				}

				var TlNonEditableFields =
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='TLDeputation_" + Td_class + "'>" + rowValues.TLDeputation + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='TLDaAmountTd_" + Td_class + "'>" + rowValues.TLDAAmount + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='TLOtherTd_" + Td_class + "' class='TLOtherAmountValue_class'>" + rowValues.TLOtherBill + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='TLHotelTd_" + Td_class + "' class='TLHotelAmountValue_class'>" + rowValues.TLHotelBill + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='TLTotalTd_" + Td_class + "' class='TLTotalAmountValue_class'>" + rowValues.TLTotalAmount + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='TLDeductedAmountTd_" + Td_class + "'>" + rowValues.tlDeductedAmount + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='TLDeductedReasonTd_" + Td_class + "'>" + rowValues.TLDeductedReason + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='TLApprovedByTd_" + Td_class + "'>" + approvedTL + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='TLApprovedDateTd_" + Td_class + "' class='border-right'>" + rowValues.tlApprovedDate + "</td>";

				return TlNonEditableFields;
		}

	}

	createNewTableDataFields_TLEditableFields(rowValues, forLoopIndex, map) {
		var Td_class = rowValues.empId + "_" + rowValues.date;
		var customAttributes = "data-common-id='" + Td_class + "' data-index='" + forLoopIndex + "'";
		var DA_value_selectTag;

		switch (currentLoopCondition) {
			case false:
			    if (rowValues.claimstatus == CLAIM_PENDING) {
    				if (rowValues.TLDeputation == 'Yes') {
    					DA_value_selectTag = "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "'><select id='editableDeputation_" + Td_class + "' class='deputationAllowancesDD form-control' " + customAttributes + "><option value='Yes' selected>YES</option><option value='No'>NO</option></select></td>";//class=' editableFieldsInClaimDetails'
    				} else {
    					DA_value_selectTag = "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "'><select id='editableDeputation_" + Td_class + "' class='deputationAllowancesDD form-control' " + customAttributes + "><option value='Yes'>YES</option><option value='No' selected>NO</option></select></td>";
    				}
			    }else {
					    DA_value_selectTag = "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='editableDeputation_" + Td_class + "' >" + rowValues.TLDeputation + "</td>";
				}
				var TLEditableFields = DA_value_selectTag +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='editableDaAmount_" + Td_class + "' data-initialValue='"+ rowValues.TLDAAmount +"'>" + rowValues.TLDAAmount + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='editableTotalOtherBillAmount_" + Td_class + "' class='TLOtherAmountValue_class'>" + rowValues.TLOtherBill + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='editableTotalHotelBillAmount_" + Td_class + "' class='TLHotelAmountValue_class'>" + rowValues.TLHotelBill + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='editableTotalFinalAmount_" + Td_class + "' class='TLTotalAmountValue_class border-right'>" + rowValues.TLTotalAmount + "</td>";
				map.set("tlDeductedAmount" + Td_class, rowValues.tlDeductedAmount); //get value from Database
				map.set("financeDeductedAmount" + Td_class, rowValues.financeDeductedAmount); //get value from Database
				map.set("beforeDeductingTotalAmount" + Td_class, rowValues.TLTotalAmount); //initial deducted amount will =0;
				return TLEditableFields;
		}

	}


	createNewTableDataFields_FinanceNonEditableFields(rowValues, forLoopIndex) {
		var Td_class = rowValues.empId + "_" + rowValues.date;
		var claimStatusUpdatedBy;

		switch (currentLoopCondition) {
			case false:
				if (rowValues.claimstatus == Number(CLAIM_TL_REJECTED) || rowValues.claimstatus == Number(CLAIM_FINANCE_REJECTED)) {
					claimStatusUpdatedBy = '';
				} else {
					claimStatusUpdatedBy = rowValues.claimStatusUpdatedBy;
				}

				var FinanceNonEditableFields =
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='financeDeputation_" + Td_class + "' >" + rowValues.financeDeputation + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='financeDaAmount_" + Td_class + "'>" + rowValues.financeDAAmount + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='financeOther_" + Td_class + "' >" + rowValues.financeOtherBill + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='financeHotel_" + Td_class + "' >" + rowValues.financeHotelBill + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='financeTotal_" + Td_class + "' >" + rowValues.financeTotalAmount + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='financeDeductedAmount_" + Td_class + "' >" + rowValues.financeDeductedAmount + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='financeDeductedReason_" + Td_class + "' >" + rowValues.financeDeductedReason + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='claimStatusUpdatedBy_" + Td_class + "' >" + claimStatusUpdatedBy + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='financeClaimUpdateDate_" + Td_class + "' class=' border-right'>" + rowValues.financeApprovedDate + "</td>";


				return FinanceNonEditableFields;
		}
	}


	createNewTableDataFields_FinanceEditableFields(rowValues, forLoopIndex, map) {
		var Td_class = rowValues.empId + "_" + rowValues.date;
		var customAttributes = "data-common-id='" + Td_class + "' data-index='" + forLoopIndex + "'";
		var DA_value_selectTag;
		switch (currentLoopCondition) {
			case false:
				if (rowValues.claimstatus == CLAIM_TL_APPROVED) {

					if (rowValues.financeDeputation == 'Yes') {
						DA_value_selectTag = "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "'><select id='editableDeputation_" + Td_class + "' class='deputationAllowancesDD form-control' " + customAttributes + "><option value='Yes' selected>YES</option><option value='No'>NO</option></select></td>";
					} else {
						DA_value_selectTag = "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "'><select id='editableDeputation_" + Td_class + "' class='deputationAllowancesDD form-control' " + customAttributes + "><option value='Yes'>YES</option><option value='No' selected>NO</option></select></td>";
					}
				} else {
					DA_value_selectTag = "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='editableDeputation_" + Td_class + "' >" + rowValues.financeDeputation + "</td>";
				}
				var FinanceEditableFields = DA_value_selectTag +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='editableDaAmount_" + Td_class + "' data-initialValue='"+ rowValues.financeDAAmount +"'>" + rowValues.financeDAAmount + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='editableTotalOtherBillAmount_" + Td_class + "' class='financeOtherAmountValue_class'>" + rowValues.financeOtherBill + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='editableTotalHotelBillAmount_" + Td_class + "' class='financeHotelAmountValue_class'>" + rowValues.financeHotelBill + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='editableTotalFinalAmount_" + Td_class + "' class='financeTotalAmountValue_class border-right'>" + rowValues.financeTotalAmount + "</td>";
				// console.log("#editableDeputation" +Td_class+" select.DA");
				map.set("tlDeductedAmount" + Td_class, rowValues.tlDeductedAmount); //get value from Database
				map.set("financeDeductedAmount" + Td_class, rowValues.financeDeductedAmount); //get value from Database
				map.set("beforeDeductingTotalAmount" + Td_class, rowValues.financeTotalAmount); //initial deducted amount will =0;

				return FinanceEditableFields;
		}
	}



	/*  createNewTableDataFields_ImageButtonUI(rowValues, forLoopIndex) {
		  return "<td class='Buttonclosed' id=_" +Td_class + " rowspan='1'><i class='fa fa-arrow-down' aria-hidden='true'></i></td>";
	  }*/
	createNewTableDataFields_ImageButtonUI(rowValues, forLoopIndex) {
		var Td_class = rowValues.empId + "_" + rowValues.date;
		var customAttributes = "data-common-id='" + Td_class + "' data-index='" + forLoopIndex + "' data-btnStatus='Buttonclosed' data-tlId='"+rowValues.tlId+"'";

		switch (currentLoopCondition) {
			case false:
				var noOfImageProofPresent = Number(rowValues.engOtherBill) + Number(rowValues.engHotelBill);
				if (noOfImageProofPresent > 0) {
					return "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "'  style='background: var(--theme-light-color);position: relative;'><button id='billImagesBtn_" + Td_class + "' class='billImageProofDropdownBtn border-0 bg-transparent position-absolute w-100 h-100' " + customAttributes + " style='outline:0 !important;right: 0;top: 0;'><i class='fa fa-arrow-down' aria-hidden='true'></i></button></td>";
				} else {
					return "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' class='noImages' >0</td>";
				}

		}

	}

	createNewTableDataFields_TotalDeductedAmountUI(rowValues) {
		var Td_class = rowValues.empId + "_" + rowValues.date;
		switch (currentLoopCondition) {
			case false:
				return "<td  rowspan='" + rowValues.siteOnOfTheDayVisitCount + "'  id='totalDeductedAmount_" + Td_class + "'>" + rowValues.totalDeductedAmount + "</td>";
		}
	}

	createNewTableDataFields_TL_ReasonButton_AND_transferClaim_UI(rowValues, forLoopIndex) {
		var Td_class = rowValues.empId + "_" + rowValues.date;
		var customAttributes = "data-common-id='" + Td_class + "' data-index='" + forLoopIndex + "'";
		switch (currentLoopCondition) {
			case false:
				if (rowValues.claimstatus == CLAIM_PENDING && rowValues.tlId==USER_EMPID) { // if claimstatus=1 and tlId=loggedInuserId
					return "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='reasonWritingBtn_" + Td_class + "' class='reasonPopupBtn' " + customAttributes + "><i class='fa fa-comment' style='color:var(--theme-color);font-size:20px' data-toggle='resonPopover' " + customAttributes + "></i></td>"+
					       "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' ><button id='transfClaimBtn_" + Td_class + "'  class='btn transferClaimBtn' " + customAttributes + "  data-toggle='modal' data-target='#transferClaimModal'><i class='fas fa-share-square'></i></button></td>";
				} else {
					return "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "'>--</td> "+
					       "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "'>--</td>";
				}

		}

	}
	createReasonButtonUI(rowValues, forLoopIndex){
	    var Td_class = rowValues.empId + "_" + rowValues.date;
		var customAttributes = "data-common-id='" + Td_class + "' data-index='" + forLoopIndex + "'";
		switch(currentLoopCondition){
		    case false:
		        return "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='reasonWritingBtn_" + Td_class + "' class='reasonPopupBtn' " + customAttributes + "><i class='fa fa-comment' style='color:var(--theme-color);font-size:20px' data-toggle='resonPopover' " + customAttributes + "></i></td>";
		    
		}
	}
	
	createRejectTabReasonButtonUI(rowValues, forLoopIndex){
	    var Td_class = rowValues.empId + "_" + rowValues.date;
		var customAttributes = "data-common-id='" + Td_class + "' data-index='" + forLoopIndex + "'";
		switch(currentLoopCondition){
		    case false:
		        if(rowValues.claimstatus == CLAIM_PERMANENT_TL_REJECT || rowValues.claimstatus == CLAIM_PERMANENT_FINANCE_REJECT){
		            return "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "'>--</td> ";
		        }else{      
		            return "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='reasonWritingBtn_" + Td_class + "' class='reasonPopupBtn' " + customAttributes + "><i class='fa fa-comment' style='color:var(--theme-color);font-size:20px' data-toggle='resonPopover' " + customAttributes + "></i></td>";
		       
		        }
		}
	}
	
	createNewTableDataFields_Finance_ReasonButtonUI(rowValues, forLoopIndex) {
		var Td_class = rowValues.empId + "_" + rowValues.date;
		var customAttributes = "data-common-id='" + Td_class + "' data-index='" + forLoopIndex + "'";
		switch (currentLoopCondition) {
			case false:
				if (rowValues.claimstatus == CLAIM_TL_APPROVED) {
					return "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='reasonWritingBtn_" + Td_class + "' class='reasonPopupBtn' " + customAttributes + "><i class='fa fa-comment' style='color:var(--theme-color);font-size:20px' data-toggle='resonPopover' " + customAttributes + "></i></td>";
				} else {
					return "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "'>--</td> "
				}
		}

	}


	createNewTableDataFields_RejectReasonAndDateAndRejectedByUI(rowValues, forLoopIndex) {
		var Td_class = rowValues.empId + "_" + rowValues.date;
		switch (currentLoopCondition) {
			case false:
				var RejectReasonAndDate = "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='reasonContent_" + Td_class + "' class='pl-2'>" + rowValues.rejectReason + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='tlOrFinanceRejectedDate_" + Td_class + "' class='pl-2'>" + rowValues.tlOrFinanceRejectedDate + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='claimStatusUpdatedBy_" + Td_class + "'>" + rowValues.claimStatusUpdatedBy + "</td>";

				return RejectReasonAndDate;
		}
	}

	createNewTableDataFields_FinanceDepartmentTLApprovedClaimsReport(rowValues, forLoopIndex) {
		var reportTd;
		switch (currentLoopCondition) {
			case false:
				if (rowValues.claimstatus == CLAIM_TL_APPROVED) {
					reportTd = this.TLApprove_ClaimsReportTableData(rowValues, forLoopIndex);
				} else {
					reportTd = "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' >--</td>";
				}
				return reportTd;
		}
	}
	createNewTableDataFieds_NewClaimsReportUi(rowValues, forLoopIndex) {
		var Td_class = rowValues.empId + "_" + rowValues.date;
		var customAttributes = "data-common-id='" + Td_class + "' data-index='" + forLoopIndex + "' data-claimStatus='"+rowValues.claimstatus+"'";
		var reportTd;
		switch (currentLoopCondition) {
			case false:
				if (rowValues.claimstatus == CLAIM_PENDING) {
				    if(rowValues.tlId==USER_EMPID){// logged in user(tl) id "USER_EMPID" in index.php
    					reportTd = "<td  rowspan='" + rowValues.siteOnOfTheDayVisitCount + "'>" +
    						"<form id='reportSubmittingForm" + Td_class + "' class='reportSubmittingForm mb-0' " + customAttributes + " style='width: 395px;'>" +
        						"<div class='approveBtnDiv form-check form-check-inline align-middle'>" +
            						"<input class='form-check-input approve selectAllApprove_radioBtn' type='radio' name='inlineRadioOptions'  id='approveRadioBtn_" + Td_class + "' required value='2' " + customAttributes + ">" +
            						"<label class='form-check-label' for='approveRadioBtn_" + Td_class + "' >APPROVE</label></div>" +
        						"<div class='rejectBtnDiv form-check form-check-inline align-middle'>" +
            						"<input class='form-check-input reject' type='radio'  name='inlineRadioOptions'  id='rejectRadioBtn_" + Td_class + "' value='3' " + customAttributes + ">" +
            						"<label class='form-check-label' for='rejectRadioBtn_" + Td_class + "' >REJECT</label></div>" +
                				"<div class='permanentRejectBtnDiv form-check form-check-inline align-middle'>" +
        					        "<input class='form-check-input permanentReject' type='radio'  name='inlineRadioOptions'  id='permanentRejectRadioBtn_" + Td_class + "' value='"+CLAIM_PERMANENT_TL_REJECT+"'  " + customAttributes + ">" +
        					        "<label class='form-check-label' for='permanentRejectRadioBtn_" + Td_class + "' data-toggle='tooltip' title='PERMANENT REJECT WILL NOT GET CLAIMED AGAIN BY EMPLOYEE'>PERMANENT REJECT</label></div>" +
        						"<button id='reportSubmissionBtn_" + Td_class + "' type='submit' class='btn btn-theme-type1 selectAll_reportSubmissionBtn' style='font-size:12px;'>Submit<i class='fa d-none fa-spinner fa-spin ml-2'></i></button>" +
        						"<p id='reasonPara_" + Td_class + "' class='reasonParaTag text-center font-weight-normal' name='rejectResonNm'></p>" +
    						"</form>" +
    						"</td>";
				    }else{
				      // alert(PENDING_AT_TL_CLAIMS_COUNT);
				        reportTd = "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "'>This claim transfered or submitted to "+rowValues.tlName+"("+rowValues.tlId+")</td>";
				    }
				      PENDING_AT_TL_CLAIMS_COUNT++;
				} else {
					reportTd = "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "'>--</td>";
				}
				return reportTd;
		}
	}

	createNewTableDataFields_PendingPaymentsClaimsReport(rowValues, forLoopIndex) {
		var Td_class = rowValues.empId + "_" + rowValues.date;
		var customAttributes = "data-common-id='" + Td_class + "' data-index='" + forLoopIndex + "'  data-claimStatus='"+rowValues.claimstatus+"'";
		switch (currentLoopCondition) {
			case false:
				var PendingPaymentClaimsReport = "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "'>" +
					"<form id='reportSubmittingForm" + Td_class + "' class='reportSubmittingForm mb-0 m-auto' " + customAttributes + "  style='width: 290px;'>" +
    					"<div class='paidBtnDiv form-check form-check-inline align-middle'>" +
        					"<input class='form-check-input paid selectAllApprove_radioBtn' type='radio'  name='inlineRadioOptions' id='paidRadioBtn_" + Td_class + "' required value='6'  " + customAttributes + ">" +
        					"<label class='form-check-label' for='paidRadioBtn_" + Td_class + "'>PAID</label></div>" +
    					"<div class='undoBtnDiv form-check form-check-inline align-middle'>" +
        					"<input class='form-check-input undo' type='radio'  name='inlineRadioOptions' id='undoRadioBtn_" + Td_class + "' required value='0'  " + customAttributes + ">" +
        					"<label class='form-check-label' for='undoRadioBtn_" + Td_class + "'>UNDO</label></div>" +
    					"<button id='reportSubmissionBtn_" + Td_class + "' type='submit' class='btn btn-theme-type1 selectAll_reportSubmissionBtn' style='font-size:12px;'>Submit<i class='fa d-none fa-spinner fa-spin ml-2'></i></button>" +
    					"<p id='reasonPara_" + Td_class + "' class='reasonParaTag text-center font-weight-normal mt-1' name='rejectResonNm' style='max-width: 290px;'></p>" +
					"</form>" +
					"</td>";
				return PendingPaymentClaimsReport;
		}
	}
	TLUndo_ClaimsReportTableData(rowValues, forLoopIndex){
	   	let Td_class = rowValues.empId + "_" + rowValues.date;
		let customAttributes = "data-common-id='" + Td_class + "' data-index='" + forLoopIndex + "'  data-claimStatus='"+rowValues.claimstatus+"'";
		switch (currentLoopCondition) {
	        case false:
	            var TLUndoClaimsReport ="<td rowspan='"+ rowValues.siteOnOfTheDayVisitCount+"'>"+
	                "<form id='reportSubmittingForm"+ Td_class+"' class='reportSubmittingForm mb-0 m-auto' "+ customAttributes +" style='width: 395px'>"+
	                  	"<div class='undoBtnDiv form-check form-check-inline align-middle'>" +
        					"<input class='form-check-input undo selectAllApprove_radioBtn' type='radio'  name='inlineRadioOptions' id='undoRadioBtn_" + Td_class + "' required value='0'  " + customAttributes + ">" +
        					"<label class='form-check-label' for='undoRadioBtn_" + Td_class + "' >UNDO</label></div>" +
        				"<div class='rejectBtnDiv form-check form-check-inline align-middle'>" +
					        "<input class='form-check-input reject' type='radio'  name='inlineRadioOptions'  id='financeRejectRadioBtn_" + Td_class + "' value='3'  " + customAttributes + ">" +
					        "<label class='form-check-label' for='financeRejectRadioBtn_" + Td_class + "' >REJECT</label></div>" +
                // 		"<div class='permanentRejectBtnDiv form-check form-check-inline align-middle'>" +
        				    // "<input class='form-check-input permanentReject' type='radio'  name='inlineRadioOptions'  id='permanentRejectRadioBtn_" + Td_class + "' value='"+CLAIM_PERMANENT_TL_REJECT+"'  " + customAttributes + ">" +
        				    // "<label class='form-check-label' for='permanentRejectRadioBtn_" + Td_class + "' data-toggle='tooltip' title='PERMANENT REJECT WILL NOT GET CLAIMED AGAIN BY EMPLOYEE'>PERMANENT REJECT</label></div>" +
	               	    "<button id='reportSubmissionBtn_" + Td_class + "' type='submit' class='btn btn-theme-type1 selectAll_reportSubmissionBtn' style='font-size:12px;'>Submit<i class='fa d-none fa-spinner fa-spin ml-2'></i></button>" +
    					"<p id='reasonPara_" + Td_class + "' class='reasonParaTag text-center font-weight-normal' name='rejectResonNm'></p>" +
					"</form>" +
	            "</td>";
	            return TLUndoClaimsReport;
	        
	    }
	}
	RejectTab_ClaimReportTableData(rowValues, forLoopIndex, permanentReject){
	   	let Td_class = rowValues.empId + "_" + rowValues.date;
		let customAttributes = "data-common-id='" + Td_class + "' data-index='" + forLoopIndex + "'  data-claimStatus='"+rowValues.claimstatus+"'";
		switch (currentLoopCondition) {
	        case false:
	          if(rowValues.claimstatus == CLAIM_PERMANENT_TL_REJECT || rowValues.claimstatus == CLAIM_PERMANENT_FINANCE_REJECT){
    	            var TLUndoRejectClaimsReport ="<td rowspan='"+ rowValues.siteOnOfTheDayVisitCount+"'>"+
    	                "<form id='reportSubmittingForm"+ Td_class+"' class='reportSubmittingForm mb-0 m-auto' "+ customAttributes +" style='width: 255px'>"+
    	                  	"<div class='undoBtnDiv form-check form-check-inline align-middle'>" +
            					"<input class='form-check-input undo selectAllApprove_radioBtn' type='radio'  name='inlineRadioOptions' id='undoRadioBtn_" + Td_class + "' required value='0'  " + customAttributes + ">" +
            					"<label class='form-check-label' for='undoRadioBtn_" + Td_class + "'  >UNDO</label></div>" +
    	               	    "<button id='reportSubmissionBtn_" + Td_class + "' type='submit' class='btn btn-theme-type1 selectAll_reportSubmissionBtn' style='font-size:12px;'>Submit<i class='fa d-none fa-spinner fa-spin ml-2'></i></button>" +
        					"<p id='reasonPara_" + Td_class + "' class='reasonParaTag text-center font-weight-normal' name='rejectResonNm'></p>" +
    					"</form>" +
    	            "</td>";
	            }else{// CLAIM_TL_REJECTED(Normal reject)  or CLAIM_FINANCE_REJECTED(Normal reject)
    	            var TLUndoRejectClaimsReport ="<td rowspan='"+ rowValues.siteOnOfTheDayVisitCount+"'>"+
    	                "<form id='reportSubmittingForm"+ Td_class+"' class='reportSubmittingForm mb-0 m-auto' "+ customAttributes +" style='width: 310px'>"+
    	                  	"<div class='undoBtnDiv form-check form-check-inline align-middle'>" +
            					"<input class='form-check-input undo selectAllApprove_radioBtn' type='radio'  name='inlineRadioOptions' id='undoRadioBtn_" + Td_class + "' required value='0'  " + customAttributes + ">" +
            					"<label class='form-check-label' for='undoRadioBtn_" + Td_class + "'  >UNDO</label></div>" +
            				"<div class='permanentRejectBtnDiv form-check form-check-inline align-middle'>" +
    					        "<input class='form-check-input permanentReject' type='radio'  name='inlineRadioOptions'  id='permanentRejectRadioBtn_" + Td_class + "' value='"+permanentReject+"'  " + customAttributes + ">" +
    					        "<label class='form-check-label' for='permanentRejectRadioBtn_" + Td_class + "'  data-toggle='tooltip' title='PERMANENT REJECT WILL NOT GET CLAIMED AGAIN BY EMPLOYEE'>PERMANENT REJECT</label></div>" +
    	               	    "<button id='reportSubmissionBtn_" + Td_class + "' type='submit' class='btn btn-theme-type1 selectAll_reportSubmissionBtn' style='font-size:12px;'>Submit<i class='fa d-none fa-spinner fa-spin ml-2'></i></button>" +
        					"<p id='reasonPara_" + Td_class + "' class='reasonParaTag text-center font-weight-normal' name='rejectResonNm'></p>" +
    					"</form>" +
    	            "</td>";
	            }
	            return TLUndoRejectClaimsReport;
	        
	    }
	}
	
	TLApprove_ClaimsReportTableData(rowValues, forLoopIndex) {
		var Td_class = rowValues.empId + "_" + rowValues.date;
		var customAttributes = "data-common-id='" + Td_class + "' data-index='" + forLoopIndex + "'  data-claimStatus='"+rowValues.claimstatus+"'";
		switch (currentLoopCondition) {
			case false:
				var TLApprovedClaimsReport = "<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "'>" +
					"<form id='reportSubmittingForm" + Td_class + "' class='reportSubmittingForm mb-0 m-auto' " + customAttributes + "  style='width: 395px;'>" +
    					"<div class='financeApprovedBtnDiv form-check form-check-inline align-middle'>" +
        					"<input class='form-check-input financeApproved selectAllApprove_radioBtn' type='radio'  name='inlineRadioOptions' id='financeApproveRadio_" + Td_class + "' required value='4'  " + customAttributes + ">" +
        					"<label class='form-check-label' for='financeApproveRadio_" + Td_class + "'  >APPROVE</label></div>" +
    					"<div class='rejectBtnDiv form-check form-check-inline align-middle'>" +
        					"<input class='form-check-input reject' type='radio'  name='inlineRadioOptions'  id='financeRejectRadioBtn_" + Td_class + "' value='5'  " + customAttributes + ">" +
        					"<label class='form-check-label' for='financeRejectRadioBtn_" + Td_class + "'  >REJECT</label></div>" +
                    	"<div class='permanentRejectBtnDiv form-check form-check-inline align-middle'>" +
            			    "<input class='form-check-input permanentReject' type='radio'  name='inlineRadioOptions'  id='permanentRejectRadioBtn_" + Td_class + "' value='"+CLAIM_PERMANENT_FINANCE_REJECT+"'  " + customAttributes + ">" +
            			    "<label class='form-check-label' for='permanentRejectRadioBtn_" + Td_class + "' data-toggle='tooltip' title='PERMANENT REJECT WILL NOT GET CLAIMED AGAIN BY EMPLOYEE'>PERMANENT REJECT</label></div>" +
    					"<button id='reportSubmissionBtn_" + Td_class + "' type='submit' class='btn btn-theme-type1 selectAll_reportSubmissionBtn' style='font-size:12px;'>Submit<i class='fa d-none fa-spinner fa-spin ml-2'></i></button>" +
    					"<p id='reasonPara_" + Td_class + "' class='reasonParaTag text-center font-weight-normal' name='rejectResonNm'></p>" +
					"</form>" +
					"</td>";

				return TLApprovedClaimsReport;
		}
	}

	createNewTabDateFields_CompletePaymentRelatedUi(rowValues, forLoopIndex) {
		var Td_class = rowValues.empId + "_" + rowValues.date;
		switch (currentLoopCondition) {
			case false:
				return "<td  rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='paidTotal_" + Td_class + "'>" + rowValues.financeTotalAmount + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='paidDate_" + Td_class + "'>" + rowValues.paidDate + "</td>" +
					"<td rowspan='" + rowValues.siteOnOfTheDayVisitCount + "' id='paidByTd_" + Td_class + "'>" + rowValues.paidBy + "</td>";
		}
	}


	createNewTableDataFields_ImageBillsTableRow(rowValues, forLoopIndex) {
		var Td_class = rowValues.empId + "_" + rowValues.date;
		return "<tr class='image-content_" + Td_class + "'>" + //empty row for every table-row to store bill-image-proofs
			"<td class='imageBillsDropDownTableRow' colspan='53' style='padding:0; border:0'>" +
			"<div id='imageBillsContainerDiv_" + Td_class + "' class='d-flex float-right' style='width:100vw;'>" +//style='width:100vw;display: -webkit-box;display: ruby;'
			"</div>" +
			"</td>" +
			"</tr>";
	}



// 	getSelectDropDownList(keyValue, selectedValue, className, Td_id, customAttributes) {

// 		//console.log("keyValue" + keyValue + "className" + className);
// 		let dropDownListArray = getStageOfAuditdropDown(); //   js/dynamicDropdown_of_project_&_stageOfAudit.js file -> class object;

// 		let select_starting_tag = "<select id='" + Td_id + "' class='form-control select " + className + "' " + customAttributes + ">";
// 		let select_ending_tag = "</select>";
// 		let optionTag = "";
// 		let conditionReference = false;
// 		if (keyValue == projectList_KeyValue_In_Json) {// comparing global variable
// 			conditionReference = dropDownListArray.hasOwnProperty(selectedValue);// checking key value in array
// 		} else {
// 			conditionReference = dropDownListArray.hasOwnProperty(keyValue);// checking key value in array
// 		}

// 		if (conditionReference) {
// 			let projectsList = dropDownListArray[keyValue];



// 			for (let index = 0; index < projectsList.length; index++) {
// 				if (projectsList[index] == selectedValue) {
// 					optionTag += "<option value='" + projectsList[index] + "' selected>" + projectsList[index] + "</option>";
// 				} else {
// 					optionTag += "<option value='" + projectsList[index] + "'>" + projectsList[index] + "</option>";
// 				}
// 			}
// 			//console.log("reference_id" + reference_id + "------------" + select_starting_tag + optionTag + select_ending_tag);
// 			return select_starting_tag + optionTag + select_ending_tag;
// 		} else {
// 			return "<select class='d-none "+className+"'><option value='' selected ></option></select>";
// 		}

// 	}
// 	displayNoneClass(stageOfaudit) {
// 		var className = ' d-none ';
// 		//alert(stageOfaudit);
// 		if (stageOfaudit === "REVISIT") {
// 			className = '';
// 		}
// 		return className;
// 	}

    // TL Deparmnt Tab related Table UI
	Tab_NewClaimsRelatedUI(rowValues, forLoopIndex, map) {
		var newClaimTabRelatedUI = this.createNewTableRowStart(rowValues) + this.TL_createNewTableDataFields_CommonUI(rowValues, forLoopIndex) +
			this.createNewTableDataFields_TLEditableFields(rowValues, forLoopIndex, map) + this.createNewTableDataFields_ImageButtonUI(rowValues, forLoopIndex) +
			this.createNewTableDataFields_TL_ReasonButton_AND_transferClaim_UI(rowValues, forLoopIndex) + this.createNewTableDataFieds_NewClaimsReportUi(rowValues, forLoopIndex) +
			this.createNewTableRowClose(rowValues, forLoopIndex);
        return newClaimTabRelatedUI;
	}
	
	Tab_TLDepartmentApprovedRelatedUI(rowValues, forLoopIndex) {
		var ApprovedTabRelatedUI = this.createNewTableRowStart(rowValues) + this.TL_createNewTableDataFields_CommonUI(rowValues, forLoopIndex) + this.createNewTableDataFields_TLNonEditableFields(rowValues) +
			this.createNewTableDataFields_ImageButtonUI(rowValues, forLoopIndex) + this.createReasonButtonUI(rowValues, forLoopIndex) + this.TLUndo_ClaimsReportTableData(rowValues, forLoopIndex)+ this.createNewTableRowClose(rowValues, forLoopIndex);
        return ApprovedTabRelatedUI;
	}
	
	Tab_TLDepartmentRejectTabRelatedUI(rowValues, forLoopIndex) {
		var rejectTabRelatedUI = this.createNewTableRowStart(rowValues) + this.TL_createNewTableDataFields_CommonUI(rowValues, forLoopIndex) + this.createNewTableDataFields_TLNonEditableFields(rowValues) +
			this.createNewTableDataFields_FinanceNonEditableFields(rowValues, forLoopIndex) + this.createNewTableDataFields_ImageButtonUI(rowValues, forLoopIndex) + this.createNewTableDataFields_RejectReasonAndDateAndRejectedByUI(rowValues, forLoopIndex) +
			this.createRejectTabReasonButtonUI(rowValues, forLoopIndex) + this.RejectTab_ClaimReportTableData(rowValues, forLoopIndex, CLAIM_PERMANENT_TL_REJECT)+this.createNewTableRowClose(rowValues, forLoopIndex);
    	return rejectTabRelatedUI;
	}
	
	Tab_TLDepartmentFinanceApprovedRelatedUI(rowValues, forLoopIndex) {
        var completedPaymentRelatedUI = this.createNewTableRowStart(rowValues) + this.TL_createNewTableDataFields_CommonUI(rowValues, forLoopIndex) + this.createNewTableDataFields_TLNonEditableFields(rowValues) +
    			this.createNewTableDataFields_FinanceNonEditableFields(rowValues, forLoopIndex) + this.createNewTableDataFields_ImageButtonUI(rowValues, forLoopIndex) + this.createNewTableDataFields_TotalDeductedAmountUI(rowValues) +
    			this.createNewTabDateFields_CompletePaymentRelatedUi(rowValues, forLoopIndex) + this.createNewTableRowClose(rowValues, forLoopIndex);
        return completedPaymentRelatedUI;
	}
    //---------------------------------------------------
    
    // Finance Deparmnt  Tab related Table UI
	Tab_FinanceDepartmentTLApprovedRelatedUI(rowValues, forLoopIndex, map) { // All claims
		var financeApprovedTabRelatedUI = this.createNewTableRowStart(rowValues) + this.finance_createNewTableDataFields_CommonUI(rowValues, forLoopIndex) +
			this.createNewTableDataFields_TLNonEditableFields(rowValues) + this.createNewTableDataFields_FinanceEditableFields(rowValues, forLoopIndex, map) +
			this.createNewTableDataFields_ImageButtonUI(rowValues, forLoopIndex) + this.createNewTableDataFields_Finance_ReasonButtonUI(rowValues, forLoopIndex) +
			this.createNewTableDataFields_FinanceDepartmentTLApprovedClaimsReport(rowValues, forLoopIndex) + this.createNewTableRowClose(rowValues, forLoopIndex);
        return financeApprovedTabRelatedUI;
	}
	
	Tab_PendingPaymentsRelatedUi(rowValues, forLoopIndex) {
		var pendingPaymentRelatedUI = this.createNewTableRowStart(rowValues) + this.finance_createNewTableDataFields_CommonUI(rowValues, forLoopIndex) + this.createNewTableDataFields_TLNonEditableFields(rowValues) +
			this.createNewTableDataFields_FinanceNonEditableFields(rowValues, forLoopIndex) + this.createNewTableDataFields_ImageButtonUI(rowValues, forLoopIndex) + this.createNewTableDataFields_TotalDeductedAmountUI(rowValues) +
			this.createNewTableDataFields_PendingPaymentsClaimsReport(rowValues, forLoopIndex) + this.createNewTableRowClose(rowValues, forLoopIndex);
        return pendingPaymentRelatedUI;
	}

    Tab_FinanceDepartmentRejectTabRelatedUI(rowValues, forLoopIndex) {
		var rejectTabRelatedUI = this.createNewTableRowStart(rowValues) + this.finance_createNewTableDataFields_CommonUI(rowValues, forLoopIndex) + this.createNewTableDataFields_TLNonEditableFields(rowValues) +
			this.createNewTableDataFields_FinanceNonEditableFields(rowValues, forLoopIndex) + this.createNewTableDataFields_ImageButtonUI(rowValues, forLoopIndex) + this.createNewTableDataFields_RejectReasonAndDateAndRejectedByUI(rowValues, forLoopIndex) +
			this.createRejectTabReasonButtonUI(rowValues, forLoopIndex) + this.RejectTab_ClaimReportTableData(rowValues, forLoopIndex,CLAIM_PERMANENT_FINANCE_REJECT)+this.createNewTableRowClose(rowValues, forLoopIndex);
    	return rejectTabRelatedUI;
	}

	Tab_CompletedPaymentsRelatedUi(rowValues, forLoopIndex) {
		var completedPaymentRelatedUI = this.createNewTableRowStart(rowValues) + this.finance_createNewTableDataFields_CommonUI(rowValues, forLoopIndex) + this.createNewTableDataFields_TLNonEditableFields(rowValues) +
			this.createNewTableDataFields_FinanceNonEditableFields(rowValues, forLoopIndex) + this.createNewTableDataFields_ImageButtonUI(rowValues, forLoopIndex) + this.createNewTableDataFields_TotalDeductedAmountUI(rowValues) +
			this.createNewTabDateFields_CompletePaymentRelatedUi(rowValues, forLoopIndex) + this.createNewTableRowClose(rowValues, forLoopIndex);
        return completedPaymentRelatedUI;
	}
//--------------------------------

}






// ;;