Project

General

Profile

Bug #535

menambahkan validasi ESS Leave pad saat mengajukan cuti, quota nya yang remaining -1

Added by Muhammad Bintar about 3 years ago. Updated about 1 month ago.

Status:
Closed
Priority:
Normal
Start date:
11/05/2021
Due date:
11/05/2021
% Done:

0%

Estimated time:

Description

dear tim developer, mohon supportnya untuk penambahan validasi pada ess leave dimana pada saat mengajukan cuti memiliki -1 , maka akan ada validasi untuk tidak dapat mengajukan ess leave tersebut.

namun di client fama dev itu bisa dilakukan.
mohon untuk mengambil referensi nya dari Bank Fama dev.


fama dev
http://remote.minovais.com:31129/

Rohto Production
sql server 2019
remote.minovais.com, 1445\MSSQLSERVER2019


Files

clipboard-202111051515-vefnv.png (95.7 KB) clipboard-202111051515-vefnv.png Muhammad Bintar, 11/05/2021 03:15 PM
clipboard-202111051603-swzei.png (59.3 KB) clipboard-202111051603-swzei.png Muhammad Bintar, 11/05/2021 04:03 PM
validasiRhoto101121.txt (4.47 KB) validasiRhoto101121.txt M Azid Wahyudi, 11/10/2021 04:01 PM
#1

Updated by Muhammad Bintar about 3 years ago

  • Assignee changed from Kezia Pawitra Yulianti to Mr. Yusuf
#2

Updated by Muhammad Bintar about 3 years ago

  • Assignee changed from Mr. Yusuf to M Azid Wahyudi
#3

Updated by M Azid Wahyudi about 3 years ago

=> penambahan CekLvDate di field OnInitExtensions di 'field[name=StartDate]': {
change: function (field) {
selectDate(field);
fillEndDate(field);
CekLvDate(); // penambahan
}
},

'field[name=AbsenceType]': {
select: function (field) {
selectAbsenceType(field);
fillEndDate(field);
CutiThn(); // penambahan
}
},

// penambahan field[name=TotalRemainingQuota]
'field[name=TotalRemainingQuota]': {
change: function () {
CekLvMin();
}
},

=> penambahan function di field OnMethodExtensions:

function CekLvDate() {
debugger;
var body = MinovaUtil.WORKFLOW.getViewBodyWorkflow();
var emp = MinovaUtil.WORKFLOW.getEmpId();
var StartDate = body.down('field[name=StartDate]').getValue();
var Lv = '';
var lv2 = '';
MinovaUtil.ExecuteParamQuery({
ID: 'LVCKDATE',
StartDate: StartDate,
EmpID: emp
}, function (s) {
d
var result = Ext.decode(s.responseText);
var dt = Ext.decode(Ext.decode(result.data));
if (dt.length == 0) {
Lv = '';
} else {
var val = dt0.Tglrovr;
var val2 = dt0.Tglrun;
Lv = val;
lv2 = val2;
}
});
if (Lv == '1') {
MinovaMessageError("ERROR", "CEK19LV", "", "");
body.down('field[name=StartDate]').setValue('');
body.down('field[name=EndDate]').setValue('');
} else if (lv2 == '1') {
MinovaMessageError("ERROR", "CEKRUNLV", "", "");
body.down('field[name=StartDate]').setValue('');
body.down('field[name=EndDate]').setValue('');
}
}
function CekLvMin() {
var Body = MinovaUtil.WORKFLOW.getViewBodyWorkflow();
var ttlquo = Body.down('[name=TotalRemainingQuota]').getValue();
if (ttlquo < 0) {
MinovaMessageError("ERROR", "CEKLVQUO", "", "");
Body.down('field[name=EndDate]').setValue('');
}
}
function CutiThn() {
var body = MinovaUtil.WORKFLOW.getViewBodyWorkflow();
var abs = body.down('[name=AbsenceType]').getValue();
var StartDate = body.down('[name=StartDate]');
var StartD = body.down('[name=StartDate]').getValue();
var EndDate = body.down('[name=EndDate]');
var ss = '19000101';
var ee = '99991231';
var now = MinovaUtil.GetNowDate();
var abss = body.down('[name=TotalAbsenceTaken]');
var res = '';
MinovaUtil.ExecuteParamQuery({
ID: 'CEKTWOWEEKLEAVE'
}, function (s) {
var result = Ext.decode(s.responseText);
var dt = Ext.decode(Ext.decode(result.data));
var val = dt0.res;
res = val;
});
if (abs == '1000') {
StartDate.setMinValue(res.substring(6, 8) + '/' + res.substring(4, 6) + '/' + res.substring(0, 4));
StartDate.setMaxValue(ee.substring(6, 8) + '/' + ee.substring(4, 6) + '/' + ee.substring(0, 4));
EndDate.setMinValue(StartD.substring(6, 8) + '/' + StartD.substring(4, 6) + '/' + StartD.substring(0, 4));
EndDate.setMaxValue(ee.substring(6, 8) + '/' + ee.substring(4, 6) + '/' + ee.substring(0, 4));
} else {
StartDate.setMinValue(ss.substring(6, 8) + '/' + ss.substring(4, 6) + '/' + ss.substring(0, 4));
EndDate.setMaxValue(ee.substring(6, 8) + '/' + ee.substring(4, 6) + '/' + ee.substring(0, 4));
}
}

=> tambah Data di table [dbo].[PCMWFCUSTPARAM] :
1)
ID : LVCKDATE

Value :
DECLARE @Regidtbl TABLE) INSERT INTO @Regidtbl SELECT RegID FROM dbo.PCMWFRUNMAIN WHERE BizflowID ='MD_Leave_AJTM' AND EmpIDAs=@EmpID DECLARE @TglRun TABLE) INSERT INTO @TglRun SELECT DISTINCT CASE WHEN NOT EXISTS (SELECT DISTINCT Value FROM PCMWFRUNBIZDATA DATA INNER JOIN @Regidtbl reg ON reg.RegID = data.RegID WHERE FieldID ='StartDate' AND Value =@StartDate ) THEN '0' ELSE '1' END DECLARE @TglOvr TABLE) INSERT INTO @TglOvr SELECT DISTINCT CASE WHEN NOT EXISTS (SELECT DISTINCT StartDate FROM PHRPA0019 WHERE EmployeeID = @EmpID AND StartDate =@StartDate) THEN '0' ELSE '1' END SELECT * FROM @TglOvr, @TglRun

CommandType : sqlstring

2)
ID : CEKTWOWEEKLEAVE

Value :
DECLARE @Days VARCHAR = (SELECT Value1 FROM dbo.PCMEPGENPARAM WHERE Parameter='MINIMALHARIPENGAJUANCUTITAHUNAN') DECLARE @Now VARCHAR = (SELECT FORMAT (getdate(), 'yyyymmdd') ) DECLARE @Two DATETIME = (SELECT DATEADD , GETDATE)) SELECT FORMAT (@Two,'yyyyMMdd') AS res

CommandType : sqlstring

#4

Updated by Muhammad Bintar about 1 month ago

  • Status changed from QA Test to Closed

Also available in: Atom PDF