HRMS(Human Resource Management System)

--人员

per_people_f

--人员分配

per_all_assignments_f

--要素

 DECLARE
l_element_name VARCHAR2(240);
l_element_id NUMBER;
l_period_name VARCHAR2(240);
l_period_date DATE;
x_element_type_id NUMBER;
x_effective_start_date DATE;
x_effective_end_date DATE;
x_object_version_number NUMBER;
x_comment_id NUMBER;
x_processing_priority_warning BOOLEAN;
BEGIN
fnd_global.apps_initialize(user_id => 1510,
resp_id => 23991,
resp_appl_id => 800); l_element_name := 'BS交通补贴12';
l_period_name := '9 2016 日历月份'; BEGIN
SELECT ptp.end_date
INTO l_period_date
FROM per_time_periods ptp
WHERE ptp.period_name = l_period_name;
EXCEPTION
WHEN OTHERS THEN
l_period_date := NULL;
END; BEGIN
SELECT petf.element_type_id
INTO l_element_id
FROM pay_element_types_f petf
WHERE petf.element_name = l_element_name
AND l_period_date BETWEEN effective_start_date AND effective_end_date;
EXCEPTION
WHEN OTHERS THEN
l_element_id := NULL;
END; dbms_output.put_line('l_period_date:=' || l_period_date);
dbms_output.put_line('l_element_id:=' || l_element_id); IF (l_element_id IS NULL) THEN
dbms_output.put_line('Create'); pay_element_types_api.create_element_type(p_validate => FALSE,
p_effective_date => l_period_date,
p_classification_id => 118,
p_element_name => l_element_name,
p_input_currency_code => 'CNY',
p_output_currency_code => 'CNY',
p_multiple_entries_allowed_fla => 'Y',
p_processing_type => 'N',
p_business_group_id => 81,
p_element_type_id => x_element_type_id,
p_effective_start_date => x_effective_start_date,
p_effective_end_date => x_effective_end_date,
p_object_version_number => x_object_version_number,
p_comment_id => x_comment_id,
p_processing_priority_warning => x_processing_priority_warning);
-- ELSE
-- pay_element_types_api.update_element_type();
END IF; IF x_processing_priority_warning THEN
dbms_output.put_line('x_processing_priority_warning');
END IF; dbms_output.put_line('x_element_type_id:=' || x_element_type_id);
dbms_output.put_line('x_effective_start_date:=' || x_effective_start_date);
dbms_output.put_line('x_effective_end_date:=' || x_effective_end_date);
dbms_output.put_line('x_element_type_id:=' || x_object_version_number);
dbms_output.put_line('x_comment_id:=' || x_comment_id);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('导入要素异常!');
END;

创建要素

--链接

  /* IF (l_element_link_id IS NULL) THEN

       pay_element_link_api.create_element_link(p_validate                   => FALSE,
p_effective_date => l_period_date,
p_element_type_id => l_element_id,
p_business_group_id => 81,
p_costable_type => 'F',
p_payroll_id => l_payroll_id,
p_people_group_id => l_people_group_id,
p_cost_concat_segments => '01.000000.66010101.0000.00000000.0000.000000.00',
p_balance_concat_segments => '01.000000.22110101.0000.00000000.0000.000000.00',
p_cost_allocation_keyflex_id => 63,
p_balancing_keyflex_id => 76,
p_standard_link_flag => 'N',
p_element_link_id => x_element_link_id,
p_comment_id => x_comment_id,
p_object_version_number => x_object_version_number,
p_effective_start_date => x_effective_start_date,
p_effective_end_date => x_effective_end_date); dbms_output.put_line('x_element_link_id:=' || x_element_link_id);
dbms_output.put_line('x_comment_id:=' || x_comment_id);
dbms_output.put_line('x_element_type_id:=' || x_object_version_number);
dbms_output.put_line('x_effective_start_date:=' || x_effective_start_date);
dbms_output.put_line('x_effective_end_date:=' || x_effective_end_date);
END IF;*/

