chore: add additional-cost table in SCR

This commit is contained in:
Sagar Sharma 2022-08-18 20:26:34 +05:30
parent 2fc6833684
commit 256b4245d5
4 changed files with 47 additions and 2 deletions

View File

@ -1,4 +1,4 @@
let document_list = ['Landed Cost Voucher', 'Stock Entry', 'Subcontracting Order'];
let document_list = ['Landed Cost Voucher', 'Stock Entry', 'Subcontracting Order', 'Subcontracting Receipt'];
document_list.forEach((doctype) => {
frappe.ui.form.on(doctype, {

View File

@ -3,6 +3,8 @@
frappe.provide('erpnext.buying');
{% include 'erpnext/stock/landed_taxes_and_charges_common.js' %};
frappe.ui.form.on('Subcontracting Receipt', {
setup: (frm) => {
frm.get_field('supplied_items').grid.cannot_add_rows = true;
@ -128,6 +130,16 @@ frappe.ui.form.on('Subcontracting Receipt', {
},
});
frappe.ui.form.on('Landed Cost Taxes and Charges', {
amount: function (frm, cdt, cdn) {
frm.events.set_base_amount(frm, cdt, cdn);
},
expense_account: function (frm, cdt, cdn) {
frm.events.set_account_currency(frm, cdt, cdn);
}
});
frappe.ui.form.on('Subcontracting Receipt Item', {
item_code(frm) {
set_missing_values(frm);

View File

@ -47,6 +47,10 @@
"raw_material_details",
"get_current_stock",
"supplied_items",
"additional_costs_section",
"distribute_additional_costs_based_on",
"additional_costs",
"total_additional_costs",
"section_break_46",
"in_words",
"bill_no",
@ -595,11 +599,39 @@
"fieldtype": "Link",
"label": "Project",
"options": "Project"
},
{
"collapsible": 1,
"collapsible_depends_on": "total_additional_costs",
"depends_on": "eval:(doc.docstatus == 0 || doc.total_additional_costs)",
"fieldname": "additional_costs_section",
"fieldtype": "Section Break",
"label": "Additional Costs"
},
{
"default": "Qty",
"fieldname": "distribute_additional_costs_based_on",
"fieldtype": "Select",
"label": "Distribute Additional Costs Based On ",
"options": "Qty\nAmount"
},
{
"fieldname": "additional_costs",
"fieldtype": "Table",
"label": "Additional Costs",
"options": "Landed Cost Taxes and Charges"
},
{
"fieldname": "total_additional_costs",
"fieldtype": "Currency",
"label": "Total Additional Costs",
"print_hide_if_no_value": 1,
"read_only": 1
}
],
"is_submittable": 1,
"links": [],
"modified": "2022-08-15 14:30:29.447307",
"modified": "2022-08-18 15:48:57.419191",
"modified_by": "Administrator",
"module": "Subcontracting",
"name": "Subcontracting Receipt",

View File

@ -103,6 +103,7 @@ class SubcontractingReceipt(SubcontractingController):
@frappe.whitelist()
def set_missing_values(self):
self.set_missing_values_in_additional_costs()
self.set_missing_values_in_supplied_items()
self.set_missing_values_in_items()