Skip to content

Commit

Permalink
Merge pull request #167 from efeone/wt_analysis_update
Browse files Browse the repository at this point in the history
feat: Weight details update on DA
  • Loading branch information
muhammadmp authored Nov 3, 2023
2 parents 3e6769c + 3ac0746 commit a320d56
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
8 changes: 7 additions & 1 deletion aumms/aumms/doctype/design_analysis/design_analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,22 +210,28 @@ frappe.ui.form.on('Verified Item',{
let d = locals[cdt][cdn];
var gold_weight = 0
var expected_weight = 0
var calculated_stone_weight = 0
frm.doc.verified_item.forEach(function(d){
gold_weight += d.gold_wt;
expected_weight += d.net_wt;
calculated_stone_weight += d.stone_wt;
})
frm.set_value('gold_weight',gold_weight),
frm.set_value('expected_weight',expected_weight)
frm.set_value('expected_weight',expected_weight),
frm.set_value('calculated_stone_weight',calculated_stone_weight)
},
verified_item_remove: function(frm){
var expected_weight = 0
var gold_weight = 0
var calculated_stone_weight = 0
frm.doc.verified_item.forEach(function(d){
gold_weight += d.gold_wt;
expected_weight += d.net_wt;
calculated_stone_weight += d.stone_wt;
})
frm.set_value('gold_weight',gold_weight),
frm.set_value('expected_weight',expected_weight)
frm.set_value('calculated_stone_weight',calculated_stone_weight)
},
});

Expand Down
19 changes: 16 additions & 3 deletions aumms/aumms/doctype/design_analysis/design_analysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"aumms_item",
"item",
"customer_name",
"approver_weight",
"column_break_v9qzp",
"item_code",
"item_group",
Expand All @@ -26,6 +27,7 @@
"verified_item",
"section_break_szurh",
"gold_weight",
"calculated_stone_weight",
"section_break_qpifr",
"expected_weight"
],
Expand Down Expand Up @@ -148,7 +150,7 @@
{
"fieldname": "gold_weight",
"fieldtype": "Data",
"label": "Gold Weight"
"label": "Calculated Gold Weight"
},
{
"fieldname": "section_break_qpifr",
Expand All @@ -157,12 +159,23 @@
{
"fieldname": "expected_weight",
"fieldtype": "Data",
"label": "Expected Weight"
"label": "Calculated Net Weight"
},
{
"fieldname": "approver_weight",
"fieldtype": "Float",
"label": "Approver Weight",
"non_negative": 1
},
{
"fieldname": "calculated_stone_weight",
"fieldtype": "Data",
"label": "Calculated Stone Weight"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-10-30 12:04:57.952805",
"modified": "2023-11-02 11:04:13.811167",
"modified_by": "Administrator",
"module": "AuMMS",
"name": "Design Analysis",
Expand Down
12 changes: 10 additions & 2 deletions aumms/aumms/doctype/verified_item/verified_item.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"quantity",
"is_customer_provided",
"gold_wt",
"net_wt"
"net_wt",
"stone_wt"
],
"fields": [
{
Expand Down Expand Up @@ -84,12 +85,19 @@
"in_list_view": 1,
"label": "Net Wt",
"options": "AuMMS Item"
},
{
"fetch_from": "item.stone_weight",
"fieldname": "stone_wt",
"fieldtype": "Link",
"label": "Stone Wt",
"options": "AuMMS Item"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2023-10-26 14:50:53.492128",
"modified": "2023-11-02 11:18:45.086742",
"modified_by": "Administrator",
"module": "AuMMS",
"name": "Verified Item",
Expand Down

0 comments on commit a320d56

Please sign in to comment.