-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating childtable doctype CostType for collecting all the costs-typ…
…e & it's server-side & client-side for calculating the fields (total cost / tax value / grand total with tax)
- Loading branch information
1 parent
f91dd21
commit d5462fc
Showing
8 changed files
with
177 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
{ | ||
"actions": [], | ||
"allow_rename": 1, | ||
"creation": "2024-07-23 13:16:39.795083", | ||
"doctype": "DocType", | ||
"editable_grid": 1, | ||
"engine": "InnoDB", | ||
"field_order": [ | ||
"document_type", | ||
"select", | ||
"uom", | ||
"qty", | ||
"unit_cost", | ||
"column_break_gwui", | ||
"total_cost", | ||
"tax", | ||
"tax_value", | ||
"grand_total_with_tax" | ||
], | ||
"fields": [ | ||
{ | ||
"fieldname": "document_type", | ||
"fieldtype": "Link", | ||
"label": "Doctype", | ||
"options": "DocType" | ||
}, | ||
{ | ||
"fieldname": "select", | ||
"fieldtype": "Dynamic Link", | ||
"label": "Costing Type", | ||
"options": "document_type" | ||
}, | ||
{ | ||
"fieldname": "uom", | ||
"fieldtype": "Link", | ||
"label": "UOM", | ||
"options": "UOM" | ||
}, | ||
{ | ||
"fieldname": "qty", | ||
"fieldtype": "Int", | ||
"label": "Qty" | ||
}, | ||
{ | ||
"fieldname": "unit_cost", | ||
"fieldtype": "Int", | ||
"label": "Unit Cost" | ||
}, | ||
{ | ||
"fieldname": "column_break_gwui", | ||
"fieldtype": "Column Break" | ||
}, | ||
{ | ||
"fieldname": "total_cost", | ||
"fieldtype": "Int", | ||
"label": "Total Cost" | ||
}, | ||
{ | ||
"fieldname": "tax", | ||
"fieldtype": "Percent", | ||
"label": "Tax" | ||
}, | ||
{ | ||
"fieldname": "tax_value", | ||
"fieldtype": "Int", | ||
"label": "Tax Value" | ||
}, | ||
{ | ||
"fieldname": "grand_total_with_tax", | ||
"fieldtype": "Int", | ||
"label": "Grand Total With Tax" | ||
} | ||
], | ||
"index_web_pages_for_search": 1, | ||
"istable": 1, | ||
"links": [], | ||
"modified": "2024-07-23 13:42:06.695525", | ||
"modified_by": "Administrator", | ||
"module": "Contracta", | ||
"name": "CostType", | ||
"owner": "Administrator", | ||
"permissions": [], | ||
"sort_field": "modified", | ||
"sort_order": "DESC", | ||
"states": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright (c) 2024, Andrew Romany and contributors | ||
# For license information, please see license.txt | ||
|
||
# import frappe | ||
from frappe.model.document import Document | ||
|
||
|
||
class CostType(Document): | ||
def validate(self): | ||
self.total_cost = self.qty * self.unit_cost | ||
self.tax_value = self.tax * self.total_cost | ||
self.grand_total_with_tax = self.total_cost + self.tax_value |
Empty file.
8 changes: 8 additions & 0 deletions
8
contracta/contracta/doctype/custom_quotation/custom_quotation.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// Copyright (c) 2024, Andrew Romany and contributors | ||
// For license information, please see license.txt | ||
|
||
// frappe.ui.form.on("Custom Quotation", { | ||
// refresh(frm) { | ||
|
||
// }, | ||
// }); |
53 changes: 53 additions & 0 deletions
53
contracta/contracta/doctype/custom_quotation/custom_quotation.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"actions": [], | ||
"allow_rename": 1, | ||
"creation": "2024-07-21 17:38:36.277478", | ||
"doctype": "DocType", | ||
"engine": "InnoDB", | ||
"field_order": [ | ||
"section_break_oj0t", | ||
"amended_from" | ||
], | ||
"fields": [ | ||
{ | ||
"fieldname": "section_break_oj0t", | ||
"fieldtype": "Section Break" | ||
}, | ||
{ | ||
"fieldname": "amended_from", | ||
"fieldtype": "Link", | ||
"label": "Amended From", | ||
"no_copy": 1, | ||
"options": "Custom Quotation", | ||
"print_hide": 1, | ||
"read_only": 1, | ||
"search_index": 1 | ||
} | ||
], | ||
"index_web_pages_for_search": 1, | ||
"is_submittable": 1, | ||
"links": [], | ||
"modified": "2024-07-21 17:38:36.277478", | ||
"modified_by": "Administrator", | ||
"module": "Contracta", | ||
"name": "Custom Quotation", | ||
"owner": "Administrator", | ||
"permissions": [ | ||
{ | ||
"create": 1, | ||
"delete": 1, | ||
"email": 1, | ||
"export": 1, | ||
"print": 1, | ||
"read": 1, | ||
"report": 1, | ||
"role": "System Manager", | ||
"share": 1, | ||
"submit": 1, | ||
"write": 1 | ||
} | ||
], | ||
"sort_field": "modified", | ||
"sort_order": "DESC", | ||
"states": [] | ||
} |
9 changes: 9 additions & 0 deletions
9
contracta/contracta/doctype/custom_quotation/custom_quotation.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (c) 2024, Andrew Romany and contributors | ||
# For license information, please see license.txt | ||
|
||
# import frappe | ||
from frappe.model.document import Document | ||
|
||
|
||
class CustomQuotation(Document): | ||
pass |
9 changes: 9 additions & 0 deletions
9
contracta/contracta/doctype/custom_quotation/test_custom_quotation.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright (c) 2024, Andrew Romany and Contributors | ||
# See license.txt | ||
|
||
# import frappe | ||
from frappe.tests.utils import FrappeTestCase | ||
|
||
|
||
class TestCustomQuotation(FrappeTestCase): | ||
pass |