Merge pull request #19746 from rohitwaghchaure/fixed_customer_selection_issue_in_sales_invoice_healthcare_module
fix: please specify customer error in sales invoice if patient is blank
This commit is contained in:
commit
b59a25b02b
@ -789,22 +789,21 @@ frappe.ui.form.on('Sales Invoice', {
|
|||||||
method: "frappe.client.get_value",
|
method: "frappe.client.get_value",
|
||||||
args:{
|
args:{
|
||||||
doctype: "Patient",
|
doctype: "Patient",
|
||||||
filters: {"name": frm.doc.patient},
|
filters: {
|
||||||
|
"name": frm.doc.patient
|
||||||
|
},
|
||||||
fieldname: "customer"
|
fieldname: "customer"
|
||||||
},
|
},
|
||||||
callback:function(patient_customer) {
|
callback:function(r) {
|
||||||
if(patient_customer){
|
if(r && r.message.customer){
|
||||||
frm.set_value("customer", patient_customer.message.customer);
|
frm.set_value("customer", r.message.customer);
|
||||||
frm.refresh_fields();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
frm.set_value("customer", '');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
if (frappe.boot.active_domains.includes("Healthcare")){
|
if (frappe.boot.active_domains.includes("Healthcare")){
|
||||||
frm.set_df_property("patient", "hidden", 0);
|
frm.set_df_property("patient", "hidden", 0);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user