Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:Modification in manufacturing Request,raw material Bundle,Jewellery job Card #385

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def create_metal_ledger(self) :
new_metal_ledger.posting_date = frappe.utils.today()
new_metal_ledger.posting_time = frappe.utils.now()
new_metal_ledger.voucher_type = self.doctype
# new_metal_ledger.voucher_no = self.name
new_metal_ledger.voucher_no = self.name
# new_metal_ledger.party_link = self.party_link
new_metal_ledger.item_code = item.item
new_metal_ledger.item_name = item.item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@
"depends_on": "eval:doc.is_raw_material_from_previous_stage_only == 0",
"fieldname": "raw_material_available",
"fieldtype": "Check",
"label": "Raw Material Available"
"label": "Raw Material Available",
"read_only": 1
},
{
"default": "0",
Expand Down Expand Up @@ -173,7 +174,7 @@
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2024-05-02 16:07:22.687542",
"modified": "2024-05-06 12:08:56.131899",
"modified_by": "Administrator",
"module": "AuMMS Manufacturing",
"name": "Manufacturing Stage",
Expand All @@ -183,4 +184,4 @@
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ frappe.ui.form.on("Manufacturing Stage", {
frm.refresh_fields();
});
},
weight: function(frm, cdt, cdn){
let row = locals[cdt][cdn];
calculate_weight(frm, cdt, cdn);
},
manufacturing_stages_remove: function (frm, cdt, cdn) {
let row = locals[cdt][cdn];
calculate_weight(frm)
},
previous_stage_completed: function(frm, cdt, cdn) {
let row = locals[cdt][cdn]
if (row.previous_stage_completed) {
Expand Down Expand Up @@ -80,3 +88,11 @@ frappe.ui.form.on("Manufacturing Stage", {
}
},
});

function calculate_weight(frm , cdt, cdn) {
var net_weight = 0;
frm.doc.manufacturing_stages.forEach(function (row) {
net_weight += row.weight;
});
frm.set_value("weight", net_weight);
};
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def update_manufacturing_stages(self):
for stage in category_doc.stages:
self.append('manufacturing_stages', {
'manufacturing_stage': stage.stage,
'required_time': stage.required_time,
'expected_execution_time': stage.required_time,
'workstation': stage.default_workstation
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ frappe.ui.form.on("Raw Material Bundle", {
}
};
});
},
on_submit: function(frm) {
if (!frm.doc.raw_material_available) {
frm.add_custom_button('Create Raw Material Request', () => {
frappe.call({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
"manufacturing_stage",
"column_break_amkz",
"stage",
"item_required_date",
"raw_material_available",
"raw_materials_section",
"items",
"raw_material_available",
"amended_from"
],
"fields": [
Expand Down Expand Up @@ -68,13 +67,14 @@
"default": "0",
"fieldname": "raw_material_available",
"fieldtype": "Check",
"label": "Raw Material Available"
"label": "Raw Material Available",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2024-05-02 10:03:01.689350",
"modified": "2024-05-06 12:13:01.179566",
"modified_by": "Administrator",
"module": "AuMMS Manufacturing",
"name": "Raw Material Bundle",
Expand All @@ -97,4 +97,4 @@
"sort_field": "modified",
"sort_order": "DESC",
"states": []
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ def autoname(self):
for items in self.get("items"):
items.raw_material_id = f"{items.item}-{self.stage}-{items.required_weight}"

def setup(self):
def validate(self):
for item in self.items:
if item.available_quantity >= item.required_quantity:
if item.available_quantity > item.required_quantity:
self.raw_material_available = 1
else:
self.raw_material_available = 0
Expand Down
Loading