Finance Payment - Employee

“When creating a payment entry from the new HR DocType ‘Employee Advance,’ the system automatically clears the employee field upon opening the payment entry form, while all other fields load correctly.”


JS code
frm.add_custom_button(__(‘Payment’), () => {
frappe.model.with_doctype(“Payment Entry”, function () {
var mr = frappe.model.get_new_doc(“Payment Entry”);
mr.payment_type = “Pay”;
mr.party_type = “Employee”;
mr.party = frm.doc.employee;
mr.paid_amount = frm.doc.advance_amount;
mr.paid_from = ‘Cash - JS’;
frappe.set_route(“Form”, “Payment Entry”, mr.name);
});
}, __(‘Create’));
}},

But @jayakumar,

HRMS already provides payment options in the Employee Advance.