diff --git a/erpnext/accounts/doctype/asset_category/asset_category.js b/erpnext/accounts/doctype/asset_category/asset_category.js index cbbdd487618..d5f4864c309 100644 --- a/erpnext/accounts/doctype/asset_category/asset_category.js +++ b/erpnext/accounts/doctype/asset_category/asset_category.js @@ -4,13 +4,13 @@ frappe.ui.form.on('Asset Category', { setup: function(frm) { frm.get_field('accounts').grid.editable_fields = [ - {fieldname: 'company_name', columns: 2}, + {fieldname: 'company_name', columns: 3}, {fieldname: 'fixed_asset_account', columns: 3}, - {fieldname: 'accumulated_depreciation_account', columns: 3}, - {fieldname: 'depreciation_expense_account', columns: 3} + {fieldname: 'accumulated_depreciation_account', columns: 2}, + {fieldname: 'depreciation_expense_account', columns: 2} ]; }, - + onload: function(frm) { frm.add_fetch('company_name', 'accumulated_depreciation_account', 'accumulated_depreciation_account'); frm.add_fetch('company_name', 'depreciation_expense_account', 'accumulated_depreciation_account'); diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js index 4b33fd39199..fcd280fd189 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js @@ -5,20 +5,20 @@ frappe.ui.form.on("Bank Reconciliation", { setup: function(frm) { frm.get_docfield("payment_entries").allow_bulk_edit = 1; frm.add_fetch("bank_account", "account_currency", "account_currency"); - + frm.get_field('payment_entries').grid.editable_fields = [ {fieldname: 'against_account', columns: 3}, {fieldname: 'amount', columns: 2}, {fieldname: 'cheque_number', columns: 3}, - {fieldname: 'clearance_date', columns: 3} + {fieldname: 'clearance_date', columns: 2} ]; }, onload: function(frm) { var default_bank_account = locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"]; - + frm.set_value("bank_account", default_bank_account); - + frm.set_query("bank_account", function() { return { "filters": { diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js index cb6c36c11c4..2b06e603a96 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -9,7 +9,7 @@ frappe.ui.form.on("Journal Entry", { setup: function(frm) { frm.get_field('accounts').grid.editable_fields = [ {fieldname: 'account', columns: 3}, - {fieldname: 'party', columns: 4}, + {fieldname: 'party', columns: 3}, {fieldname: 'debit_in_account_currency', columns: 2}, {fieldname: 'credit_in_account_currency', columns: 2} ]; @@ -283,7 +283,7 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) { type: "GET", method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_default_bank_cash_account", args: { - "account_type": (doc.voucher_type=="Bank Entry" ? + "account_type": (doc.voucher_type=="Bank Entry" ? "Bank" : (doc.voucher_type=="Cash" ? "Cash" : null)), "company": doc.company }, diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index 9b1ed381364..a5fbfba48be 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -12,7 +12,7 @@ frappe.ui.form.on('Payment Entry', { setup: function(frm) { frm.get_field('references').grid.editable_fields = [ {fieldname: 'reference_doctype', columns: 2}, - {fieldname: 'reference_name', columns: 3}, + {fieldname: 'reference_name', columns: 2}, {fieldname: 'outstanding_amount', columns: 3}, {fieldname: 'allocated_amount', columns: 3} ]; diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js index a50ff197a87..027fa63ca08 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js +++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js @@ -7,12 +7,12 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext setup: function() { this.frm.get_field('payments').grid.editable_fields = [ {fieldname: 'reference_name', columns: 3}, - {fieldname: 'amount', columns: 2}, {fieldname: 'invoice_number', columns: 3}, - {fieldname: 'allocated_amount', columns: 3} + {fieldname: 'amount', columns: 2}, + {fieldname: 'allocated_amount', columns: 2} ]; - }, - + }, + onload: function() { var me = this this.frm.set_query('party_type', function() { @@ -113,7 +113,7 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext if (row.invoice_number && !inList(invoices, row.invoice_number)) invoices.push(row.invoice_type + " | " + row.invoice_number); }); - + if (invoices) { frappe.meta.get_docfield("Payment Reconciliation Payment", "invoice_number", me.frm.doc.name).options = "\n" + invoices.join("\n"); @@ -122,7 +122,7 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext if(!inList(invoices, cstr(p.invoice_number))) p.invoice_number = null; }); } - + refresh_field("payments"); }, diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 64379a16e90..8ca4d5f1e51 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -454,13 +454,6 @@ frappe.ui.form.on('Sales Invoice', { ] } } - - if(frm.doc.is_pos){ - frm.get_field('payments').grid.editable_fields = [ - {fieldname: 'mode_of_payment', columns: 2}, - {fieldname: 'amount', columns: 2} - ]; - } }, }) diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js index c6847156ee7..1806d93d4bf 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.js +++ b/erpnext/buying/doctype/purchase_common/purchase_common.js @@ -14,7 +14,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ this._super(); if(!in_list(["Material Request", "Request for Quotation"], this.frm.doc.doctype)){ this.frm.get_field('items').grid.editable_fields = [ - {fieldname: 'item_code', columns: 4}, + {fieldname: 'item_code', columns: 3}, {fieldname: 'qty', columns: 2}, {fieldname: 'rate', columns: 3}, {fieldname: 'amount', columns: 2} diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js index ce1c088263d..5eafb81a0e7 100644 --- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js +++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js @@ -16,7 +16,7 @@ frappe.ui.form.on("Request for Quotation",{ } frm.get_field('items').grid.editable_fields = [ - {fieldname: 'item_code', columns: 4}, + {fieldname: 'item_code', columns: 3}, {fieldname: 'qty', columns: 2}, {fieldname: 'schedule_date', columns: 2}, {fieldname: 'warehouse', columns: 3}, diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js index 832402e51eb..2fbdbcbad19 100644 --- a/erpnext/manufacturing/doctype/bom/bom.js +++ b/erpnext/manufacturing/doctype/bom/bom.js @@ -6,7 +6,7 @@ frappe.provide("erpnext.bom"); frappe.ui.form.on("BOM", { setup: function(frm) { frm.get_field('items').grid.editable_fields = [ - {fieldname: 'item_code', columns: 4}, + {fieldname: 'item_code', columns: 3}, {fieldname: 'item_name', columns: 3}, {fieldname: 'qty', columns: 2}, {fieldname: 'rate', columns: 2} diff --git a/erpnext/projects/doctype/project/project.js b/erpnext/projects/doctype/project/project.js index f9b71c4bd9b..1b3b05d5060 100644 --- a/erpnext/projects/doctype/project/project.js +++ b/erpnext/projects/doctype/project/project.js @@ -4,7 +4,7 @@ frappe.ui.form.on("Project", { setup: function(frm) { frm.get_field('tasks').grid.editable_fields = [ - {fieldname: 'title', columns: 4}, + {fieldname: 'title', columns: 3}, {fieldname: 'status', columns: 3}, {fieldname: 'start_date', columns: 2}, {fieldname: 'end_date', columns: 2} diff --git a/erpnext/projects/doctype/timesheet/timesheet.js b/erpnext/projects/doctype/timesheet/timesheet.js index 4d162959790..9ba24e31049 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.js +++ b/erpnext/projects/doctype/timesheet/timesheet.js @@ -5,7 +5,7 @@ cur_frm.add_fetch('employee', 'employee_name', 'employee_name'); frappe.ui.form.on("Timesheet", { setup: function(frm) { frm.get_field('time_logs').grid.editable_fields = [ - {fieldname: 'activity_type', columns: 2}, + {fieldname: 'activity_type', columns: 4}, {fieldname: 'from_time', columns: 2}, {fieldname: 'hours', columns: 2}, {fieldname: 'to_time', columns: 2}, @@ -36,7 +36,7 @@ frappe.ui.form.on("Timesheet", { refresh: function(frm) { if(frm.doc.docstatus==1) { - if(!frm.doc.sales_invoice && frm.doc.total_billing_amount > 0 + if(!frm.doc.sales_invoice && frm.doc.total_billing_amount > 0 && frm.doc.employee){ frm.add_custom_button(__("Make Sales Invoice"), function() { frm.trigger("make_invoice") }, "icon-file-alt"); diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js index a0507ef69f0..e7485c19d48 100644 --- a/erpnext/public/js/controllers/taxes_and_totals.js +++ b/erpnext/public/js/controllers/taxes_and_totals.js @@ -6,7 +6,7 @@ erpnext.taxes_and_totals = erpnext.payments.extend({ if(this.frm.get_field('taxes')) { this.frm.get_field('taxes').grid.editable_fields = [ {fieldname: 'charge_type', columns: 2}, - {fieldname: 'account_head', columns: 3}, + {fieldname: 'account_head', columns: 2}, {fieldname: 'rate', columns: 2}, {fieldname: 'tax_amount', columns: 2}, {fieldname: 'total', columns: 2} diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index c39048d8986..2b73cf4a054 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -4,16 +4,16 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ setup: function() { this._super(); - + if(in_list(["Sales Invoice", "Purchase Invoice"], this.frm.doc.doctype)) { this.frm.get_field('advances').grid.editable_fields = [ - {fieldname: 'reference_name', columns: 2}, + {fieldname: 'reference_name', columns: 3}, {fieldname: 'remarks', columns: 3}, - {fieldname: 'advance_amount', columns: 3}, - {fieldname: 'allocated_amount', columns: 3} + {fieldname: 'advance_amount', columns: 2}, + {fieldname: 'allocated_amount', columns: 2} ]; } - + frappe.ui.form.on(this.frm.doctype + " Item", "rate", function(frm, cdt, cdn) { var item = frappe.get_doc(cdt, cdn); frappe.model.round_floats_in(item, ["rate", "price_list_rate"]); @@ -432,7 +432,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ var company_currency = this.get_company_currency(); // Added `ignore_pricing_rule` to determine if document is loading after mapping from another doc - if(this.frm.doc.currency && this.frm.doc.currency !== company_currency + if(this.frm.doc.currency && this.frm.doc.currency !== company_currency && !this.frm.doc.ignore_pricing_rule) { this.get_exchange_rate(this.frm.doc.currency, company_currency, function(exchange_rate) { @@ -973,7 +973,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ this.item_selector = new erpnext.ItemSelector({frm: this.frm}); } }, - + get_advances: function() { if(!this.frm.is_return) { return this.frm.call({ @@ -985,7 +985,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ }) } }, - + make_payment_entry: function() { return frappe.call({ method: "erpnext.accounts.doctype.payment_entry.payment_entry.get_payment_entry", diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js index d02fed28d76..d58adce06fa 100644 --- a/erpnext/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -15,7 +15,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ this.frm.get_field('items').grid.editable_fields = [ {fieldname: 'item_code', columns: 4}, {fieldname: 'qty', columns: 2}, - {fieldname: 'rate', columns: 3}, + {fieldname: 'rate', columns: 2}, {fieldname: 'amount', columns: 2} ]; }, diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js index bbd312d72a2..62ae0911626 100644 --- a/erpnext/stock/doctype/material_request/material_request.js +++ b/erpnext/stock/doctype/material_request/material_request.js @@ -6,7 +6,7 @@ frappe.ui.form.on('Material Request', { setup: function(frm) { frm.get_field('items').grid.editable_fields = [ - {fieldname: 'item_code', columns: 4}, + {fieldname: 'item_code', columns: 3}, {fieldname: 'qty', columns: 2}, {fieldname: 'warehouse', columns: 3}, {fieldname: 'schedule_date', columns: 2}, diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 69d9a766b47..6c2a14b50c7 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -52,9 +52,9 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ this.frm.get_field('items').grid.editable_fields = [ {fieldname: 'item_code', columns: 3}, - {fieldname: 'qty', columns: 2}, - {fieldname: 's_warehouse', columns: 3}, - {fieldname: 't_warehouse', columns: 3} + {fieldname: 'qty', columns: 3}, + {fieldname: 's_warehouse', columns: 2}, + {fieldname: 't_warehouse', columns: 2} ]; }, diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js index 58b3549d1af..e7ba1bacbf4 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js @@ -6,7 +6,7 @@ frappe.provide("erpnext.stock"); frappe.ui.form.on("Stock Reconciliation", { onload: function(frm) { frm.add_fetch("item_code", "item_name", "item_name"); - + // end of life frm.set_query("item_code", "items", function(doc, cdt, cdn) { return { @@ -17,7 +17,7 @@ frappe.ui.form.on("Stock Reconciliation", { } } }); - + if (frm.doc.company) { erpnext.queries.setup_queries(frm, "Warehouse", function() { return erpnext.queries.warehouse(frm.doc); @@ -140,12 +140,12 @@ erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({ } } } - + this.frm.get_field('items').grid.editable_fields = [ {fieldname: 'item_code', columns: 3}, {fieldname: 'warehouse', columns: 3}, {fieldname: 'qty', columns: 2}, - {fieldname: 'valuation_rate', columns: 3} + {fieldname: 'valuation_rate', columns: 2} ]; },