From bd071b95433fdc1132e98bdb15a4e1a115b510ff Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 25 Oct 2013 15:39:17 +0530 Subject: [PATCH 01/19] [fix] [minor] update finished goods against production order --- .../production_order/production_order.py | 6 ++-- stock/doctype/stock_entry/stock_entry.py | 31 +++++++++++++------ 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/manufacturing/doctype/production_order/production_order.py b/manufacturing/doctype/production_order/production_order.py index b29b0f1e72..dd21782559 100644 --- a/manufacturing/doctype/production_order/production_order.py +++ b/manufacturing/doctype/production_order/production_order.py @@ -134,16 +134,16 @@ class DocType: @webnotes.whitelist() def get_item_details(item): - res = webnotes.conn.sql("""select stock_uom + res = webnotes.conn.sql("""select stock_uom, description from `tabItem` where (ifnull(end_of_life, "")="" or end_of_life > now()) - and name=%s""", (item,), as_dict=1) + and name=%s""", item, as_dict=1) if not res: return {} res = res[0] bom = webnotes.conn.sql("""select name from `tabBOM` where item=%s - and ifnull(is_default, 0)=1""", (item,)) + and ifnull(is_default, 0)=1""", item) if bom: res.bom_no = bom[0][0] diff --git a/stock/doctype/stock_entry/stock_entry.py b/stock/doctype/stock_entry/stock_entry.py index 7ec2ba32bd..9f3b0ce2ca 100644 --- a/stock/doctype/stock_entry/stock_entry.py +++ b/stock/doctype/stock_entry/stock_entry.py @@ -454,35 +454,44 @@ class DocType(StockController): item["to_warehouse"] = "" # add raw materials to Stock Entry Detail table - self.add_to_stock_entry_detail(item_dict) + idx = self.add_to_stock_entry_detail(item_dict) # add finished good item to Stock Entry Detail table -- along with bom_no if self.doc.production_order and self.doc.purpose == "Manufacture/Repack": + item = webnotes.conn.get_value("Item", pro_obj.doc.production_item, ["item_name", + "description", "stock_uom", "purchase_account", "cost_center"], as_dict=1) self.add_to_stock_entry_detail({ cstr(pro_obj.doc.production_item): { "to_warehouse": pro_obj.doc.fg_warehouse, "from_warehouse": "", "qty": self.doc.fg_completed_qty, - "description": pro_obj.doc.description, - "stock_uom": pro_obj.doc.stock_uom + "item_name": item.item_name, + "description": item.description, + "stock_uom": item.stock_uom, + "expense_account": item.purchase_account, + "cost_center": item.cost_center, } - }, bom_no=pro_obj.doc.bom_no) + }, bom_no=pro_obj.doc.bom_no, idx=idx) elif self.doc.purpose in ["Material Receipt", "Manufacture/Repack"]: if self.doc.purpose=="Material Receipt": self.doc.from_warehouse = "" - item = webnotes.conn.sql("""select name, item_name, description, uom - from `tabItem` where name=%s""", (self.doc.bom_no), as_dict=1) + item = webnotes.conn.sql("""select name, item_name, description, + uom, purchase_account, cost_center from `tabItem` + where name=(select item from tabBOM where name=%s)""", + self.doc.bom_no, as_dict=1) self.add_to_stock_entry_detail({ item[0]["item"] : { "qty": self.doc.fg_completed_qty, "item_name": item[0].item_name, "description": item[0]["description"], "stock_uom": item[0]["uom"], - "from_warehouse": "" + "from_warehouse": "", + "expense_account": item[0].purchase_account, + "cost_center": item[0].cost_center, } - }, bom_no=self.doc.bom_no) + }, bom_no=self.doc.bom_no, idx=idx) self.get_stock_and_rate() @@ -607,8 +616,9 @@ class DocType(StockController): return issued_item_qty - def add_to_stock_entry_detail(self, item_dict, bom_no=None): - idx = 1 + def add_to_stock_entry_detail(self, item_dict, bom_no=None, idx=None): + webnotes.errprint([]) + if not idx: idx = 1 expense_account, cost_center = webnotes.conn.get_values("Company", self.doc.company, \ ["default_expense_account", "cost_center"])[0] @@ -636,6 +646,7 @@ class DocType(StockController): # increment idx by 1 idx += 1 + return idx def get_cust_values(self): """fetches customer details""" From d5daf04499695844b8c1a96cfd6d95b9a172843e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 25 Oct 2013 17:19:05 +0530 Subject: [PATCH 02/19] [minor] Ignore permission while updating profile from employee --- hr/doctype/employee/employee.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hr/doctype/employee/employee.py b/hr/doctype/employee/employee.py index e28e02d81b..78cb905580 100644 --- a/hr/doctype/employee/employee.py +++ b/hr/doctype/employee/employee.py @@ -105,7 +105,7 @@ class DocType: except webnotes.DuplicateEntryError, e: # already exists pass - + profile_wrapper.ignore_permissions = True profile_wrapper.save() def validate_date(self): From ef42d601533b3008c1ebd96bc244dc54d9ea3846 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Sat, 26 Oct 2013 15:06:09 +0530 Subject: [PATCH 03/19] [fix] [minor] fetch item and price list details on saving item price --- setup/doctype/item_price/item_price.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/setup/doctype/item_price/item_price.py b/setup/doctype/item_price/item_price.py index ddde87e98a..be235de27c 100644 --- a/setup/doctype/item_price/item_price.py +++ b/setup/doctype/item_price/item_price.py @@ -13,23 +13,18 @@ class DocType: def __init__(self, d, dl): self.doc, self.doclist = d, dl - def on_update(self): + def validate(self): + self.check_duplicate_item() self.update_price_list_details() self.update_item_details() - self.check_duplicate_item() def update_price_list_details(self): - self.doc.buying_or_selling = webnotes.conn.get_value("Price List", self.doc.price_list, - "buying_or_selling") - - self.doc.currency = webnotes.conn.get_value("Price List", self.doc.price_list, - "currency") + self.doc.buying_or_selling, self.doc.currency = webnotes.conn.get_value("Price List", + self.doc.price_list, ["buying_or_selling", "currency"]) def update_item_details(self): - self.doc.item_name = webnotes.conn.get_value("Item", self.doc.item_code, "item_name") - - self.doc.item_description = webnotes.conn.get_value("Item", self.doc.item_code, - "description") + self.doc.item_name, self.doc.item_description = webnotes.conn.get_value("Item", + self.doc.item_code, ["item_name", "description"]) def check_duplicate_item(self): if webnotes.conn.sql("""select name from `tabItem Price` From 1fbc03bcfb4f894beddafb829ff50f13ed820b61 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Sun, 27 Oct 2013 16:20:51 +0530 Subject: [PATCH 04/19] [fix] [minor] account group balance in grid report --- public/js/account_tree_grid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/account_tree_grid.js b/public/js/account_tree_grid.js index c779cfa6d9..13e2de2960 100644 --- a/public/js/account_tree_grid.js +++ b/public/js/account_tree_grid.js @@ -174,7 +174,7 @@ erpnext.AccountTreeGrid = wn.views.TreeGridReport.extend({ var me= this; $.each(this.data, function(i, account) { // update groups - if(account.rgt - account.lft == 1) { + if((account.group_or_ledger == "Ledger") || (account.rgt - account.lft == 1)) { var parent = me.parent_map[account.name]; while(parent) { var parent_account = me.item_by_name[parent]; From 9304396e171fb7aa1cbc642d2af70ee43d9c3515 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 28 Oct 2013 15:33:36 +0530 Subject: [PATCH 05/19] [fix] [minor] Cost center is mandatory if tax is include din valuation and perpetual inventory enabled --- .../doctype/purchase_invoice/purchase_invoice.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/accounts/doctype/purchase_invoice/purchase_invoice.py b/accounts/doctype/purchase_invoice/purchase_invoice.py index c1e92b9f4f..f3d359bd45 100644 --- a/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -350,11 +350,14 @@ class DocType(BuyingController): ) # accumulate valuation tax - if tax.category in ("Valuation", "Valuation and Total") and flt(tax.tax_amount) \ - and tax.cost_center: - valuation_tax.setdefault(tax.cost_center, 0) - valuation_tax[tax.cost_center] += \ - (tax.add_deduct_tax == "Add" and 1 or -1) * flt(tax.tax_amount) + if tax.category in ("Valuation", "Valuation and Total") and flt(tax.tax_amount): + if auto_accounting_for_stock and not tax.cost_center: + webnotes.throw(_("Row %(row)s: Cost Center is mandatory \ + if tax/charges category is Valuation or Valuation and Total" % + {"row": tax.idx})) + valuation_tax.setdefault(tax.cost_center, 0) + valuation_tax[tax.cost_center] += \ + (tax.add_deduct_tax == "Add" and 1 or -1) * flt(tax.tax_amount) # item gl entries stock_item_and_auto_accounting_for_stock = False From 93ba6f7e0ebbcc1201015dd2ef55745173cdd342 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 31 Oct 2013 11:47:45 +0530 Subject: [PATCH 06/19] [fix] [minor] update outstanding amount --- accounts/doctype/gl_entry/gl_entry.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/accounts/doctype/gl_entry/gl_entry.py b/accounts/doctype/gl_entry/gl_entry.py index 0c11198be9..dfac6b6469 100644 --- a/accounts/doctype/gl_entry/gl_entry.py +++ b/accounts/doctype/gl_entry/gl_entry.py @@ -135,17 +135,18 @@ def check_freezing_date(posting_date, adv_adj=False): def update_outstanding_amt(account, against_voucher_type, against_voucher, on_cancel=False): # get final outstanding amt - bal = flt(webnotes.conn.sql("""select sum(debit) - sum(credit) from `tabGL Entry` + bal = flt(webnotes.conn.sql("""select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0)) + from `tabGL Entry` where against_voucher_type=%s and against_voucher=%s and account = %s""", (against_voucher_type, against_voucher, account))[0][0] or 0.0) if against_voucher_type == 'Purchase Invoice': bal = -bal elif against_voucher_type == "Journal Voucher": - against_voucher_amount = flt(webnotes.conn.sql("""select sum(debit) - sum(credit) + against_voucher_amount = flt(webnotes.conn.sql(""" + select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0)) from `tabGL Entry` where voucher_type = 'Journal Voucher' and voucher_no = %s and account = %s""", (against_voucher, account))[0][0]) - bal = against_voucher_amount + bal if against_voucher_amount < 0: bal = -bal From 0b39e95011835517c9e91afc9b972474d0e1d590 Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Thu, 31 Oct 2013 12:35:52 +0530 Subject: [PATCH 07/19] [cleanup] moved for territory, price list and item price doctype from setup to stock --- patches/august_2013/p02_rename_price_list.py | 2 +- patches/june_2013/p03_buying_selling_for_price_list.py | 4 ++-- patches/june_2013/p07_taxes_price_list_for_territory.py | 4 ++-- .../p02_update_price_list_and_item_details_in_item_price.py | 2 +- .../p03_modify_item_price_include_in_price_list.py | 4 ++-- {setup => stock}/doctype/for_territory/__init__.py | 0 {setup => stock}/doctype/for_territory/for_territory.py | 0 {setup => stock}/doctype/for_territory/for_territory.txt | 0 {setup => stock}/doctype/item_price/README.md | 0 {setup => stock}/doctype/item_price/__init__.py | 0 {setup => stock}/doctype/item_price/item_price.js | 0 {setup => stock}/doctype/item_price/item_price.py | 0 {setup => stock}/doctype/item_price/item_price.txt | 0 {setup => stock}/doctype/item_price/test_item_price.py | 0 {setup => stock}/doctype/price_list/README.md | 0 {setup => stock}/doctype/price_list/__init__.py | 0 {setup => stock}/doctype/price_list/price_list.css | 0 {setup => stock}/doctype/price_list/price_list.js | 0 {setup => stock}/doctype/price_list/price_list.py | 0 {setup => stock}/doctype/price_list/price_list.txt | 0 {setup => stock}/doctype/price_list/test_price_list.py | 0 21 files changed, 8 insertions(+), 8 deletions(-) rename {setup => stock}/doctype/for_territory/__init__.py (100%) rename {setup => stock}/doctype/for_territory/for_territory.py (100%) rename {setup => stock}/doctype/for_territory/for_territory.txt (100%) rename {setup => stock}/doctype/item_price/README.md (100%) rename {setup => stock}/doctype/item_price/__init__.py (100%) rename {setup => stock}/doctype/item_price/item_price.js (100%) rename {setup => stock}/doctype/item_price/item_price.py (100%) rename {setup => stock}/doctype/item_price/item_price.txt (100%) rename {setup => stock}/doctype/item_price/test_item_price.py (100%) rename {setup => stock}/doctype/price_list/README.md (100%) rename {setup => stock}/doctype/price_list/__init__.py (100%) rename {setup => stock}/doctype/price_list/price_list.css (100%) rename {setup => stock}/doctype/price_list/price_list.js (100%) rename {setup => stock}/doctype/price_list/price_list.py (100%) rename {setup => stock}/doctype/price_list/price_list.txt (100%) rename {setup => stock}/doctype/price_list/test_price_list.py (100%) diff --git a/patches/august_2013/p02_rename_price_list.py b/patches/august_2013/p02_rename_price_list.py index 0a1929925b..dbe268f0ad 100644 --- a/patches/august_2013/p02_rename_price_list.py +++ b/patches/august_2013/p02_rename_price_list.py @@ -6,7 +6,7 @@ import webnotes def execute(): webnotes.reload_doc("selling", "doctype", "shopping_cart_price_list") - webnotes.reload_doc("setup", "doctype", "item_price") + webnotes.reload_doc("stock", "doctype", "item_price") for t in [ ("Supplier Quotation", "price_list_name", "buying_price_list"), diff --git a/patches/june_2013/p03_buying_selling_for_price_list.py b/patches/june_2013/p03_buying_selling_for_price_list.py index ead97ab2a8..61cddd0b28 100644 --- a/patches/june_2013/p03_buying_selling_for_price_list.py +++ b/patches/june_2013/p03_buying_selling_for_price_list.py @@ -7,8 +7,8 @@ from webnotes.utils import cint import MySQLdb def execute(): - webnotes.reload_doc("setup", "doctype", "price_list") - webnotes.reload_doc("setup", "doctype", "item_price") + webnotes.reload_doc("stock", "doctype", "price_list") + webnotes.reload_doc("stock", "doctype", "item_price") try: for price_list in webnotes.conn.sql_list("""select name from `tabPrice List`"""): diff --git a/patches/june_2013/p07_taxes_price_list_for_territory.py b/patches/june_2013/p07_taxes_price_list_for_territory.py index f57ecf8173..d523ea934b 100644 --- a/patches/june_2013/p07_taxes_price_list_for_territory.py +++ b/patches/june_2013/p07_taxes_price_list_for_territory.py @@ -4,8 +4,8 @@ import webnotes def execute(): - webnotes.reload_doc("setup", "doctype", "for_territory") - webnotes.reload_doc("setup", "doctype", "price_list") + webnotes.reload_doc("stock", "doctype", "for_territory") + webnotes.reload_doc("stock", "doctype", "price_list") webnotes.reload_doc("accounts", "doctype", "sales_taxes_and_charges_master") webnotes.reload_doc("accounts", "doctype", "shipping_rule") diff --git a/patches/october_2013/p02_update_price_list_and_item_details_in_item_price.py b/patches/october_2013/p02_update_price_list_and_item_details_in_item_price.py index 209ebf3574..4a90b8c634 100644 --- a/patches/october_2013/p02_update_price_list_and_item_details_in_item_price.py +++ b/patches/october_2013/p02_update_price_list_and_item_details_in_item_price.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import webnotes def execute(): - webnotes.reload_doc("setup", "doctype", "item_price") + webnotes.reload_doc("stock", "doctype", "item_price") webnotes.conn.sql("""update `tabItem Price` ip, `tabItem` i set ip.item_name=i.item_name, ip.item_description=i.description diff --git a/patches/september_2013/p03_modify_item_price_include_in_price_list.py b/patches/september_2013/p03_modify_item_price_include_in_price_list.py index 8ca6d76f9c..2400918473 100644 --- a/patches/september_2013/p03_modify_item_price_include_in_price_list.py +++ b/patches/september_2013/p03_modify_item_price_include_in_price_list.py @@ -5,8 +5,8 @@ from __future__ import unicode_literals import webnotes def execute(): - webnotes.reload_doc("setup", "doctype", "price_list") - webnotes.reload_doc("setup", "doctype", "item_price") + webnotes.reload_doc("stock", "doctype", "price_list") + webnotes.reload_doc("stock", "doctype", "item_price") webnotes.reload_doc("stock", "doctype", "item") webnotes.conn.sql("""update `tabItem Price` set parenttype='Price List', diff --git a/setup/doctype/for_territory/__init__.py b/stock/doctype/for_territory/__init__.py similarity index 100% rename from setup/doctype/for_territory/__init__.py rename to stock/doctype/for_territory/__init__.py diff --git a/setup/doctype/for_territory/for_territory.py b/stock/doctype/for_territory/for_territory.py similarity index 100% rename from setup/doctype/for_territory/for_territory.py rename to stock/doctype/for_territory/for_territory.py diff --git a/setup/doctype/for_territory/for_territory.txt b/stock/doctype/for_territory/for_territory.txt similarity index 100% rename from setup/doctype/for_territory/for_territory.txt rename to stock/doctype/for_territory/for_territory.txt diff --git a/setup/doctype/item_price/README.md b/stock/doctype/item_price/README.md similarity index 100% rename from setup/doctype/item_price/README.md rename to stock/doctype/item_price/README.md diff --git a/setup/doctype/item_price/__init__.py b/stock/doctype/item_price/__init__.py similarity index 100% rename from setup/doctype/item_price/__init__.py rename to stock/doctype/item_price/__init__.py diff --git a/setup/doctype/item_price/item_price.js b/stock/doctype/item_price/item_price.js similarity index 100% rename from setup/doctype/item_price/item_price.js rename to stock/doctype/item_price/item_price.js diff --git a/setup/doctype/item_price/item_price.py b/stock/doctype/item_price/item_price.py similarity index 100% rename from setup/doctype/item_price/item_price.py rename to stock/doctype/item_price/item_price.py diff --git a/setup/doctype/item_price/item_price.txt b/stock/doctype/item_price/item_price.txt similarity index 100% rename from setup/doctype/item_price/item_price.txt rename to stock/doctype/item_price/item_price.txt diff --git a/setup/doctype/item_price/test_item_price.py b/stock/doctype/item_price/test_item_price.py similarity index 100% rename from setup/doctype/item_price/test_item_price.py rename to stock/doctype/item_price/test_item_price.py diff --git a/setup/doctype/price_list/README.md b/stock/doctype/price_list/README.md similarity index 100% rename from setup/doctype/price_list/README.md rename to stock/doctype/price_list/README.md diff --git a/setup/doctype/price_list/__init__.py b/stock/doctype/price_list/__init__.py similarity index 100% rename from setup/doctype/price_list/__init__.py rename to stock/doctype/price_list/__init__.py diff --git a/setup/doctype/price_list/price_list.css b/stock/doctype/price_list/price_list.css similarity index 100% rename from setup/doctype/price_list/price_list.css rename to stock/doctype/price_list/price_list.css diff --git a/setup/doctype/price_list/price_list.js b/stock/doctype/price_list/price_list.js similarity index 100% rename from setup/doctype/price_list/price_list.js rename to stock/doctype/price_list/price_list.js diff --git a/setup/doctype/price_list/price_list.py b/stock/doctype/price_list/price_list.py similarity index 100% rename from setup/doctype/price_list/price_list.py rename to stock/doctype/price_list/price_list.py diff --git a/setup/doctype/price_list/price_list.txt b/stock/doctype/price_list/price_list.txt similarity index 100% rename from setup/doctype/price_list/price_list.txt rename to stock/doctype/price_list/price_list.txt diff --git a/setup/doctype/price_list/test_price_list.py b/stock/doctype/price_list/test_price_list.py similarity index 100% rename from setup/doctype/price_list/test_price_list.py rename to stock/doctype/price_list/test_price_list.py From e158cea77ad528a391e22af70acda91f4caf5864 Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Thu, 31 Oct 2013 19:50:51 +0530 Subject: [PATCH 08/19] [cleanup] [minor] replaced for territory to applicable territory --- .../sales_taxes_and_charges_master.js | 2 +- .../sales_taxes_and_charges_master.txt | 4 ++-- .../test_sales_taxes_and_charges_master.py | 6 +++--- .../doctype/shipping_rule/shipping_rule.js | 2 +- .../doctype/shipping_rule/shipping_rule.txt | 4 ++-- .../shipping_rule/test_shipping_rule.py | 2 +- .../p07_taxes_price_list_for_territory.py | 6 +++--- .../october_2013/p07_rename_for_territory.py | 21 +++++++++++++++++++ patches/patch_list.py | 3 ++- public/js/utils.js | 4 ++-- .../doctype/applicable_territory}/__init__.py | 0 .../applicable_territory.py | 2 +- .../applicable_territory.txt | 6 +++--- setup/doctype/setup_control/setup_control.py | 2 +- stock/doctype/item_price/item_price.txt | 4 ++-- stock/doctype/price_list/price_list.js | 2 +- stock/doctype/price_list/price_list.py | 2 +- stock/doctype/price_list/price_list.txt | 6 +++--- stock/doctype/price_list/test_price_list.py | 10 ++++----- utilities/demo/demo_docs/Price_List.csv | 2 +- 20 files changed, 56 insertions(+), 34 deletions(-) create mode 100644 patches/october_2013/p07_rename_for_territory.py rename {stock/doctype/for_territory => setup/doctype/applicable_territory}/__init__.py (100%) rename stock/doctype/for_territory/for_territory.py => setup/doctype/applicable_territory/applicable_territory.py (80%) rename stock/doctype/for_territory/for_territory.txt => setup/doctype/applicable_territory/applicable_territory.txt (83%) diff --git a/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js b/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js index f1a602738b..a7a88d4663 100644 --- a/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js +++ b/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js @@ -4,7 +4,7 @@ //--------- ONLOAD ------------- cur_frm.cscript.onload = function(doc, cdt, cdn) { if(doc.doctype === "Sales Taxes and Charges Master") - erpnext.add_for_territory(); + erpnext.add_applicable_territory(); } cur_frm.cscript.refresh = function(doc, cdt, cdn) { diff --git a/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt b/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt index 20e40768bd..cddf10ec85 100644 --- a/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt +++ b/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt @@ -2,7 +2,7 @@ { "creation": "2013-01-10 16:34:09", "docstatus": 0, - "modified": "2013-07-22 15:22:14", + "modified": "2013-10-31 19:25:09", "modified_by": "Administrator", "owner": "Administrator" }, @@ -94,7 +94,7 @@ "fieldname": "valid_for_territories", "fieldtype": "Table", "label": "Valid for Territories", - "options": "For Territory", + "options": "Applicable Territory", "reqd": 1 }, { diff --git a/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py b/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py index 74b0b4edb4..7a013fbf48 100644 --- a/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py +++ b/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py @@ -25,7 +25,7 @@ test_records = [ "rate": 6.36, }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "All Territories" } @@ -113,7 +113,7 @@ test_records = [ "row_id": 7 }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "_Test Territory India" } @@ -141,7 +141,7 @@ test_records = [ "rate": 4, }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "All Territories" } diff --git a/accounts/doctype/shipping_rule/shipping_rule.js b/accounts/doctype/shipping_rule/shipping_rule.js index 2aeb8ddcd3..2a0c433996 100644 --- a/accounts/doctype/shipping_rule/shipping_rule.js +++ b/accounts/doctype/shipping_rule/shipping_rule.js @@ -3,6 +3,6 @@ $.extend(cur_frm.cscript, { onload: function() { - erpnext.add_for_territory(); + erpnext.add_applicable_territory(); } }); \ No newline at end of file diff --git a/accounts/doctype/shipping_rule/shipping_rule.txt b/accounts/doctype/shipping_rule/shipping_rule.txt index 43589b49a3..27aaa70115 100644 --- a/accounts/doctype/shipping_rule/shipping_rule.txt +++ b/accounts/doctype/shipping_rule/shipping_rule.txt @@ -2,7 +2,7 @@ { "creation": "2013-06-25 11:48:03", "docstatus": 0, - "modified": "2013-07-05 14:55:00", + "modified": "2013-10-31 19:24:50", "modified_by": "Administrator", "owner": "Administrator" }, @@ -87,7 +87,7 @@ "fieldname": "valid_for_territories", "fieldtype": "Table", "label": "Valid For Territories", - "options": "For Territory", + "options": "Applicable Territory", "reqd": 1 }, { diff --git a/accounts/doctype/shipping_rule/test_shipping_rule.py b/accounts/doctype/shipping_rule/test_shipping_rule.py index f85909e2c0..a9aa4c702e 100644 --- a/accounts/doctype/shipping_rule/test_shipping_rule.py +++ b/accounts/doctype/shipping_rule/test_shipping_rule.py @@ -62,7 +62,7 @@ test_records = [ "shipping_amount": 0.0 }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "_Test Territory" } diff --git a/patches/june_2013/p07_taxes_price_list_for_territory.py b/patches/june_2013/p07_taxes_price_list_for_territory.py index d523ea934b..f6663bf6af 100644 --- a/patches/june_2013/p07_taxes_price_list_for_territory.py +++ b/patches/june_2013/p07_taxes_price_list_for_territory.py @@ -4,7 +4,7 @@ import webnotes def execute(): - webnotes.reload_doc("stock", "doctype", "for_territory") + webnotes.reload_doc("setup", "doctype", "applicable_territory") webnotes.reload_doc("stock", "doctype", "price_list") webnotes.reload_doc("accounts", "doctype", "sales_taxes_and_charges_master") webnotes.reload_doc("accounts", "doctype", "shipping_rule") @@ -14,12 +14,12 @@ def execute(): for parenttype in ["Sales Taxes and Charges Master", "Price List", "Shipping Rule"]: for name in webnotes.conn.sql_list("""select name from `tab%s` main - where not exists (select parent from `tabFor Territory` territory + where not exists (select parent from `tabApplicable Territory` territory where territory.parenttype=%s and territory.parent=main.name)""" % \ (parenttype, "%s"), (parenttype,)): doc = webnotes.doc({ - "doctype": "For Territory", + "doctype": "Applicable Territory", "__islocal": 1, "parenttype": parenttype, "parentfield": "valid_for_territories", diff --git a/patches/october_2013/p07_rename_for_territory.py b/patches/october_2013/p07_rename_for_territory.py new file mode 100644 index 0000000000..2317002fe6 --- /dev/null +++ b/patches/october_2013/p07_rename_for_territory.py @@ -0,0 +1,21 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import webnotes, os + +def execute(): + webnotes.reload_doc("core", "doctype", "doctype") + + tables = webnotes.conn.sql_list("show tables") + + if "tabApplicable Territory" not in tables: + webnotes.rename_doc("DocType", "For Territory", "Applicable Territory", force=True) + + webnotes.reload_doc("setup", "doctype", "applicable_territory") + + if os.path.exists("app/setup/doctype/for_territory"): + os.system("rm -rf app/setup/doctype/for_territory") + + if webnotes.conn.exists("DocType", "For Territory"): + webnotes.delete_doc("DocType", "For Territory") \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 37220abe1f..67affb6de1 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -163,7 +163,6 @@ patch_list = [ "execute:webnotes.delete_doc('Report', 'Sales Orders Pending To Be Delivered')", "patches.june_2013.p05_remove_unused_doctypes", "patches.june_2013.p06_drop_unused_tables", - "patches.june_2013.p07_taxes_price_list_for_territory", "patches.june_2013.p08_shopping_cart_settings", "patches.june_2013.p09_update_global_defaults", "patches.june_2013.p10_lead_address", @@ -228,4 +227,6 @@ patch_list = [ "patches.october_2013.p04_update_report_permission", "patches.october_2013.p05_delete_gl_entries_for_cancelled_vouchers", "patches.october_2013.p06_update_control_panel_and_global_defaults", + "patches.october_2013.p07_rename_for_territory", + "patches.june_2013.p07_taxes_price_list_for_territory", ] \ No newline at end of file diff --git a/public/js/utils.js b/public/js/utils.js index 61e613bdec..2dccd35b1f 100644 --- a/public/js/utils.js +++ b/public/js/utils.js @@ -28,10 +28,10 @@ $.extend(erpnext, { } }, - add_for_territory: function() { + add_applicable_territory: function() { if(cur_frm.doc.__islocal && wn.model.get_doclist(cur_frm.doc.doctype, cur_frm.doc.name).length === 1) { - var territory = wn.model.add_child(cur_frm.doc, "For Territory", + var territory = wn.model.add_child(cur_frm.doc, "Applicable Territory", "valid_for_territories"); territory.territory = wn.defaults.get_default("territory"); } diff --git a/stock/doctype/for_territory/__init__.py b/setup/doctype/applicable_territory/__init__.py similarity index 100% rename from stock/doctype/for_territory/__init__.py rename to setup/doctype/applicable_territory/__init__.py diff --git a/stock/doctype/for_territory/for_territory.py b/setup/doctype/applicable_territory/applicable_territory.py similarity index 80% rename from stock/doctype/for_territory/for_territory.py rename to setup/doctype/applicable_territory/applicable_territory.py index 784339de7d..3256c80d42 100644 --- a/stock/doctype/for_territory/for_territory.py +++ b/setup/doctype/applicable_territory/applicable_territory.py @@ -1,5 +1,5 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. -# License: GNU General Public License v3. See license.txt +# MIT License. See license.txt # For license information, please see license.txt diff --git a/stock/doctype/for_territory/for_territory.txt b/setup/doctype/applicable_territory/applicable_territory.txt similarity index 83% rename from stock/doctype/for_territory/for_territory.txt rename to setup/doctype/applicable_territory/applicable_territory.txt index be454ec018..31064deec5 100644 --- a/stock/doctype/for_territory/for_territory.txt +++ b/setup/doctype/applicable_territory/applicable_territory.txt @@ -2,7 +2,7 @@ { "creation": "2013-06-20 12:48:38", "docstatus": 0, - "modified": "2013-07-10 14:54:09", + "modified": "2013-10-31 18:56:54", "modified_by": "Administrator", "owner": "Administrator" }, @@ -20,7 +20,7 @@ "label": "Territory", "name": "__common__", "options": "Territory", - "parent": "For Territory", + "parent": "Applicable Territory", "parentfield": "fields", "parenttype": "DocType", "permlevel": 0, @@ -28,7 +28,7 @@ }, { "doctype": "DocType", - "name": "For Territory" + "name": "Applicable Territory" }, { "doctype": "DocField" diff --git a/setup/doctype/setup_control/setup_control.py b/setup/doctype/setup_control/setup_control.py index 818e310425..9599e58c78 100644 --- a/setup/doctype/setup_control/setup_control.py +++ b/setup/doctype/setup_control/setup_control.py @@ -85,7 +85,7 @@ class DocType: "currency": args["currency"] }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "All Territories" } diff --git a/stock/doctype/item_price/item_price.txt b/stock/doctype/item_price/item_price.txt index 779bbd47e0..fc411eb1d6 100644 --- a/stock/doctype/item_price/item_price.txt +++ b/stock/doctype/item_price/item_price.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-02 16:29:48", "docstatus": 0, - "modified": "2013-10-21 15:11:20", + "modified": "2013-10-31 12:59:02", "modified_by": "Administrator", "owner": "Administrator" }, @@ -14,7 +14,7 @@ "icon": "icon-flag", "in_create": 0, "istable": 0, - "module": "Setup", + "module": "Stock", "name": "__common__", "read_only": 0 }, diff --git a/stock/doctype/price_list/price_list.js b/stock/doctype/price_list/price_list.js index 84c4c2f957..be3aeaab33 100644 --- a/stock/doctype/price_list/price_list.js +++ b/stock/doctype/price_list/price_list.js @@ -3,7 +3,7 @@ $.extend(cur_frm.cscript, { onload: function() { - erpnext.add_for_territory(); + erpnext.add_applicable_territory(); }, refresh: function() { diff --git a/stock/doctype/price_list/price_list.py b/stock/doctype/price_list/price_list.py index d94b78e19a..993f4ea94b 100644 --- a/stock/doctype/price_list/price_list.py +++ b/stock/doctype/price_list/price_list.py @@ -18,7 +18,7 @@ class DocType(DocListController): # if no territory, set default territory if webnotes.defaults.get_user_default("territory"): self.doclist.append({ - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": webnotes.defaults.get_user_default("territory") }) diff --git a/stock/doctype/price_list/price_list.txt b/stock/doctype/price_list/price_list.txt index b93cfcc2c3..d43076bcc8 100644 --- a/stock/doctype/price_list/price_list.txt +++ b/stock/doctype/price_list/price_list.txt @@ -2,7 +2,7 @@ { "creation": "2013-01-25 11:35:09", "docstatus": 0, - "modified": "2013-10-18 13:33:07", + "modified": "2013-10-31 19:24:33", "modified_by": "Administrator", "owner": "Administrator" }, @@ -17,7 +17,7 @@ "document_type": "Master", "icon": "icon-tags", "max_attachments": 1, - "module": "Setup", + "module": "Stock", "name": "__common__" }, { @@ -81,7 +81,7 @@ "fieldname": "valid_for_territories", "fieldtype": "Table", "label": "Valid for Territories", - "options": "For Territory", + "options": "Applicable Territory", "reqd": 1 }, { diff --git a/stock/doctype/price_list/test_price_list.py b/stock/doctype/price_list/test_price_list.py index d5174ed7fc..e3fa791e42 100644 --- a/stock/doctype/price_list/test_price_list.py +++ b/stock/doctype/price_list/test_price_list.py @@ -15,7 +15,7 @@ test_records = [ "buying_or_selling": "Selling" }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "All Territories" }, @@ -28,7 +28,7 @@ test_records = [ "buying_or_selling": "Selling" }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "_Test Territory Rest of the World" } @@ -41,7 +41,7 @@ test_records = [ "buying_or_selling": "Selling" }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "_Test Territory India" } @@ -54,12 +54,12 @@ test_records = [ "buying_or_selling": "Selling" }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "_Test Territory Rest of the World" }, { - "doctype": "For Territory", + "doctype": "Applicable Territory", "parentfield": "valid_for_territories", "territory": "_Test Territory United States" } diff --git a/utilities/demo/demo_docs/Price_List.csv b/utilities/demo/demo_docs/Price_List.csv index fb412399e1..1e0dcec7f9 100644 --- a/utilities/demo/demo_docs/Price_List.csv +++ b/utilities/demo/demo_docs/Price_List.csv @@ -11,7 +11,7 @@ Only mandatory fields are necessary for new records. You can delete non-mandator "For updating, you can update only selective columns.",,,,,,,,,,, You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,, ,,,,,,,,,,, -DocType:,Price List,,,,~,For Territory,valid_for_territories,~,Item Price,item_prices, +DocType:,Price List,,,,~,Applicable Territory,valid_for_territories,~,Item Price,item_prices, Column Labels:,ID,Price List Name,Currency,Valid for Buying or Selling?,,ID,Territory,,ID,Item Code,Rate Column Name:,name,price_list_name,currency,buying_or_selling,~,name,territory,~,name,item_code,ref_rate Mandatory:,Yes,Yes,Yes,Yes,,Yes,Yes,,Yes,Yes,Yes From 9c1488a7c0fc34142559d09b621f32eb35b08797 Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Thu, 31 Oct 2013 19:56:31 +0530 Subject: [PATCH 09/19] [cleanup] [minor] for territory fixed to applicable territory --- .../doctype/shopping_cart_settings/shopping_cart_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selling/doctype/shopping_cart_settings/shopping_cart_settings.py b/selling/doctype/shopping_cart_settings/shopping_cart_settings.py index f3954584e7..d23f5e232d 100644 --- a/selling/doctype/shopping_cart_settings/shopping_cart_settings.py +++ b/selling/doctype/shopping_cart_settings/shopping_cart_settings.py @@ -72,7 +72,7 @@ class DocType(DocListController): # make a map of territory: [list of names] # if list against each territory has more than one element, raise exception territory_name = webnotes.conn.sql("""select `territory`, `parent` - from `tabFor Territory` + from `tabApplicable Territory` where `parenttype`=%s and `parent` in (%s)""" % ("%s", ", ".join(["%s"]*len(names))), tuple([parenttype] + names)) From 4144b1c8415e3fdaca8c390973893cf7a9affbc9 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 1 Nov 2013 18:08:55 +0530 Subject: [PATCH 10/19] [fix] [minor] itemwise sales/purchase register --- .../item_wise_purchase_register/item_wise_purchase_register.py | 2 +- .../report/item_wise_sales_register/item_wise_sales_register.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py b/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py index 1c3cef3115..4f11a61cc3 100644 --- a/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py +++ b/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py @@ -86,7 +86,7 @@ def get_tax_accounts(item_list, columns): item_wise_tax_detail = json.loads(item_wise_tax_detail) for item, tax_amount in item_wise_tax_detail.items(): item_tax.setdefault(parent, {}).setdefault(item, {})[account_head] = \ - flt(tax_amount[1]) + flt(tax_amount[1]) if isinstance(tax_amount, list) else flt(tax_amount) except ValueError: continue diff --git a/accounts/report/item_wise_sales_register/item_wise_sales_register.py b/accounts/report/item_wise_sales_register/item_wise_sales_register.py index 48bc463f14..ce8e3c566b 100644 --- a/accounts/report/item_wise_sales_register/item_wise_sales_register.py +++ b/accounts/report/item_wise_sales_register/item_wise_sales_register.py @@ -83,7 +83,7 @@ def get_tax_accounts(item_list, columns): item_wise_tax_detail = json.loads(item_wise_tax_detail) for item, tax_amount in item_wise_tax_detail.items(): item_tax.setdefault(parent, {}).setdefault(item, {})[account_head] = \ - flt(tax_amount[1]) + flt(tax_amount[1]) if isinstance(tax_amount, list) else flt(tax_amount) except ValueError: continue From 06757a19ef1df9262924094899fa81f21e6e19c5 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 4 Nov 2013 12:55:24 +0530 Subject: [PATCH 11/19] [minor] [query] expense and income account queries should exclude customer and supplier accounts --- accounts/doctype/purchase_invoice/purchase_invoice.py | 9 +++++++-- accounts/doctype/sales_invoice/sales_invoice.py | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/accounts/doctype/purchase_invoice/purchase_invoice.py b/accounts/doctype/purchase_invoice/purchase_invoice.py index f3d359bd45..55776d9cdd 100644 --- a/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -468,12 +468,17 @@ class DocType(BuyingController): @webnotes.whitelist() def get_expense_account(doctype, txt, searchfield, start, page_len, filters): from controllers.queries import get_match_cond - + + # expense account can be any Debit account, + # but can also be a Liability account with account_type='Expense Account' in special circumstances. + # Hence the first condition is an "OR" return webnotes.conn.sql("""select tabAccount.name from `tabAccount` where (tabAccount.debit_or_credit="Debit" - or tabAccount.account_type = "Expense Account") + or tabAccount.account_type = "Expense Account") and tabAccount.group_or_ledger="Ledger" and tabAccount.docstatus!=2 + and ifnull(tabAccount.master_type, "")="" + and ifnull(tabAccount.master_name, "")="" and tabAccount.company = '%(company)s' and tabAccount.%(key)s LIKE '%(txt)s' %(mcond)s""" % {'company': filters['company'], 'key': searchfield, diff --git a/accounts/doctype/sales_invoice/sales_invoice.py b/accounts/doctype/sales_invoice/sales_invoice.py index 3ae74e481e..6c02bbea66 100644 --- a/accounts/doctype/sales_invoice/sales_invoice.py +++ b/accounts/doctype/sales_invoice/sales_invoice.py @@ -925,11 +925,16 @@ def get_bank_cash_account(mode_of_payment): def get_income_account(doctype, txt, searchfield, start, page_len, filters): from controllers.queries import get_match_cond + # income account can be any Credit account, + # but can also be a Asset account with account_type='Income Account' in special circumstances. + # Hence the first condition is an "OR" return webnotes.conn.sql("""select tabAccount.name from `tabAccount` where (tabAccount.debit_or_credit="Credit" or tabAccount.account_type = "Income Account") and tabAccount.group_or_ledger="Ledger" - and tabAccount.docstatus!=2 + and tabAccount.docstatus!=2 + and ifnull(tabAccount.master_type, "")="" + and ifnull(tabAccount.master_name, "")="" and tabAccount.company = '%(company)s' and tabAccount.%(key)s LIKE '%(txt)s' %(mcond)s""" % {'company': filters['company'], 'key': searchfield, From 2ced381976c39a7e8bfd4fa9d0e178a1d42a1834 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 4 Nov 2013 14:37:29 +0530 Subject: [PATCH 12/19] [minor] fixes in test cases and demo --- .../doctype/pos_setting/test_pos_setting.py | 1 - setup/doctype/setup_control/setup_control.py | 8 +- stock/doctype/stock_entry/stock_entry.py | 1 - utilities/demo/demo_docs/Item_Price.csv | 49 +++++++ utilities/demo/demo_docs/Lead.csv | 136 +++++++++--------- utilities/demo/demo_docs/Price_List.csv | 49 ------- utilities/demo/make_demo.py | 4 +- 7 files changed, 123 insertions(+), 125 deletions(-) create mode 100644 utilities/demo/demo_docs/Item_Price.csv delete mode 100644 utilities/demo/demo_docs/Price_List.csv diff --git a/accounts/doctype/pos_setting/test_pos_setting.py b/accounts/doctype/pos_setting/test_pos_setting.py index 579a75edcd..8d02c57fd1 100644 --- a/accounts/doctype/pos_setting/test_pos_setting.py +++ b/accounts/doctype/pos_setting/test_pos_setting.py @@ -6,7 +6,6 @@ test_records = [ "doctype": "POS Setting", "name": "_Test POS Setting", "currency": "INR", - "conversion_rate": 1.0, "selling_price_list": "_Test Price List", "company": "_Test Company", "warehouse": "_Test Warehouse - _TC", diff --git a/setup/doctype/setup_control/setup_control.py b/setup/doctype/setup_control/setup_control.py index 9599e58c78..200ff3c61b 100644 --- a/setup/doctype/setup_control/setup_control.py +++ b/setup/doctype/setup_control/setup_control.py @@ -101,7 +101,9 @@ class DocType: 'default_currency': args.get('currency'), 'default_company':args.get('company_name'), 'date_format': webnotes.conn.get_value("Country", args.get("country"), "date_format"), - "float_precision": 4 + "float_precision": 3, + "time_zone": args.get("time_zone"), + "country": args.get("country") }) global_defaults.save() @@ -141,9 +143,7 @@ class DocType: # control panel cp = webnotes.doc("Control Panel", "Control Panel") - for k in ['country', 'time_zone', 'company_name']: - cp.fields[k] = args[k] - + cp.company_name = args["company_name"] cp.save() def create_feed_and_todo(self): diff --git a/stock/doctype/stock_entry/stock_entry.py b/stock/doctype/stock_entry/stock_entry.py index 9f3b0ce2ca..12b0f514a3 100644 --- a/stock/doctype/stock_entry/stock_entry.py +++ b/stock/doctype/stock_entry/stock_entry.py @@ -617,7 +617,6 @@ class DocType(StockController): return issued_item_qty def add_to_stock_entry_detail(self, item_dict, bom_no=None, idx=None): - webnotes.errprint([]) if not idx: idx = 1 expense_account, cost_center = webnotes.conn.get_values("Company", self.doc.company, \ ["default_expense_account", "cost_center"])[0] diff --git a/utilities/demo/demo_docs/Item_Price.csv b/utilities/demo/demo_docs/Item_Price.csv new file mode 100644 index 0000000000..d70b7b3e67 --- /dev/null +++ b/utilities/demo/demo_docs/Item_Price.csv @@ -0,0 +1,49 @@ +Data Import Template,,,,,,, +Table:,Item Price,,,,,, +,,,,,,, +,,,,,,, +Notes:,,,,,,, +Please do not change the template headings.,,,,,,, +First data column must be blank.,,,,,,, +"If you are uploading new records, leave the ""name"""" (ID) column blank.""",,,,,,, +"If you are uploading new records, ""Naming Series"""" becomes mandatory"," if present.""",,,,,, +Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,,, +"For updating, you can update only selective columns.",,,,,,, +You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,, +,,,,,,, +DocType:,Item Price,,,,,, +Column Labels:,ID,Price List,Item Code,Rate,Valid for Buying or Selling?,Item Name,Item Description +Column Name:,name,price_list,item_code,ref_rate,buying_or_selling,item_name,item_description +Mandatory:,Yes,Yes,Yes,Yes,No,No,No +Type:,Data (text),Link,Link,Currency,Select,Data,Text +Info:,,Valid Price List,Valid Item,,"One of: Selling, Buying",, +Start entering data below this line,,,,,,, +,,Standard Buying,Base Bearing Plate,15,Buying,, +,,Standard Buying,Base Plate,20,Buying,, +,,Standard Buying,Bearing Block,10,Buying,, +,,Standard Buying,Bearing Collar,20,Buying,, +,,Standard Buying,Bearing Pipe,15,Buying,, +,,Standard Buying,Blade Rib,10,Buying,, +,,Standard Buying,Disc Collars,74,Buying,, +,,Standard Buying,External Disc,45,Buying,, +,,Standard Buying,Internal Disc,33,Buying,, +,,Standard Buying,Shaft,30,Buying,, +,,Standard Buying,Stand,40,Buying,, +,,Standard Buying,Upper Bearing Plate,50,Buying,, +,,Standard Buying,Wing Sheet,22,Buying,, +,,Standard Selling,Wind Turbine,21,Selling,, +,,Standard Selling,Wind Mill A Series,28,Selling,, +,,Standard Selling,Wind MIll C Series,14,Selling,, +,,Standard Selling,Base Bearing Plate,28,Selling,, +,,Standard Selling,Base Plate,21,Selling,, +,,Standard Selling,Bearing Block,14,Selling,, +,,Standard Selling,Bearing Collar,103.6,Selling,, +,,Standard Selling,Bearing Pipe,63,Selling,, +,,Standard Selling,Blade Rib,46.2,Selling,, +,,Standard Selling,Disc Collars,42,Selling,, +,,Standard Selling,External Disc,56,Selling,, +,,Standard Selling,Internal Disc,70,Selling,, +,,Standard Selling,Shaft,340,Selling,, +,,Standard Selling,Stand,400,Selling,, +,,Standard Selling,Upper Bearing Plate,300,Selling,, +,,Standard Selling,Wing Sheet,30.8,Selling,, \ No newline at end of file diff --git a/utilities/demo/demo_docs/Lead.csv b/utilities/demo/demo_docs/Lead.csv index c00ab44162..e3415facf7 100644 --- a/utilities/demo/demo_docs/Lead.csv +++ b/utilities/demo/demo_docs/Lead.csv @@ -1,68 +1,68 @@ -Data Import Template,,,,,,,,,,,,,,,,,,,,,,,,,,, -Table:,Lead,,,,,,,,,,,,,,,,,,,,,,,,,, -,,,,,,,,,,,,,,,,,,,,,,,,,,, -,,,,,,,,,,,,,,,,,,,,,,,,,,, -Notes:,,,,,,,,,,,,,,,,,,,,,,,,,,, -Please do not change the template headings.,,,,,,,,,,,,,,,,,,,,,,,,,,, -First data column must be blank.,,,,,,,,,,,,,,,,,,,,,,,,,,, -Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,,,,,,,,,,,,,,,,,,,,,,, -"For updating, you can update only selective columns.",,,,,,,,,,,,,,,,,,,,,,,,,,, -"If you are uploading new records, leave the ""name"" (ID) column blank.",,,,,,,,,,,,,,,,,,,,,,,,,,, -"If you are uploading new records, ""Naming Series"" becomes mandatory, if present.",,,,,,,,,,,,,,,,,,,,,,,,,,, -You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,,,,,,,,,,,,,,,,,, -,,,,,,,,,,,,,,,,,,,,,,,,,,, -Column Labels,ID,Contact Name,Status,Naming Series,Company Name,Email Id,Source,From Customer,Campaign Name,Remark,Phone,Mobile No.,Fax,Website,Territory,Lead Type,Lead Owner,Market Segment,Industry,Request Type,Lost Reason,Next Contact By,Next Contact Date,Last Contact Date,Company,Unsubscribed,Blog Subscriber -Column Name:,name,lead_name,status,naming_series,company_name,email_id,source,customer,campaign_name,remark,phone,mobile_no,fax,website,territory,type,lead_owner,market_segment,industry,request_type,order_lost_reason,contact_by,contact_date,last_contact_date,company,unsubscribed,blog_subscriber -Mandatory:,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No -Type:,Data (text),Data,Select,Select,Data,Data,Select,Link,Link,Small Text,Data,Data,Data,Data,Link,Select,Link,Select,Link,Select,Link,Link,Date,Date,Link,Check,Check -Info:,,,"One of: Open, Replied, Attempted to Contact, Contact in Future, Contacted, Interested, Not interested, Lead Lost, Converted","One of: LEAD, LEAD/10-11/, LEAD/MUMBAI/",,,"One of: Advertisement, Blog Post, Campaign, Call, Customer, Exhibition, Supplier, Website, Email",Valid Customer,Valid Campaign,,,,,,Valid Territory,"One of: Client, Channel Partner, Consultant",Valid Profile,"One of: Lower Income, Middle Income, Upper Income",Valid Industry Type,"One of: Product Enquiry, Request for Information, Suggestions, Other",Valid Quotation Lost Reason,Valid Profile,,,Valid Company,0 or 1,0 or 1 -Start entering data below this line,,,,,,,,,,,,,,,,,,,,,,,,,,, -,,Mart Lakeman,Passive,,Zany Brainy,MartLakeman@einrot.com,,,,,,,,,,,,,,,,,,,,, -,,Saga Lundqvist,Passive,,Patterson-Fletcher,SagaLundqvist@dayrep.com,,,,,,,,,,,,,,,,,,,,, -,,Adna Sjöberg,Passive,,Griff's Hamburgers,AdnaSjoberg@gustr.com,,,,,,,,,,,,,,,,,,,,, -,,Ida Svendsen,Passive,,Rhodes Furniture,IdaDSvendsen@superrito.com,,,,,,,,,,,,,,,,,,,,, -,,Emppu Hämeenniemi,Passive,,Burger Chef,EmppuHameenniemi@teleworm.us,,,,,,,,,,,,,,,,,,,,, -,,Eugenio Pisano,Passive,,Stratabiz,EugenioPisano@cuvox.de,,,,,,,,,,,,,,,,,,,,, -,,Semhar Hagos,Passive,,Home Quarters Warehouse,SemharHagos@einrot.com,,,,,,,,,,,,,,,,,,,,, -,,Branimira Ivanković,Passive,,Enviro Architectural Designs,BranimiraIvankovic@einrot.com,,,,,,,,,,,,,,,,,,,,, -,,Shelly Fields,Passive,,Ideal Garden Management,ShellyLFields@superrito.com,,,,,,,,,,,,,,,,,,,,, -,,Leo Mikulić,Passive,,Listen Up,LeoMikulic@gustr.com,,,,,,,,,,,,,,,,,,,,, -,,Denisa Jarošová,Passive,,I. Magnin,DenisaJarosova@teleworm.us,,,,,,,,,,,,,,,,,,,,, -,,Janek Rutkowski,Passive,,First Rate Choice,JanekRutkowski@dayrep.com,,,,,,,,,,,,,,,,,,,,, -,,美月 宇藤,Passive,,Multi Tech Development,mm@gustr.com,,,,,,,,,,,,,,,,,,,,, -,,Даниил Афанасьев,Passive,,National Auto Parts,dd@einrot.com,,,,,,,,,,,,,,,,,,,,, -,,Zorislav Petković,Passive,,Integra Investment Plan,ZorislavPetkovic@cuvox.de,,,,,,,,,,,,,,,,,,,,, -,,Nanao Niwa,Passive,,The Lawn Guru,NanaoNiwa@superrito.com,,,,,,,,,,,,,,,,,,,,, -,,Hreiðar Jörundsson,Passive,,Buena Vista Realty Service,HreiarJorundsson@armyspy.com,,,,,,,,,,,,,,,,,,,,, -,,Lai Chu,Passive,,Bountiful Harvest Health Food Store,ChuThiBichLai@einrot.com,,,,,,,,,,,,,,,,,,,,, -,,Victor Aksakov,Passive,,P. Samuels Men's Clothiers,VictorAksakov@dayrep.com,,,,,,,,,,,,,,,,,,,,, -,,Saidalim Bisliev,Passive,,Vinyl Fever,SaidalimBisliev@cuvox.de,,,,,,,,,,,,,,,,,,,,, -,,Totte Jakobsson,Passive,,Garden Master,TotteJakobsson@armyspy.com,,,,,,,,,,,,,,,,,,,,, -,,Naná Armas,Passive,,Big Apple,NanaArmasRobles@cuvox.de,,,,,,,,,,,,,,,,,,,,, -,,Walerian Duda,Passive,,Monk House Sales,WalerianDuda@dayrep.com,,,,,,,,,,,,,,,,,,,,, -,,Moarimikashi ,Passive,,ManCharm,Moarimikashi@teleworm.us,,,,,,,,,,,,,,,,,,,,, -,,Dobromił Dąbrowski ,Passive,,Custom Lawn Care,DobromilDabrowski@dayrep.com,,,,,,,,,,,,,,,,,,,,, -,,Teigan Sinclair,Passive,,The Serendipity Dip,TeiganSinclair@gustr.com,,,,,,,,,,,,,,,,,,,,, -,,Fahad Guirguis,Passive,,Cavages,FahadSaidGuirguis@gustr.com,,,,,,,,,,,,,,,,,,,,, -,,Morten Olsen,Passive,,Gallenkamp,MortenJOlsen@armyspy.com,,,,,,,,,,,,,,,,,,,,, -,,Christian Baecker,Passive,,Webcom Business Services,ChristianBaecker@armyspy.com,,,,,,,,,,,,,,,,,,,,, -,,Sebastianus Dohmen,Passive,,Accord Investments,SebastianusDohmen@cuvox.de,,,,,,,,,,,,,,,,,,,,, -,,Eero Koskinen,Passive,,American Appliance,EeroKoskinen@superrito.com,,,,,,,,,,,,,,,,,,,,, -,,富奎 盧,Passive,,Bettendorf's,LuFuKui@teleworm.us,,,,,,,,,,,,,,,,,,,,, -,,Milica Jelić,Passive,,House Of Denmark,MilicaJelic@dayrep.com,,,,,,,,,,,,,,,,,,,,, -,,Barbora Holubová,Passive,,10000 Auto Parts,BarboraHolubova@cuvox.de,,,,,,,,,,,,,,,,,,,,, -,,Marta Kos,Passive,,Mages,MartaKos@einrot.com,,,,,,,,,,,,,,,,,,,,, -,,Simret Zula,Passive,,CSK Auto,SimretZula@cuvox.de,,,,,,,,,,,,,,,,,,,,, -,,Kamil Chlubna,Passive,,Eagle Hardware & Garden,KamilChlubna@einrot.com,,,,,,,,,,,,,,,,,,,,, -,,Aceline Bolduc,Passive,,Rustler Steak House,AcelineBolduc@armyspy.com,,,,,,,,,,,,,,,,,,,,, -,,Lucie Stupková,Passive,,ABCO Foods,LucieStupkova@gustr.com,,,,,,,,,,,,,,,,,,,,, -,,Roland Solvik,Passive,,Trak Auto,RolandSolvik@cuvox.de,,,,,,,,,,,,,,,,,,,,, -,,Mekirinzukushitakufu ,Passive,,Choices,Mekirinzukushitakufu@teleworm.us,,,,,,,,,,,,,,,,,,,,, -,,Mukharbek Sultanovich,Passive,,Megatronic,MukharbekSultanovich@cuvox.de,,,,,,,,,,,,,,,,,,,,, -,,Osman Amanuel,Passive,,Handy Dan,OsmanAmanuel@dayrep.com,,,,,,,,,,,,,,,,,,,,, -,,幸子 阪部,Passive,,Channel Home Centers,dd@armyspy.com,,,,,,,,,,,,,,,,,,,,, -,,Masakazu Kamitani,Passive,,Honest Air Group,MasakazuKamitani@superrito.com,,,,,,,,,,,,,,,,,,,,, -,,Omran Sabbagh,Passive,,Pleasures and Pasttimes,OmranNuhaidSabbagh@einrot.com,,,,,,,,,,,,,,,,,,,,, -,,Rikako Matsumura,Passive,,Lazysize,RikakoMatsumura@einrot.com,,,,,,,,,,,,,,,,,,,,, -,,Anayolisa Chukwukadibia,Passive,,Prestiga-Biz,AnayolisaChukwukadibia@einrot.com,,,,,,,,,,,,,,,,,,,,, -,,Gudmunda Hinna,Passive,,Childs Restaurants,GudmundaHinna@armyspy.com,,,,,,,,,,,,,,,,,,,,, \ No newline at end of file +Data Import Template,,,,,,,,,,,,,,,,,,,,,,,,,, +Table:,Lead,,,,,,,,,,,,,,,,,,,,,,,,, +,,,,,,,,,,,,,,,,,,,,,,,,,, +,,,,,,,,,,,,,,,,,,,,,,,,,, +Notes:,,,,,,,,,,,,,,,,,,,,,,,,,, +Please do not change the template headings.,,,,,,,,,,,,,,,,,,,,,,,,,, +First data column must be blank.,,,,,,,,,,,,,,,,,,,,,,,,,, +Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,,,,,,,,,,,,,,,,,,,,,, +"For updating, you can update only selective columns.",,,,,,,,,,,,,,,,,,,,,,,,,, +"If you are uploading new records, leave the ""name"""" (ID) column blank.""",,,,,,,,,,,,,,,,,,,,,,,,,, +"If you are uploading new records, ""Naming Series"""" becomes mandatory"," if present.""",,,,,,,,,,,,,,,,,,,,,,,,, +You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,,,,,,,,,,,,,,,,, +,,,,,,,,,,,,,,,,,,,,,,,,,, +Column Labels,ID,Contact Name,Status,Naming Series,Company Name,Email Id,Source,From Customer,Campaign Name,Remark,Phone,Mobile No.,Fax,Website,Territory,Lead Type,Lead Owner,Market Segment,Industry,Request Type,Lost Reason,Next Contact By,Next Contact Date,Company,Unsubscribed,Blog Subscriber +Column Name:,name,lead_name,status,naming_series,company_name,email_id,source,customer,campaign_name,remark,phone,mobile_no,fax,website,territory,type,lead_owner,market_segment,industry,request_type,order_lost_reason,contact_by,contact_date,company,unsubscribed,blog_subscriber +Mandatory:,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No,No +Type:,Data (text),Data,Select,Select,Data,Data,Select,Link,Link,Small Text,Data,Data,Data,Data,Link,Select,Link,Select,Link,Select,Link,Link,Date,Link,Check,Check +Info:,,,"One of: Open, Replied, Attempted to Contact, Contact in Future, Contacted, Interested, Not interested, Lead Lost, Converted","One of: LEAD, LEAD/10-11/, LEAD/MUMBAI/",,,"One of: Advertisement, Blog Post, Campaign, Call, Customer, Exhibition, Supplier, Website, Email",Valid Customer,Valid Campaign,,,,,,Valid Territory,"One of: Client, Channel Partner, Consultant",Valid Profile,"One of: Lower Income, Middle Income, Upper Income",Valid Industry Type,"One of: Product Enquiry, Request for Information, Suggestions, Other",Valid Quotation Lost Reason,Valid Profile,,Valid Company,0 or 1,0 or 1 +Start entering data below this line,,,,,,,,,,,,,,,,,,,,,,,,,, +,,Mart Lakeman,Passive,,Zany Brainy,MartLakeman@einrot.com,,,,,,,,,,,,,,,,,,,, +,,Saga Lundqvist,Passive,,Patterson-Fletcher,SagaLundqvist@dayrep.com,,,,,,,,,,,,,,,,,,,, +,,Adna Sjöberg,Passive,,Griff's Hamburgers,AdnaSjoberg@gustr.com,,,,,,,,,,,,,,,,,,,, +,,Ida Svendsen,Passive,,Rhodes Furniture,IdaDSvendsen@superrito.com,,,,,,,,,,,,,,,,,,,, +,,Emppu Hämeenniemi,Passive,,Burger Chef,EmppuHameenniemi@teleworm.us,,,,,,,,,,,,,,,,,,,, +,,Eugenio Pisano,Passive,,Stratabiz,EugenioPisano@cuvox.de,,,,,,,,,,,,,,,,,,,, +,,Semhar Hagos,Passive,,Home Quarters Warehouse,SemharHagos@einrot.com,,,,,,,,,,,,,,,,,,,, +,,Branimira Ivanković,Passive,,Enviro Architectural Designs,BranimiraIvankovic@einrot.com,,,,,,,,,,,,,,,,,,,, +,,Shelly Fields,Passive,,Ideal Garden Management,ShellyLFields@superrito.com,,,,,,,,,,,,,,,,,,,, +,,Leo Mikulić,Passive,,Listen Up,LeoMikulic@gustr.com,,,,,,,,,,,,,,,,,,,, +,,Denisa Jarošová,Passive,,I. Magnin,DenisaJarosova@teleworm.us,,,,,,,,,,,,,,,,,,,, +,,Janek Rutkowski,Passive,,First Rate Choice,JanekRutkowski@dayrep.com,,,,,,,,,,,,,,,,,,,, +,,美月 宇藤,Passive,,Multi Tech Development,mm@gustr.com,,,,,,,,,,,,,,,,,,,, +,,Даниил Афанасьев,Passive,,National Auto Parts,dd@einrot.com,,,,,,,,,,,,,,,,,,,, +,,Zorislav Petković,Passive,,Integra Investment Plan,ZorislavPetkovic@cuvox.de,,,,,,,,,,,,,,,,,,,, +,,Nanao Niwa,Passive,,The Lawn Guru,NanaoNiwa@superrito.com,,,,,,,,,,,,,,,,,,,, +,,Hreiðar Jörundsson,Passive,,Buena Vista Realty Service,HreiarJorundsson@armyspy.com,,,,,,,,,,,,,,,,,,,, +,,Lai Chu,Passive,,Bountiful Harvest Health Food Store,ChuThiBichLai@einrot.com,,,,,,,,,,,,,,,,,,,, +,,Victor Aksakov,Passive,,P. Samuels Men's Clothiers,VictorAksakov@dayrep.com,,,,,,,,,,,,,,,,,,,, +,,Saidalim Bisliev,Passive,,Vinyl Fever,SaidalimBisliev@cuvox.de,,,,,,,,,,,,,,,,,,,, +,,Totte Jakobsson,Passive,,Garden Master,TotteJakobsson@armyspy.com,,,,,,,,,,,,,,,,,,,, +,,Naná Armas,Passive,,Big Apple,NanaArmasRobles@cuvox.de,,,,,,,,,,,,,,,,,,,, +,,Walerian Duda,Passive,,Monk House Sales,WalerianDuda@dayrep.com,,,,,,,,,,,,,,,,,,,, +,,Moarimikashi ,Passive,,ManCharm,Moarimikashi@teleworm.us,,,,,,,,,,,,,,,,,,,, +,,Dobromił Dąbrowski ,Passive,,Custom Lawn Care,DobromilDabrowski@dayrep.com,,,,,,,,,,,,,,,,,,,, +,,Teigan Sinclair,Passive,,The Serendipity Dip,TeiganSinclair@gustr.com,,,,,,,,,,,,,,,,,,,, +,,Fahad Guirguis,Passive,,Cavages,FahadSaidGuirguis@gustr.com,,,,,,,,,,,,,,,,,,,, +,,Morten Olsen,Passive,,Gallenkamp,MortenJOlsen@armyspy.com,,,,,,,,,,,,,,,,,,,, +,,Christian Baecker,Passive,,Webcom Business Services,ChristianBaecker@armyspy.com,,,,,,,,,,,,,,,,,,,, +,,Sebastianus Dohmen,Passive,,Accord Investments,SebastianusDohmen@cuvox.de,,,,,,,,,,,,,,,,,,,, +,,Eero Koskinen,Passive,,American Appliance,EeroKoskinen@superrito.com,,,,,,,,,,,,,,,,,,,, +,,富奎 盧,Passive,,Bettendorf's,LuFuKui@teleworm.us,,,,,,,,,,,,,,,,,,,, +,,Milica Jelić,Passive,,House Of Denmark,MilicaJelic@dayrep.com,,,,,,,,,,,,,,,,,,,, +,,Barbora Holubová,Passive,,10000 Auto Parts,BarboraHolubova@cuvox.de,,,,,,,,,,,,,,,,,,,, +,,Marta Kos,Passive,,Mages,MartaKos@einrot.com,,,,,,,,,,,,,,,,,,,, +,,Simret Zula,Passive,,CSK Auto,SimretZula@cuvox.de,,,,,,,,,,,,,,,,,,,, +,,Kamil Chlubna,Passive,,Eagle Hardware & Garden,KamilChlubna@einrot.com,,,,,,,,,,,,,,,,,,,, +,,Aceline Bolduc,Passive,,Rustler Steak House,AcelineBolduc@armyspy.com,,,,,,,,,,,,,,,,,,,, +,,Lucie Stupková,Passive,,ABCO Foods,LucieStupkova@gustr.com,,,,,,,,,,,,,,,,,,,, +,,Roland Solvik,Passive,,Trak Auto,RolandSolvik@cuvox.de,,,,,,,,,,,,,,,,,,,, +,,Mekirinzukushitakufu ,Passive,,Choices,Mekirinzukushitakufu@teleworm.us,,,,,,,,,,,,,,,,,,,, +,,Mukharbek Sultanovich,Passive,,Megatronic,MukharbekSultanovich@cuvox.de,,,,,,,,,,,,,,,,,,,, +,,Osman Amanuel,Passive,,Handy Dan,OsmanAmanuel@dayrep.com,,,,,,,,,,,,,,,,,,,, +,,幸子 阪部,Passive,,Channel Home Centers,dd@armyspy.com,,,,,,,,,,,,,,,,,,,, +,,Masakazu Kamitani,Passive,,Honest Air Group,MasakazuKamitani@superrito.com,,,,,,,,,,,,,,,,,,,, +,,Omran Sabbagh,Passive,,Pleasures and Pasttimes,OmranNuhaidSabbagh@einrot.com,,,,,,,,,,,,,,,,,,,, +,,Rikako Matsumura,Passive,,Lazysize,RikakoMatsumura@einrot.com,,,,,,,,,,,,,,,,,,,, +,,Anayolisa Chukwukadibia,Passive,,Prestiga-Biz,AnayolisaChukwukadibia@einrot.com,,,,,,,,,,,,,,,,,,,, +,,Gudmunda Hinna,Passive,,Childs Restaurants,GudmundaHinna@armyspy.com,,,,,,,,,,,,,,,,,,,, \ No newline at end of file diff --git a/utilities/demo/demo_docs/Price_List.csv b/utilities/demo/demo_docs/Price_List.csv deleted file mode 100644 index 1e0dcec7f9..0000000000 --- a/utilities/demo/demo_docs/Price_List.csv +++ /dev/null @@ -1,49 +0,0 @@ -Data Import Template,,,,,,,,,,, -Table:,Price List,,,,,,,,,, -,,,,,,,,,,, -,,,,,,,,,,, -Notes:,,,,,,,,,,, -Please do not change the template headings.,,,,,,,,,,, -First data column must be blank.,,,,,,,,,,, -"If you are uploading new records, leave the ""name"" (ID) column blank.",,,,,,,,,,, -"If you are uploading new records, ""Naming Series"" becomes mandatory, if present.",,,,,,,,,,, -Only mandatory fields are necessary for new records. You can delete non-mandatory columns if you wish.,,,,,,,,,,, -"For updating, you can update only selective columns.",,,,,,,,,,, -You can only upload upto 5000 records in one go. (may be less in some cases),,,,,,,,,,, -,,,,,,,,,,, -DocType:,Price List,,,,~,Applicable Territory,valid_for_territories,~,Item Price,item_prices, -Column Labels:,ID,Price List Name,Currency,Valid for Buying or Selling?,,ID,Territory,,ID,Item Code,Rate -Column Name:,name,price_list_name,currency,buying_or_selling,~,name,territory,~,name,item_code,ref_rate -Mandatory:,Yes,Yes,Yes,Yes,,Yes,Yes,,Yes,Yes,Yes -Type:,Data (text),Data,Link,Select,,Data,Link,,Data,Link,Currency -Info:,,,Valid Currency,"One of: Buying, Selling",,Leave blank for new records,Valid Territory,,Leave blank for new records,Valid Item, -Start entering data below this line,,,,,,,,,,, -,Standard Buying,Standard Buying,USD,Buying,,,United States,,,Base Bearing Plate,15 -,,,,,,,,,,Base Plate,20 -,,,,,,,,,,Bearing Block,10 -,,,,,,,,,,Bearing Collar,20 -,,,,,,,,,,Bearing Pipe,15 -,,,,,,,,,,Blade Rib,10 -,,,,,,,,,,Disc Collars,74 -,,,,,,,,,,External Disc,45 -,,,,,,,,,,Internal Disc,33 -,,,,,,,,,,Shaft,30 -,,,,,,,,,,Stand,40 -,,,,,,,,,,Upper Bearing Plate,50 -,,,,,,,,,,Wing Sheet,22 -,Standard Selling,Standard Selling,USD,Selling,,,United States,,,Wind Turbine,21 -,,,,,,,,,,Wind Mill A Series,28 -,,,,,,,,,,Wind MIll C Series,14 -,,,,,,,,,,Base Bearing Plate,28 -,,,,,,,,,,Base Plate,21 -,,,,,,,,,,Bearing Block,14 -,,,,,,,,,,Bearing Collar,103.6 -,,,,,,,,,,Bearing Pipe,63 -,,,,,,,,,,Blade Rib,46.2 -,,,,,,,,,,Disc Collars,42 -,,,,,,,,,,External Disc,56 -,,,,,,,,,,Internal Disc,70 -,,,,,,,,,,Shaft,340 -,,,,,,,,,,Stand,400 -,,,,,,,,,,Upper Bearing Plate,300 -,,,,,,,,,,Wing Sheet,30.8 diff --git a/utilities/demo/make_demo.py b/utilities/demo/make_demo.py index 046e81a421..ea0fca6b98 100644 --- a/utilities/demo/make_demo.py +++ b/utilities/demo/make_demo.py @@ -151,7 +151,7 @@ def run_stock(current_date): if can_make("Delivery Note"): from selling.doctype.sales_order.sales_order import make_delivery_note from stock.stock_ledger import NegativeStockError - from stock.doctype.stock_ledger_entry.stock_ledger_entry import SerialNoRequiredError, SerialNoQtyError + from stock.doctype.serial_no.serial_no import SerialNoRequiredError, SerialNoQtyError report = "Ordered Items To Be Delivered" for so in list(set([r[0] for r in query_report.run(report)["result"] if r[0]!="Total"]))[:how_many("Delivery Note")]: dn = webnotes.bean(make_delivery_note(so)) @@ -382,7 +382,7 @@ def make_items(): import_data("BOM", submit=True) def make_price_lists(): - import_data("Price_List", overwrite=True) + import_data("Item_Price", overwrite=True) def make_customers_suppliers_contacts(): import_data(["Customer", "Supplier", "Contact", "Address", "Lead"]) From 3673a251767105d8e96530f6ff07a7f332a5a62a Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 4 Nov 2013 15:14:57 +0530 Subject: [PATCH 13/19] [minor] fixes after item price move --- patches/october_2013/p07_rename_for_territory.py | 5 +++-- .../p08_cleanup_after_item_price_module_change.py | 13 +++++++++++++ patches/patch_list.py | 1 + stock/doctype/item_price/item_price.py | 12 ++++++++---- stock/doctype/item_price/test_item_price.py | 6 +++--- 5 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 patches/october_2013/p08_cleanup_after_item_price_module_change.py diff --git a/patches/october_2013/p07_rename_for_territory.py b/patches/october_2013/p07_rename_for_territory.py index 2317002fe6..c4b674574c 100644 --- a/patches/october_2013/p07_rename_for_territory.py +++ b/patches/october_2013/p07_rename_for_territory.py @@ -14,8 +14,9 @@ def execute(): webnotes.reload_doc("setup", "doctype", "applicable_territory") - if os.path.exists("app/setup/doctype/for_territory"): - os.system("rm -rf app/setup/doctype/for_territory") + path = os.path.join(get_base_path(), "app", "setup", "doctype", "for_territory") + if os.path.exists(path): + os.system("rm -rf {path}".format(path=path)) if webnotes.conn.exists("DocType", "For Territory"): webnotes.delete_doc("DocType", "For Territory") \ No newline at end of file diff --git a/patches/october_2013/p08_cleanup_after_item_price_module_change.py b/patches/october_2013/p08_cleanup_after_item_price_module_change.py new file mode 100644 index 0000000000..4169d96b3e --- /dev/null +++ b/patches/october_2013/p08_cleanup_after_item_price_module_change.py @@ -0,0 +1,13 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import webnotes, os + +def execute(): + from webnotes.utils import get_base_path + + for dt in ("item_price", "price_list"): + path = os.path.join(get_base_path(), "app", "setup", "doctype", dt) + if os.path.exists(path): + os.system("rm -rf {path}".format(path=path)) \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index 67affb6de1..0cc393e02e 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -229,4 +229,5 @@ patch_list = [ "patches.october_2013.p06_update_control_panel_and_global_defaults", "patches.october_2013.p07_rename_for_territory", "patches.june_2013.p07_taxes_price_list_for_territory", + "patches.october_2013.p08_cleanup_after_item_price_module_change", ] \ No newline at end of file diff --git a/stock/doctype/item_price/item_price.py b/stock/doctype/item_price/item_price.py index be235de27c..b398326d02 100644 --- a/stock/doctype/item_price/item_price.py +++ b/stock/doctype/item_price/item_price.py @@ -7,7 +7,7 @@ from __future__ import unicode_literals import webnotes from webnotes import _ -class ItemPriceDuplicateItem(Exception): pass +class ItemPriceDuplicateItem(webnotes.ValidationError): pass class DocType: def __init__(self, d, dl): @@ -30,6 +30,10 @@ class DocType: if webnotes.conn.sql("""select name from `tabItem Price` where item_code=%s and price_list=%s and name!=%s""", (self.doc.item_code, self.doc.price_list, self.doc.name)): - webnotes.throw(_("Duplicate Item: ") + self.doc.item_code + - _(" already available in Price List: ") + self.doc.price_list, - ItemPriceDuplicateItem) \ No newline at end of file + webnotes.throw("{duplicate_item}: {item_code}, {already}: {price_list}".format(**{ + "duplicate_item": _("Duplicate Item"), + "item_code": self.doc.item_code, + "already": _("already available in Price List"), + "price_list": self.doc.price_list + }), ItemPriceDuplicateItem) + \ No newline at end of file diff --git a/stock/doctype/item_price/test_item_price.py b/stock/doctype/item_price/test_item_price.py index 43694da8fa..73b8a8ccec 100644 --- a/stock/doctype/item_price/test_item_price.py +++ b/stock/doctype/item_price/test_item_price.py @@ -4,12 +4,12 @@ from __future__ import unicode_literals import unittest import webnotes -from setup.doctype.item_price.item_price import ItemPriceDuplicateItem class TestItem(unittest.TestCase): def test_duplicate_item(self): - item_price = webnotes.bean(copy=test_records[0]) - self.assertRaises(ItemPriceDuplicateItem, item_price.insert) + from stock.doctype.item_price.item_price import ItemPriceDuplicateItem + bean = webnotes.bean(copy=test_records[0]) + self.assertRaises(ItemPriceDuplicateItem, bean.insert) test_records = [ [ From b03f870441a7e1ff91538403c2ad13a9050275f6 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 4 Nov 2013 15:22:50 +0530 Subject: [PATCH 14/19] Merge branch '1310' of github.com:webnotes/erpnext --- patches/october_2013/p07_rename_for_territory.py | 2 +- .../p08_cleanup_after_item_price_module_change.py | 13 +++++++++++++ patches/patch_list.py | 1 + setup/page/setup_wizard/setup_wizard.py | 8 ++++---- stock/doctype/item_price/item_price.py | 12 ++++++++---- stock/doctype/item_price/test_item_price.py | 6 +++--- 6 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 patches/october_2013/p08_cleanup_after_item_price_module_change.py diff --git a/patches/october_2013/p07_rename_for_territory.py b/patches/october_2013/p07_rename_for_territory.py index 240a957321..520f3bc91c 100644 --- a/patches/october_2013/p07_rename_for_territory.py +++ b/patches/october_2013/p07_rename_for_territory.py @@ -20,4 +20,4 @@ def execute(): os.system("rm -rf {path}".format(path=path)) if webnotes.conn.exists("DocType", "For Territory"): - webnotes.delete_doc("DocType", "For Territory") \ No newline at end of file + webnotes.delete_doc("DocType", "For Territory") diff --git a/patches/october_2013/p08_cleanup_after_item_price_module_change.py b/patches/october_2013/p08_cleanup_after_item_price_module_change.py new file mode 100644 index 0000000000..4169d96b3e --- /dev/null +++ b/patches/october_2013/p08_cleanup_after_item_price_module_change.py @@ -0,0 +1,13 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import webnotes, os + +def execute(): + from webnotes.utils import get_base_path + + for dt in ("item_price", "price_list"): + path = os.path.join(get_base_path(), "app", "setup", "doctype", dt) + if os.path.exists(path): + os.system("rm -rf {path}".format(path=path)) \ No newline at end of file diff --git a/patches/patch_list.py b/patches/patch_list.py index e55991b058..1581841872 100644 --- a/patches/patch_list.py +++ b/patches/patch_list.py @@ -236,4 +236,5 @@ patch_list = [ "patches.october_2013.p06_update_control_panel_and_global_defaults", "patches.october_2013.p07_rename_for_territory", "patches.june_2013.p07_taxes_price_list_for_territory", + "patches.october_2013.p08_cleanup_after_item_price_module_change", ] \ No newline at end of file diff --git a/setup/page/setup_wizard/setup_wizard.py b/setup/page/setup_wizard/setup_wizard.py index 7ed930073d..61af55b98b 100644 --- a/setup/page/setup_wizard/setup_wizard.py +++ b/setup/page/setup_wizard/setup_wizard.py @@ -124,7 +124,9 @@ def set_defaults(args): 'default_currency': args.get('currency'), 'default_company':args.get('company_name'), 'date_format': webnotes.conn.get_value("Country", args.get("country"), "date_format"), - "float_precision": 4 + "float_precision": 3, + "country": args.get("country"), + "time_zone": args.get("time_zone") }) global_defaults.save() @@ -164,9 +166,7 @@ def set_defaults(args): # control panel cp = webnotes.doc("Control Panel", "Control Panel") - for k in ['country', 'timezone', 'company_name']: - cp.fields[k] = args[k] - + cp.company_name = args["company_name"] cp.save() def create_feed_and_todo(): diff --git a/stock/doctype/item_price/item_price.py b/stock/doctype/item_price/item_price.py index be235de27c..b398326d02 100644 --- a/stock/doctype/item_price/item_price.py +++ b/stock/doctype/item_price/item_price.py @@ -7,7 +7,7 @@ from __future__ import unicode_literals import webnotes from webnotes import _ -class ItemPriceDuplicateItem(Exception): pass +class ItemPriceDuplicateItem(webnotes.ValidationError): pass class DocType: def __init__(self, d, dl): @@ -30,6 +30,10 @@ class DocType: if webnotes.conn.sql("""select name from `tabItem Price` where item_code=%s and price_list=%s and name!=%s""", (self.doc.item_code, self.doc.price_list, self.doc.name)): - webnotes.throw(_("Duplicate Item: ") + self.doc.item_code + - _(" already available in Price List: ") + self.doc.price_list, - ItemPriceDuplicateItem) \ No newline at end of file + webnotes.throw("{duplicate_item}: {item_code}, {already}: {price_list}".format(**{ + "duplicate_item": _("Duplicate Item"), + "item_code": self.doc.item_code, + "already": _("already available in Price List"), + "price_list": self.doc.price_list + }), ItemPriceDuplicateItem) + \ No newline at end of file diff --git a/stock/doctype/item_price/test_item_price.py b/stock/doctype/item_price/test_item_price.py index 43694da8fa..73b8a8ccec 100644 --- a/stock/doctype/item_price/test_item_price.py +++ b/stock/doctype/item_price/test_item_price.py @@ -4,12 +4,12 @@ from __future__ import unicode_literals import unittest import webnotes -from setup.doctype.item_price.item_price import ItemPriceDuplicateItem class TestItem(unittest.TestCase): def test_duplicate_item(self): - item_price = webnotes.bean(copy=test_records[0]) - self.assertRaises(ItemPriceDuplicateItem, item_price.insert) + from stock.doctype.item_price.item_price import ItemPriceDuplicateItem + bean = webnotes.bean(copy=test_records[0]) + self.assertRaises(ItemPriceDuplicateItem, bean.insert) test_records = [ [ From 4bfaaf33aae9f84921befa296877cc4fc6f4584f Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 4 Nov 2013 15:31:00 +0530 Subject: [PATCH 15/19] [minor] fix in patch --- patches/october_2013/p07_rename_for_territory.py | 4 +++- .../p08_cleanup_after_item_price_module_change.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/patches/october_2013/p07_rename_for_territory.py b/patches/october_2013/p07_rename_for_territory.py index c4b674574c..c7734837a0 100644 --- a/patches/october_2013/p07_rename_for_territory.py +++ b/patches/october_2013/p07_rename_for_territory.py @@ -5,6 +5,8 @@ from __future__ import unicode_literals import webnotes, os def execute(): + import shutil + webnotes.reload_doc("core", "doctype", "doctype") tables = webnotes.conn.sql_list("show tables") @@ -16,7 +18,7 @@ def execute(): path = os.path.join(get_base_path(), "app", "setup", "doctype", "for_territory") if os.path.exists(path): - os.system("rm -rf {path}".format(path=path)) + shutil.rmtree(path) if webnotes.conn.exists("DocType", "For Territory"): webnotes.delete_doc("DocType", "For Territory") \ No newline at end of file diff --git a/patches/october_2013/p08_cleanup_after_item_price_module_change.py b/patches/october_2013/p08_cleanup_after_item_price_module_change.py index 4169d96b3e..cbc1c86c8a 100644 --- a/patches/october_2013/p08_cleanup_after_item_price_module_change.py +++ b/patches/october_2013/p08_cleanup_after_item_price_module_change.py @@ -5,9 +5,10 @@ from __future__ import unicode_literals import webnotes, os def execute(): + import shutil from webnotes.utils import get_base_path for dt in ("item_price", "price_list"): path = os.path.join(get_base_path(), "app", "setup", "doctype", dt) if os.path.exists(path): - os.system("rm -rf {path}".format(path=path)) \ No newline at end of file + shutil.rmtree(path) \ No newline at end of file From a3a348fc10b4a144d7880f49ad18bc39c5cea177 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 4 Nov 2013 15:33:39 +0530 Subject: [PATCH 16/19] [minor] fix in patch --- patches/october_2013/p07_rename_for_territory.py | 1 + 1 file changed, 1 insertion(+) diff --git a/patches/october_2013/p07_rename_for_territory.py b/patches/october_2013/p07_rename_for_territory.py index c7734837a0..2ce7ed4f8f 100644 --- a/patches/october_2013/p07_rename_for_territory.py +++ b/patches/october_2013/p07_rename_for_territory.py @@ -5,6 +5,7 @@ from __future__ import unicode_literals import webnotes, os def execute(): + from webnotes.utils import get_base_path import shutil webnotes.reload_doc("core", "doctype", "doctype") From 22c0d78ef41f460de473bfb2e72baaecaf55d7a7 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 4 Nov 2013 16:23:04 +0530 Subject: [PATCH 17/19] [minor] [fix] added end of life condition in item query --- controllers/queries.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/controllers/queries.py b/controllers/queries.py index 637d5e18cd..7681e6f350 100644 --- a/controllers/queries.py +++ b/controllers/queries.py @@ -117,21 +117,30 @@ def tax_account_query(doctype, txt, searchfield, start, page_len, filters): filters.get("company"), "%%%s%%" % txt, start, page_len])) def item_query(doctype, txt, searchfield, start, page_len, filters): + from webnotes.utils import nowdate + conditions = [] return webnotes.conn.sql("""select tabItem.name, if(length(tabItem.item_name) > 40, concat(substr(tabItem.item_name, 1, 40), "..."), item_name) as item_name, if(length(tabItem.description) > 40, \ - concat(substr(tabItem.description, 1, 40), "..."), description) as decription + concat(substr(tabItem.description, 1, 40), "..."), description) as decription from tabItem - where tabItem.docstatus<2 - and (tabItem.%(key)s LIKE "%(txt)s" - or tabItem.item_name LIKE "%(txt)s") - %(fcond)s %(mcond)s - limit %(start)s,%(page_len)s """ % {'key': searchfield, 'txt': "%%%s%%" % txt, - 'fcond': get_filters_cond(doctype, filters, conditions), - 'mcond': get_match_cond(doctype, searchfield), 'start': start, 'page_len': page_len}) + where tabItem.docstatus < 2 + and (ifnull(tabItem.end_of_life, '') = '' or tabItem.end_of_life > %(today)s) + and (tabItem.`{key}` LIKE %(txt)s + or tabItem.item_name LIKE %(txt)s) + {fcond} {mcond} + limit %(start)s, %(page_len)s """.format(key=searchfield, + fcond=get_filters_cond(doctype, filters, conditions), + mcond=get_match_cond(doctype, searchfield)), + { + "today": nowdate(), + "txt": "%%%s%%" % txt, + "start": start, + "page_len": page_len + }) def bom(doctype, txt, searchfield, start, page_len, filters): conditions = [] From 8bc3c164973cfe1ecd516279fcba1bd3a1f806c9 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 5 Nov 2013 20:05:39 +0530 Subject: [PATCH 18/19] [minor] fix in general ledger after translation merge --- accounts/page/general_ledger/general_ledger.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/accounts/page/general_ledger/general_ledger.js b/accounts/page/general_ledger/general_ledger.js index 93a23889bf..dbc691b549 100644 --- a/accounts/page/general_ledger/general_ledger.js +++ b/accounts/page/general_ledger/general_ledger.js @@ -24,7 +24,6 @@ erpnext.GeneralLedger = wn.views.GridReport.extend({ }); }, setup_columns: function() { - var DEFAULT_COMPANY_VALUE = wn._("Select Company..."); this.columns = [ {id: "posting_date", name: wn._("Posting Date"), field: "posting_date", width: 100, formatter: this.date_formatter}, @@ -55,9 +54,9 @@ erpnext.GeneralLedger = wn.views.GridReport.extend({ }, filters: [ - {fieldtype:"Select", label: wn._("Company"), link:"Company", default_value: DEFAULT_COMPANY_VALUE, + {fieldtype:"Select", label: wn._("Company"), link:"Company", default_value: wn._("Select Company..."), filter: function(val, item, opts) { - return item.company == val || val == DEFAULT_COMPANY_VALUE; + return item.company == val || val == opts.default_value; }}, {fieldtype:"Link", label: wn._("Account"), link:"Account", filter: function(val, item, opts, me) { From 3bed5abc7612cbba5bf15e813df210d2105c431e Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 5 Nov 2013 20:05:52 +0530 Subject: [PATCH 19/19] [minor] demo login fix --- utilities/demo/demo-login.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utilities/demo/demo-login.js b/utilities/demo/demo-login.js index 03fe6b96b9..509057b9ef 100644 --- a/utilities/demo/demo-login.js +++ b/utilities/demo/demo-login.js @@ -14,9 +14,9 @@ $(document).ready(function() { callback: function(r) { $(me).prop("disabled", false); if(r.exc) { - alert(wn._("Error, please contact support@erpnext.com")); + alert("Error, please contact support@erpnext.com"); } else { - console.log(wn._("Logged In")); + console.log("Logged In"); window.location.href = "app.html"; } }