How To Configure Expense Report Numbers? 客户化费用报表编号
2015-08-20 16:17
344 查看
参考文档:文档 ID 365238.1
根据文档显示,只需要在程序AP_WEB_OA_CUSTOM_PKG.GetNewExpenseReportInvoice 添加生成逻辑即可
程序举例:
根据文档显示,只需要在程序AP_WEB_OA_CUSTOM_PKG.GetNewExpenseReportInvoice 添加生成逻辑即可
程序举例:
FUNCTION GetNewExpenseReportInvoice(p_employeeId IN ap_expense_report_headers.employee_id%TYPE, p_userId IN fnd_user.user_id%TYPE, p_reportHeaderId IN ap_expense_report_headers.report_header_id%TYPE) RETURN VARCHAR2 IS l_reportNumber ap_expense_report_headers.invoice_num%TYPE := NULL; l_userName fnd_user.user_name%TYPE := null; l_nReport NUMBER := 0; BEGIN IF (p_employeeId is not NULL AND p_userId is not NULL) THEN -- SAMPLE CODE -- If you want to access the AP_WEB_REPNUM_PREFIX profile option, -- use the following function: -- fnd_profile.value_specific( 'AP_WEB_REPNUM_PREFIX', p_userId ) -- -- The following sample code will generate the report invoice of <userid><YY-DDMMHHMI><-><number> format -- where: -- userid : the employee's user name -- YY : the las 2 digit of the current year and -- number : the total number of expense reports the employee has -- for the current year including the current report. -- -- -- Get the user name SELECT user_name INTO l_userName FROM fnd_user fnd WHERE fnd.employee_id = p_employeeId AND fnd.user_id = p_userId AND sysdate <= nvl(fnd.end_date, sysdate) AND rownum = 1; -- Get the total of the number of expense report -- this employee has for current year SELECT count(*) INTO l_nReport FROM ap_expense_report_headers WHERE employee_id = p_employeeId AND to_char(sysdate, 'RR') = to_char(CREATION_DATE, 'RR'); l_nReport := l_nReport + 1; -- Max length of the report number is 50 l_reportNumber := SUBSTR(l_userName, 1, 30) || to_char(sysdate,'RR-DDMMHHMI') || '-'|| ltrim(to_char(l_nReport,'0999')); END IF; RETURN l_reportNumber; EXCEPTION WHEN NO_DATA_FOUND THEN RETURN NULL; WHEN OTHERS THEN return NULL; END GetNewExpenseReportInvoice;
相关文章推荐
- C++中的 Round(),floor(),ceil()
- parentsUntil([expr|element][,filter])
- cocos2dx 3.0 环境搭建
- DOM(一)-06-(Location对象)
- 进职场记(一)--下山
- css多栏自适应布局
- javascript 事件 第23节
- 跳出frameset框架
- 虚拟化--[搭建]vsphere
- Aspose.Words使用教程之插入文档元素(三)【连载】
- Cocos2d-x 3.2中的三种缓存类
- 智能指针里弱引用应该如何实现?(WeakReference/WeakPtr<T>)
- DOM(一)-05-(BOM&Navigator对象&History对象)
- SDK支付流程
- Windows 10企业批量部署实战之Task任务序列创建
- 关于sqlserver还原不了数据库的原因
- 开发支付宝支付用DELPHI实现 RSA签名
- VS2010/MFC编程入门之四十(文档、视图和框架:各对象之间的关系)
- 爬虫
- DOM(一)-04-(DHTML概述)