Skip to main content

Advance Leave Encashment

This option is for leave encashment for advance leaves.

There are two scenarios here:

1. If payment type is selected as continuous in leave encashment screen, then the leave encashment salary will be credited through the payroll.

2. If payment type is selected as advance in leave encashment screen, then the leave encashment salary will not be credited through payroll but in the print layout, encash amount can be viewed.

Settings>>Customization>>Leaves>>Leave Encashment>>Print layout

clip_image001

Note: Employee Account and Salary Account should be mapped in the Employee master

Follow the below steps for FA posting:

1. Create two account master fields in leave encashment screen as shown in the below screen.

clip_image003

image

In the above two screens, two accounts are created. One is Company account in the first screen and Emp account in the second screen.

Employee account is created to credit the encash amount and add these two fields in page layout of leave encashment.

2. Run below stored procedure in the database.

Before running the script, replace the below highlighted field names with the created account field names in leave encashment screen.

<KeyValuePair> <Key>LeaveCompanyAccount</Key> <Value>' + @SalAccount + '</Value> </KeyValuePair>

<KeyValuePair> <Key>LeaveEmployeeAccount</Key> <Value>' +@EmpAccount+'</Value> </KeyValuePair>

Script:

Create PROC pPay_LoadAccounts @xmlIn AS XML

,@xmlOut AS XML OUT

AS

BEGIN

DECLARE @EmployeeID AS INT

DeCLARE @EmpAccount AS VARCHAR(1500)

DeCLARE @SalAccount AS VARCHAR(1500)

SELECT TOP 1 @EmployeeID = xmlData.data.value('Value[1]', 'varchar(max)')

FROM @xmlIn.nodes('/ArrayOfKeyValuePair/KeyValuePair') AS xmlData(data)

WHERE xmlData.data.value('Key[1]', 'varchar(max)') LIKE 'iEmpId'

SET @xmlOut = convert(XML, N'<ArrayOfKeyValuePair></ArrayOfKeyValuePair>')

SELECT top 1 @EmpAccount=m.iEmployeeAccountName+'|'+convert(varchar(100),m.iEmployeeAccount) ,@SalAccount=m.iSalaryAccountName+ '|'+ convert(varchar(100),m.iSalaryAccount)

FROM vaPay_Employee m

WHERE m.iMasterId=@EmployeeID

SET @xmlOut = convert(XML, N'<ArrayOfKeyValuePair></ArrayOfKeyValuePair>')

DECLARE @newFeatures XML;

SET @newFeatures = N'

<KeyValuePair> <Key>LeaveCompanyAccount</Key> <Value>' + @SalAccount + '</Value> </KeyValuePair>

<KeyValuePair> <Key>LeaveEmployeeAccount</Key> <Value>' +@EmpAccount+'</Value> </KeyValuePair>

';

SET @xmlOut.modify('

insert sql:variable("@newFeatures")

into (/ArrayOfKeyValuePair)[1] ')

END

3. After executing the script, write the rule for the employee field. Edit the Employee account from the customization screen.

clip_image005

As mentioned in the screen, Apply on Load, on leave, No condition to be checked. In the properties grid, Emp account field to be selected against which the stored procedure details to be entered as mentioned in the above screen.

Note:

· Emp Account is the created account field of leave encashment screen.

· 4. Create work flow for posting FA of leave encashment automatically.

Settings>>Approval>>Work flow

clip_image007

Select evaluate on field according to the authorization flow defined.

clip_image008

Approve – if authorization is defined.

Create – If no authorization is available.

If authorization flow is defined, Approve option to be selected. If no authorization is available, create option to be selected.

Define the work flow with filter for payment type is equal to advance type. Refer work flow screen.

5. Go to the next tab (Actions)and select create module.

clip_image010

6. Select destination module as FA posting, on selection of FA posting, voucher field will be loaded. Select Credit Notes (Linewise)/Payroll from the drop down box.

7. Once the voucher is selected a grid with source fields and destination fields will be loaded.

Select source fields and destination fields as below for credit and debit accounts.clip_image012

8. Whenever the employee applies for leave encashment, automatically company account and employee accounts will be loaded in the screen.

clip_image014

Employee will enter the required leaves for encashment and save the screen.

9. On saving the leave encashment screen, and selecting payment type as Advance, system will automatically post the FA based on the work flow defined.

Refer below screen where company account and employee salary account is loaded against credit and debit accounts respectively.

clip_image016

Comments

Popular posts from this blog

TDS details in Payslip

TDS variables are added in the payslip to display the tax details for employees. These variables will give a clear idea to the employee of what is the taxable income, total tax per year to be deducted, tax deducted till date and the balance tax which he needs to pay. Follow the steps below. 1. Create the payroll components as mentioned below under Deductions. TDS_TotalTaxableIncome TDS_TotalTax TDS_PrevEmployerTDS TDS_TaxDeductedYTD TDS_BalanceTax 2. Go to deduction preferences, and add the TDS variable exactly with the same name under formula. Below is the screen shot for reference. 3. The values of TDS variables will be displayed in the payroll preview screen. The same will be displayed in the payslip, once these variables are mapped to the payslip. Note: 1. Priority Order: TDS variables should be placed after TDS component. Sample Payslip with TDS variable:

Using Stored Procedure in the Earning/Deduction Formulas

Naming Convention : Stored Procedure Name : pPay_GetData1 Variable to use above stored procedure : fPay1 Advantages: we can assign multiple earning/deduction values using single stored procedure Eg : CREATE PROCEDURE pPay_GetData1 (      @xmlIn AS XML = NULL      ,@xmlOut AS XML = NULL OUT      ,@Result AS DECIMAL(18, 4) OUT      ) AS BEGIN      SET NOCOUNT ON;      SET @xmlOut = @xmlIn     DECLARE @EmpId AS VARCHAR(max),@PayrollRefType AS VARCHAR(100)      declare @ToDate as int=0     declare @BonusFromDate as int=0,@BonusToDate as int=0     --Retriving Employee Id      SELECT @EmpId = v.value('iEmpId[1]', 'varchar(max)')      FROM @xmlIn.nodes('/PayrollData') x(v)     --Retriving Payroll Date      SELECT @ToDate = v.value('...