Browse Source

Merge branch 'master' of github.com:webnotes/erpnext

develop
Anand Doshi 12 years ago
parent
commit
fa1963164c
  1. 2
      erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js
  2. 3
      erpnext/accounts/doctype/sales_invoice/sales_invoice.py
  3. 18
      erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt
  4. 2
      erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js
  5. 0
      erpnext/patches/june_2012/__init__.py
  6. 7
      erpnext/patches/june_2012/barcode_in_feature_setup.py
  7. 4
      erpnext/patches/june_2012/copy_uom_for_pur_inv_item.py
  8. 10
      erpnext/patches/patch_list.py
  9. 4
      erpnext/selling/doctype/quotation_item/quotation_item.txt
  10. 10
      erpnext/selling/doctype/sales_common/sales_common.js
  11. 22
      erpnext/selling/doctype/sales_common/sales_common.py
  12. 8
      erpnext/selling/doctype/sales_order_item/sales_order_item.txt
  13. 15
      erpnext/setup/doctype/features_setup/features_setup.txt
  14. 5
      erpnext/startup/js/feature_setup.js
  15. 3
      erpnext/stock/doctype/delivery_note/delivery_note.py
  16. 16
      erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt
  17. 7
      erpnext/stock/doctype/item/item.py
  18. 11
      erpnext/stock/doctype/item/item.txt
  19. 2
      erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt
  20. 2
      public/js/all-app.js

2
erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js

@ -127,7 +127,7 @@ cur_frm.cscript.row_id = function(doc, cdt, cdn) {
/*---------------------- Get rate if account_head has account_type as TAX or CHARGEABLE-------------------------------------*/
cur_frm.fields_dict['purchase_tax_details'].grid.get_field("account_head").get_query = function(doc,cdt,cdn) {
return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND (tabAccount.account_type in ("Tax", "Chargeable", "Expense") or (tabAccount.is_pl_account = "Yes" and tabAccount.debit_or_credit = "Debit")) AND tabAccount.company = "' + doc.company + '" AND tabAccount.name LIKE "%s"'
return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND (tabAccount.account_type in ("Tax", "Chargeable", "Expense Account") or (tabAccount.is_pl_account = "Yes" and tabAccount.debit_or_credit = "Debit")) AND tabAccount.company = "' + doc.company + '" AND tabAccount.name LIKE "%s"'
}

3
erpnext/accounts/doctype/sales_invoice/sales_invoice.py

@ -211,6 +211,9 @@ class DocType(TransactionBase):
ret['actual_qty']= actual_qty and flt(actual_qty[0][0]) or 0
return ret
def get_barcode_details(self, barcode):
return get_obj('Sales Common').get_barcode_details(barcode)
# Fetch ref rate from item master as per selected price list
def get_adj_percent(self, arg=''):

18
erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt

@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2012-03-27 14:35:48',
'creation': '2012-04-13 11:56:18',
'docstatus': 0,
'modified': '2012-03-27 14:35:48',
'modified': '2012-06-07 19:05:06',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@ -22,7 +22,7 @@
'section_style': u'Tray',
'server_code_error': u' ',
'show_in_menu': 0,
'version': 29
'version': 1
},
# These values are common for all DocField
@ -40,6 +40,16 @@
'name': u'Sales Invoice Item'
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'barcode',
'fieldtype': u'Data',
'label': u'Barcode',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': u'DocField',
@ -431,4 +441,4 @@
'print_hide': 1,
'report_hide': 1
}
]
]

2
erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js

@ -140,7 +140,7 @@ cur_frm.cscript.row_id = function(doc, cdt, cdn) {
/*---------------------- Get rate if account_head has account_type as TAX or CHARGEABLE-------------------------------------*/
cur_frm.fields_dict['other_charges'].grid.get_field("account_head").get_query = function(doc,cdt,cdn) {
return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND tabAccount.account_type in ("Tax", "Chargeable", "Income") AND tabAccount.company = "'+doc.company+'" AND tabAccount.name LIKE "%s"'
return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND tabAccount.account_type in ("Tax", "Chargeable", "Income Account") AND tabAccount.company = "'+doc.company+'" AND tabAccount.name LIKE "%s"'
}
cur_frm.fields_dict['other_charges'].grid.get_field("cost_center_other_charges").get_query = function(doc) {

0
erpnext/patches/june_2012/__init__.py

7
erpnext/patches/june_2012/barcode_in_feature_setup.py

@ -0,0 +1,7 @@
def execute():
import webnotes
from webnotes.model.code import get_obj
fs = get_obj('Features Setup')
fs.doc.fs_item_barcode = 0
fs.doc.save()
fs.validate()

4
erpnext/patches/june_2012/copy_uom_for_pur_inv_item.py

@ -0,0 +1,4 @@
def execute():
import webnotes
webnotes.conn.sql("update `tabPurchase Invoice Item` t1, `tabPurchase Order Item` t2 set t1.uom = t2.uom where ifnull(t1.po_detail, '') != '' and t1.po_detail = t2.name")
webnotes.conn.sql("update `tabPurchase Invoice Item` t1, `tabPurchase Receipt Item` t2 set t1.uom = t2.uom where ifnull(t1.pr_detail, '') != '' and t1.pr_detail = t2.name")

10
erpnext/patches/patch_list.py

@ -412,4 +412,14 @@ patch_list = [
'patch_file': 'remove_communication_log',
'description': 'Remove Communication Log and replace it with Communication'
},
{
'patch_module': 'patches.june_2012',
'patch_file': 'barcode_in_feature_setup',
'description': 'Track item by barcode'
},
{
'patch_module': 'patches.june_2012',
'patch_file': 'copy_uom_for_pur_inv_item',
'description': 'Copy uom for pur inv item from PO and PR item table'
},
]

4
erpnext/selling/doctype/quotation_item/quotation_item.txt

@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2012-05-15 12:14:54',
'creation': '2012-06-04 15:40:56',
'docstatus': 0,
'modified': '2012-05-18 18:21:08',
'modified': '2012-06-07 17:58:39',
'modified_by': u'Administrator',
'owner': u'Administrator'
},

