From 95a620a30d67e6b2ac5137d87efa97f3f149b95f Mon Sep 17 00:00:00 2001 From: Sabu Siyad Date: Thu, 24 Nov 2022 15:40:05 +0530 Subject: [PATCH 1/2] fix(pos): warehouse should be in company Signed-off-by: Sabu Siyad --- erpnext/accounts/doctype/pos_invoice/pos_invoice.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.js b/erpnext/accounts/doctype/pos_invoice/pos_invoice.js index 15c292211c0..c868d9ec7e9 100644 --- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.js +++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.js @@ -12,6 +12,8 @@ erpnext.selling.POSInvoiceController = class POSInvoiceController extends erpnex company() { erpnext.accounts.dimensions.update_dimension(this.frm, this.frm.doctype); + this.frm.set_value("set_warehouse", ""); + this.frm.set_value("taxes_and_charges", ""); } onload(doc) { From 4ad0e2ed7eb925c893a84ef00964fbc1cab09cc6 Mon Sep 17 00:00:00 2001 From: Sabu Siyad Date: Thu, 24 Nov 2022 16:11:26 +0530 Subject: [PATCH 2/2] feat(pos): invoice: fitler warehouse by company Signed-off-by: Sabu Siyad --- erpnext/accounts/doctype/pos_invoice/pos_invoice.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.js b/erpnext/accounts/doctype/pos_invoice/pos_invoice.js index c868d9ec7e9..40df6187d29 100644 --- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.js +++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.js @@ -19,11 +19,20 @@ erpnext.selling.POSInvoiceController = class POSInvoiceController extends erpnex onload(doc) { super.onload(); this.frm.ignore_doctypes_on_cancel_all = ['POS Invoice Merge Log', 'POS Closing Entry']; + if(doc.__islocal && doc.is_pos && frappe.get_route_str() !== 'point-of-sale') { this.frm.script_manager.trigger("is_pos"); this.frm.refresh_fields(); } + this.frm.set_query("set_warehouse", function(doc) { + return { + filters: { + company: doc.company ? doc.company : '', + } + } + }); + erpnext.accounts.dimensions.setup_dimension_filters(this.frm, this.frm.doctype); }