Skip to content

Commit

Permalink
Merge pull request #148 from efeone/dr_required/develop
Browse files Browse the repository at this point in the history
feat: Item Upload from analysis
  • Loading branch information
muhammadmp authored Oct 9, 2023
2 parents 4b2d8a3 + e2c7031 commit c4e1aff
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 4 deletions.
29 changes: 29 additions & 0 deletions aumms/aumms/doctype/design_analysis/design_analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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');
}
});
20 changes: 18 additions & 2 deletions aumms/aumms/doctype/design_analysis/design_analysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down
17 changes: 15 additions & 2 deletions aumms/aumms/doctype/design_details/design_details.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"purity",
"unit_of_measure",
"quantity",
"is_customer_provided"
"is_customer_provided",
"dr_required",
"attach"
],
"fields": [
{
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit c4e1aff

Please sign in to comment.