10
erpnext/selling/doctype/sales_common/sales_common.js

@ -265,6 +265,16 @@ cur_frm.cscript.item_code = function(doc, cdt, cdn) {
}
}
//Barcode
//
cur_frm.cscript.barcode = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
var callback = function(r, rt) {
cur_frm.cscript.item_code(doc, cdt, cdn);
}
get_server_fields('get_barcode_details', d.barcode, cur_frm.cscript.fname, doc, cdt, cdn, 1, callback);
}
// *********************** QUANTITY ***************************
cur_frm.cscript.qty = function(doc, cdt, cdn) { cur_frm.cscript.recalc(doc, 1); }

22
erpnext/selling/doctype/sales_common/sales_common.py

@ -128,12 +128,13 @@ class DocType(TransactionBase):
if not obj.doc.price_list_name:
msgprint("Please Select Price List before selecting Items")
raise Exception
item = webnotes.conn.sql("select description, item_name, brand, item_group, stock_uom, default_warehouse, default_income_account, default_sales_cost_center, description_html from `tabItem` where name = '%s' and (ifnull(end_of_life,'')='' or end_of_life > now() or end_of_life = '0000-00-00') and (is_sales_item = 'Yes' or is_service_item = 'Yes')" % (args['item_code']), as_dict=1)
item = webnotes.conn.sql("select description, item_name, brand, item_group, stock_uom, default_warehouse, default_income_account, default_sales_cost_center, description_html, barcode from `tabItem` where name = '%s' and (ifnull(end_of_life,'')='' or end_of_life > now() or end_of_life = '0000-00-00') and (is_sales_item = 'Yes' or is_service_item = 'Yes')" % (args['item_code']), as_dict=1)
tax = webnotes.conn.sql("select tax_type, tax_rate from `tabItem Tax` where parent = %s" , args['item_code'])
t = {}
for x in tax: t[x[0]] = flt(x[1])
ret = {
'description' : item and item[0]['description_html'] or item[0]['description'],
'barcode' : item and item[0]['barcode'] or '',
'item_group' : item and item[0]['item_group'] or '',
'item_name' : item and item[0]['item_name'] or '',
'brand' : item and item[0]['brand'] or '',
@ -171,7 +172,6 @@ class DocType(TransactionBase):
return ret
# ***************** Get Ref rate as entered in Item Master ********************
def get_ref_rate(self, item_code, price_list_name, price_list_currency, plc_conv_rate):
@ -179,6 +179,24 @@ class DocType(TransactionBase):
base_ref_rate = ref_rate and flt(ref_rate[0][0]) * flt(plc_conv_rate) or 0
return base_ref_rate
def get_barcode_details(self, barcode):
item = webnotes.conn.sql("select name, end_of_life, is_sales_item, is_service_item \
from `tabItem` where barcode = %s", barcode, as_dict=1)
ret = {}
if not item:
msgprint("""No item found for this barcode: %s.
May be barcode not updated in item master. Please check""" % barcode)
elif item[0]['end_of_life'] and getdate(cstr(item[0]['end_of_life'])) < nowdate():
msgprint("Item: %s has been expired. Please check 'End of Life' field in item master" % item[0]['name'])
elif item[0]['is_sales_item'] == 'No' and item[0]['is_service_item'] == 'No':
msgprint("Item: %s is not a sales or service item" % item[0]['name'])
elif len(item) > 1:
msgprint("There are multiple item for this barcode. \nPlease select item code manually")
else:
ret = {'item_code': item and item[0]['name'] or ''}
return ret
# ****** Re-cancellculates Basic Rate & amount based on Price List Selected ******
def get_adj_percent(self, obj):

8
erpnext/selling/doctype/sales_order_item/sales_order_item.txt

@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2012-03-27 14:36:15',
'creation': '2012-04-13 11:56:28',
'docstatus': 0,
'modified': '2012-03-27 14:36:15',
'modified': '2012-06-07 18:04:52',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@ -22,7 +22,7 @@
'section_style': u'Tray',
'server_code_error': u' ',
'show_in_menu': 0,
'version': 54
'version': 1
},
# These values are common for all DocField
@ -68,7 +68,7 @@
'permlevel': 0,
'print_hide': 1,
'reqd': 1,
'width': u'150px'
'width': u'150'
},
# DocField

