fix: healtcare unit type enable toggle

This commit is contained in:
scmmishra 2019-03-29 19:00:45 +05:30
parent 862f77cc13
commit 29dc744354
2 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ frappe.ui.form.on('Healthcare Service Unit Type', {
var disable = function(frm){ var disable = function(frm){
var doc = frm.doc; var doc = frm.doc;
frappe.call({ frappe.call({
method: "erpnext.healthcare.doctype.healthcare_service_unit_type.healthcare_service_unit_type.disable_enable", method: "erpnext.healthcare.doctype.healthcare_service_unit_type.healthcare_service_unit_type.disable_enable",
args: {status: 1, doc_name: doc.name, item: doc.item, is_billable: doc.is_billable}, args: {status: 1, doc_name: doc.name, item: doc.item, is_billable: doc.is_billable},
callback: function(){ callback: function(){
cur_frm.reload_doc(); cur_frm.reload_doc();
@ -60,7 +60,7 @@ var disable = function(frm){
var enable = function(frm){ var enable = function(frm){
var doc = frm.doc; var doc = frm.doc;
frappe.call({ frappe.call({
method: "erpnext.healthcare.doctype.healthcare_service_unit_type.healthcare_service_unit_type.disable_enable", method: "erpnext.healthcare.doctype.healthcare_service_unit_type.healthcare_service_unit_type.disable_enable",
args: {status: 0, doc_name: doc.name, item: doc.item, is_billable: doc.is_billable}, args: {status: 0, doc_name: doc.name, item: doc.item, is_billable: doc.is_billable},
callback: function(){ callback: function(){
cur_frm.reload_doc(); cur_frm.reload_doc();

View File

@ -111,7 +111,7 @@ def change_item_code(item, item_code, doc_name):
frappe.db.set_value("Healthcare Service Unit Type", doc_name, "item_code", item_code) frappe.db.set_value("Healthcare Service Unit Type", doc_name, "item_code", item_code)
@frappe.whitelist() @frappe.whitelist()
def disable_enable(status, doc_name, item, is_billable): def disable_enable(status, doc_name, item=None, is_billable=None):
frappe.db.set_value("Healthcare Service Unit Type", doc_name, "disabled", status) frappe.db.set_value("Healthcare Service Unit Type", doc_name, "disabled", status)
if(is_billable == 1): if(is_billable == 1):
frappe.db.set_value("Item", item, "disabled", status) frappe.db.set_value("Item", item, "disabled", status)