I want to display Arrears Amount in salary slip

Hi Friends,
I have a Arrears(Doctype) in that have fields called "

based on the employee which Arrears Amount is their i want display in “Salary Slip(Doctype)” " here are the fields in salary slip() (52 row)" can you please help me i a not getting how to do this??

thank you i am waiting for ur response…

You will have to write custom script to fetch values into Salary Slip. Search for custom script in Frappe Documentation.

@Pawan i am writing in custom script and want to get that method using hooks.py,is it right process?
Is it right code?
def Arrears_info(self):
data = frappe.db.sql(“”“select employee, arrears_amount from tabArrears
print “---------------DATA in arrears--------------------”,data
a = frappe.get_doc(“Salary Slip”,data)
frappe.db.set_value(“Salary Slip”,a.arrears_amount,“Arrears”,“”)

Can you please explain what exactly you need to do?
But basically I do not see that you need to use hooks.py, what you need is to have script that will be triggered when selecting for example the employee, this script should do the work and return the value to be displayed.

But you need to think what will happen if you are using Payroll Process, it will work? You need to test it also from Payroll Process as well as testing from Salary Slip.

Hi bghayad,

@bghayad you are right…for what i am thinking,while going for a payroll process if an employee has ARREARS the amount will display to the particle employee otherwise it will display zero

So you added the script for Salary Slip?