Merge pull request #3435 from neilLasrado/barcode
Barcode added to Purchase Receipt
diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js
index e05245e..ca0a6cb 100644
--- a/erpnext/public/js/controllers/transaction.js
+++ b/erpnext/public/js/controllers/transaction.js
@@ -105,6 +105,15 @@
}
},
+ 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 5ab04dd..664da66 100644
--- a/erpnext/public/js/feature_setup.js
+++ b/erpnext/public/js/feature_setup.js
@@ -81,7 +81,8 @@
'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 3ef8525..775eb41 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -124,15 +124,6 @@
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 c48aa2c..f53f508 100755
--- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
+++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
@@ -5,6 +5,19 @@
"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",
"in_filter": 1,
@@ -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",