创建链接

--要素集

 DECLARE
l_element_name VARCHAR2(240);
l_element_id NUMBER;
l_period_name VARCHAR2(240);
l_period_date DATE;
l_assign_number VARCHAR2(240);
l_assignment_id NUMBER;
l_payroll_id NUMBER;
l_payroll VARCHAR2(240);
l_element_link_id NUMBER;
l_element_entry_id NUMBER;
l_people_group_id NUMBER;
x_element_link_id NUMBER;
x_effective_start_date DATE;
x_effective_end_date DATE;
x_object_version_number NUMBER;
x_comment_id NUMBER;
x_element_entry_id NUMBER;
x_create_warning BOOLEAN;
BEGIN fnd_global.apps_initialize(user_id => 1510,
resp_id => 23991,
resp_appl_id => 800); l_element_name := 'BS_FJJ_非计件日工';
l_period_name := '9 2016 日历月份';
l_assign_number := ''; BEGIN
SELECT ptp.end_date
INTO l_period_date
FROM per_time_periods ptp
WHERE ptp.period_name = l_period_name;
EXCEPTION
WHEN OTHERS THEN
l_period_date := NULL;
END; BEGIN
SELECT petf.element_type_id
INTO l_element_id
FROM pay_element_types_f petf
WHERE petf.element_name = l_element_name
AND l_period_date BETWEEN effective_start_date AND effective_end_date;
EXCEPTION
WHEN OTHERS THEN
l_element_id := NULL;
END; dbms_output.put_line('l_period_date:=' || l_period_date);
dbms_output.put_line('l_element_id:=' || l_element_id); BEGIN
SELECT paaf.payroll_id,
paaf.assignment_id,
paaf.people_group_id
INTO l_payroll_id,
l_assignment_id,
l_people_group_id
FROM per_all_assignments_f paaf
WHERE paaf.assignment_number = l_assign_number
AND l_period_date BETWEEN paaf.effective_start_date AND paaf.effective_end_date;
EXCEPTION
WHEN no_data_found THEN
dbms_output.put_line('没有分配信息');
WHEN too_many_rows THEN
dbms_output.put_line('存在多条分配信息');
END; dbms_output.put_line('l_payroll_id:=' || l_payroll_id);
dbms_output.put_line('l_assignment_id:=' || l_assignment_id);
dbms_output.put_line('l_people_group_id:=' || l_people_group_id); IF l_payroll_id IS NOT NULL THEN
BEGIN
SELECT pap.payroll_name
INTO l_payroll
FROM pay_all_payrolls_f pap
WHERE pap.payroll_id = l_payroll_id
AND l_period_date BETWEEN pap.effective_start_date AND pap.effective_end_date;
EXCEPTION
WHEN no_data_found THEN
dbms_output.put_line('没有有效工资单');
WHEN too_many_rows THEN
dbms_output.put_line('存在多工资单');
END; dbms_output.put_line('l_payroll:=' || l_payroll);
END IF; --IF l_payroll_id IS NULL THEN IF (l_element_id IS NOT NULL) THEN l_element_link_id := NULL;
BEGIN
SELECT pelf.element_link_id
INTO l_element_link_id
FROM pay_element_links_f pelf
WHERE pelf.element_type_id = l_element_id
AND pelf.payroll_id = l_payroll_id
--AND pelf.people_group_id = l_people_group_id
AND l_period_date BETWEEN pelf.effective_start_date AND pelf.effective_end_date
AND cuxhrpkg.show_record('PAY_PEOPLE_GROUPS',
NULL,
pelf.business_group_id,
pelf.people_group_id,
to_char(l_period_date,
'YYYYMMDD'),
'') = 'TRUE'
AND cuxhrpkg.show_ass(l_assignment_id,
pelf.people_group_id,
l_period_date) = 'TRUE'; EXCEPTION
WHEN OTHERS THEN
l_element_link_id := NULL;
END; dbms_output.put_line('l_element_link_id:=' || l_element_link_id); IF (l_element_link_id IS NOT NULL) THEN
BEGIN
SELECT ee.element_entry_id
--ee.object_version_number
INTO l_element_entry_id
-- l_object_version_number
FROM pay_element_entries_f ee,
pay_element_types_f et,
pay_element_links_f el
WHERE el.element_link_id = ee.element_link_id
AND el.element_link_id = l_element_link_id
AND el.element_type_id = et.element_type_id
AND ee.assignment_id = l_assignment_id
AND l_period_date BETWEEN ee.effective_start_date AND ee.effective_end_date
AND l_period_date BETWEEN el.effective_start_date AND el.effective_end_date
AND l_period_date BETWEEN et.effective_start_date AND et.effective_end_date
AND et.multiple_entries_allowed_flag = 'N'
AND ee.entry_type = 'E';
EXCEPTION
WHEN OTHERS THEN
l_element_entry_id := NULL;
END; dbms_output.put_line('l_element_entry_id:=' || l_element_entry_id);
END IF;
END IF; -- IF (l_element_id IS NOT NULL) THEN
IF (l_element_entry_id IS NULL) THEN
pay_element_entry_api.create_element_entry(p_effective_date => l_period_date,
p_business_group_id => 81,
p_assignment_id => l_assignment_id,
p_element_link_id => l_element_link_id,
p_entry_type => 'E',
p_creator_type => 'F',
p_cost_allocation_keyflex_id => NULL,
-- p_input_value_id1 => l_input_id, p_effective_start_date => x_effective_start_date,
p_effective_end_date => x_effective_end_date,
p_element_entry_id => x_element_entry_id,
p_object_version_number => x_object_version_number,
p_create_warning => x_create_warning); dbms_output.put_line('x_effective_start_date:=' || x_effective_start_date);
dbms_output.put_line('x_effective_end_date:=' || x_effective_end_date);
dbms_output.put_line('x_element_entry_id:=' || x_element_entry_id);
dbms_output.put_line('x_object_version_number:=' || x_object_version_number); END IF;
--dbms_output.put_line('l_payroll:=' || l_payroll);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('导入要素异常!');
END;

