Sei sulla pagina 1di 9

-------------------------

TAF 101
-------------------------
/** loading **/
applications_uspMainHomePageTAF ( loads Menu )
> applications_uspMainTAF2 ( load forms )
- 2 types of loading
'p=applications_uspTAF_Load&p1=HG&p2=4&p3=000000' ( not used )
'p=applications_uspTAF_Load&p1=HG&p2=4&p3={{TafNo}}' ( new )

- 4 types of action ( receiver of action applications_uspTAF_Actions )


New, Draft, Search, SearchEmp, Update ( is not visible in home )

> applications_uspTAF_LoadEmployee ( 000000 /* load current user*/, empno )


--loads employee in evt
src tbl payroll.dbo.employee_master_list_oracle

/** loading of employees from search **/


applications_uspTAF_Load
> reservation.dbo.applications_uspTAF_Load ( load taf of emp )
- central.dbo.applications_uspTAF_GetApprovals ( load approvals )
applications_uspTAF_Actions
applications_uspTAF_Actions

-------------------------
TAF Utilities
-------------------------
SELECT
roles.role_name,
usr.ad_account
FROM
[CENTRAL].[dbo].[applications_roles] roles,
[CENTRAL].[dbo].[applications_user_roles] usr_roles,
[CENTRAL].[dbo].[applications_users] usr
WHERE
roles.APP_ID = '000004_APPS_DVO' --taf
AND roles.ROLE_ID = usr_roles.ROLE_ID
AND usr_roles.PERSON_ID = usr.person_id
AND usr.ad_account like '%garcia%'

applications_uspMainHomePageTAF
Aboitiz\CFuentecilla

applications_uspMainHomePageTAF
applications_uspMainTAF2 ( applications_uspMainTAF3 )
applications_uspTAF_LoadEmployee
applications_uspTAF_Actions

select * from dbo.applications_users


where ad_account like '%esguerra%'

select * from dbo.applications_users


where person_id = 59199
select * from reservation.dbo.tb_taf_transactions
where person_id = 48511

insert into dbo.applications_user_roles


select role_id, '000616_USER_DVO', 59199, start_date, end_date, 'ABOITIZ\CSGarcia',
creation_date, last_modified_date, deleted from dbo.applications_user_roles
where user_id = '000225_USER_DVO'
and role_id = '000006_ROLE_DVO'

IMPORTANT!! put 'aboitiz' in ad_account!!!

update dbo.applications_users set


ad_account = 'ABOITIZ\SADLAWAN',
external_username = null,
external_password = null,
resetExPassword = 0,
email_address = 'seth.adlawan@aboitiz.com'
where [user_id] = '000616_USER_DVO'

check approvers
declare @Approvers varchar(12)
EXEC central.dbo.usp_wac_CheckApprover 'TAF', 48511, 201805000035, @Approvers
OUTPUT
select @Approvers

exec reservation.dbo.applications_uspTAF_NotifyApprover '201805000035M'

declare @transaction varchar(20) = '000030_TAF_DVO'


declare @SenderEmailAddress varchar(100) = 'wilbert.comicho@aboitiz.com'

SELECT preapproval, [status], approver FROM reservation.dbo.tb_taf_transactions


where taf_no = @transaction
select max(approval_order) from central.dbo.applications_workflow_history where
object_id = @transaction

SELECT preapproval, [status], approver FROM reservation.dbo.tb_taf_transactions


where taf_no = @transaction

SELECT preapproval, [status], central.dbo.ufnSplit(approver,':',1) FROM


reservation.dbo.tb_taf_transactions where taf_no = @transaction
SELECT TOP 1 CAST(PERSON_ID AS VARCHAR(10)) FROM CENTRAL.DBO.APPLICATIONS_USERS
WHERE email_address = @SenderEmailAddress
SELECT COUNT(*) FROM reservation.dbo.tb_taf_transactions WHERE TAF_NO =
@transaction AND STATUS = 'In-Process'

select * from central.dbo.applications_workflow_history --where object_id =


@transaction
order by creation_date

(select cast(approval_order as varchar(2)) + ':' + approver from


central.dbo.applications_workflow_history where approval_order = @order + 1 and
object_id = @MY_NUMBER)

