设为首页 加入收藏

TOP

How To Configure Expense Report Numbers?客户化费用报表编号
2015-11-21 01:44:51 来源: 作者: 【 】 浏览:0
Tags:How Configure Expense Report Numbers 客户 费用 报表 编号

根据文档显示,只需要在程序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 
  
   
    <->
    
      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;
    
   
  
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇ocp-512 下一篇文件系统和数据库的对比

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: