How to get Employee balance by balance Name in Oracle HRMS Payroll

How can i get Employee Balance by Element

Please find PL-SQL Function definition below.

Please note that you may change the balance dimension according to your requirement.
Currently, Fiscal year to date balance dimension is specified in the function.



CREATE OR REPLACE FUNCTION CUST_GET_BALANCE (
   P_ASSG_ID           NUMBER,
   P_PAY_EARNED_DATE   DATE,
   P_BALANCE_NAME      VARCHAR2
)
   RETURN NUMBER
IS
   X_PAY_NUM    NUMBER;
   P_PAY_Y_SD   DATE;
BEGIN
   SELECT SUM (NVL (PBVV.VALUE, 0))
     INTO X_PAY_NUM
     FROM PAY_BALANCE_VALUES_V PBVV
    WHERE PBVV.BALANCE_NAME = P_BALANCE_NAME
      AND PBVV.DATABASE_ITEM_SUFFIX = '_ASG_FYTD'
      AND PBVV.ASSIGNMENT_ID = P_ASSG_ID
      AND PBVV.EFFECTIVE_DATE = P_PAY_EARNED_DATE;

   RETURN X_PAY_NUM;
EXCEPTION
   WHEN OTHERS
   THEN
      RETURN 0;
END;
/



Leave a comment for any query.



6 comments:

  1. If you make few balance adjustments in a month and then try to get the balance; it will return incorrect balance value by applying sum function on retrieved data. Kindly suggest how we can get the final balance value of the month this scenario.

    Regards
    Ali Hassan

    ReplyDelete
  2. Office management is the work associated with designing, implementing, evaluating and maintaining processes of work within the office and other organizations to maintain and improve efficiency and productivity. Try our high quality Office Management Software

    ReplyDelete
  3. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work. mybalancenow.company

    ReplyDelete
  4. I really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people. Employee Attendance

    ReplyDelete
  5. stone or what we could call the passed the check of time relationship or the 75th wedding wedding, there's no other solution to enjoy a marriage wedding than to observe the event with an event with household, buddies and relatives. swag bag companies

    ReplyDelete