dbo].[applications_uspTAF_processEmailApproval

if @action = 'STactns' --buttons for approval


exec reservation.dbo.applications_uspTAF_SetActions

/** approval of taf admin **/


https://apps.hedcor.com/taf/default.aspx?processid=IC,_x8NpG
%7CDs2%7C9DEEsol833yEHDoN~%7CMG3N3,4CxS39EC3EElwW~NtH4lxxNM4&bu=Hedcor
%20Group&act=4&paf=%20Approve&pars=201807000160M~In%20Process~Emmanuel%20B.
%20Medelo~Jul%20%206%202018%20%207:23AM~103666~HEDCOR
%20Group~07/10/2018~07/14/2018~Hedcor,%20Inc.:Hedcor%20Inc.%20%20%20Davao
%20Warehouse~Attend%20meeting%20and%20Panel%20discussion%20on%20vehicular
%20accident%20and%20fire%20incident%20in%20Benguet~Hedcor,%20Inc.~Beckel%20Office
%20in%20Benguet%20~LateReason~~~0~07/10/2018~07/14/2018~~Bloomfield%20w/
%20breakfast%0ARed%20Clark%20w/o%20breakfast%20for%20July
%2013.14~0~07/10/2018~07/14/2018~~~0~07/10/2018~07/14/2018~%20@

18, 19
23, 24
28, 29

select case when central.dbo.ufnSplit(@p_params,'~',28) = ' ' then 'hello' end

/** email approver **/

select email_address from central.dbo.applications_users


where PERSON_ID = 776

select * from payroll.dbo.employee_hierarchy_oracle where full_name like '%cherry%'


/** HRQ error **/
SELECT TOP 1 PERSON_ID FROM PAYROLL.DBO.EMPLOYEE_MASTER_LIST_ORACLE WHERE
ASSIGNMENT_NUMBER = @p_empnumber AND FULL_NAME LIKE REPLACE(@p_empname,' ','%')

/** check earning policy error **/


select earning_policy_name from [HGPayroll].[dbo].[ORACLE_Employee_Master] where
person_id = 59199

Payroll.[dbo].[ORACLE_Employee_Master] where person_id = 59199

update Payroll.[dbo].[ORACLE_Employee_Master] set


earning_policy_name = 'Santa Cruz Earning Policy'
where person_id = 59199

/** query for approver **/


select * from reservation.dbo.tb_taf_transactions
where
workflow like '%28240%'
and [status] not in (
'Returned',
'Approved'
)

/** update the dates **/


select * from reservation.dbo.tb_taf_transactions
where person_id = 776
and taf_no = '201807000194M'

update reservation.dbo.tb_taf_transactions set


travel_period_start = '2018-08-06 07:55:00',
travel_period_end = '2018-08-07 07:55:00',
plane_no_of_days = 1,
plane_departure_date = '2018-08-06 07:56:00.000',
plane_return_date = '2018-08-07 07:56:00.000',
accom_check_in = '2018-08-06 07:57:00.000',
accom_check_out = '2018-08-07 07:57:00.000'
where person_id = 776
and taf_no = '201807000194M'

update reservation.dbo.tb_taf_transactions set


cost_center = 'Hedcor Inc.,'
where taf_no = '201808000242M'

/** taf extraction **/


/****** Script for SelectTopNRows command from SSMS ******/
SELECT
taf.[taf_no],
emp.full_name name
,taf.[date_prepared]
,taf.[travel_period_start]
,taf.[travel_period_end]
,taf.[purpose]
,taf.[bu]
,taf.[employee_base]
,taf.[cost_center]
,isnull(taf.[destination], '')
,case isnull(taf.[latereason], '')
when 'Choose here' then 'N/A'
when '{{LateReason}}' then 'N/A'
else taf.[latereason]
end latereason
,isnull(taf.[latebywhom], '') lateby
,isnull(taf.[plane_no_of_days], 0) plane_no_of_days
,case isnull(taf.[plane_departure_date], '1900-01-01 00:00:00.000')
when '1900-01-01 00:00:00.000' then 'N/A'
else convert(varchar, taf.[plane_departure_date])
end plane_departure_date --case
,case isnull(taf.[plane_return_date], '1900-01-01 00:00:00.000')
when '1900-01-01 00:00:00.000' then 'N/A'
else convert(varchar, taf.[plane_return_date])
end plane_return_date --case
,isnull(taf.[plane_spec_req], 'N/A') plane_spec_req
,isnull(taf.[plane_conf_amnt], 'N/A') plane_conf_amnt
,isnull(taf.[accom_no_of_days], 0) accom_no_of_days
,case isnull(taf.[accom_check_in], '1900-01-01 00:00:00.000')
when '1900-01-01 00:00:00.000' then 'N/A'
else convert(varchar, taf.[accom_check_in])
end accom_check_in --case
,case isnull(taf.[accom_check_out], '1900-01-01 00:00:00.000')
when '1900-01-01 00:00:00.000' then 'N/A'
else convert(varchar, taf.[accom_check_out])
end accom_check_out --case
,isnull(taf.[accom_spec_req], 'N/A') accom_spec_req
,isnull(taf.[accom_conf_amnt], 'N/A') accom_conf_amnt
,isnull(taf.[land_no_of_days], 0) land_no_of_days
,case isnull(taf.[land_start_date], '1900-01-01 00:00:00.000')
when '1900-01-01 00:00:00.000' then 'N/A'
else convert(varchar, taf.[land_start_date])
end land_start_date --case
,case isnull(taf.[land_end_date], '1900-01-01 00:00:00.000')
when '1900-01-01 00:00:00.000' then 'N/A'
else convert(varchar, taf.[land_end_date])
end land_end_date --case
,isnull(taf.[land_spec_req], 'N/A') land_spec_req
,isnull(taf.[land_conf_amnt], 'N/A') land_conf_amnt
,[status]
FROM
[Reservation].[dbo].[tb_taf_transactions] taf,
payroll.dbo.employee_master_list_oracle emp
where
emp.person_id = taf.person_id
and taf.date_prepared > '2018-05-31 17:13:00.000'
and taf.[status] IN ( 'Approved', 'In-Process')
and taf.[deleted] = 0
order by taf.date_prepared
/** check current approvers **/
SELECT preapproval, [status], approver FROM reservation.dbo.tb_taf_transactions
where taf_no = '201810000357M'

/** check list of approvers **/


select * from central.dbo.applications_workflow_history where object_id =
'201810000357M'

/** update approvers **/


declare @transaction varchar(20) = '201810000357M'
declare @SenderEmailAddress varchar(100) = 'wilbert.comicho@aboitiz.com'

declare @approval_order int


SELECT preapproval, [status], central.dbo.ufnSplit(approver,':',1),
central.dbo.ufnSplit(workflow,'~',3), workflow FROM
reservation.dbo.tb_taf_transactions where taf_no = @transaction
SELECT @approval_order = convert(int, central.dbo.ufnSplit(approver,':',1)) FROM
reservation.dbo.tb_taf_transactions where taf_no = @transaction

/*
select * from central.dbo.applications_workflow_history
where object_id = @transaction
and approval_order = @approval_order
order by creation_date
*/
--SELECT * FROM reservation.dbo.tb_taf_transactions where taf_no = @transaction

SELECT *
FROM [Reservation].[dbo].[tb_taf_remarks]
where taf_no = @transaction
select * from central.dbo.applications_workflow_history where [object_id] =
'201810000357M'

/** update applications_workflow_history based on remarks **/


update central.dbo.applications_workflow_history set
action_date = '2018-10-04 11:59:59.483',
remarks = 'Approve',
last_modified_by = 93
where [object_id] = @transaction
and approval_order = @approval_order

/** update transaction **/


SELECT central.dbo.ufnSplit(workflow,'~',3) FROM
reservation.dbo.tb_taf_transactions where taf_no = @transaction

/** kulang ug condition for approver = 93!! **/


update prod set
prod.approver = bak.approver,
prod.last_modified_by = bak.last_modified_by,
prod.remarks = bak.remarks,
prod.action_date = bak.action_date
from
[CENTRAL].[dbo].[applications_workflow_history] prod,
iridium.[CENTRALthursday].[dbo].[applications_workflow_history] bak
WHERE
prod.object_id = bak.object_id
and prod.approval_order = bak.approval_order

/** logs **/


MonitoringDB.dbo.log_entries

/** insert remarks **/


exec dbo.applications_uspTAF_Remarks
'Aboitiz\rpacquiao'
,'0'
,'Hedcor Group'
,'201810000359M'
,''

if not showing forms look for this table


select * from
payroll.dbo.oracle_employee_master where person_id = @p
/****** sagot sa automation ******/
SELECT [SenderEmailAddress]
,[Subject]
,[Body]
,[encKey]
,[DateReceived]
,[TimeReceived]
FROM [MonitoringDB].[dbo].[EMAIL_HedcorAppsMails]
WHERE [subject] like '%201908001290L%'

update [MonitoringDB].[dbo].[EMAIL_HedcorAppsMails] set


encKey = 'XX_7sS|NSses|jx2@N2GSD4K2qdEe|xjC_SCSI*xeHEjr3@5yGd_4,tqqEe*|
jlIS4~sTxdsS|NSses|0EsG8D5sJWS~M2SGIJ*_8n2SG|TBs8HxIl|892dlpxX|STos,dNHxSRSIdsS|
NSses|HGIDSent from my iP_XX'
WHERE [subject] like '%201908001290L%'

exec [MonitoringDB].[dbo].[EMAIL_usp_mnv_Handler] 'chris.faelnar@aboitiz.com',


'TAF APPROVE 201908001290L : Brenda G. Capsuyen', 'For Comments and Remarks, please
specify below:

HGID7sS|NSses|jx2@N2GSD4K2qdEe|xjC_SCSI*xeHEjr3@5yGd_4,tqqEe*|
jlIS4~sTxd0EsG8D5sJWS~M2SGIJ*_8n2SG|TBs8HxIl|892dlpxX|STos,dNHxSRSIdHGID

Sent from my iPhone


', '2019-08-01 22:10:37.700'

declare @transaction varchar(24) = '201908001290L'

SELECT *
FROM [Reservation].[dbo].[tb_taf_remarks]
where taf_no = @transaction
and taf_remarks_no = '016666_TAFR_DVO'

update [Reservation].[dbo].[tb_taf_remarks] set


creation_date = '2019-08-01 22:10:37.700'
where taf_no = @transaction
and taf_remarks_no = '016666_TAFR_DVO'
declare @transaction varchar(24) = '201908001290L'
select * from central.dbo.applications_workflow_history where [object_id] =
@transaction

/** update applications_workflow_history based on remarks **/


update central.dbo.applications_workflow_history set
action_date = '2019-08-01 22:10:37.700',
remarks = 'Approve',
last_modified_by = 87
where [object_id] = @transaction
and approval_order = 1

Potrebbero piacerti anche