diff --git a/aumms/aumms/doctype/design_analysis/design_analysis.js b/aumms/aumms/doctype/design_analysis/design_analysis.js index 88e2d87d..ae97d51e 100644 --- a/aumms/aumms/doctype/design_analysis/design_analysis.js +++ b/aumms/aumms/doctype/design_analysis/design_analysis.js @@ -148,6 +148,9 @@ frappe.ui.form.on('Design Analysis', { // Call a function to create the BOM frm.trigger('create_bom'); }); + frm.add_custom_button(__('Proceed'), () => { + frm.trigger('proceed_action'); + }); }, create_bom: function(frm) { frappe.call({ @@ -163,5 +166,31 @@ frappe.ui.form.on('Design Analysis', { } } }); + }, + proceed_action: function(frm){ + if(frm.is_dirty()){ + frappe.throw('You have unsaved changed. Please save and continue.') + } + else{ + if(frm.doc.dr_required_check){ + console.log("required"); + } + else{ + frappe.msgprint("Please fill the verified item table") + frm.scroll_to_field('verified_item'); + } + } + }, + check_dr_required: function(frm){ + let dr_required = 0; + frm.doc.design_details.forEach(function(detail) { + if(detail.dr_required == 1){ + dr_required = 1; + } + }); + frm.set_value('dr_required_check', dr_required) + }, + validate: function(frm){ + frm.trigger('check_dr_required'); } }); diff --git a/aumms/aumms/doctype/design_analysis/design_analysis.json b/aumms/aumms/doctype/design_analysis/design_analysis.json index 000d93a1..af8c7c71 100644 --- a/aumms/aumms/doctype/design_analysis/design_analysis.json +++ b/aumms/aumms/doctype/design_analysis/design_analysis.json @@ -7,17 +7,19 @@ "engine": "InnoDB", "field_order": [ "design_request", - "customer_name", "aumms_item", "item", + "customer_name", "column_break_v9qzp", "item_code", "item_group", "purity", + "phoneno", "section_break_rgobr", "column_break_y3jbr", "section_break_qqgnh", "design_details", + "dr_required_check", "comment", "verify_section", "verified_item" @@ -112,11 +114,25 @@ "label": "Item", "options": "Item", "read_only": 1 + }, + { + "fetch_from": "customer_name.mobile_no", + "fetch_if_empty": 1, + "fieldname": "phoneno", + "fieldtype": "Data", + "label": "Phone.No" + }, + { + "default": "0", + "fieldname": "dr_required_check", + "fieldtype": "Check", + "label": "DR Required Check", + "read_only": 1 } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2023-09-28 18:42:43.935781", + "modified": "2023-10-07 18:20:51.635310", "modified_by": "Administrator", "module": "AuMMS", "name": "Design Analysis", diff --git a/aumms/aumms/doctype/design_details/design_details.json b/aumms/aumms/doctype/design_details/design_details.json index ef72fcf3..80fdb309 100644 --- a/aumms/aumms/doctype/design_details/design_details.json +++ b/aumms/aumms/doctype/design_details/design_details.json @@ -12,7 +12,9 @@ "purity", "unit_of_measure", "quantity", - "is_customer_provided" + "is_customer_provided", + "dr_required", + "attach" ], "fields": [ { @@ -54,12 +56,23 @@ "fieldtype": "Check", "in_list_view": 1, "label": "Is Customer Provided" + }, + { + "default": "0", + "fieldname": "dr_required", + "fieldtype": "Check", + "label": "DR Required" + }, + { + "fieldname": "attach", + "fieldtype": "Attach Image", + "label": "Attach" } ], "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2023-08-10 09:47:49.330704", + "modified": "2023-10-06 11:01:47.779904", "modified_by": "Administrator", "module": "AuMMS", "name": "Design Details",