15
erpnext/setup/doctype/features_setup/features_setup.txt

@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2012-03-27 14:36:21',
'creation': '2012-04-13 11:56:31',
'docstatus': 0,
'modified': '2012-03-27 14:36:21',
'modified': '2012-06-07 18:41:50',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@ -22,7 +22,7 @@
'name_case': u'Title Case',
'section_style': u'Simple',
'show_in_menu': 1,
'version': 26
'version': 1
},
# These values are common for all DocField
@ -104,6 +104,15 @@
'label': u'Brands'
},
# DocField
{
'description': u'To track items using barcode. You will be able to enter items in Delivery Note and Sales Invoice by scanning barcode of item.',
'doctype': u'DocField',
'fieldname': u'fs_item_barcode',
'fieldtype': u'Check',
'label': u'Item Barcode'
},
# DocField
{
'doctype': u'DocField',

5
erpnext/startup/js/feature_setup.js

@ -93,6 +93,11 @@ pscript.feature_dict = {
'Stock Entry': {'mtn_details':['serial_no']},
'Stock Ledger Entry': {'fields':['serial_no']}
},
'fs_item_barcode': {
'Item': {'fields': ['barcode']},
'Delivery Note': {'delivery_note_details': ['barcode']},
'Sales Invoice': {'entries': ['barcode']}
},
'fs_item_group_in_details': {
'Delivery Note': {'delivery_note_details':['item_group']},
'Opportunity': {'enquiry_details':['item_group']},

3
erpnext/stock/doctype/delivery_note/delivery_note.py

@ -122,6 +122,9 @@ class DocType(TransactionBase):
if not doc.fields.get(r):
doc.fields[r] = ret[r]
def get_barcode_details(self, barcode):
return get_obj('Sales Common').get_barcode_details(barcode)
# *** Re-calculates Basic Rate & amount based on Price List Selected ***
def get_adj_percent(self, arg=''):

16
erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt

@ -3,9 +3,9 @@
# These values are common in all dictionaries
{
'creation': '2012-03-27 14:36:29',
'creation': '2012-04-13 11:56:35',
'docstatus': 0,
'modified': '2012-03-27 14:36:29',
'modified': '2012-06-07 17:57:14',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@ -23,7 +23,7 @@
'section_style': u'Tray',
'server_code_error': u' ',
'show_in_menu': 0,
'version': 56
'version': 1
},
# These values are common for all DocField
@ -41,6 +41,16 @@
'name': u'Delivery Note Item'
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'barcode',
'fieldtype': u'Data',
'label': u'Barcode',
'permlevel': 0,
'print_hide': 1
},
# DocField
{
'doctype': u'DocField',

7
erpnext/stock/doctype/item/item.py

@ -127,6 +127,12 @@ class DocType:
if bom and bom[0][0]:
msgprint("%s should be 'Yes'. As Item %s is present in one or many Active BOMs." % (cstr(check), cstr(self.doc.name)))
raise Exception
def validate_barcode(self):
if self.doc.barcode:
duplicate = sql("select name from tabItem where barcode = %s and name != %s", (self.doc.barcode, self.doc.name))
if duplicate:
msgprint("Barcode: %s already used in item: %s" % (self.doc.barcode, cstr(duplicate[0][0])), raise_exception = 1)
def validate(self):
fl = {'is_manufactured_item' :'Is Manufactured Item',
@ -139,6 +145,7 @@ class DocType:
self.check_ref_rate_detail()
self.fill_customer_code()
self.check_item_tax()
self.validate_barcode()
if not self.doc.min_order_qty:
self.doc.min_order_qty = 0
self.check_non_asset_warehouse()

11
erpnext/stock/doctype/item/item.txt

@ -5,7 +5,7 @@
{
'creation': '2012-04-30 18:33:53',
'docstatus': 0,
'modified': '2012-05-31 11:18:10',
'modified': '2012-06-07 16:16:24',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@ -235,6 +235,15 @@
'reqd': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'barcode',
'fieldtype': u'Data',
'label': u'Barcode',
'permlevel': 0
},
# DocField
{
'doctype': u'DocField',

2
erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt

@ -5,7 +5,7 @@
{
'creation': '2012-04-13 11:56:36',
'docstatus': 0,
'modified': '2012-05-09 14:25:12',
'modified': '2012-06-07 18:07:12',
'modified_by': u'Administrator',
'owner': u'Administrator'
},

2
public/js/all-app.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save