Barcode added to Purchase Receipt
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/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
index fe41b4f..c85123c 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
@@ -204,3 +204,18 @@
}
frm.toggle_reqd("supplier_warehouse", frm.doc.is_subcontracted==="Yes");
});
+
+cur_frm.cscript.barcode = function(doc, cdt, cdn) {
+ var d = locals[cdt][cdn];
+ if (d.barcode) {
+ frappe.call({
+ method: "erpnext.stock.get_item_details.get_item_code",
+ args: {"barcode": d.barcode },
+ callback: function(r) {
+ if (!r.exe){
+ frappe.model.set_value(cdt, cdn, "item_code", r.message);
+ }
+ }
+ });
+ }
+}
\ No newline at end of file
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",