diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index e05245e7b0..ca0a6cb8d2 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -105,6 +105,15 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ } }, + barcode: function(doc, cdt, cdn) { + var d = locals[cdt][cdn]; + if(d.barcode=="" || d.barcode==null) { + // barcode cleared, remove item + d.item_code = ""; + } + this.item_code(doc, cdt, cdn); + }, + item_code: function(doc, cdt, cdn) { var me = this; var item = frappe.get_doc(cdt, cdn); diff --git a/erpnext/public/js/feature_setup.js b/erpnext/public/js/feature_setup.js index 5ab04ddfa2..664da664d3 100644 --- a/erpnext/public/js/feature_setup.js +++ b/erpnext/public/js/feature_setup.js @@ -81,7 +81,8 @@ erpnext.feature_setup.feature_dict = { 'Item': {'fields': ['barcode']}, 'Delivery Note': {'items': ['barcode']}, 'Sales Invoice': {'items': ['barcode']}, - 'Stock Entry': {'items': ['barcode']} + 'Stock Entry': {'items': ['barcode']}, + 'Purchase Receipt': {'items': ['barcode']} }, 'fs_item_group_in_details': { 'Delivery Note': {'items':['item_group']}, diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js index 3ef85257f3..775eb4143f 100644 --- a/erpnext/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -124,15 +124,6 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ this.apply_pricing_rule(); }, - barcode: function(doc, cdt, cdn) { - var d = locals[cdt][cdn]; - if(d.barcode=="" || d.barcode==null) { - // barcode cleared, remove item - d.item_code = ""; - } - this.item_code(doc, cdt, cdn); - }, - selling_price_list: function() { this.apply_price_list(); }, diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json index c48aa2c269..f53f50850e 100755 --- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json +++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json @@ -4,6 +4,19 @@ "docstatus": 0, "doctype": "DocType", "fields": [ + { + "fieldname": "barcode", + "fieldtype": "Data", + "label": "Barcode", + "permlevel": 0, + "precision": "" + }, + { + "fieldname": "section_break_2", + "fieldtype": "Section Break", + "permlevel": 0, + "precision": "" + }, { "fieldname": "item_code", "fieldtype": "Link", @@ -642,7 +655,7 @@ ], "idx": 1, "istable": 1, - "modified": "2015-06-02 14:19:13.528248", + "modified": "2015-06-08 08:21:18.024324", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt Item",