Skip to content

Commit

Permalink
Merge pull request #214 from efeone/aumms_004
Browse files Browse the repository at this point in the history
fix : Added Stone details
  • Loading branch information
SherinKR authored Feb 15, 2024
2 parents 2ae40e4 + 709c501 commit cbaaed1
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
"item_details_column",
"item_name",
"gold_weight",
"column_break_juco",
"net_weight",
"column_break_juco",
"stone",
"stone_weight",
"stone_charge",
"amount"
],
"fields": [
Expand All @@ -21,32 +24,54 @@
{
"fieldname": "item_name",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Item Code"
},
{
"fieldname": "gold_weight",
"fieldtype": "Float",
"in_list_view": 1,
"label": "Gold Weight"
},
{
"fieldname": "net_weight",
"fieldtype": "Float",
"in_list_view": 1,
"label": "Net Weight"
},
{
"fieldname": "amount",
"fieldtype": "Float",
"in_list_view": 1,
"label": "Amount"
},
{
"fieldname": "column_break_juco",
"fieldtype": "Column Break"
},
{
"fieldname": "stone",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Stone"
},
{
"fieldname": "stone_weight",
"fieldtype": "Float",
"in_list_view": 1,
"label": "Stone Weight"
},
{
"fieldname": "stone_charge",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Stone Charge"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2024-02-12 02:45:56.301857",
"modified": "2024-02-14 12:45:03.190279",
"modified_by": "Administrator",
"module": "AuMMS",
"name": "Purchase Item Details",
Expand Down
33 changes: 19 additions & 14 deletions aumms/aumms/doctype/purchase_tool/purchase_tool.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,25 @@
// For license information, please see license.txt

frappe.ui.form.on("Purchase Tool", {
is_stone(frm) {
if(frm.doc.is_stone == 1){
frm.set_df_property("has_stone", "hidden", 1)
refresh : function(frm){
if(frm.doc.has_stone == 1){
frm.fields_dict.item_details.grid.update_docfield_property('stone', 'hidden', 1);
frm.fields_dict.item_details.grid.update_docfield_property('stone_weight', 'hidden', 1);
frm.fields_dict.item_details.grid.update_docfield_property('stone_charge', 'hidden', 1);
}
else{
frm.fields_dict.item_details.grid.update_docfield_property('stone', 'hidden', 0);
frm.fields_dict.item_details.grid.update_docfield_property('stone_weight', 'hidden', 0);
frm.fields_dict.item_details.grid.update_docfield_property('stone_charge', 'hidden', 0);
}
}
else{
frm.set_df_property("has_stone", "hidden", 0)
}
},
has_stone(frm){
if(frm.doc.has_stone == 1){
frm.set_df_property("is_stone", "hidden", 1)
}
else{
frm.set_df_property("is_stone", "hidden", 0)
});

frappe.ui.form.on("Purchase Item Details",{
item_details_add : function(frm, cdt, cdn){
let child = locals[cdt][cdn]
if(frm.doc.stone){
frappe.model.set_value(child.doctype, child.name, 'stone', frm.doc.stone);
}
}
}
});
29 changes: 16 additions & 13 deletions aumms/aumms/doctype/purchase_tool/purchase_tool.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"board_rate",
"date",
"stone",
"is_stone",
"has_stone",
"section_break_vxux",
"item_details",
Expand All @@ -29,37 +28,38 @@
{
"fieldname": "supplier",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Supplier",
"options": "Supplier"
"options": "Supplier",
"reqd": 1
},
{
"fieldname": "item_type",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Item Type",
"options": "Item Type"
"options": "Item Type",
"reqd": 1
},
{
"fieldname": "item_group",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Item Group",
"options": "Item Group"
"options": "Item Group",
"reqd": 1
},
{
"fieldname": "column_break_pnvl",
"fieldtype": "Column Break"
},
{
"depends_on": "eval:doc.has_stone == 1",
"fieldname": "stone",
"fieldtype": "Link",
"label": "Stone",
"options": "Stone Type"
},
{
"default": "0",
"fieldname": "is_stone",
"fieldtype": "Check",
"label": "Is Stone"
},
{
"default": "0",
"fieldname": "has_stone",
Expand Down Expand Up @@ -89,7 +89,8 @@
{
"fieldname": "date",
"fieldtype": "Date",
"label": "Date"
"label": "Date",
"reqd": 1
},
{
"fieldname": "item_set",
Expand All @@ -99,13 +100,15 @@
{
"fieldname": "board_rate",
"fieldtype": "Float",
"label": "Board Rate"
"in_list_view": 1,
"label": "Board Rate",
"reqd": 1
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2024-02-12 02:39:50.132642",
"modified": "2024-02-14 12:52:10.709714",
"modified_by": "Administrator",
"module": "AuMMS",
"name": "Purchase Tool",
Expand Down

0 comments on commit cbaaed1

Please sign in to comment.