Merge pull request #3435 from neilLasrado/barcode

Barcode added to Purchase Receipt
This commit is contained in:
Nabin Hait 2015-06-09 15:44:09 +05:30
commit bafc73568a
4 changed files with 25 additions and 11 deletions

View File

@ -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) { item_code: function(doc, cdt, cdn) {
var me = this; var me = this;
var item = frappe.get_doc(cdt, cdn); var item = frappe.get_doc(cdt, cdn);

View File

@ -81,7 +81,8 @@ erpnext.feature_setup.feature_dict = {
'Item': {'fields': ['barcode']}, 'Item': {'fields': ['barcode']},
'Delivery Note': {'items': ['barcode']}, 'Delivery Note': {'items': ['barcode']},
'Sales Invoice': {'items': ['barcode']}, 'Sales Invoice': {'items': ['barcode']},
'Stock Entry': {'items': ['barcode']} 'Stock Entry': {'items': ['barcode']},
'Purchase Receipt': {'items': ['barcode']}
}, },
'fs_item_group_in_details': { 'fs_item_group_in_details': {
'Delivery Note': {'items':['item_group']}, 'Delivery Note': {'items':['item_group']},

View File

@ -124,15 +124,6 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
this.apply_pricing_rule(); 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() { selling_price_list: function() {
this.apply_price_list(); this.apply_price_list();
}, },

View File

@ -4,6 +4,19 @@
"docstatus": 0, "docstatus": 0,
"doctype": "DocType", "doctype": "DocType",
"fields": [ "fields": [
{
"fieldname": "barcode",
"fieldtype": "Data",
"label": "Barcode",
"permlevel": 0,
"precision": ""
},
{
"fieldname": "section_break_2",
"fieldtype": "Section Break",
"permlevel": 0,
"precision": ""
},
{ {
"fieldname": "item_code", "fieldname": "item_code",
"fieldtype": "Link", "fieldtype": "Link",
@ -642,7 +655,7 @@
], ],
"idx": 1, "idx": 1,
"istable": 1, "istable": 1,
"modified": "2015-06-02 14:19:13.528248", "modified": "2015-06-08 08:21:18.024324",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Purchase Receipt Item", "name": "Purchase Receipt Item",