refactor: remove Recalculate Rate from SCR Item (#36929)

This commit is contained in:
s-aga-r 2023-09-03 18:54:44 +05:30 committed by GitHub
parent 22cf1556cd
commit cd8ddae7c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 25 deletions

View File

@ -239,12 +239,6 @@ frappe.ui.form.on('Subcontracting Receipt Item', {
set_missing_values(frm);
},
recalculate_rate(frm) {
if (frm.doc.recalculate_rate) {
set_missing_values(frm);
}
},
items_remove: (frm) => {
set_missing_values(frm);
},

View File

@ -180,7 +180,6 @@ class SubcontractingReceipt(SubcontractingController):
"item_name": scrap_item.item_name,
"qty": qty,
"stock_uom": scrap_item.stock_uom,
"recalculate_rate": 0,
"rate": rate,
"rm_cost_per_qty": 0,
"service_cost_per_qty": 0,
@ -277,13 +276,12 @@ class SubcontractingReceipt(SubcontractingController):
else:
item.scrap_cost_per_qty = 0
if item.recalculate_rate:
item.rate = (
flt(item.rm_cost_per_qty)
+ flt(item.service_cost_per_qty)
+ flt(item.additional_cost_per_qty)
- flt(item.scrap_cost_per_qty)
)
item.rate = (
flt(item.rm_cost_per_qty)
+ flt(item.service_cost_per_qty)
+ flt(item.additional_cost_per_qty)
- flt(item.scrap_cost_per_qty)
)
item.received_qty = flt(item.qty) + flt(item.rejected_qty)
item.amount = flt(item.qty) * flt(item.rate)

View File

@ -28,7 +28,6 @@
"rate_and_amount",
"rate",
"amount",
"recalculate_rate",
"column_break_19",
"rm_cost_per_qty",
"service_cost_per_qty",
@ -202,7 +201,6 @@
"options": "currency",
"print_width": "100px",
"read_only": 1,
"read_only_depends_on": "eval: doc.recalculate_rate",
"width": "100px"
},
{
@ -475,14 +473,6 @@
"fieldtype": "Section Break",
"label": "Accounting Details"
},
{
"default": "1",
"depends_on": "eval: !doc.is_scrap_item",
"fieldname": "recalculate_rate",
"fieldtype": "Check",
"label": "Recalculate Rate",
"read_only_depends_on": "eval: doc.is_scrap_item"
},
{
"fieldname": "serial_and_batch_bundle",
"fieldtype": "Link",
@ -531,7 +521,7 @@
"idx": 1,
"istable": 1,
"links": [],
"modified": "2023-08-25 20:09:03.069417",
"modified": "2023-09-03 17:04:21.214316",
"modified_by": "Administrator",
"module": "Subcontracting",
"name": "Subcontracting Receipt Item",