UmaG
April 24, 2017, 8:39am
1
Hi,
I have added a few custom fields for calculating “leave balance” and “leave taken this month”, to the Salary Slip table. The fields are getting calculated and are showing in the form. Now, I added these fields to the standard print format. Though, these are showing up on the screen, when i click on the print icon, but the fields do not get reflected in the PDF or in the Print Preview. What could be missing out?
Thanks
Uma
umair
April 26, 2017, 9:30am
2
Hello Uma,
Is this a standard print format, or made one in the HTML print format?
UmaG
April 26, 2017, 9:33am
3
Hi @umair ,
This is standard print format.
umair
April 26, 2017, 9:44am
4
Since this issue is related to customization, request you to share following info.
Custom Script.
Screenshot of the custom fields indicatinf value in the Print Hide.
UmaG
April 26, 2017, 10:14am
5
Hi Umair,
Attached is my custom script and the screenshot of custom field with Print Hide value.
frappe.ui.form.on(“Salary Slip”, “after_save”, function(frm, cdt, cdn) {
frappe.call({
method: "icp.api.get_leave_balance_on",
args: {
"employee": frm.doc.employee,
"leave_type": "Casual Leave",
"date": frm.doc.end_date
},
callback:function(r){
if(r.message) {
frappe.model.set_value(cdt, cdn, "casual_leave_balance", flt(r.message));
refresh_field("casual_leave_balance");
}
}
});
frappe.call({
method: "icp.api.get_leave_balance_on",
args: {
"employee": frm.doc.employee,
"leave_type": "Privilege Leave",
"date": frm.doc.end_date
},
callback:function(r){
if(r.message) {
frappe.model.set_value(cdt, cdn, "earned_leave_balance", flt(r.message));
refresh_field("earned_leave_balance");
}
}
});
});
The Print Hide is not set for any of the custom fields.
UmaG
May 5, 2017, 9:15am
6
Hi @umair ,
Any idea why I am still not able to view them in PDF or Print?
Regards
Uma
HI, any solution for this issue ?I faced same issue
UmaG
December 14, 2017, 8:43am
8
Hi @harrisonle ,
I was not able to resolve this issue. So, had to write a separate print format for this.
How to create separated print format with these customs field ? So headache !
umair
December 15, 2017, 6:58pm
10
Here is the help on creating Custom Print Format using Print Format builder.
Feel free to Google for help as a prevention from headache