Healthcare Settings - Heathcare Service Item - Validation
This commit is contained in:
parent
e82f27ac10
commit
1dbfd5c1e7
@ -25,6 +25,7 @@ frappe.ui.form.on('Healthcare Settings', {
|
|||||||
});
|
});
|
||||||
set_query_service_item(frm, 'inpatient_visit_charge_item');
|
set_query_service_item(frm, 'inpatient_visit_charge_item');
|
||||||
set_query_service_item(frm, 'op_consulting_charge_item');
|
set_query_service_item(frm, 'op_consulting_charge_item');
|
||||||
|
set_query_service_item(frm, 'clinical_procedure_consumable_item');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -37,4 +38,4 @@ var set_query_service_item = function(frm, service_item_field) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
@ -17,6 +17,12 @@ class HealthcareSettings(Document):
|
|||||||
if(self.collect_registration_fee):
|
if(self.collect_registration_fee):
|
||||||
if self.registration_fee <= 0 :
|
if self.registration_fee <= 0 :
|
||||||
frappe.throw(_("Registration fee can not be Zero"))
|
frappe.throw(_("Registration fee can not be Zero"))
|
||||||
|
if self.inpatient_visit_charge_item:
|
||||||
|
validate_service_item(self.inpatient_visit_charge_item, "Configure a service Item for Inpatient Visit Charge Item")
|
||||||
|
if self.op_consulting_charge_item:
|
||||||
|
validate_service_item(self.op_consulting_charge_item, "Configure a service Item for Out Patient Consulting Charge Item")
|
||||||
|
if self.clinical_procedure_consumable_item:
|
||||||
|
validate_service_item(self.clinical_procedure_consumable_item, "Configure a service Item for Clinical Procedure Consumable Item")
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_sms_text(doc):
|
def get_sms_text(doc):
|
||||||
@ -67,3 +73,7 @@ def get_account(parent_type, parent_field, parent, company):
|
|||||||
if(parent_field):
|
if(parent_field):
|
||||||
return frappe.db.get_value("Party Account",
|
return frappe.db.get_value("Party Account",
|
||||||
{"parentfield": parent_field, "parent": parent, "company": company}, "account")
|
{"parentfield": parent_field, "parent": parent, "company": company}, "account")
|
||||||
|
|
||||||
|
def validate_service_item(item, msg):
|
||||||
|
if frappe.db.get_value("Item", item, "is_stock_item") == 1:
|
||||||
|
frappe.throw(_(msg))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user