创建要素集

HR*创建人员要素链接的更多相关文章

  1. 在64位SQL Server中创建Oracle的链接服务器 Link Server

    有时候我们希望在一个sqlserver下访问另一个sqlserver数据库上的数据,或者访问其他oracle数据库上的数据,要想完成这些操作,我们首要的是创建数据库链接. 数据库链接能够让本地的一个s ...

  2. 在64位SQL Server中创建Oracle的链接服务器

    当我们同时使用SQL Server和Oracle来存储数据时,经常会用到跨库查询.为了方便使用跨库查询,一个最好的办法就是通过创建链接服务器来实现.既可以在SQL Server中创建Oracle的链接 ...

  3. openerp模块收藏 移除下拉选择列表中的“创建并编辑”链接(转载)

    移除下拉选择列表中的“创建并编辑”链接 原文:http://shine-it.net/index.php/topic,5990.0.html 有时希望下拉列表中列出的项是与主表某个字段关联的,用户只能 ...

  4. 利用CMake自己创建OpenCV静态链接库

    1.准备工作: 1)完成Visual Studio2012安装: 2)下载并解压CMake3.5.0: 3)下载并解压OpenCV2.4.12: 4)下载并解压TBB44_20160128oss. 2 ...

  5. VMware vSphere 服务器虚拟化之二十二桌面虚拟化之创建View Composer链接克隆的虚拟桌面池

    VMware vSphere 服务器虚拟化之二十二桌面虚拟化之创建View Composer链接克隆的虚拟桌面池 在上一节我们创建了完整克隆的自动专有桌面池,在创建过程比较缓慢,这次我们将学习创建Vi ...

  6. 如何创建一个要素数据类 IField,IFieldEdit,IFields,IFieldsEditI,GeometryDef,IGeometryDefEdit接口

    如何创建一个要素数据类 创建要素类用到了IFeatureWorkspace.CreateFeatureClass方法,在这个方法中有众多的参数,为了满足这些参数,我们要学习和了解下面的接口. IFie ...

  7. 宝塔控制面板创建ftp后链接不上的解决方法

    很多的新手在安装宝塔面板并且创建完ftp管理后链接ftp居然链接不上?有许多朋友都不知道本站q302博客也是基于宝塔控制面板管理的,本站在安装网站完成后也和你们一样ftp链接不上,后面经过多次测试之后 ...

  8. windows下创建文件夹链接

    mklink百度百科https://baike.baidu.com/item/mklink/566760?fr=aladdin 创建文件夹链接mklink /d "C:\Users\Admi ...

  9. VS2010创建C++静态链接库创建和使用

    VS2010创建C++静态链接库的方法: 1. 创建一个新项目,在已安装的模板中选择“常规”,在右边的类型下选择“空项目”,在名称和解决方案名称中输入 staLIB.点击确定. 2.在解决方案资源管理 ...

