-
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.
Calculating the fields in the child table CostType in Costing Note do…
…ctype
- Loading branch information
1 parent
d5462fc
commit 5586957
Showing
9 changed files
with
62 additions
and
26 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1,8 +1,12 @@ | ||
// Copyright (c) 2024, Andrew Romany and contributors | ||
// For license information, please see license.txt | ||
|
||
// frappe.ui.form.on("Costing Note", { | ||
// refresh(frm) { | ||
|
||
// }, | ||
// }); | ||
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; | ||
}); | ||
}, | ||
}); |
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
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
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
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
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,23 @@ | ||
frappe.ui.form.on('Quotation', { | ||
refresh(frm) { | ||
frm.add_custom_button('Contract', function() { | ||
frappe.call({ | ||
method: 'frappe.client.insert', | ||
args: { | ||
doc: { | ||
doctype: "Contract", | ||
party_name: frm.doc.customer_name, | ||
contract_terms: frm.doc.terms, | ||
quotation: frm.doc.name | ||
} | ||
}, | ||
callback: function(response) { | ||
let contract = response.message; | ||
if (contract && contract.name) { | ||
frappe.set_route("Form", "Contract", contract.name); | ||
} | ||
} | ||
}); | ||
}, __("Create")); | ||
} | ||
}); |