From 0ebd3c373c1b98d7168bb33c63f84804847f8b1a Mon Sep 17 00:00:00 2001 From: AravindPranera Date: Tue, 31 Oct 2017 10:26:58 +0530 Subject: [PATCH] Getting Quotation Document in Sales Invoice --- .../doctype/sales_invoice/sales_invoice.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 28a5d01aa8..b0566f1f30 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -157,6 +157,26 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte }) }, __("Get items from")); }, + + quotation_btn: function() { + var me = this; + this.$quotation_btn = this.frm.add_custom_button(__('Quotation'), + function() { + erpnext.utils.map_current_doc({ + method: "erpnext.selling.doctype.quotation.quotation.make_quotation", + source_doctype: "Quotation", + target: me.frm, + setters: { + customer: me.frm.doc.customer || undefined, + }, + get_query_filters: { + docstatus: 1, + status: ["!=", "Lost"], + company: me.frm.doc.company + } + }) + }, __("Get items from")); + }, delivery_note_btn: function() { var me = this;