...
Payslip Data is made available into the template through a custom object, generated through a combination of saved search calls across employee, payslip and payslip details. basic structure being the root element represents the payslip which contains objects for:
- employer
- employee
- leave
detail (list of payslip details)- Deprecated No Longer Exposed Post release 20.2.00- detailgrp (list of payslip details grouped for display purposes)
- ytdgrp (summary of ytd amounts by group)
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
var data={
"id": paySlipId,
"logopdf": nlapiEscapeXML(logoPdfUrlStr),
"logohtml": logoHtmlUrlStr,
"payslipref": sRow.getValue("name"),
"message": sRow.getValue("custrecord_pr_ps_message"),
"payfrequency": sRow.getValue("custrecord_ps_pay_freq"),
"paydate": sRow.getValue("custrecord_pr_ps_pay_date"),
"fromdate": sRow.getValue("custrecord_pr_ps_from"),
"todate": sRow.getValue("custrecord_ps_pay_period_end"),
"status": sRow.getText("custrecord_ps_status"),
"taxyearid": sRow.getValue("custrecord_ps_year"),
"taxyear": sRow.getText("custrecord_ps_year"),
"employer": {
"name": preferenceArr['cmp_name'],
"abn": formatABN(preferenceArr['cmp_abn']),
"supercontribution": 0.00,
"supercontributionytd": 0.00
},
"basesalary": nlapiFormatCurrency(sRow.getValue("custrecord_ps_base_salary")),
"hourlyrate": nlapiFormatCurrency(sRow.getValue("custrecord_pr_ps_hourly_rate")),
"nontaxableallowance": nlapiFormatCurrency(sRow.getValue("custrecord_pr_ps_nontaxable_allowance")),
"taxableincome": nlapiFormatCurrency(sRow.getValue("custrecord_ps_taxable_income")),
"taxdeductions": nlapiFormatCurrency(sRow.getValue("custrecord_ps_tax_deduct")),
"taxdeductionsytd": 0.00,
"taxableallowance": nlapiFormatCurrency(sRow.getValue("custrecord_pr_ps_taxable_allowance")),
"expenses": nlapiFormatCurrency(sRow.getValue("custrecord_ps_expenses")),
"netpay": nlapiFormatCurrency(sRow.getValue("custrecord_ps_net_pay")),
"netpayytd": 0.00,
"grosswage": nlapiFormatCurrency(sRow.getValue("custrecord_ps_gross_wage")),
"grosswageytd": 0.00,
"totaldeductions": nlapiFormatCurrency(setFloat(sRow.getValue("custrecord_ps_tax_deduct")) + setFloat(sRow.getValue("custrecord_pr_other_deductions")) + setFloat(sRow.getValue("custrecord_pr_ps_salary_sacrifice"))),
"totaldeductionsytd": 0.00,
"superobligation": nlapiFormatCurrency(setFloat(sRow.getValue("custrecord_pr_ps_super_obligation"))),
"baseforsuper": nlapiFormatCurrency(setFloat(sRow.getValue("custrecord_pr_ps_base_super"))),
"salarysacrifice": nlapiFormatCurrency(setFloat(sRow.getValue("custrecord_pr_ps_salary_sacrifice"))),
"salarysacrificesuper": nlapiFormatCurrency(setFloat(sRow.getValue("custrecord_pr_ps_ss_super"))),
"baseforsalarysacrifice": nlapiFormatCurrency(setFloat(sRow.getValue("custrecord_pr_ps_base_pay_period"))),
"employee": {
"isinactive" : sRow.getValue("isinactive","custrecord_ps_employee") == "T",
"id": sRow.getValue("custrecord_ps_employee"),
"name": sRow.getValue("firstname", "custrecord_ps_employee") + " " + sRow.getValue("lastname", "custrecord_ps_employee"),
"email": sRow.getValue("email", "custrecord_ps_employee"),
"employmentstatus": sRow.getText("custrecord_ps_employment_status"),
"residentstatus": sRow.getText("custrecord_ps_resident_status"),
"paytype": sRow.getText("custrecord_ps_pay_type"),
"superfundid": sRow.getValue("custrecord_ps_super_fund"),
"superfund": sRow.getText("custrecord_ps_super_fund"),
"superfundvendorid": sRow.getValue("custrecord_ps_super_fund_vendor"),
"superfundvendor" : sRow.getText("custrecord_ps_super_fund_vendor"),
"jobtitleid": sRow.getValue("custentity_pr_position_title", "custrecord_ps_employee"),
"jobtitle": sRow.getText("custentity_pr_position_title", "custrecord_ps_employee"),
"awardid": sRow.getValue("custentity_pr_award_name", "custrecord_ps_employee"),
"hoursperday": sRow.getValue("custentity_pr_hours_per_day", "custrecord_ps_employee"),
"award": sRow.getText("custentity_pr_award_name", "custrecord_ps_employee"),
"annualleavehours": sRow.getValue("custentity_pr_annual_leave_accrued", "custrecord_ps_employee"),
"hourlyrate": nlapiFormatCurrency(sRow.getValue("custentity_pr_hourly_rate", "custrecord_ps_employee")),
"paymethod" : sRow.getText("custentity_pr_payslip_method", "custrecord_ps_employee"),
"taxcode" : sRow.getText("custentity_employee_tax_scale", "custrecord_ps_employee")
},
"leave": {
"annual": {
"entitlement": sRow.getValue("custentity_pr_al_entitlement_days", "custrecord_ps_employee"),
"accrued": setFloat(sRow.getValue("custentity_pr_annual_leave_accrued", "custrecord_ps_employee"), 2),
"available" : setFloat(sRow.getValue("custentity_pr_annual_leave_available", "custrecord_ps_employee"), 2),
"hourlyrate" : 0.00,
"periodtakenhour" : 0.00,
"periodaccruedhour" : 0.00
},
"personal": {
"entitlement": sRow.getValue("custentity_pr_pl_entitlement_days", "custrecord_ps_employee"),
"accrued": setFloat(sRow.getValue("custentity_pr_personal_leave_accrued", "custrecord_ps_employee"), 2),
"available" : setFloat(sRow.getValue("custentity_pr_personal_leave_available", "custrecord_ps_employee"), 2),
"hourlyrate" : 0.00,
"periodtakenhour" : 0.00,
"periodaccruedhour" : 0.00
},
"longservice": {
"entitlement": sRow.getValue("custentity_pr_lsl_entitlement_days", "custrecord_ps_employee"),
"accrued": setFloat(sRow.getValue("custentity_pr_lsl_accrued", "custrecord_ps_employee"), 2),
"available" : setFloat(sRow.getValue("custentity_pr_lsl_available", "custrecord_ps_employee"), 2),
"hourlyrate" : 0.00,
"periodtakenhour" : 0.00,
"periodaccruedhour" : 0.00
},
"inlieu": {
"accrued": sRow.getValue("custentity_pr_time_in_lieu_accrued", "custrecord_ps_employee")
}
},
"detail": [],
"detailgrp": {},
"ytdgrp": {},
"ytdpc" : pcytdArr
}; |
...