Bug #2174
[HR-User management]fungsi engine untuk merubah valid through username untuk employee yang sudah resign
Added by Muhammad Bintar over 1 year ago.
Updated over 1 year ago.
Due date:
05/22/2023 (about 19 months late)
Description
dear tim developer,
berdasarkan referensi ini
http://remote.minovais.com:3000/redmine/issues/2098
untuk update lock nya sudah bisa, namun ternyata karena kolom validthrough nya tidak terupdate alias masih 99991231, username tersebut masih bisa login walau employee tersebut sudah resign.
20200098
20200478
20230064
20230106
20230122
remote.minovais.com:31141
database sql server
remote.minovais.com, 1438
Files
- Status changed from New to Assigned
- Assignee changed from Saswanto Tampan to M Azid Wahyudi
- Status changed from Assigned to QA Test
dear masbin , udah bisa di test ya , untuk issue ini menggunakan trigger after update pada movement type di phrpa0002 berikut ini triggernya
USE MinovaHR_Indomobil_Dev;
GO
CREATE TRIGGER [dbo].UpdateValidtrought
ON [dbo].[hr_md_emp_md0002]
AFTER UPDATE
AS
BEGIN
-- Cek jika kolom test1 diperbarui ke '01'
IF UPDATE
BEGIN
-- Perbarui kolom start_date di TabelB berdasarkan start_date di TabelA
UPDATE B
SET B.valid_through = A.[start_date]
FROM base_sys_user AS B
INNER JOIN [hr_md_emp_md0002] AS A ON B.emp_id = A.emp_id
INNER JOIN inserted AS I ON A.emp_id = I.emp_id
INNER JOIN deleted AS D ON A.emp_id = D.emp_id
WHERE I.movement_type = '80' AND (D.movement_type <> '80' OR D.movement_type IS NULL);
END;
END;
makasih
- Assignee changed from M Azid Wahyudi to Muhammad Bintar
- Status changed from QA Test to Deploy
- Assignee changed from Muhammad Bintar to M Azid Wahyudi
update:
masih belum fix ya azid....
- Assignee changed from M Azid Wahyudi to Muhammad Bintar
update :
berikut query trigger nya
USE [MinovaHR_Indomobil_Dev]
GO
/****** Object: Trigger [dbo].[UpdateValidThrougtInsert] Script Date: 23/05/2023 10:51:02 **/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[UpdateValidThrougtInsert]
ON [dbo].[hr_md_emp_md0002]
AFTER INSERT
AS
BEGIN
IF EXISTS (SELECT 1 FROM inserted WHERE movement_type ='80')
BEGIN
UPDATE base_sys_user
SET valid_through = a.[start_date]
FROM base_sys_user b
INNER JOIN inserted a ON b.emp_id = a.emp_id
WHERE a.movement_type = '80';
END
END;
sudah di deploy ke client imfi.
tinggal di tes contoh employee lain oleh user nya.
Also available in: Atom
PDF