From e56cdc2a1ff1db86bbf8c4ef3e2b4e9ca4f7665b Mon Sep 17 00:00:00 2001 From: Andro0o0o0w-Romany Date: Wed, 24 Jul 2024 09:55:44 +0000 Subject: [PATCH] Changing field's name in Costtype doctype from total cost to amount --- .../doctype/costing_note/costing_note.js | 6 +- .../doctype/costing_note/costing_note.json | 56 ++----------------- .../doctype/costing_note/costing_note.py | 6 +- .../contracta/doctype/costtype/costtype.json | 14 ++--- 4 files changed, 17 insertions(+), 65 deletions(-) diff --git a/contracta/contracta/doctype/costing_note/costing_note.js b/contracta/contracta/doctype/costing_note/costing_note.js index 45a5945..3b1101f 100644 --- a/contracta/contracta/doctype/costing_note/costing_note.js +++ b/contracta/contracta/doctype/costing_note/costing_note.js @@ -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; }); }, }); diff --git a/contracta/contracta/doctype/costing_note/costing_note.json b/contracta/contracta/doctype/costing_note/costing_note.json index 5e72e7e..0301f4d 100644 --- a/contracta/contracta/doctype/costing_note/costing_note.json +++ b/contracta/contracta/doctype/costing_note/costing_note.json @@ -10,8 +10,6 @@ "amended_from", "basic_classification", "clause", - "uom", - "qty", "holder", "column_break_ytai", "naming_series", @@ -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": [ { @@ -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", @@ -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", @@ -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", diff --git a/contracta/contracta/doctype/costing_note/costing_note.py b/contracta/contracta/doctype/costing_note/costing_note.py index e8f7ece..1a17a51 100644 --- a/contracta/contracta/doctype/costing_note/costing_note.py +++ b/contracta/contracta/doctype/costing_note/costing_note.py @@ -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 diff --git a/contracta/contracta/doctype/costtype/costtype.json b/contracta/contracta/doctype/costtype/costtype.json index 433e715..3cb464a 100644 --- a/contracta/contracta/doctype/costtype/costtype.json +++ b/contracta/contracta/doctype/costtype/costtype.json @@ -12,7 +12,7 @@ "qty", "unit_cost", "column_break_gwui", - "total_cost", + "amount", "tax", "tax_value", "grand_total_with_tax" @@ -50,11 +50,6 @@ "fieldname": "column_break_gwui", "fieldtype": "Column Break" }, - { - "fieldname": "total_cost", - "fieldtype": "Int", - "label": "Total Cost" - }, { "fieldname": "tax", "fieldtype": "Percent", @@ -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",