fix: recalculate rate of items based on "Recalculate Rate" checkbox
This commit is contained in:
parent
ea82fe5bc2
commit
2fc6833684
@ -125,7 +125,7 @@ class SubcontractingReceipt(SubcontractingController):
|
|||||||
item.rm_cost_per_qty = item.rm_supp_cost / item.qty
|
item.rm_cost_per_qty = item.rm_supp_cost / item.qty
|
||||||
rm_supp_cost.pop(item.name)
|
rm_supp_cost.pop(item.name)
|
||||||
|
|
||||||
if self.is_new() and item.rm_supp_cost > 0:
|
if item.recalculate_rate:
|
||||||
item.rate = (
|
item.rate = (
|
||||||
item.rm_cost_per_qty + (item.service_cost_per_qty or 0) + item.additional_cost_per_qty
|
item.rm_cost_per_qty + (item.service_cost_per_qty or 0) + item.additional_cost_per_qty
|
||||||
)
|
)
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
"rate_and_amount",
|
"rate_and_amount",
|
||||||
"rate",
|
"rate",
|
||||||
"amount",
|
"amount",
|
||||||
|
"recalculate_rate",
|
||||||
"column_break_19",
|
"column_break_19",
|
||||||
"rm_cost_per_qty",
|
"rm_cost_per_qty",
|
||||||
"service_cost_per_qty",
|
"service_cost_per_qty",
|
||||||
@ -460,12 +461,18 @@
|
|||||||
"fieldname": "accounting_details_section",
|
"fieldname": "accounting_details_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"label": "Accounting Details"
|
"label": "Accounting Details"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "1",
|
||||||
|
"fieldname": "recalculate_rate",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Recalculate Rate"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2022-08-15 14:51:10.613347",
|
"modified": "2022-08-18 19:42:24.313449",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Subcontracting",
|
"module": "Subcontracting",
|
||||||
"name": "Subcontracting Receipt Item",
|
"name": "Subcontracting Receipt Item",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user