This commit is contained in:
2023-03-11 17:30:20 +00:00
commit b6c4e025bc
5124 changed files with 1153349 additions and 0 deletions
@@ -0,0 +1,309 @@
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Hrms;
(function (Hrms) {
let Components;
(function (Components) {
class AttendanceRequest extends Unibase.Platform.Core.BaseComponent {
init(formpropertyid, prop, callback) {
}
loadControl(containerid, prop) {
let html = '';
html = `<div class="card attendace_card_view d-none"><div class="card-header d-sm-block d-none"><div class="row text-dark"><div class="col-11"><div class="row"><div class="col-sm-2"></div><div class="col-sm-5"><div class="row"><div class="col-6">Check-in <span class="text-dark">*</span></div><div class="col-6">Check-out <span class="text-dark">*</span></div></div></div><div class="col-sm-2">Total Hours</div><div class="col-sm-3">Description</div></div></div><div class="col-1"></div></div></div><div class="card-body"><ul class="attendance_list"></ul><input type="hidden" id = "hdn_AttendanceRequestControl" class="value-control" value = "Bizgaze.Apps.Hrms.Components.AttendanceRequest.Instance().Attendancerequestobj();" ></div></div>`;
$('#' + containerid).html(html);
}
loadControlSettings(controlsettingjson, formpropertyid) {
return null;
}
loadPropertySettings(propertysettings, formpropertyid, DocPropertyName) {
return null;
}
bindEditFormDetails(formpropertyid, propval, DocPropertyName) {
var id = propval;
let html = `<div class="row text-dark"><div class="col-sm-2"></div><div class="col-sm-5"><div class="row"><div class="col-6">Check-in <span class="text-dark">*</span></div><div class="col-6">Check-out <span class="text-dark">*</span></div></div></div><div class="col-sm-2">Total Hours</div><div class="col-sm-3">Description</div></div>;`;
return html;
}
getEmployeeCheckinAndCheckout(employeeid, fromdate, todate) {
debugger;
var fdate = moment(fromdate.replaceAll("/", "-"), "DD-MM-YYYY").format("YYYY-MM-DD");
var tdate = moment(todate.replaceAll("/", "-"), "DD-MM-YYYY").format("YYYY-MM-DD");
if (tdate < fdate) {
MessageHelper.Instance().showError("Todate cannot be lesser than Fromdate", 'div_ErrorMessage_' + $('#' + Unibase.Platform.Helpers.NavigationHelper.Instance().getLastContainerId()).find('#hf_FormId').val());
}
let Todatehf = moment(todate, "DD/MM/YYYY").format("YYYY/MM/DD");
let Fromdatehf = moment(fromdate, "DD/MM/YYYY").format("YYYY/MM/DD");
$(".hfdate_fromdate").val(Fromdatehf);
$(".hfdate_todate").val(Todatehf);
$(".attendace_card_view").removeClass("d-none");
if ($("#div_FormName").text() == "Create Regularization") {
this.fileCacheHelper.loadJsFile("apps/hrms/managers/attendencemanager.js", function () {
Bizgaze.Apps.Hrms.Managers.AttendenceManager.Instance().getEmployeeCheckinAndCheckout(employeeid, fdate, tdate).then(function (response) {
$('.attendance_list').html('');
const datestotal = [];
function getDates(startDate, endDate) {
const dates = [];
let currentDate = startDate;
const addDays = function (days) {
const date = new Date(this.valueOf());
date.setDate(date.getDate() + days);
return date;
};
while (currentDate <= endDate) {
dates.push(currentDate);
currentDate = addDays.call(currentDate, 1);
}
return dates;
}
let totaldates, html_content = '';
const dates = getDates(new Date(fdate), new Date(tdate));
dates.forEach(function (date) {
datestotal.push(date);
});
totaldates = datestotal;
for (let j = 0; j < totaldates.length; j++) {
let selecteddates = totaldates[j];
let datesbetween = moment(selecteddates).format("YYYY-MM-DD");
let displaydate = moment(selecteddates).format('llll');
displaydate = displaydate.substring(0, 17);
html_content = `<li class="row align-items-center text-dark py-2 border-bottom datesbetween" id='` + datesbetween + `'>
<div class="col-sm-11 col-11"><div class="row">
<div class="col-sm-2 text-left px-1">
<div class="date font-weight-500">` + displaydate + `</div>
</div> <div class="row"> <div class="col-3 hf_date">
<input type ="hidden" class="hf_date" id = "hf_date" value=` + datesbetween + `></div></div>
<div class="row"> <div class="col-3 hf_attendanceid">
<input type ="hidden" class="hf_attendanceid" id = "hf_attendanceid" value="0"></div></div>
<div class="row"> <div class="col-3 hf_regularizationapprovalid">
<input type ="hidden" class="hf_regularizationapprovalid" id = "hf_regularizationapprovalid" value="0"></div></div>
<div class="col-sm-5">
<div class="row">
<div class="col-6 check_in"><input type="time" id="Check_in" class="Check_in_btn form-control datepicker-input hasDatepicker floating-label-control date_startdate hello" ></div>
<div class="col-6 check_out"><input type="time" id="Check_out" class="Check_out_btn form-control type-control datepicker-input hasDatepicker floating-label-control date_startdate" ></div>
</div>
</div>
<div class="col-sm-2 totaltime">00:00</div>
<div class="col-sm-3 txt_Description">
<input type ="text" class="form-control floating-label-control txt_Description" id="txt_Description" data-isdynamic="false" placeholder="Enter Description" data-placeholder="Description" data-label="Description" >
</div>
</div>
</div>
<div class="col-1 col-sm-1 text-right">
<input type="checkbox" id="txt_checkbox" class="floating-label-control txt_checkbox hidden"></div>
</li>`;
$('.attendance_list').append(html_content);
}
if (response.result.length > 0) {
for (var i = 0; i < response.result.length; i++) {
var data = response.result[i];
let attendanceid = data.AttendanceId, date = data, checkindate = Unibase.Platform.Helpers.DateTimeHelper.instance.formatLocalDateTime(data.CheckIn), checkindate_format = moment(data.Date).format("YYYY-MM-DD"), checkoutdate = Unibase.Platform.Helpers.DateTimeHelper.instance.formatLocalDateTime(data.CheckOut), totaltime = data.TotalMinutes, description = data.Description;
let attendeddate = checkindate.substring(0, 10);
if (checkindate.length != 0) {
let ckeckintime = checkindate.substring(11, 16);
let checkindates = moment(ckeckintime, 'HHmm').format("HH:mm");
$("#" + checkindate_format).find(".check_in").html(`<input type="time" id="Check_in" class="Check_in_btn form-control datepicker-input hasDatepicker" value=` + checkindates + ` >`);
}
if (checkoutdate > checkindate) {
if (checkoutdate.length != 0) {
let ckeckouttime = checkoutdate.substring(11, 16);
let checkoutdates = moment(ckeckouttime, 'HHmm').format("HH:mm");
$("#" + checkindate_format).find(".check_out").html(`<input type="time" id="Check_out" class="Check_out_btn form-control datepicker-input hasDatepicker " value=` + checkoutdates + ` >`);
}
}
if (description != null && description != "") {
$("#" + checkindate_format).find(".txt_Description").html(`<input type="text" id="txt_Description" class="form-control" value=` + description + ` >`);
}
if (totaltime != 0) {
var m = totaltime % 60;
var h = (totaltime - m) / 60;
var HHMM = (h < 10 ? "0" : "") + h.toString() + ":" + (m < 10 ? "0" : "") + m.toString();
$("#" + checkindate_format).find(".totaltime").html(HHMM);
}
if (attendanceid != 0) {
$("#" + checkindate_format).find(".hf_attendanceid").html(`<input type ="hidden" id="hf_attendanceid" class="form-control" value=` + attendanceid + ` >`);
}
}
}
$(".Check_out_btn,.Check_in_btn").change(function () {
debugger;
var checkin = $(this).parents(".datesbetween").find("#Check_in").val();
var checkout = $(this).parents(".datesbetween").find("#Check_out").val();
var start = new Date("01/01/2007 " + checkin).getTime();
var end = new Date("01/01/2007 " + checkout).getTime();
let difference = Math.abs(end - start);
difference = difference / 1000;
let hourDifference = Math.floor(difference / 3600);
difference -= hourDifference * 3600;
let minuteDifference = Math.floor(difference / 60);
difference -= minuteDifference * 60;
var value = (hourDifference < 10 ? "0" : "") + hourDifference.toString() + ":" + (minuteDifference < 10 ? "0" : "") + minuteDifference.toString();
$(this).parents(".datesbetween").find(".totaltime").html(value);
});
});
});
}
else {
this.fileCacheHelper.loadJsFile("apps/hrms/managers/attendencemanager.js", function () {
Bizgaze.Apps.Hrms.Managers.AttendenceManager.Instance().getRegularizationCheckinAndCheckout(employeeid, fdate, tdate).then(function (response) {
$('.attendance_list').html('');
const datestotal = [];
function getDates(startDate, endDate) {
const dates = [];
let currentDate = startDate;
const addDays = function (days) {
const date = new Date(this.valueOf());
date.setDate(date.getDate() + days);
return date;
};
while (currentDate <= endDate) {
dates.push(currentDate);
currentDate = addDays.call(currentDate, 1);
}
return dates;
}
let totaldates, html_content = '';
const dates = getDates(new Date(fdate), new Date(tdate));
dates.forEach(function (date) {
datestotal.push(date);
});
totaldates = datestotal;
for (let j = 0; j < totaldates.length; j++) {
let selecteddates = totaldates[j];
let datesbetween = moment(selecteddates).format("YYYY-MM-DD");
let displaydate = moment(selecteddates).format('llll');
displaydate = displaydate.substring(0, 17);
html_content = `<li class="row align-items-center text-dark py-2 border-bottom datesbetween" id='` + datesbetween + `'>
<div class="col-sm-11 col-11"><div class="row">
<div class="col-sm-2 text-left px-1">
<div class="date font-weight-500">` + displaydate + `</div>
</div> <div class="row"> <div class="col-3 hf_date">
<input type ="hidden" class="hf_date" id = "hf_date" value=` + datesbetween + `></div></div>
<div class="row"> <div class="col-3 hf_attendanceid">
<input type ="hidden" class="hf_attendanceid" id = "hf_attendanceid" value="0"></div></div>
<div class="row"> <div class="col-3 hf_regularizationapprovalid">
<input type ="hidden" class="hf_regularizationapprovalid" id = "hf_regularizationapprovalid" value="0"></div></div>
<div class="col-sm-5">
<div class="row">
<div class="col-6 check_in"><input type="time" id="Check_in" class="Check_in_btn form-control datepicker-input hasDatepicker floating-label-control date_startdate hello" ></div>
<div class="col-6 check_out"><input type="time" id="Check_out" class="Check_out_btn form-control type-control datepicker-input hasDatepicker floating-label-control date_startdate" ></div>
</div>
</div>
<div class="col-sm-2 totaltime">00:00</div>
<div class="col-sm-3 txt_Description">
<input type ="text" class="form-control floating-label-control txt_Description" id="txt_Description" data-isdynamic="false" placeholder="Enter Description" data-placeholder="Description" data-label="Description" >
</div>
</div>
</div>
<div class="col-1 col-sm-1 text-right">
<input type="checkbox" id="txt_checkbox" class="floating-label-control txt_checkbox hidden"></div>
</li>`;
$('.attendance_list').append(html_content);
}
if (response.result.length > 0) {
debugger;
for (var i = 0; i < response.result.length; i++) {
var data = response.result[i];
let attendanceid = data.attendanceid, regularizationapprovalid = data.regularizationapprovalid, date = data, checkindate = Unibase.Platform.Helpers.DateTimeHelper.instance.formatLocalDateTime(data.checkin), checkindate_format = moment(data.date).format("YYYY-MM-DD"), checkoutdate = Unibase.Platform.Helpers.DateTimeHelper.instance.formatLocalDateTime(data.checkout), totaltime = data.totalminutes, description = data.description;
let attendeddate = checkindate.substring(0, 10);
if (checkindate.length != 0) {
let ckeckintime = checkindate.substring(11, 16);
let checkindates = moment(ckeckintime, 'HHmm').format("HH:mm");
$("#" + checkindate_format).find(".check_in").html(`<input type="time" id="Check_in" class="Check_in_btn form-control datepicker-input hasDatepicker" value=` + checkindates + ` >`);
}
if (checkoutdate.length != 0) {
let ckeckouttime = checkoutdate.substring(11, 16);
let checkoutdates = moment(ckeckouttime, 'HHmm').format("HH:mm");
$("#" + checkindate_format).find(".check_out").html(`<input type="time" id="Check_out" class="Check_out_btn form-control datepicker-input hasDatepicker " value=` + checkoutdates + ` >`);
}
if (description != null && description != "") {
$("#" + checkindate_format).find(".txt_Description").html(`<input type="text" id="txt_Description" class="form-control" value=` + description + ` >`);
}
if (totaltime != 0) {
var m = totaltime % 60;
var h = (totaltime - m) / 60;
var HHMM = (h < 10 ? "0" : "") + h.toString() + ":" + (m < 10 ? "0" : "") + m.toString();
$("#" + checkindate_format).find(".totaltime").html(HHMM);
}
if (attendanceid != 0) {
$("#" + checkindate_format).find(".hf_attendanceid").html(`<input type ="hidden" id="hf_attendanceid" class="form-control" value=` + attendanceid + ` >`);
}
if (regularizationapprovalid != 0) {
$("#" + checkindate_format).find(".hf_regularizationapprovalid").html(`<input type ="hidden" id="hf_regularizationapprovalid" class="form-control" value=` + regularizationapprovalid + ` >`);
}
}
}
$(".Check_out_btn ,.Check_in_btn").change(function () {
debugger;
var checkin = $(this).parents(".datesbetween").find("#Check_in").val();
var checkout = $(this).parents(".datesbetween").find("#Check_out").val();
var start = new Date("01/01/2007 " + checkin).getTime();
var end = new Date("01/01/2007 " + checkout).getTime();
let difference = Math.abs(end - start);
difference = difference / 1000;
let hourDifference = Math.floor(difference / 3600);
difference -= hourDifference * 3600;
let minuteDifference = Math.floor(difference / 60);
difference -= minuteDifference * 60;
var value = (hourDifference < 10 ? "0" : "") + hourDifference.toString() + ":" + (minuteDifference < 10 ? "0" : "") + minuteDifference.toString();
$(this).parents(".datesbetween").find(".totaltime").html(value);
});
if ($("#div_FormName").text() == "Regularization_ApprovedForm") {
$(".txt_checkbox").removeClass("hidden");
$(".Check_out_btn").attr("disabled", "disabled");
$(".Check_in_btn").attr("disabled", "disabled");
$(".dropdown_periodtypeid").attr("disabled", "disabled");
$(".txtAutoComplete_employeeid").attr("disabled", "disabled");
$(".date_fromdate").attr("disabled", "disabled");
$(".date_todate").attr("disabled", "disabled");
$(".calender_fromdate").addClass("hidden");
$(".calender_todate").addClass("hidden");
}
});
});
}
}
Attendancerequestobj() {
debugger;
var attendanceRequest = new Array();
$('.datesbetween').each(function (index) {
var element = $(this);
var date_nontz = element.find("#hf_date").val();
var date_withtz = new Date(date_nontz.toString());
var isApproved = $(this).find('.txt_checkbox').is(':checked');
attendanceRequest.push({
Date: date_withtz,
Description: element.find('#txt_Description').val(),
CheckIn: element.find('#Check_in').val(),
CheckOut: element.find('#Check_out').val(),
AttendanceId: Number(element.find('#hf_attendanceid').val()),
RegularizationapprovalId: Number(element.find('#hf_regularizationapprovalid').val()),
IsApproved: isApproved,
});
});
return attendanceRequest;
}
regularizationapprove() {
let detailContainer = $("._bizgaze_detail_container:visible");
let refstatusId = (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.filter(function (o) {
return o.Key === "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_refstatusid";
})[0].Value);
$(detailContainer).find('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_Approve').addClass('hidden');
if (refstatusId != '3' && refstatusId != '5') {
$(detailContainer).find('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_Approve').removeClass('hidden');
}
}
static Instance() {
if (this.instance === undefined) {
this.instance = new AttendanceRequest();
}
return this.instance;
}
}
Components.AttendanceRequest = AttendanceRequest;
})(Components = Hrms.Components || (Hrms.Components = {}));
})(Hrms = Apps.Hrms || (Apps.Hrms = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
File diff suppressed because one or more lines are too long
@@ -0,0 +1,40 @@
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Hrms;
(function (Hrms) {
let Components;
(function (Components) {
class AttendanceRequest_Settings {
loadControlPropertiesHtml(controlpropList, container) {
return ``;
}
bindPropertySettings(prop) {
var propertySettings = prop.PropertySettings;
return "";
}
savePropertySettings(prop) {
var propertySettings = prop.PropertySettings;
return "";
}
loadSettingHtml() {
return null;
}
bindControlData(controldatajson) {
return null;
}
SaveControlData(controldatajson) {
return controldatajson;
}
static Instance() {
if (this._instance === undefined)
this._instance = new AttendanceRequest_Settings();
return this._instance;
}
}
Components.AttendanceRequest_Settings = AttendanceRequest_Settings;
})(Components = Hrms.Components || (Hrms.Components = {}));
})(Hrms = Apps.Hrms || (Apps.Hrms = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
@@ -0,0 +1 @@
{"version":3,"file":"attendancerequest.settings.js","sourceRoot":"","sources":["attendancerequest.settings.ts"],"names":[],"mappings":"AAAA,IAAU,OAAO,CAsChB;AAtCD,WAAU,OAAO;IACb,IAAiB,IAAI,CAoCpB;IApCD,WAAiB,IAAI;QACjB,IAAiB,IAAI,CAkCpB;QAlCD,WAAiB,IAAI;YACjB,IAAiB,UAAU,CAgC1B;YAhCD,WAAiB,UAAU;gBACvB,MAAa,0BAA0B;oBACnC,yBAAyB,CAAC,eAAsC,EAAE,SAAS;wBAEvE,OAAO,EAAE,CAAC;oBAEd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,eAAe;wBACX,OAAO,IAAI,CAAC;oBAChB,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,IAAI,CAAC;oBAChB,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,eAAe,CAAC;oBAC3B,CAAC;oBAGD,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;4BAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,0BAA0B,EAAE,CAAC;wBACtD,OAAO,IAAI,CAAC,SAAS,CAAC;oBAC1B,CAAC;iBACJ;gBA9BY,qCAA0B,6BA8BtC,CAAA;YACL,CAAC,EAhCgB,UAAU,GAAV,eAAU,KAAV,eAAU,QAgC1B;QACL,CAAC,EAlCgB,IAAI,GAAJ,SAAI,KAAJ,SAAI,QAkCpB;IACL,CAAC,EApCgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAoCpB;AACL,CAAC,EAtCS,OAAO,KAAP,OAAO,QAsChB"}
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,40 @@
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Hrms;
(function (Hrms) {
let Controls;
(function (Controls) {
class EmployeeLeaves_Settings {
loadControlPropertiesHtml(controlpropList, container) {
return ``;
}
bindPropertySettings(prop) {
var propertySettings = prop.PropertySettings;
return "";
}
savePropertySettings(prop) {
var propertySettings = prop.PropertySettings;
return "";
}
loadSettingHtml() {
return null;
}
bindControlData(controldatajson) {
return null;
}
SaveControlData(controldatajson) {
return controldatajson;
}
static Instance() {
if (this._instance === undefined)
this._instance = new EmployeeLeaves_Settings();
return this._instance;
}
}
Controls.EmployeeLeaves_Settings = EmployeeLeaves_Settings;
})(Controls = Hrms.Controls || (Hrms.Controls = {}));
})(Hrms = Apps.Hrms || (Apps.Hrms = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
@@ -0,0 +1 @@
{"version":3,"file":"employeeleave.settings.js","sourceRoot":"","sources":["employeeleave.settings.ts"],"names":[],"mappings":"AACA,IAAU,OAAO,CAsChB;AAtCD,WAAU,OAAO;IACb,IAAiB,IAAI,CAoCpB;IApCD,WAAiB,IAAI;QACjB,IAAiB,IAAI,CAkCpB;QAlCD,WAAiB,IAAI;YACjB,IAAiB,QAAQ,CAgCxB;YAhCD,WAAiB,QAAQ;gBACrB,MAAa,uBAAuB;oBAChC,yBAAyB,CAAC,eAAsC,EAAE,SAAS;wBAEvE,OAAO,EAAE,CAAC;oBAEd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,eAAe;wBACX,OAAO,IAAI,CAAC;oBAChB,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,IAAI,CAAC;oBAChB,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,eAAe,CAAC;oBAC3B,CAAC;oBAGD,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;4BAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,uBAAuB,EAAE,CAAC;wBACnD,OAAO,IAAI,CAAC,SAAS,CAAC;oBAC1B,CAAC;iBACJ;gBA9BY,gCAAuB,0BA8BnC,CAAA;YACL,CAAC,EAhCgB,QAAQ,GAAR,aAAQ,KAAR,aAAQ,QAgCxB;QACL,CAAC,EAlCgB,IAAI,GAAJ,SAAI,KAAJ,SAAI,QAkCpB;IACL,CAAC,EApCgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAoCpB;AACL,CAAC,EAtCS,OAAO,KAAP,OAAO,QAsChB"}
@@ -0,0 +1,144 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Hrms;
(function (Hrms) {
let Controls;
(function (Controls) {
class EmployeeLeaves extends Unibase.Platform.Core.BaseComponent {
constructor() {
super(...arguments);
this.availablebalance = 0;
this.currentlybooked = "0";
this.balanceleaves = 0;
this.employeeid = 0;
this.leavetypeid = 0;
this.containerid = "";
this.currentlybookedcount = 0;
this.leavepolicyid = 0;
}
init(formpropertyid, prop, callback) {
let instance = this;
if (this.employeeid == 0 && this.leavetypeid == 0) {
this.availablebalance = 0;
this.currentlybooked = "0";
this.currentlybookedcount = 0;
this.balanceleaves = 0;
this.leavepolicyid = 0;
instance.loadControl(instance.containerid, null);
}
if (callback != null)
callback();
}
loadControl(containerid, prop) {
let instance = this;
instance.todate1 = moment(new Date($.now())).format("DD/MM/YYYY");
instance.yearlastdate = new Date(new Date().getFullYear(), 11, 31);
instance.yearlastdate = moment(instance.yearlastdate).format("DD/MM/YYYY");
instance.containerid = containerid;
var html = `<table class="table"><thead><tr><div class="todate-date d-flex align-items-center"><th scope ="col">AS of ${instance.todate1}</th><th scope ="col">Day(s)</th></tr></thead></div><thead><tr><div class="dayscount-date d-flex align-items-center"><th scope ="col">Available Balance:</th><th scope ="col" id="availble">${instance.availablebalance}</th> </tr></thead></div><thead><tr><div class="totaldays-date d-flex align-items-center"><th scope ="col">Currently Booked:</th><th scope ="col">${instance.currentlybooked}</th></tr></thead></div><thead><tr><div class="total-date d-flex align-items-center"><th scope ="col">Balance After Booked Leave:</th><th scope ="col">${instance.balanceleaves}</th></tr></thead></div></table>
<input type="hidden" id="hdn_employeeleavescountcontrol" class="value-control" value="Bizgaze.Apps.Hrms.Controls.EmployeeLeaves.Instance().employeeleavesControlObj();">`;
$("#" + containerid).html(html);
}
getEmployeeAvailableLeaves(employeeid, leavetypeid) {
let instance = this;
instance.fileCacheHelper.loadJsFile("apps/hrms/managers/leavemanager.js", function () {
Bizgaze.Apps.Hrms.Managers.LeaveManager.Instance().getleavescountData(Number(employeeid), Number(leavetypeid)).then(function (response) {
if (response.result.length > 0) {
var data = response.result;
instance.leavepolicyid = data[0].leavepolicyid;
instance.availablebalance = data[0].availableleaves;
Bizgaze.Apps.Hrms.Controls.EmployeeLeaves.Instance().getCurrentlyBookedLeaves();
instance.loadControl(instance.containerid, null);
}
});
});
}
getCurrentlyBookedLeaves() {
let instance = this;
let fromdate = $(".hfdate_fromdate").val();
let todate = $(".hfdate_todate").val();
var firstDate = moment(fromdate);
var secondDate = moment(todate);
var leavefromdate = moment(fromdate).format("YYYY-MM-DD");
var leavetodate = moment(todate).format("YYYY-MM-DD");
var diffInDays = Math.abs(firstDate.diff(secondDate, 'days'));
instance.fileCacheHelper.loadJsFile("apps/hrms/managers/holidaymanager.js", function () {
Bizgaze.Apps.Hrms.Managers.HolidayManager.Instance().getHolidayDates(leavefromdate, leavetodate, instance.leavepolicyid).then(function (response) {
var data = response.result;
instance.currentlybooked = data + "(days)";
instance.currentlybookedcount = data;
instance.balanceleaves = instance.availablebalance - instance.currentlybookedcount;
instance.loadControl(instance.containerid, null);
});
});
}
employeeleavesControlObj() {
let instance = this;
var EmployeeId = Number($(".txtAutoComplete_employeeid").val());
var LeaveTypeId = Number($(".ddl_cascading_leavetypeid").val());
if (instance.currentlybookedcount == 0 && EmployeeId != 0 && LeaveTypeId != 0) {
MessageHelper.Instance().showError("Currently Booked Leaves Is Zero.Please check once.", 'div_ErrorMessage_' + $('#' + Unibase.Platform.Helpers.NavigationHelper.Instance().getLastContainerId()).find('#hf_FormId').val());
return false;
}
}
loadControlSettings(controlsettingjson, formpropertyid) {
return null;
}
loadPropertySettings(propertysettings, formpropertyid, DocPropertyName) {
return null;
}
bindEditFormDetails(formpropertyid, propval, DocPropertyName) {
var instance = this;
var leaverequestid = Number(propval);
let employeeid;
let leavetypeid;
instance.fileCacheHelper.loadJsFiles(["apps/hrms/managers/leavemanager.js"], function () {
return __awaiter(this, void 0, void 0, function* () {
if ($("#div_FormName").text() == "Employee Leave Request") {
yield Bizgaze.Apps.Hrms.Managers.LeaveManager.Instance().getLeaveRequest(leaverequestid).then(function (response) {
var requsetdata = response.result;
employeeid = requsetdata[0].employeeid;
leavetypeid = requsetdata[0].leavetypeid;
});
}
else {
var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
employeeid = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_employeeid").Value;
leavetypeid = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_leavetypeid").Value;
}
Bizgaze.Apps.Hrms.Managers.LeaveManager.Instance().getleavescountData(Number(employeeid), Number(leavetypeid)).then(function (response) {
if (response.result.length > 0) {
var data = response.result;
instance.availablebalance = data[0].availableleaves + data[0].currentlybooked;
instance.balanceleaves = data[0].balanceleaves;
instance.currentlybookedcount = data[0].currentlybooked;
instance.currentlybooked = data[0].currentlybooked + "(days)";
instance.leavepolicyid = data[0].leavepolicyid;
instance.loadControl(instance.containerid, null);
}
});
});
});
}
static Instance() {
if (this._instance === undefined)
this._instance = new EmployeeLeaves();
return this._instance;
}
}
Controls.EmployeeLeaves = EmployeeLeaves;
})(Controls = Hrms.Controls || (Hrms.Controls = {}));
})(Hrms = Apps.Hrms || (Apps.Hrms = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
File diff suppressed because one or more lines are too long
+333
View File
@@ -0,0 +1,333 @@
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Hrms;
(function (Hrms) {
let Components;
(function (Components) {
class Leaves extends Unibase.Platform.Core.BaseComponent {
loaddata(fromdate, todate, employeeid, leavetypeid, totalDayPropertyId, durationProperyId, totaldaysleavehistoryProperyId) {
var instance = this;
var fdate = moment(fromdate.replaceAll("/", "-"), "DD/MM/YYYY").format("YYYY/MM/DD");
var tdate = moment(todate.replaceAll("/", "-"), "DD/MM/YYYY").format("YYYY/MM/DD");
var iWeeks = 0;
var iDateDiff = 0;
var iAdjust = 0;
var dd;
instance.fileCacheHelper.loadJsFiles(["apps/hrms/components/leavetype.js", "apps/hrms/managers/leavemanager.js", "apps/hrms/managers/leavemanager.js", "apps/hrms/enums/leavetypes.js"], function () {
Bizgaze.Apps.Hrms.Managers.LeaveManager.Instance().getleavescountData(employeeid, leavetypeid).then(function (response) {
var totaldays = 0;
var result = "";
if (response.result != null && response.result != "") {
result = response.result;
totaldays = response.result.totaldays;
}
Bizgaze.Apps.Hrms.Managers.LeaveManager.Instance().Getleavetypedata(leavetypeid).then(function (response) {
if (response.result != null && response.result != "") {
result = response.result;
var fromvalidity = response.result.fromvalidity;
var accuraldate = response.result.accuraldate;
var mothname = response.result.mothname;
var jan = response.result.jan;
var feb = response.result.feb;
var mar = response.result.mar;
var apr = response.result.apr;
var may = response.result.may;
var jun = response.result.jun;
var jul = response.result.jul;
var aug = response.result.aug;
var sep = response.result.sep;
var oct = response.result.oct;
var nov = response.result.nov;
var dec = response.result.dec;
var jantojun = response.result.jantojun;
var jultodec = response.result.jultodec;
var jantoaprl = response.result.jantoaprl;
var maytoaug = response.result.maytoaug;
var septodec = response.result.septodec;
}
var leaveType = Hrms.Enums.LeaveTypes.None;
if (jan != 0 || feb != 0 || mar != 0 || apr != 0 || may != 0 || jun != 0 || jul != 0 || aug != 0 || sep != 0 || oct != 0 || nov != 0 || dec != 0) {
leaveType = Hrms.Enums.LeaveTypes.Monthly;
}
else if (jantojun != 0 || jultodec != 0) {
leaveType = Hrms.Enums.LeaveTypes.HalfYearly;
}
else if (jantoaprl != 0 || maytoaug != 0 || septodec != 0) {
leaveType = Hrms.Enums.LeaveTypes.Quarterly;
}
var leavefromyear = moment(fdate, "YYYY/MM/DD").year();
var leavefromonth = 1 + moment(fdate, "YYYY/MM/DD").month();
var leavefromdate = moment(fdate, "YYYY/MM/DD").date();
var leavetodateyear = moment(tdate, "YYYY/MM/DD").year();
var leavetodatemonth = 1 + moment(tdate, "YYYY/MM/DD").month();
var leavetodate = moment(tdate, "YYYY/MM/DD").date();
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
var month = months.indexOf(mothname);
todate = new Date(tdate);
fromdate = new Date(fdate);
if (todate < fromdate)
return 0;
var iWeekday1 = fromdate.getDay();
var iWeekday2 = todate.getDay();
iWeekday1 = (iWeekday1 == 0) ? 7 : iWeekday1;
iWeekday2 = (iWeekday2 == 0) ? 7 : iWeekday2;
if ((iWeekday1 > 5) && (iWeekday2 > 5))
iAdjust = 1;
iWeekday1 = (iWeekday1 > 5) ? 5 : iWeekday1;
iWeekday2 = (iWeekday2 > 5) ? 5 : iWeekday2;
iWeeks = Math.floor((todate.getTime() - fromdate.getTime()) / 604800000);
if (iWeekday1 < iWeekday2) {
iDateDiff = (iWeeks * 5) + (iWeekday2 - iWeekday1);
}
if ((leavefromyear == leavetodateyear) && (leavefromonth == leavetodatemonth) && (leavefromdate == leavetodate)) {
if (iWeekday1 == iWeekday2) {
iDateDiff = 0;
}
}
else if (fromdate != todate) {
if (iWeekday1 == iWeekday2) {
iDateDiff = ((0 + 1) * 5) - (iWeekday1 - iWeekday2);
}
else if (iWeekday1 != iWeekday2) {
iDateDiff = ((iWeeks + 1) * 5) - (iWeekday1 - iWeekday2);
}
}
else {
iDateDiff = ((iWeeks + 1) * 5) - (iWeekday1 - iWeekday2);
}
iDateDiff -= iAdjust;
dd = iDateDiff + 1;
if (totaldays > 0) {
dd = dd + totaldays;
}
$("#" + totalDayPropertyId).val(dd);
$("#" + totaldaysleavehistoryProperyId).val(dd);
var FulDay = dd + " " + "Days";
var HalfDay = "HalfDay";
var QuaterDay = "QuaterDay";
var Hourly = "Hourly";
var duration = Number($("#" + durationProperyId).val());
if (duration == 1) {
if (leaveType == Hrms.Enums.LeaveTypes.Monthly) {
if (leavefromonth == 1 && leavetodatemonth == 1) {
var jan = response.result.jan;
if (dd <= jan) {
alert("these days are applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html(FulDay);
}
else {
alert("these days are not applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html("");
}
}
else if (leavefromonth == 2 && leavetodatemonth == 2) {
var feb = response.result.feb;
if (dd <= feb) {
alert("these days are applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html(FulDay);
}
else {
alert("these days are not applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html("");
}
}
else if (leavefromonth == 3 && leavetodatemonth == 3) {
var mar = response.result.mar;
if (dd <= mar) {
alert("these days are applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html(FulDay);
}
else {
alert("these days are not applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html("");
}
}
else if (leavefromonth == 4 && leavetodatemonth == 4) {
var apr = response.result.apr;
if (dd <= apr) {
alert("these days are applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html(FulDay);
}
else {
alert("these days are not applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html("");
}
}
else if (leavefromonth == 5 && leavetodatemonth == 5) {
var may = response.result.may;
if (dd <= may) {
alert("these days are applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html(FulDay);
}
else {
alert("these days are not applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html("");
}
}
else if (leavefromonth == 6 && leavetodatemonth == 6) {
var jun = response.result.jun;
if (dd <= jun) {
alert("these days are applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html(FulDay);
}
else {
alert("these days are not applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html("");
}
}
else if (leavefromonth == 7 && leavetodatemonth == 7) {
var jul = response.result.jul;
if (dd <= jul) {
alert("these days are applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html(FulDay);
}
else {
alert("these days are not applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html("");
}
}
else if (leavefromonth == 8 && leavetodatemonth == 8) {
var aug = response.result.aug;
if (dd <= aug) {
alert("these days are applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html(FulDay);
}
else {
alert("these days are not applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html("");
}
}
else if (leavefromonth == 9 && leavetodatemonth == 9) {
var sep = response.result.sep;
if (dd <= sep) {
alert("these days are applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html(FulDay);
}
else {
alert("these days are not applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html("");
}
}
else if (leavefromonth == 10 && leavetodatemonth == 10) {
var oct = response.result.oct;
if (dd <= oct) {
alert("these days are applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html(FulDay);
}
else {
alert("these days are not applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html("");
}
}
else if (leavefromonth == 11 && leavetodatemonth == 11) {
var nov = response.result.nov;
if (dd <= nov) {
alert("these days are applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html(FulDay);
}
else {
alert("these days are not applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html("");
}
}
else if (leavefromonth == 12 && leavetodatemonth == 12) {
var dec = response.result.dec;
if (dd <= dec) {
alert("these days are applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html(FulDay);
}
else {
alert("these days are not applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html("");
}
}
}
else if (leaveType == Hrms.Enums.LeaveTypes.HalfYearly) {
if (leavefromonth == 1 || leavetodatemonth <= 6) {
var jantojun = response.result.jantojun;
if (dd <= jantojun) {
alert("these days are applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html(FulDay);
}
else {
alert("these days are not applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html("");
}
}
else if (leavefromonth == 7 || leavetodatemonth <= 12) {
var jultodec = response.result.jultodec;
if (dd <= jultodec) {
alert("these days are applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html(FulDay);
}
else {
alert("these days are not applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html("");
}
}
}
else if (leaveType == Hrms.Enums.LeaveTypes.Quarterly) {
if (leavefromonth == 1 || leavetodatemonth <= 4) {
var jantoaprl = response.result.jantoaprl;
if (dd <= jantoaprl) {
alert("these days are applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html(FulDay);
}
else {
alert("these days are not applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html("");
}
}
else if (leavefromonth == 5 || leavetodatemonth <= 8) {
var maytoaug = response.result.maytoaug;
if (dd <= maytoaug) {
alert("these days are applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html(FulDay);
}
else {
alert("these days are not applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html("");
}
}
else if (leavefromonth == 9 || leavetodatemonth <= 12) {
var septodec = response.result.septodec;
if (dd <= septodec) {
alert("these days are applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html(FulDay);
}
else {
alert("these days are not applicable for this month");
$("#divSectionProperties_Totalcountdays_ActionProperty").html("");
}
}
else {
alert("these days are not applicable for this month");
}
}
}
else if (duration == 2) {
$("#divSectionProperties_Totalcountdays_ActionProperty").html(Hourly);
}
else if (duration == 3) {
$("#divSectionProperties_Totalcountdays_ActionProperty").html(QuaterDay);
}
else if (duration == 4) {
$("#divSectionProperties_Totalcountdays_ActionProperty").html(HalfDay);
}
});
});
});
}
static Instance() {
if (this._instance === undefined)
this._instance = new Leaves();
return this._instance;
}
}
Components.Leaves = Leaves;
})(Components = Hrms.Components || (Hrms.Components = {}));
})(Hrms = Apps.Hrms || (Apps.Hrms = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
File diff suppressed because one or more lines are too long
+1
View File
File diff suppressed because one or more lines are too long
+53
View File
@@ -0,0 +1,53 @@
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Hrms;
(function (Hrms) {
let Components;
(function (Components) {
class LeavesTypes extends Unibase.Platform.Core.BaseComponent {
loadForms(TenureName) {
var FormName = TenureName;
let FormUniquId = "";
var instance = this;
instance.fileCacheHelper.loadJsFiles(["apps/hrms/components/leavetype.js", "platform/forms/managers/formmanager.js"], function () {
if (FormName == "Monthly") {
FormUniquId = "Bizgaze_Extension_HRMs_Forms_MONTHS";
}
else if (FormName == "Half Yearly") {
FormUniquId = "Bizgaze_Extension_HRMs_Forms_Half_Yearly";
}
else if (FormName == "Tri Annually") {
FormUniquId = "Bizgaze_Extension_HRMs_Forms_Tri Annually";
}
else if (FormName == "Annually") {
FormUniquId = "Bizgaze_Extension_HRMs_Forms_ANNUALLY";
}
Unibase.Platform.Forms.Managers.FormManager.Instance().getFormbyUniqueId(FormUniquId).then(function (response) {
var data = response.result;
var formid = data.FormId;
var viewerobject = {
FormId: formid,
Pk_Value: 0,
AppConfigurationId: 0,
PortletWidgetId: 0,
OnSuccess: null,
OnLoad: null,
OnFail: null,
};
Unibase.Platform.Forms.Components.FormViewer.Instance().init(viewerobject);
});
});
}
static Instance() {
if (this._instance === undefined)
this._instance = new LeavesTypes();
return this._instance;
}
}
Components.LeavesTypes = LeavesTypes;
})(Components = Hrms.Components || (Hrms.Components = {}));
})(Hrms = Apps.Hrms || (Apps.Hrms = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"leavetype.js","sourceRoot":"","sources":["leavetype.ts"],"names":[],"mappings":"AACA,IAAU,OAAO,CAsDhB;AAtDD,WAAU,OAAO;IACb,IAAiB,IAAI,CAoDpB;IApDD,WAAiB,IAAI;QACjB,IAAiB,IAAI,CAkDpB;QAlDD,WAAiB,IAAI;YACjB,IAAiB,UAAU,CAgD1B;YAhDD,WAAiB,UAAU;gBACvB,MAAa,WAAY,SAAQ,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa;oBAEhE,SAAS,CAAC,UAAU;wBAEhB,IAAI,QAAQ,GAAG,UAAU,CAAC;wBAC1B,IAAI,WAAW,GAAG,EAAE,CAAC;wBACrB,IAAI,QAAQ,GAAG,IAAI,CAAC;wBACpB,QAAQ,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,mCAAmC,EAAE,wCAAwC,CAAC,EAAE;4BAClH,IAAI,QAAQ,IAAI,SAAS,EAAE;gCACvB,WAAW,GAAG,qCAAqC,CAAC;6BACvD;iCACI,IAAI,QAAQ,IAAI,aAAa,EAAE;gCAChC,WAAW,GAAG,0CAA0C,CAAC;6BAC5D;iCACI,IAAI,QAAQ,IAAI,cAAc,EAAE;gCACjC,WAAW,GAAG,2CAA2C,CAAC;6BAC7D;iCACI,IAAI,QAAQ,IAAI,UAAU,EAAE;gCAC7B,WAAW,GAAG,uCAAuC,CAAC;6BACzD;4BACD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,UAAU,QAAQ;gCACzG,IAAI,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC;gCAC3B,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;gCAEzB,IAAI,YAAY,GAAqD;oCACjE,MAAM,EAAE,MAAM;oCACd,QAAQ,EAAE,CAAC;oCACX,kBAAkB,EAAE,CAAC;oCAErB,eAAe,EAAE,CAAC;oCAClB,SAAS,EAAE,IAAI;oCACf,MAAM,EAAE,IAAI;oCACZ,MAAM,EAAE,IAAI;iCACf,CAAA;gCACD,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;4BAC/E,CAAC,CAAC,CAAC;wBAEP,CAAC,CAAC,CAAC;oBACP,CAAC;oBAGD,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;4BAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,WAAW,EAAE,CAAC;wBACvC,OAAO,IAAI,CAAC,SAAS,CAAC;oBAC1B,CAAC;iBACJ;gBA9CY,sBAAW,cA8CvB,CAAA;YACL,CAAC,EAhDgB,UAAU,GAAV,eAAU,KAAV,eAAU,QAgD1B;QACL,CAAC,EAlDgB,IAAI,GAAJ,SAAI,KAAJ,SAAI,QAkDpB;IACL,CAAC,EApDgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAoDpB;AACL,CAAC,EAtDS,OAAO,KAAP,OAAO,QAsDhB"}
+149
View File
@@ -0,0 +1,149 @@
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Hrms;
(function (Hrms) {
let Components;
(function (Components) {
class LoanButton extends Unibase.Platform.Core.BaseComponent {
cssFiles() {
return [];
}
jsFiles() {
return [''];
}
html(id, containerid) {
return "";
}
init(containerid) {
}
load(loanid, containerid, callback) {
}
disburse() {
debugger;
let detailContainer = $("._bizgaze_detail_container:visible");
let refstatusId = (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.filter(function (o) {
return o.Key === "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_refstatusid";
})[0].Value);
let stage = (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.filter(function (o) {
return o.Key === "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_stage";
})[0].Value);
$(detailContainer).find('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_Disburse').addClass('hidden');
if (refstatusId == '3') {
$(detailContainer).find('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_Disburse').removeClass('hidden');
}
var instance = this;
$(detailContainer).find('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_Disburse').click(function () {
let uniqueid = 'Bizgaze_Extension_HRMs_LoanDisbursal';
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(['platform/forms/managers/formmanager.js', 'platform/forms/components/formviewer/formviewer.js', 'platform/forms/requests/forms.js'], function () {
Unibase.Platform.Forms.Managers.FormManager.Instance().getFormbyUniqueId(uniqueid).then(function (responce) {
var formid = responce.result.FormId;
var successobj = {
CallBack: function () {
var loanid = (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.filter(function (o) {
return o.Key === "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_loanid";
})[0].Value);
instance.UpdateLoanStage(loanid);
},
Parameters: null,
};
var formviewerObj = {
FormId: formid,
AppConfigurationId: 0,
Pk_Value: 0,
PortletWidgetId: 0,
OnSuccess: successobj,
OnFail: null,
OnLoad: null,
};
Unibase.Platform.Forms.Components.FormViewer.Instance().init(formviewerObj);
});
});
});
$(detailContainer).find('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_Repayment').addClass('hidden');
if (refstatusId == '4') {
$(detailContainer).find('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_Repayment').removeClass('hidden');
}
$(detailContainer).find('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_Repayment').click(function () {
let uniqueid = 'Bizgaze_Extension_HRMs_LoanRepayment';
Unibase.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(['platform/forms/managers/formmanager.js', 'platform/forms/components/formviewer/formviewer.js', 'platform/forms/requests/forms.js'], function () {
Unibase.Platform.Forms.Managers.FormManager.Instance().getFormbyUniqueId(uniqueid).then(function (res) {
var formid = res.result.FormId;
var successobj = {
CallBack: function () {
var portal = Unibase.Themes.Compact.Components.Details.Instance().loadPortlets(Unibase.Themes.Compact.Components.Details.Instance());
var loanid = (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.filter(function (o) {
return o.Key === "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_loanid";
})[0].Value);
},
Parameters: null,
};
var formviewerObj = {
FormId: formid,
AppConfigurationId: 0,
Pk_Value: 0,
PortletWidgetId: 0,
OnSuccess: successobj,
OnFail: null,
OnLoad: null,
FormContainer: null,
};
Unibase.Platform.Forms.Components.FormViewer.Instance().init(formviewerObj);
});
});
});
}
UpdateLoanStage(loanid) {
var instance = this;
var jsfiles = ['apps/hrms/components/loanbutton.js', 'apps/hrms/managers/loanmanager.js'];
instance.fileCacheHelper.loadJsFiles(jsfiles, function (response) {
Bizgaze.Apps.Hrms.Managers.LoanManager.Instance().UpdateLoanStage(loanid).then(function (response) {
MessageHelper.Instance().showSuccess(response.message, '');
var detailobj = Unibase.Themes.Compact.Components.Details.Instance();
detailobj._recordId = Unibase.Themes.Providers.DetailHelper.recordId;
detailobj._installedAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
detailobj._containerId = instance.navigationHelper.getLastContainerId();
var IdetailObj = detailobj;
detailobj.loadPortlets(IdetailObj);
instance.disburse();
});
});
}
saveAsDraft() {
let instance = this;
let InstalledAppId = Unibase.Platform.Forms.Components.FormViewer.instance.InstalledAppId;
let RefStatusId = 1;
Unibase.Platform.Apps.Managers.StageManager.Instance().getStagesByInstalledAppandRefStatus(InstalledAppId, RefStatusId).then(function (response) {
const containerid = instance.navigationHelper.getLastContainerId();
$("#" + containerid).find(".hdn_stageid").val(response.result.StageId);
$("#" + containerid).find("#btnDynamicSave").click();
});
}
calendar() {
debugger;
const dateFormat = moment().format("DD/MM/YYYY");
$(".date_installmentstartdate").daterangepicker({
startDate: dateFormat,
autoUpdateInput: false,
singleDatePicker: true,
showDropdowns: true,
minYear: 1901,
minDate: dateFormat,
locale: {
format: 'DD/MM/YYYY',
firstDay: 1,
},
});
}
static Instance() {
if (this._instance === undefined)
this._instance = new LoanButton();
return this._instance;
}
}
Components.LoanButton = LoanButton;
})(Components = Hrms.Components || (Hrms.Components = {}));
})(Hrms = Apps.Hrms || (Apps.Hrms = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
File diff suppressed because one or more lines are too long
@@ -0,0 +1,116 @@
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Hrms;
(function (Hrms) {
let Components;
(function (Components) {
class ManualBalance extends Unibase.Platform.Core.BaseComponent {
constructor() {
super(...arguments);
this.existingbalance = 0;
this.newbalance = 0;
this.reason = "";
}
init(formpropertyid, prop, callback) {
var instance = this;
instance.existingbalance = 0;
instance.newbalance = 0;
var employeeid = Unibase.Themes.Providers.DetailHelper.recordId;
instance.getManualBalance(employeeid);
if (callback != null) {
callback();
}
}
loadControl(containerid, prop) {
var html = '<ul class="mt-10 align-items-center" id="Employee_ManualBalance">' +
'<li class="list-group-item hidden" id="EmployeeManual_Balance">' +
'<div class="row">' +
'<div class="col-sm-2"><strong>Leave Type</strong></div>' +
'<div class="col-sm-2"><strong>Date</strong></div>' +
'<div class="col-sm-2"><strong>Existing Balance</strong></div>' +
'<div class="col-sm-3"><strong>New Balance</strong></div>' +
'<div class="col-sm-3"><strong>Reason</strong></div>' +
'</div>' +
'</li>' +
'<li class="length-row" id="li_EmployeeManualBalance_Details">' +
'</li>' +
'<input type="hidden" id="hdn_EmployeeManualBalanceControl" class="value-control" value=" Bizgaze.Apps.Hrms.Components.ManualBalance.Instance().EmployeeManualBalanceobj();">' +
'</ul>';
$("#" + containerid).html(html);
}
loadControlSettings(controlsettingjson, formpropertyid) {
return null;
}
loadPropertySettings(propertysettings, formpropertyid) {
return null;
}
bindEditFormDetails(formpropertyid, propval, DocPropertyName) {
var manualbalanceid = Number(propval);
var instance = this;
}
getManualBalance(employeeid) {
var instance = this;
var jsfiles = ['apps/hrms/managers/leavemanager.js'];
$(".EmployeeManaulBalance").remove();
$("#div_employeealert").remove();
instance.fileCacheHelper.loadJsFiles(jsfiles, function (response) {
Bizgaze.Apps.Hrms.Managers.LeaveManager.Instance().getEmployeeExistingBalance(Number(employeeid)).then(function (response) {
var dt = response.result;
if (dt.length > 0) {
for (var i = 0; i < dt.length; i++) {
var data = dt[i];
instance.EmployeeManualBalanceTemplate(data);
}
}
else {
$("#EmployeeManual_Balance").removeClass("hidden");
$('#Employee_ManualBalance').after('<div class="alert alert-danger ma-0" id="div_employeealert"> No Data Found</div>');
}
});
});
}
EmployeeManualBalanceTemplate(data) {
let instance = this;
let manualdate = moment(new Date($.now())).format("DD/MM/YYYY");
var html = '<li class="list-group-item EmployeeManaulBalance" id="li_EmployeeManaulBalance_">' +
'<div class="row">' +
'<input type ="hidden" class="hf_employeeid" value = "' + data.userid + '" id = "employeeid" />' +
'<input type ="hidden" class="hf_leavetypeid" value = "' + data.leavetypeid + '" id ="leavetypeid" /> ' +
'<input type ="hidden" class="hf_existingbalance" value = "' + data.availableleaves + '" id ="existingbalance" /> ' +
'<input type ="hidden" class="hf_manualbalancedate" value = "' + manualdate + '" id ="manualbalancedate" />' +
'<div class="col-sm-2" id="txt_leavetypename"> ' + data.leavetypename + ' </div>' +
'<div class="col-sm-2" id="manualbalancedate" > ' + manualdate + ' </div>' +
'<div class="col-sm-2" id="txt_existingbalance" > ' + data.availableleaves + ' </div>' +
'<div class="col-sm-3" ><input type ="number" class="form-control floating-label-control txt_newbalance" id="txt_newbalance" data-isdynamic="false" placeholder="New Balance" data-placeholder="Please Enter New Balance" data-label="New Balance" ></div >' + '<div class="col-sm-3" ><input type ="text" class="form-control floating-label-control txt_reason" id="txt_Reason" data-isdynamic="false" placeholder="Reason" data-placeholder="Please Enter Reason" data-label="Reason"></div >' +
'</div></li>';
$("#EmployeeManual_Balance").removeClass("hidden");
$("#li_EmployeeManualBalance_Details").after(html);
}
EmployeeManualBalanceobj() {
var employeeManualBlance = new Array();
$('.EmployeeManaulBalance').each(function (index) {
var element = $(this);
employeeManualBlance.push({
EmployeeId: Number(element.find('.hf_employeeid').val()),
LeaveTypeId: Number(element.find('.hf_leavetypeid').val()),
ExistingBalance: Number(element.find('.hf_existingbalance').val()),
ManualBalanceDate: new Date(moment(element.find(".hf_manualbalancedate").val(), "DD/MM/YYYY").format("YYYY/MM/DD")),
NewBalance: Number(element.find('.txt_newbalance').val()),
Reason: element.find('.txt_reason').val()
});
});
return employeeManualBlance;
}
static Instance() {
if (this.instance === undefined)
this.instance = new ManualBalance();
return this.instance;
}
}
Components.ManualBalance = ManualBalance;
})(Components = Hrms.Components || (Hrms.Components = {}));
})(Hrms = Apps.Hrms || (Apps.Hrms = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"manualbalance.js","sourceRoot":"","sources":["manualbalance.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,40 @@
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Hrms;
(function (Hrms) {
let Components;
(function (Components) {
class ManualBalance_Settings {
loadControlPropertiesHtml(controlpropList, container) {
return ``;
}
bindPropertySettings(prop) {
var propertySettings = prop.PropertySettings;
return "";
}
savePropertySettings(prop) {
var propertySettings = prop.PropertySettings;
return "";
}
loadSettingHtml() {
return null;
}
bindControlData(controldatajson) {
return null;
}
SaveControlData(controldatajson) {
return controldatajson;
}
static Instance() {
if (this._instance === undefined)
this._instance = new ManualBalance_Settings();
return this._instance;
}
}
Components.ManualBalance_Settings = ManualBalance_Settings;
})(Components = Hrms.Components || (Hrms.Components = {}));
})(Hrms = Apps.Hrms || (Apps.Hrms = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
@@ -0,0 +1 @@
{"version":3,"file":"manualbalance.settings.js","sourceRoot":"","sources":["manualbalance.settings.ts"],"names":[],"mappings":"AACA,IAAU,OAAO,CAsChB;AAtCD,WAAU,OAAO;IACb,IAAiB,IAAI,CAoCpB;IApCD,WAAiB,IAAI;QACjB,IAAiB,IAAI,CAkCpB;QAlCD,WAAiB,IAAI;YACjB,IAAiB,UAAU,CAgC1B;YAhCD,WAAiB,UAAU;gBACvB,MAAa,sBAAsB;oBAC/B,yBAAyB,CAAC,eAAsC,EAAE,SAAS;wBAEvE,OAAO,EAAE,CAAC;oBAEd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,eAAe;wBACX,OAAO,IAAI,CAAC;oBAChB,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,IAAI,CAAC;oBAChB,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,eAAe,CAAC;oBAC3B,CAAC;oBAGD,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;4BAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,sBAAsB,EAAE,CAAC;wBAClD,OAAO,IAAI,CAAC,SAAS,CAAC;oBAC1B,CAAC;iBACJ;gBA9BY,iCAAsB,yBA8BlC,CAAA;YACL,CAAC,EAhCgB,UAAU,GAAV,eAAU,KAAV,eAAU,QAgC1B;QACL,CAAC,EAlCgB,IAAI,GAAJ,SAAI,KAAJ,SAAI,QAkCpB;IACL,CAAC,EApCgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAoCpB;AACL,CAAC,EAtCS,OAAO,KAAP,OAAO,QAsChB"}
@@ -0,0 +1,40 @@
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let HRMS;
(function (HRMS) {
let Components;
(function (Components) {
class ShiftCalendar_Settings {
loadControlPropertiesHtml(controlpropList, container) {
return ``;
}
bindPropertySettings(prop) {
var propertySettings = prop.PropertySettings;
return "";
}
savePropertySettings(prop) {
var propertySettings = prop.PropertySettings;
return "";
}
loadSettingHtml() {
return null;
}
bindControlData(controldatajson) {
return null;
}
SaveControlData(controldatajson) {
return controldatajson;
}
static Instance() {
if (this._instance === undefined)
this._instance = new ShiftCalendar_Settings();
return this._instance;
}
}
Components.ShiftCalendar_Settings = ShiftCalendar_Settings;
})(Components = HRMS.Components || (HRMS.Components = {}));
})(HRMS = Apps.HRMS || (Apps.HRMS = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
@@ -0,0 +1 @@
{"version":3,"file":"shiftcalendar.settings.js","sourceRoot":"","sources":["shiftcalendar.settings.ts"],"names":[],"mappings":"AACA,IAAU,OAAO,CAmChB;AAnCD,WAAU,OAAO;IACb,IAAiB,IAAI,CAiCpB;IAjCD,WAAiB,IAAI;QACjB,IAAiB,IAAI,CA+BpB;QA/BD,WAAiB,IAAI;YACjB,IAAiB,UAAU,CA6B1B;YA7BD,WAAiB,UAAU;gBACvB,MAAa,sBAAsB;oBAC/B,yBAAyB,CAAC,eAAsC,EAAE,SAAS;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,oBAAoB,CAAC,IAAgB;wBACjC,IAAI,gBAAgB,GAA6B,IAAI,CAAC,gBAAgB,CAAC;wBACvE,OAAO,EAAE,CAAC;oBACd,CAAC;oBACD,eAAe;wBACX,OAAO,IAAI,CAAC;oBAChB,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,IAAI,CAAC;oBAChB,CAAC;oBACD,eAAe,CAAC,eAAoB;wBAChC,OAAO,eAAe,CAAC;oBAC3B,CAAC;oBAED,MAAM,CAAC,QAAQ;wBACX,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;4BAC5B,IAAI,CAAC,SAAS,GAAG,IAAI,sBAAsB,EAAE,CAAC;wBAClD,OAAO,IAAI,CAAC,SAAS,CAAC;oBAC1B,CAAC;iBACJ;gBA3BY,iCAAsB,yBA2BlC,CAAA;YACL,CAAC,EA7BgB,UAAU,GAAV,eAAU,KAAV,eAAU,QA6B1B;QACL,CAAC,EA/BgB,IAAI,GAAJ,SAAI,KAAJ,SAAI,QA+BpB;IACL,CAAC,EAjCgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAiCpB;AACL,CAAC,EAnCS,OAAO,KAAP,OAAO,QAmChB"}
@@ -0,0 +1,729 @@
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var Bizgaze;
(function (Bizgaze) {
let Apps;
(function (Apps) {
let Hrms;
(function (Hrms) {
let Components;
(function (Components) {
class ShiftCalender extends Unibase.Platform.Core.BaseComponent {
constructor() {
super(...arguments);
this.holidaycalendar = new Array();
this.firstweekcheckedarray = [];
this.secondweekcheckedarray = [];
this.thirdweekcheckedarray = [];
this.fourthweekcheckedarray = [];
this.fifththweekcheckedarray = [];
}
init(formpropertyid, prop, callback) {
var instance = this;
this.holidaycalendar = [];
this.firstweekcheckedarray = [];
this.secondweekcheckedarray = [];
this.thirdweekcheckedarray = [];
this.fourthweekcheckedarray = [];
this.fifththweekcheckedarray = [];
$('#SelectAllSunday').change(function () {
let checkelemnt = $(this).is(':checked');
if (checkelemnt == true) {
$(".Sunday").prop("checked", true);
}
else {
$(".Sunday").prop("checked", false);
}
});
$(".Sunday").click(function () {
let checkelemnt = $(this).is(':checked');
if (checkelemnt == true) {
$(this).prop("checked", true);
}
else {
$(this).prop("checked", false);
}
});
$('#SelectAllMonday').change(function () {
let checkelemnt = $(this).is(':checked');
if (checkelemnt == true) {
$(".Monday").prop("checked", true);
}
else {
$(".Monday").prop("checked", false);
}
});
$(".Monday").click(function () {
let checkelemnt = $(this).is(':checked');
if (checkelemnt == true) {
$(this).prop("checked", true);
}
else {
$(this).prop("checked", false);
}
});
$('#SelectAllTuesday').change(function () {
let checkelemnt = $(this).is(':checked');
if (checkelemnt == true) {
$(".Tuesday").prop("checked", true);
}
else {
$(".Tuesday").prop("checked", false);
}
});
$(".Tuesday").click(function () {
let checkelemnt = $(this).is(':checked');
if (checkelemnt == true) {
$(this).prop("checked", true);
}
else {
$(this).prop("checked", false);
}
});
$('#SelectAllWednesday').change(function () {
let checkelemnt = $(this).is(':checked');
if (checkelemnt == true) {
$(".Wednesday").prop("checked", true);
}
else {
$(".Wednesday").prop("checked", false);
}
});
$(".Wednesday").click(function () {
let checkelemnt = $(this).is(':checked');
if (checkelemnt == true) {
$(this).prop("checked", true);
}
else {
$(this).prop("checked", false);
}
});
$('#SelectAllThursday').change(function () {
let checkelemnt = $(this).is(':checked');
if (checkelemnt == true) {
$(".Thursday").prop("checked", true);
}
else {
$(".Thursday").prop("checked", false);
}
});
$(".Thursday").click(function () {
let checkelemnt = $(this).is(':checked');
if (checkelemnt == true) {
$(this).prop("checked", true);
}
else {
$(this).prop("checked", false);
}
});
$('#SelectAllFriday').change(function () {
let checkelemnt = $(this).is(':checked');
if (checkelemnt == true) {
$(".Friday").prop("checked", true);
}
else {
$(".Friday").prop("checked", false);
}
});
$(".Friday").click(function () {
let checkelemnt = $(this).is(':checked');
if (checkelemnt == true) {
$(this).prop("checked", true);
}
else {
$(this).prop("checked", false);
}
});
$('#SelectAllSaturday').change(function () {
let checkelemnt = $(this).is(':checked');
if (checkelemnt == true) {
$(".Saturday").prop("checked", true);
}
else {
$(".Saturday").prop("checked", false);
}
});
$(".Saturday").click(function () {
let checkelemnt = $(this).is(':checked');
if (checkelemnt == true) {
$(this).prop("checked", true);
}
else {
$(this).prop("checked", false);
}
});
$(".fifthweek").click(function () {
let checkelemnt = $(this).is(':checked');
let day = $(this).val();
var splt = day.toString().split(':');
let dayname = splt[0];
let dayval = Boolean(splt[1]);
let weekday = { [dayname]: dayval };
if (checkelemnt == true) {
$(this).prop("checked", true);
instance.fifththweekcheckedarray.push({ [dayname]: dayval });
console.log(instance.fifththweekcheckedarray);
}
else {
$(this).prop("checked", false);
let newArray = [];
for (let i = 0; i < instance.fifththweekcheckedarray.length; i++) {
if (JSON.stringify(instance.fifththweekcheckedarray[i]) !== JSON.stringify(weekday)) {
newArray.push(instance.fifththweekcheckedarray[i]);
}
}
instance.fifththweekcheckedarray = [];
instance.fifththweekcheckedarray = newArray;
console.log(instance.fifththweekcheckedarray);
}
});
$(".firstweek").click(function () {
let checkelemnt = $(this).is(':checked');
let day = $(this).val();
var splt = day.toString().split(':');
let dayname = splt[0];
let dayval = Boolean(splt[1]);
let weekday = { [dayname]: dayval };
if (checkelemnt == true) {
$(this).prop("checked", true);
instance.firstweekcheckedarray.push({ [dayname]: dayval });
console.log(instance.firstweekcheckedarray);
}
else {
$(this).prop("checked", false);
let newArray = [];
for (let i = 0; i < instance.firstweekcheckedarray.length; i++) {
if (JSON.stringify(instance.firstweekcheckedarray[i]) != JSON.stringify(weekday)) {
newArray.push(instance.firstweekcheckedarray[i]);
}
}
instance.firstweekcheckedarray = [];
instance.firstweekcheckedarray = newArray;
console.log(instance.firstweekcheckedarray);
}
});
$(".secondweek").click(function () {
let checkelemnt = $(this).is(':checked');
let day = $(this).val();
var splt = day.toString().split(':');
let dayname = splt[0];
let dayval = Boolean(splt[1]);
let weekday = { [dayname]: dayval };
if (checkelemnt == true) {
$(this).prop("checked", true);
instance.secondweekcheckedarray.push({ [dayname]: dayval });
console.log(instance.secondweekcheckedarray);
}
else {
$(this).prop("checked", false);
let newArray = [];
for (let i = 0; i < instance.secondweekcheckedarray.length; i++) {
if (JSON.stringify(instance.secondweekcheckedarray[i]) !== JSON.stringify(weekday)) {
newArray.push(instance.secondweekcheckedarray[i]);
}
}
instance.secondweekcheckedarray = [];
instance.secondweekcheckedarray = newArray;
console.log(instance.secondweekcheckedarray);
}
});
$(".thirdweek").click(function () {
let checkelemnt = $(this).is(':checked');
let day = $(this).val();
var splt = day.toString().split(':');
let dayname = splt[0];
let dayval = Boolean(splt[1]);
let weekday = { [dayname]: dayval };
if (checkelemnt == true) {
$(this).prop("checked", true);
instance.thirdweekcheckedarray.push({ [dayname]: dayval });
console.log(instance.thirdweekcheckedarray);
}
else {
$(this).prop("checked", false);
let newArray = [];
for (let i = 0; i < instance.thirdweekcheckedarray.length; i++) {
if (JSON.stringify(instance.thirdweekcheckedarray[i]) !== JSON.stringify(weekday)) {
newArray.push(instance.thirdweekcheckedarray[i]);
}
}
instance.thirdweekcheckedarray = [];
instance.thirdweekcheckedarray = newArray;
console.log(instance.thirdweekcheckedarray);
}
});
$(".fourthweek").click(function () {
let checkelemnt = $(this).is(':checked');
let day = $(this).val();
var splt = day.toString().split(':');
let dayname = splt[0];
let dayval = Boolean(splt[1]);
let weekday = { [dayname]: dayval };
if (checkelemnt == true) {
$(this).prop("checked", true);
instance.fourthweekcheckedarray.push({ [dayname]: dayval });
console.log(instance.fourthweekcheckedarray);
}
else {
$(this).prop("checked", false);
let newArray = [];
for (let i = 0; i < instance.fourthweekcheckedarray.length; i++) {
if (JSON.stringify(instance.fourthweekcheckedarray[i]) !== JSON.stringify(weekday)) {
newArray.push(instance.fourthweekcheckedarray[i]);
}
}
instance.fourthweekcheckedarray = [];
instance.fourthweekcheckedarray = newArray;
console.log(instance.fourthweekcheckedarray);
}
});
if (callback != null) {
callback();
}
}
loadControl(containerid, prop) {
$("." + containerid).empty();
let html = `<div class="card">
<div class="card-header card-header-action">
<div class="col-12">
<span class="h6 ml-10">
Weekend Definition
</span>
</div>
</div>
<div class="card-body" style="overflow-x:auto;">
<table class="bg-white" id="bizgazecrm_Routes_tbl_DayWise" style="border: 1px solid #c6c6c6;text-align: left; border-collapse: collapse;width: 100%; ">
<thead>
<tr style="border: 1px solid #c6c6c6;" class="list-item-main-title">
<td style="border: 1px solid #c6c6c6;padding: 15px;" rowspan="2"> Days</td>
<td style="text-align:center;border: 1px solid #c6c6c6;padding:10px" colspan="6">Weeks</td>
</tr>
<tr style="border: 1px solid #c6c6c6;text-align;font-weight:500" >
<td style="text-align:center;border: 1px solid #c6c6c6;padding: 5px;">All</td>
<td style="text-align:center;border: 1px solid #c6c6c6;padding: 5px;">1st</td>
<td style="text-align:center;border: 1px solid #c6c6c6;padding: 5px;">2nd</td>
<td style="text-align:center;border: 1px solid #c6c6c6;padding: 5px;">3rd</td>
<td style="text-align:center;border: 1px solid #c6c6c6;padding: 5px;">4th</td>
<td style="text-align:center;border: 1px solid #c6c6c6;padding: 5px;">5th</td>
</tr>
</thead>
<tr>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Sunday</td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllSunday" name="Sunday" value="" class="SelectAllSunday"></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Sunday firstweek" id="1stSunday" name="1stSunday" value=Sunday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Sunday secondweek" id="2ndSunday" name="2ndSunday" value=Sunday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Sunday thirdweek" id="3rdSunday" name="3rdSunday" value=Sunday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Sunday fourthweek" id="4thSunday" name="4thSunday" value=Sunday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Sunday fifthweek" id="5thSunday" name="5thSunday" value=Sunday:true></td>
</tr>
<tr>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Monday</td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllMonday" name="Monday" value="" class="SelectAllMonday"></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Monday firstweek" id="1stMonday" name="1stMonday" value=Monday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Monday secondweek" id="2ndMonday" name="2ndMonday" value=Monday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Monday thirdweek" id="3rdMonday" name="3rdMonday" value=Monday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Monday fourthweek" id="4thMonday" name="4thMonday" value=Monday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Monday fifthweek" id="5thMonday" name="5thMonday" value=Monday:true></td>
</tr>
<tr>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Tuesday</td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllTuesday" name="Tuesday" value="" class="SelectAllTuesday"></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Tuesday firstweek" id="1stTuesday" name="1stTuesday" value=Tuesday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Tuesday secondweek" id="2ndTuesday" name="2ndTuesday" value=Tuesday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Tuesday thirdweek" id="3rdTuesday" name="3rdTuesday" value=Tuesday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Tuesday fourthweek" id="4thTuesday" name="4thTuesday" value=Tuesday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Tuesday fifthweek" id="5thTuesday" name="5thTuesday" value=Tuesday:true></td>
</tr>
<tr>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Wednesday</td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllWednesday" name="Wednesday" value="" class="SelectAllWednesday"></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Wednesday firstweek" id="1stWednesday" name="1stWednesday" value=Wednesday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Wednesday secondweek" id="2ndWednesday" name="2ndWednesday" value=Wednesday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Wednesday thirdweek" id="3rdWednesday" name="3rdWednesday" value=Wednesday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Wednesday fourthweek" id="4thWednesday" name="4thWednesday" value=Wednesday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Wednesday fifthweek" id="5thWednesday" name="5thWednesday" value=Wednesday:true></td>
</tr>
<tr>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Thursday</td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllThursday" name="Thursday" value="" class="SelectAllThursday"></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Thursday firstweek" id="1stThursday" name="1stThursday" value=Thursday:1></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Thursday secondweek" id="2ndThursday" name="2ndThursday" value=Thursday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Thursday thirdweek" id="3rdThursday" name="3rdThursday" value=Thursday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Thursday fourthweek" id="4thThursday" name="4thThursday" value=Thursday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Thursday fifthweek" id="5thThursday" name="5thThursday" value=Thursday:true></td>
</tr>
<tr>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Friday</td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllFriday" name="Friday" value="" class="SelectAllFriday"></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Friday firstweek" id="1stFriday" name="1stFriday" value=Friday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Friday secondweek" id="2ndFriday" name="2ndFriday" value=Friday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Friday thirdweek" id="3rdFriday" name="3rdFriday" value=Friday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Friday fourthweek" id="4thFriday" name="4thFriday" value=Friday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Friday fifthweek" id="5thFriday" name="5thFriday" value=Friday:true></td>
</tr>
<tr>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: left;padding: 15px;" class="list-item-main-title">Saturday</td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" id="SelectAllSaturday" name="Saturday" value="AllSundays" class="SelectAllSaturday"></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"> <input type="checkbox" class="Saturday firstweek" id="1stSaturday" name="1stSaturday" value=Saturday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Saturday secondweek" id="2ndSaturday" name="2ndSaturday" value=Saturday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Saturday thirdweek" id="3rdSaturday" name="3rdSaturday" value=Saturday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Saturday fourthweek" id="4thSaturday" name="4thSaturday" value=Saturday:true></td>
<td style="cursor:pointer;text-align:center;border: 1px solid #c6c6c6;text-align: center;padding: 15px;"><input type="checkbox" class="Saturday fifthweek" id="5thSaturday" name="5thSaturday" value=Saturday:true></td>
</tr>
<input type="hidden" id="hdn_HolidayCalendarControl" class="value-control" value=" Bizgaze.Apps.Hrms.Components.ShiftCalender.Instance().HolidayCalendarobjitems();">
</table>
</div>
</div>`;
$("#" + containerid).html(html);
}
loadControlSettings(controlsettingjson, formpropertyid) {
return null;
}
loadPropertySettings(propertysettings, formpropertyid, DocPropertyName) {
return null;
}
bindEditFormDetails(formpropertyid, propval, DocPropertyName) {
var id = Number(propval);
var instance = this;
var jsfiles = ['apps/hrms/managers/holidaymanager.js'];
instance.fileCacheHelper.loadJsFiles(jsfiles, function (response) {
Bizgaze.Apps.Hrms.Managers.HolidayManager.Instance().getHolidayCalendar(id).then(function (response) {
if (response.result.length > 0) {
var data = response.result;
var everysunday = data[0].everysunday;
var everymonday = data[0].everymonday;
var everytuesday = data[0].everytuesday;
var everywednesday = data[0].everywednesday;
var everythursday = data[0].everythursday;
var everyfriday = data[0].everyfriday;
var everysaturday = data[0].everysaturday;
if (everysunday == true) {
$(".Sunday").prop("checked", true);
$("#SelectAllSunday").prop("checked", true);
}
else {
$(".Sunday").prop("checked", false);
$("#SelectAllSunday").prop("checked", false);
}
if (everymonday == true) {
$(".Monday").prop("checked", true);
$("#SelectAllMonday").prop("checked", true);
}
else {
$(".Monday").prop("checked", false);
$("#SelectAllMonday").prop("checked", false);
}
if (everytuesday == true) {
$(".Tuesday").prop("checked", true);
$("#SelectAllTuesday").prop("checked", true);
}
else {
$(".Tuesday").prop("checked", false);
$("#SelectAllTuesday").prop("checked", false);
}
if (everywednesday == true) {
$(".Wednesday").prop("checked", true);
$("#SelectAllWednesday").prop("checked", true);
}
else {
$(".Wednesday").prop("checked", false);
$("#SelectAllWednesday").prop("checked", false);
}
if (everythursday == true) {
$(".Thursday").prop("checked", true);
$("#SelectAllThursday").prop("checked", true);
}
else {
$(".Thursday").prop("checked", false);
$("#SelectAllThursday").prop("checked", false);
}
if (everyfriday == true) {
$(".Friday").prop("checked", true);
$("#SelectAllFriday").prop("checked", true);
}
else {
$(".Friday").prop("checked", false);
$("#SelectAllFriday").prop("checked", false);
}
if (everysaturday == true) {
$(".Saturday").prop("checked", true);
$("#SelectAllSaturday").prop("checked", true);
}
else {
$(".Saturday").prop("checked", false);
$("#SelectAllSaturday").prop("checked", false);
}
}
instance.getCalenderWeekItems(id);
});
});
}
getCalenderWeekItems(id) {
return __awaiter(this, void 0, void 0, function* () {
let instance = this;
yield Bizgaze.Apps.Hrms.Managers.HolidayManager.Instance().getCalendarWeekItems(id).then(function (response) {
if (response.result.length > 0) {
for (var i = 0; i < response.result.length; i++) {
var data = response.result[i];
let weekid = data.weekid;
var sunday = data.sunday;
var monday = data.monday;
var tuesday = data.tuesday;
var wednesday = data.wednesday;
var thursday = data.thursday;
var friday = data.friday;
var saturday = data.saturday;
if (weekid == 1) {
if (sunday == true) {
$("#1stSunday").prop("checked", true);
instance.firstweekcheckedarray.push({ Sunday: true });
}
if (monday == true) {
$("#1stMonday").prop("checked", true);
instance.firstweekcheckedarray.push({ Monday: true });
}
if (tuesday == true) {
$("#1stTuesday").prop("checked", true);
instance.firstweekcheckedarray.push({ Tuesday: true });
}
if (wednesday == true) {
$("#1stWednesday").prop("checked", true);
instance.firstweekcheckedarray.push({ Wednesday: true });
}
if (thursday == true) {
$("#1stThursday").prop("checked", true);
instance.firstweekcheckedarray.push({ Thursday: true });
}
if (friday == true) {
$("#1stFriday").prop("checked", true);
instance.firstweekcheckedarray.push({ Friday: true });
}
if (saturday == true) {
$("#1stSaturday").prop("checked", true);
instance.firstweekcheckedarray.push({ Saturday: true });
}
}
else if (weekid == 2) {
if (sunday == true) {
$("#2ndSunday").prop("checked", true);
instance.secondweekcheckedarray.push({ Sunday: true });
}
if (monday == true) {
$("#2ndMonday").prop("checked", true);
instance.secondweekcheckedarray.push({ Monday: true });
}
if (tuesday == true) {
$("#2ndTuesday").prop("checked", true);
instance.secondweekcheckedarray.push({ Tuesday: true });
}
if (wednesday == true) {
$("#2ndWednesday").prop("checked", true);
instance.secondweekcheckedarray.push({ Wednesday: true });
}
if (thursday == true) {
$("#2ndThursday").prop("checked", true);
instance.secondweekcheckedarray.push({ Thursday: true });
}
if (friday == true) {
$("#2ndFriday").prop("checked", true);
instance.secondweekcheckedarray.push({ Friday: true });
}
if (saturday == true) {
$("#2ndSaturday").prop("checked", true);
instance.secondweekcheckedarray.push({ Saturday: true });
}
}
else if (weekid == 3) {
if (sunday == true) {
$("#3rdSunday").prop("checked", true);
instance.thirdweekcheckedarray.push({ Sunday: true });
}
if (monday == true) {
$("#3rdMonday").prop("checked", true);
instance.thirdweekcheckedarray.push({ Monday: true });
}
if (tuesday == true) {
$("#3rdTuesday").prop("checked", true);
instance.thirdweekcheckedarray.push({ Tuesday: true });
}
if (wednesday == true) {
$("#3rdWednesday").prop("checked", true);
instance.thirdweekcheckedarray.push({ Wednesday: true });
}
if (thursday == true) {
$("#3rdThursday").prop("checked", true);
instance.thirdweekcheckedarray.push({ Thursday: true });
}
if (friday == true) {
$("#3rdFriday").prop("checked", true);
instance.thirdweekcheckedarray.push({ Friday: true });
}
if (saturday == true) {
$("#3rdSaturday").prop("checked", true);
instance.thirdweekcheckedarray.push({ Saturday: true });
}
}
else if (weekid == 4) {
if (sunday == true) {
$("#4thSunday").prop("checked", true);
instance.fourthweekcheckedarray.push({ Sunday: true });
}
if (monday == true) {
$("#4thMonday").prop("checked", true);
instance.fourthweekcheckedarray.push({ Monday: true });
}
if (tuesday == true) {
$("#4thTuesday").prop("checked", true);
instance.fourthweekcheckedarray.push({ Tuesday: true });
}
if (wednesday == true) {
$("#4thWednesday").prop("checked", true);
instance.fourthweekcheckedarray.push({ Wednesday: true });
}
if (thursday == true) {
$("#4thThursday").prop("checked", true);
instance.fourthweekcheckedarray.push({ Thursday: true });
}
if (friday == true) {
$("#4thFriday").prop("checked", true);
instance.fourthweekcheckedarray.push({ Friday: true });
}
if (saturday == true) {
$("#4thSaturday").prop("checked", true);
instance.fourthweekcheckedarray.push({ Saturday: true });
}
}
else if (weekid == 5) {
if (sunday == true) {
$("#5thSunday").prop("checked", true);
instance.fifththweekcheckedarray.push({ Sunday: true });
}
if (monday == true) {
$("#5thMonday").prop("checked", true);
instance.fifththweekcheckedarray.push({ Monday: true });
}
if (tuesday == true) {
$("#5thTuesday").prop("checked", true);
instance.fifththweekcheckedarray.push({ Tuesday: true });
}
if (wednesday == true) {
$("#5thWednesday").prop("checked", true);
instance.fifththweekcheckedarray.push({ Wednesday: true });
}
if (thursday == true) {
$("#5thThursday").prop("checked", true);
instance.fifththweekcheckedarray.push({ Thursday: true });
}
if (friday == true) {
$("#5thFriday").prop("checked", true);
instance.fifththweekcheckedarray.push({ Friday: true });
}
if (saturday == true) {
$("#5thSaturday").prop("checked", true);
instance.fifththweekcheckedarray.push({ Saturday: true });
}
}
}
}
});
});
}
HolidayCalendarobj() {
let instance = this;
var allsundays;
var allmondays;
var alltuesdays;
var allwednesdays;
var allthursdays;
var allfridays;
var allsaturdays;
if ($("#SelectAllSunday").is(':checked')) {
allsundays = true;
}
else {
allsundays = false;
}
if ($("#SelectAllMonday").is(':checked')) {
allmondays = true;
}
else {
allmondays = false;
}
if ($("#SelectAllTuesday").is(':checked')) {
alltuesdays = true;
}
else {
alltuesdays = false;
}
if ($("#SelectAllWednesday").is(':checked')) {
allwednesdays = true;
}
else {
allwednesdays = false;
}
if ($("#SelectAllThursday").is(':checked')) {
allthursdays = true;
}
else {
allthursdays = false;
}
if ($("#SelectAllFriday").is(':checked')) {
allfridays = true;
}
else {
allfridays = false;
}
if ($("#SelectAllSaturday").is(':checked')) {
allsaturdays = true;
}
else {
allsaturdays = false;
}
instance.holidaycalendar.push({
AllSundays: allsundays,
AllMondays: allmondays,
AllTuesdays: alltuesdays,
AllWednesdays: allwednesdays,
AllThursdays: allthursdays,
AllFridays: allfridays,
AllSaturdays: allsaturdays
});
}
HolidayCalendarobjitems() {
let instance = this;
instance.HolidayCalendarobj();
var holidaycalendaritems = new Array();
holidaycalendaritems.push({
AllWeeks: instance.holidaycalendar,
FirstWeek: instance.firstweekcheckedarray,
SecondWeek: instance.secondweekcheckedarray,
ThirdWeek: instance.thirdweekcheckedarray,
FourthWeek: instance.fourthweekcheckedarray,
FifthWeek: instance.fifththweekcheckedarray
});
return holidaycalendaritems;
}
static Instance() {
if (this.instance === undefined) {
this.instance = new ShiftCalender();
}
return this.instance;
}
}
Components.ShiftCalender = ShiftCalender;
})(Components = Hrms.Components || (Hrms.Components = {}));
})(Hrms = Apps.Hrms || (Apps.Hrms = {}));
})(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
})(Bizgaze || (Bizgaze = {}));
File diff suppressed because one or more lines are too long