随机推荐

  1. 【数据结构】 最小生成树(四)——利用kruskal算法搞定例题×3+变形+一道大水题

    在这一专辑(最小生成树)中的上一期讲到了prim算法,但是prim算法比较难懂,为了避免看不懂,就先用kruskal算法写题吧,下面将会将三道例题,加一道变形,以及一道大水题,水到不用高级数据结构,建 ...

  2. nyoj 1007 GCD(数学题 欧拉函数的应用)

    GCD 描述 The greatest common divisor GCD(a,b) of two positive integers a and b,sometimes written (a,b) ...

  3. nyoj 151 Biorhythms

    描述 Some people believe that there are three cycles in a person's life that start the day he or she i ...

  4. 【二分答案】【最大流】[HNOI2007]紧急疏散EVACUATE

    [HNOI2007]紧急疏散EVACUATE 题目描述 发生了火警,所有人员需要紧急疏散!假设每个房间是一个N M的矩形区域.每个格子如果是'.',那么表示这是一块空地:如果是'X',那么表示这是一面 ...

  5. 【找规律】【DFS】XVII Open Cup named after E.V. Pankratiev Stage 14, Grand Prix of Tatarstan, Sunday, April 2, 2017 Problem A. Arithmetic Derivative

    假设一个数有n个质因子a1,a2,..,an,那么n'=Σ(a1*a2*...*an)/ai. 打个表出来,发现一个数x,如果x'=Kx,那么x一定由K个“基础因子”组成. 这些基础因子是2^2,3^ ...

  6. datatable无法设置横向滚动条(设置无效)

    datatable设置横向滚动条无效 js如下: 页面如下: 设置 scrollx 属性为true时,还需在 table 添加 style="white-space: nowrap; &qu ...

  7. [转] Hibernate与 MyBatis的比较

    hibernateHibernateibatisIBATISMyBatismybatis 目录(?)[-] 第一章     Hibernate与MyBatis 1 Hibernate 简介 2 MyB ...

  8. uboot显示logo的方式

    转:http://blog.chinaunix.net/uid-22030783-id-3257554.html 本文使用uboot2010.03版本,2010.06版本同样适用,在XC2440板上实 ...

  9. mysql的锁定问题

    1.锁定这个问题,是mysql自动产生的,不用程序猿自己加锁 答:默认情况下,档执行insert/update操作时,mysql会自动进行表锁定.从而此时读取操作只能等待. 2.mysql, 需要添加 ...

  10. 安卓安装ZXING(二维码)SDK

    安卓安装ZXING(二维码)SDK 安装<WIFI共享精灵>后,ZXING(二维码)SDK就有了,扫二维码又快而且精度又高. 真是意外的发现.不需要去下载BARCODE SCANNER.