Skip to content

Commit

Permalink
Changing field's name in Costtype doctype from total cost to amount
Browse files Browse the repository at this point in the history
  • Loading branch information
Andro0o0o0w-Romany committed Jul 24, 2024
1 parent 5586957 commit e56cdc2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 65 deletions.
6 changes: 3 additions & 3 deletions contracta/contracta/doctype/costing_note/costing_note.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
frappe.ui.form.on("Costing Note", {
validate: function(frm) {
frm.doc.costtype.forEach(function(row){
row.total_cost = row.qty * row.unit_cost;
row.tax_value = row.tax * row.total_cost;
row.grand_total_with_tax = row.total_cost + row.tax_value;
row.amount = row.qty * row.unit_cost;
row.tax_value = row.tax * row.amount;
row.grand_total_with_tax = row.amount + row.tax_value;
});
},
});
56 changes: 4 additions & 52 deletions contracta/contracta/doctype/costing_note/costing_note.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
"amended_from",
"basic_classification",
"clause",
"uom",
"qty",
"holder",
"column_break_ytai",
"naming_series",
Expand All @@ -20,13 +18,8 @@
"ending_date",
"expected_time_to_deliver",
"section_break_llma",
"material_costs",
"labor_costs",
"equipment_costs",
"contractors_costs",
"expense_schedule",
"totals",
"costtype"
"costtype",
"totals"
],
"fields": [
{
Expand All @@ -52,20 +45,9 @@
{
"fieldname": "clause",
"fieldtype": "Link",
"label": "business clause name and it's ID",
"label": "clause",
"options": "Business Clause"
},
{
"fieldname": "uom",
"fieldtype": "Link",
"label": "UOM",
"options": "UOM"
},
{
"fieldname": "qty",
"fieldtype": "Int",
"label": "Qty"
},
{
"fieldname": "holder",
"fieldtype": "Data",
Expand Down Expand Up @@ -100,36 +82,6 @@
"fieldname": "section_break_llma",
"fieldtype": "Section Break"
},
{
"fieldname": "material_costs",
"fieldtype": "Table",
"label": "Material Costs",
"options": "Materials Costs"
},
{
"fieldname": "equipment_costs",
"fieldtype": "Table",
"label": "Equipment Costs",
"options": "Equipment Costs"
},
{
"fieldname": "labor_costs",
"fieldtype": "Table",
"label": "Labor Costs",
"options": "Labor Costs"
},
{
"fieldname": "contractors_costs",
"fieldtype": "Table",
"label": "Contractors Costs",
"options": "Contractors Costs"
},
{
"fieldname": "expense_schedule",
"fieldtype": "Table",
"label": "Expense Schedule",
"options": "Expense Schedule"
},
{
"fieldname": "totals",
"fieldtype": "Table",
Expand All @@ -152,7 +104,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2024-07-23 13:43:04.997310",
"modified": "2024-07-24 12:48:13.969866",
"modified_by": "Administrator",
"module": "Contracta",
"name": "Costing Note",
Expand Down
6 changes: 3 additions & 3 deletions contracta/contracta/doctype/costing_note/costing_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
class CostingNote(Document):
def validate(self):
for calucate in self.costtype:
calucate.total_cost = calucate.qty * calucate.unit_cost
calucate.tax_value = calucate.tax * calucate.total_cost
calucate.grand_total_with_tax = calucate.total_cost + calucate.tax_value
calucate.amount = calucate.qty * calucate.unit_cost
calucate.tax_value = calucate.tax * calucate.amount
calucate.grand_total_with_tax = calucate.amount + calucate.tax_value
14 changes: 7 additions & 7 deletions contracta/contracta/doctype/costtype/costtype.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"qty",
"unit_cost",
"column_break_gwui",
"total_cost",
"amount",
"tax",
"tax_value",
"grand_total_with_tax"
Expand Down Expand Up @@ -50,11 +50,6 @@
"fieldname": "column_break_gwui",
"fieldtype": "Column Break"
},
{
"fieldname": "total_cost",
"fieldtype": "Int",
"label": "Total Cost"
},
{
"fieldname": "tax",
"fieldtype": "Percent",
Expand All @@ -69,12 +64,17 @@
"fieldname": "grand_total_with_tax",
"fieldtype": "Int",
"label": "Grand Total With Tax"
},
{
"fieldname": "amount",
"fieldtype": "Int",
"label": "Amount"
}
],
"index_web_pages_for_search": 1,
"istable": 1,
"links": [],
"modified": "2024-07-23 13:42:06.695525",
"modified": "2024-07-24 12:51:12.365575",
"modified_by": "Administrator",
"module": "Contracta",
"name": "CostType",
Expand Down

0 comments on commit e56cdc2

Please sign in to comment.