How to deduct the entire positive plan balance first, then deduct the negative balance based on priority?

You need to enable the ORA_ANC_ABS_CASCADE_PLANS_ENABLED profile option to ensure that the application first consumes the positive balance from the plans in the sequence of the absence type for a worker, before deducting the negative balance.

For example, let's assume a worker has three absence plans A, B, and C in that order of priority in an absence type. Plan A is configured to allow negative balance, and Plan C is a qualification plan. When the worker submits an absence, the application will first consume all the positive balance from Plan A. After that, even though Plan A allows negative balance, the application will use the positive balance from Plan B. Once the positive balance from plan B is exhausted, the balance is consumed from the defined bands entitled in the qualification plan. Once all the positive balance is consumed, the application will deduct negative balance from Plan A.