diff --git a/accounts/doctype/sales_invoice/sales_invoice.py b/accounts/doctype/sales_invoice/sales_invoice.py
index f4ac6b08c00..17ae216e022 100644
--- a/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/accounts/doctype/sales_invoice/sales_invoice.py
@@ -549,9 +549,7 @@ class DocType(SellingController):
self.values = []
items = get_obj('Sales Common').get_item_list(self)
for d in items:
- stock_item = webnotes.conn.sql("SELECT is_stock_item, is_sample_item \
- FROM tabItem where name = '%s'"%(d['item_code']), as_dict = 1)
- if stock_item[0]['is_stock_item'] == "Yes":
+ if webnotes.conn.get_value("Item", d['item_code'], "is_stock_item") == "Yes":
if not d['warehouse']:
msgprint("Message: Please enter Warehouse for item %s as it is stock item." \
% d['item_code'], raise_exception=1)
diff --git a/accounts/doctype/sales_invoice/sales_invoice.txt b/accounts/doctype/sales_invoice/sales_invoice.txt
index dbdf42fd3ea..2a2a2e1db66 100644
--- a/accounts/doctype/sales_invoice/sales_invoice.txt
+++ b/accounts/doctype/sales_invoice/sales_invoice.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:05",
"docstatus": 0,
- "modified": "2013-08-09 14:45:42",
+ "modified": "2013-08-31 10:19:01",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -179,7 +179,6 @@
"search_index": 1
},
{
- "default": "Today",
"description": "Enter the date by which payments from customer is expected against this invoice.",
"doctype": "DocField",
"fieldname": "due_date",
diff --git a/accounts/report/gross_profit/gross_profit.py b/accounts/report/gross_profit/gross_profit.py
index 3aba234c190..590babbf6bc 100644
--- a/accounts/report/gross_profit/gross_profit.py
+++ b/accounts/report/gross_profit/gross_profit.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import webnotes
from webnotes.utils import flt
-from stock.utils import get_buying_amount
+from stock.utils import get_buying_amount, get_sales_bom_buying_amount
def execute(filters=None):
if not filters: filters = {}
@@ -21,10 +21,15 @@ def execute(filters=None):
data = []
for row in source:
selling_amount = flt(row.amount)
-
- buying_amount = get_buying_amount(row.item_code, row.parenttype, row.name, row.item_row,
- stock_ledger_entries.get((row.item_code, row.warehouse), []),
- item_sales_bom.get(row.parenttype, {}).get(row.name, webnotes._dict()))
+
+ item_sales_bom_map = item_sales_bom.get(row.parenttype, {}).get(row.name, webnotes._dict())
+
+ if item_sales_bom_map.get(row.item_code):
+ buying_amount = get_sales_bom_buying_amount(row.item_code, row.warehouse,
+ row.parenttype, row.name, row.item_row, stock_ledger_entries, item_sales_bom_map)
+ else:
+ buying_amount = get_buying_amount(row.parenttype, row.name, row.item_row,
+ stock_ledger_entries.get((row.item_code, row.warehouse), []))
buying_amount = buying_amount > 0 and buying_amount or 0
diff --git a/config.json b/config.json
index 6656ed37de2..61df211d01f 100644
--- a/config.json
+++ b/config.json
@@ -146,7 +146,7 @@
},
"writers": {
"template": "app/website/templates/pages/writers",
- "args_method": "website.helpers.blog.get_writers_args"
+ "args_method": "website.doctype.blogger.blogger.get_writers_args"
},
"profile": {
"no_cache": true,
diff --git a/controllers/buying_controller.py b/controllers/buying_controller.py
index 63244c5fcec..043099a70df 100644
--- a/controllers/buying_controller.py
+++ b/controllers/buying_controller.py
@@ -17,7 +17,6 @@ class BuyingController(StockController):
def onload_post_render(self):
# contact, address, item details
self.set_missing_values()
- self.set_taxes("purchase_tax_details", "purchase_other_charges")
def validate(self):
super(BuyingController, self).validate()
@@ -40,6 +39,8 @@ class BuyingController(StockController):
self.doc.fields[fieldname] = val
self.set_missing_item_details(get_item_details)
+ if self.doc.fields.get("__islocal"):
+ self.set_taxes("purchase_tax_details", "purchase_other_charges")
def set_supplier_from_item_default(self):
if self.meta.get_field("supplier") and not self.doc.supplier:
diff --git a/controllers/selling_controller.py b/controllers/selling_controller.py
index 086c42e3981..a13d747279c 100644
--- a/controllers/selling_controller.py
+++ b/controllers/selling_controller.py
@@ -14,15 +14,15 @@ class SellingController(StockController):
def onload_post_render(self):
# contact, address, item details and pos details (if applicable)
self.set_missing_values()
- self.set_taxes("other_charges", "charge")
def set_missing_values(self, for_validate=False):
super(SellingController, self).set_missing_values(for_validate)
# set contact and address details for customer, if they are not mentioned
self.set_missing_lead_customer_details()
-
self.set_price_list_and_item_details()
+ if self.doc.fields.get("__islocal"):
+ self.set_taxes("other_charges", "charge")
def set_missing_lead_customer_details(self):
if self.doc.customer:
@@ -85,7 +85,7 @@ class SellingController(StockController):
self.doc.grand_total_export or self.doc.rounded_total_export, self.doc.currency)
def set_buying_amount(self, stock_ledger_entries = None):
- from stock.utils import get_buying_amount
+ from stock.utils import get_buying_amount, get_sales_bom_buying_amount
if not stock_ledger_entries:
stock_ledger_entries = self.get_stock_ledger_entries()
@@ -99,13 +99,18 @@ class SellingController(StockController):
for item in self.doclist.get({"parentfield": self.fname}):
if item.item_code in self.stock_items or \
(item_sales_bom and item_sales_bom.get(item.item_code)):
- buying_amount = get_buying_amount(item.item_code, self.doc.doctype, self.doc.name, item.name,
- stock_ledger_entries.get((item.item_code, item.warehouse), []),
- item_sales_bom)
+ if item.item_code in self.stock_items:
+ buying_amount = get_buying_amount(self.doc.doctype, self.doc.name,
+ item.name, stock_ledger_entries.get((item.item_code,
+ item.warehouse), []))
+ elif item_sales_bom and item_sales_bom.get(item.item_code):
+ buying_amount = get_sales_bom_buying_amount(item.item_code, item.warehouse,
+ self.doc.doctype, self.doc.name, item.name, stock_ledger_entries,
+ item_sales_bom)
- item.buying_amount = buying_amount >= 0.01 and buying_amount or 0
- webnotes.conn.set_value(item.doctype, item.name, "buying_amount",
- item.buying_amount)
+ item.buying_amount = buying_amount >= 0.01 and buying_amount or 0
+ webnotes.conn.set_value(item.doctype, item.name, "buying_amount",
+ item.buying_amount)
def check_expense_account(self, item):
if item.buying_amount and not item.expense_account:
diff --git a/docs/docs.community.md b/docs/docs.community.md
deleted file mode 100644
index 121a6925d0a..00000000000
--- a/docs/docs.community.md
+++ /dev/null
@@ -1,14 +0,0 @@
----
-{
- "_label": "Get Involved"
-}
----
-If you are an ERPNext user:
-
-[https://groups.google.com/group/erpnext-user-forum](https://groups.google.com/group/erpnext-user-forum)
-
-If you are an ERPNext developer:
-
-[https://groups.google.com/group/erpnext-developer-forum](https://groups.google.com/group/erpnext-developer-forum)
-
-
diff --git a/docs/docs.md b/docs/docs.md
index 378a0b8eb5d..3ed24b75d64 100644
--- a/docs/docs.md
+++ b/docs/docs.md
@@ -7,28 +7,25 @@
"docs.dev",
"docs.download",
"docs.community",
- "docs.blog",
- "docs.about"
+ "docs.blog"
],
"_no_toc": 1
}
---
-
-
All-in-One Platform to Manage Your Organization.
-
100% Free and Open Source.
+
+
ERPNext Docs (beta)
+
Open Source ERP Built for The Web.
+
For the main site, go to https://erpnext.com

+Welcome to the ERPNext Documentation + Community Site
+
### What is ERPNext?
-ERPNext is an information system that links together an entire organization's operations. It is a software package that offers convenience of managing all the business functions from a single platform. No need of going to different applications to process different requests. No need of saving data in different functional packages. Under one ERP "roof" you can manage Accounting, Warehouse Management, CRM, Human Resources, Supply Chain Management, Sales Management, and Website Design.
+ERPNext is an Open Source integrated app (that manages Financial Accounting, Inventory, CRM) that is built grounds up for the web, using some of the latest web technologies and frameworks. ERPNext helps your organization manage Financial Accounting, Inventory, Sales, Purchase, Payroll, Customer Support, E-Commerce all in one platform. Learn more at [https://erpnext.com](https://erpnext.com)
-ERPNext is written by Web Notes Technologies keeping small and medium businesses in mind.
+### Site Contents
-- It gives better access to crucial information as a whole rather than in fragments of different versions.
-- It provides comparable financial reports.
-- It avoids duplication of reports and redundant data.
-- It allows better alignment across cross-functional departments.
-- It facilitates Website Design and provides shopping cart facility.
-- It gives better deployment on mobiles, tablets, desktops and large screens.
\ No newline at end of file
+This site contains the full User and Developer Documentation for ERPNext. This is still a work-in-progress. Please feel free to contribute issues and documentation.
diff --git a/patches/august_2013/fix_fiscal_year.py b/patches/august_2013/fix_fiscal_year.py
new file mode 100644
index 00000000000..67988c440e3
--- /dev/null
+++ b/patches/august_2013/fix_fiscal_year.py
@@ -0,0 +1,49 @@
+import webnotes
+
+def execute():
+ create_fiscal_years()
+
+ doctypes = webnotes.conn.sql_list("""select parent from tabDocField
+ where (fieldtype="Link" and options='Fiscal Year')
+ or (fieldtype="Select" and options='link:Fiscal Year')""")
+
+ for dt in doctypes:
+ date_fields = webnotes.conn.sql_list("""select fieldname from tabDocField
+ where parent=%s and fieldtype='Date'""", dt)
+
+ date_field = get_date_field(date_fields, dt)
+
+ if not date_field:
+ print dt, date_field
+ else:
+ webnotes.conn.sql("""update `tab%s` set fiscal_year =
+ if(%s<='2013-06-30', '2012-2013', '2013-2014')""" % (dt, date_field))
+
+def create_fiscal_years():
+ fiscal_years = {
+ "2012-2013": ["2012-07-01", "2013-06-30"],
+ "2013-2014": ["2013-07-01", "2014-06-30"]
+ }
+
+ for d in fiscal_years:
+ webnotes.bean({
+ "doctype": "Fiscal Year",
+ "year": d,
+ "year_start_date": fiscal_years[d][0],
+ "is_fiscal_year_closed": "No"
+ }).insert()
+
+
+def get_date_field(date_fields, dt):
+ date_field = None
+ if date_fields:
+ if "posting_date" in date_fields:
+ date_field = "posting_date"
+ elif "transaction_date" in date_fields:
+ date_field = 'transaction_date'
+ else:
+ date_field = date_fields[0]
+ # print dt, date_fields
+
+ return date_field
+
\ No newline at end of file
diff --git a/stock/doctype/item/item.txt b/stock/doctype/item/item.txt
index 8b17aee6bb0..eb05503b329 100644
--- a/stock/doctype/item/item.txt
+++ b/stock/doctype/item/item.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-03 10:45:46",
"docstatus": 0,
- "modified": "2013-08-14 11:46:49",
+ "modified": "2013-08-30 16:21:38",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -35,7 +35,9 @@
"parentfield": "permissions",
"parenttype": "DocType",
"permlevel": 0,
- "read": 1
+ "read": 1,
+ "report": 1,
+ "submit": 0
},
{
"doctype": "DocType",
@@ -557,20 +559,6 @@
"read_only": 0,
"reqd": 1
},
- {
- "default": "No",
- "depends_on": "eval:doc.is_sales_item==\"Yes\"",
- "description": "Select \"Yes\" if this item is to be sent to a customer or received from a supplier as a sample. Delivery notes and Purchase Receipts will update stock levels but there will be no invoice against this item.",
- "doctype": "DocField",
- "fieldname": "is_sample_item",
- "fieldtype": "Select",
- "label": "Allow Samples",
- "oldfieldname": "is_sample_item",
- "oldfieldtype": "Select",
- "options": "Yes\nNo",
- "read_only": 0,
- "reqd": 1
- },
{
"depends_on": "eval:doc.is_sales_item==\"Yes\"",
"doctype": "DocField",
@@ -878,9 +866,7 @@
"cancel": 1,
"create": 1,
"doctype": "DocPerm",
- "report": 1,
"role": "Material Master Manager",
- "submit": 0,
"write": 1
},
{
@@ -888,9 +874,7 @@
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
- "report": 1,
"role": "Material Manager",
- "submit": 0,
"write": 0
},
{
@@ -898,21 +882,7 @@
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
- "report": 1,
"role": "Material User",
- "submit": 0,
"write": 0
- },
- {
- "doctype": "DocPerm",
- "role": "Sales User"
- },
- {
- "doctype": "DocPerm",
- "role": "Purchase User"
- },
- {
- "doctype": "DocPerm",
- "role": "Accounts User"
}
]
\ No newline at end of file
diff --git a/stock/doctype/item/test_item.py b/stock/doctype/item/test_item.py
index b9b67e2db1f..7be6ea56edc 100644
--- a/stock/doctype/item/test_item.py
+++ b/stock/doctype/item/test_item.py
@@ -44,7 +44,6 @@ test_records = [
"is_purchase_item": "Yes",
"is_sales_item": "Yes",
"is_service_item": "No",
- "is_sample_item": "No",
"inspection_required": "No",
"is_pro_applicable": "No",
"is_sub_contracted_item": "No",
@@ -82,7 +81,6 @@ test_records = [
"is_purchase_item": "Yes",
"is_sales_item": "Yes",
"is_service_item": "No",
- "is_sample_item": "No",
"inspection_required": "No",
"is_pro_applicable": "No",
"is_sub_contracted_item": "No",
@@ -108,7 +106,6 @@ test_records = [
"is_purchase_item": "Yes",
"is_sales_item": "Yes",
"is_service_item": "No",
- "is_sample_item": "No",
"inspection_required": "No",
"is_pro_applicable": "No",
"is_sub_contracted_item": "No",
@@ -128,7 +125,6 @@ test_records = [
"is_purchase_item": "Yes",
"is_sales_item": "Yes",
"is_service_item": "No",
- "is_sample_item": "No",
"inspection_required": "No",
"is_pro_applicable": "No",
"is_sub_contracted_item": "No",
@@ -149,7 +145,6 @@ test_records = [
"is_purchase_item": "Yes",
"is_sales_item": "Yes",
"is_service_item": "No",
- "is_sample_item": "No",
"inspection_required": "No",
"is_pro_applicable": "Yes",
"is_sub_contracted_item": "Yes",
@@ -168,7 +163,6 @@ test_records = [
"is_purchase_item": "Yes",
"is_sales_item": "Yes",
"is_service_item": "No",
- "is_sample_item": "No",
"inspection_required": "No",
"is_pro_applicable": "No",
"is_sub_contracted_item": "No",
@@ -188,7 +182,6 @@ test_records = [
"is_purchase_item": "Yes",
"is_sales_item": "Yes",
"is_service_item": "No",
- "is_sample_item": "No",
"inspection_required": "No",
"is_pro_applicable": "No",
"is_sub_contracted_item": "No",
@@ -209,7 +202,6 @@ test_records = [
"is_purchase_item": "Yes",
"is_sales_item": "Yes",
"is_service_item": "No",
- "is_sample_item": "No",
"inspection_required": "No",
"is_pro_applicable": "No",
"is_sub_contracted_item": "No",
diff --git a/stock/doctype/stock_reconciliation/stock_reconciliation.py b/stock/doctype/stock_reconciliation/stock_reconciliation.py
index 617ec698c4a..dbb0a348c3f 100644
--- a/stock/doctype/stock_reconciliation/stock_reconciliation.py
+++ b/stock/doctype/stock_reconciliation/stock_reconciliation.py
@@ -293,7 +293,7 @@ class DocType(StockController):
self.doc.stock_value_difference = 0.0
for d in self.entries:
- self.doc.stock_value_difference -= get_buying_amount(d.item_code, self.doc.doctype, self.doc.name,
+ self.doc.stock_value_difference -= get_buying_amount(self.doc.doctype, self.doc.name,
d.voucher_detail_no, stock_ledger_entries.get((d.item_code, d.warehouse), []))
webnotes.conn.set(self.doc, "stock_value_difference", self.doc.stock_value_difference)
diff --git a/stock/utils.py b/stock/utils.py
index f04b6632369..52471e4c6fd 100644
--- a/stock/utils.py
+++ b/stock/utils.py
@@ -164,20 +164,18 @@ def validate_warehouse_user(warehouse):
webnotes.throw(_("Not allowed entry in Warehouse") \
+ ": " + warehouse, UserNotAllowedForWarehouse)
-def get_buying_amount(item_code, voucher_type, voucher_no, voucher_detail_no,
- stock_ledger_entries, item_sales_bom=None):
- if item_sales_bom and item_sales_bom.get(item_code):
- # sales bom item
- buying_amount = 0.0
- for bom_item in item_sales_bom[item_code]:
- if bom_item.get("parent_detail_docname")==voucher_detail_no:
- buying_amount += _get_buying_amount(voucher_type, voucher_no, voucher_detail_no, stock_ledger_entries)
- return buying_amount
- else:
- # doesn't have sales bom
- return _get_buying_amount(voucher_type, voucher_no, voucher_detail_no, stock_ledger_entries)
+def get_sales_bom_buying_amount(item_code, warehouse, voucher_type, voucher_no, voucher_detail_no,
+ stock_ledger_entries, item_sales_bom):
+ # sales bom item
+ buying_amount = 0.0
+ for bom_item in item_sales_bom[item_code]:
+ if bom_item.get("parent_detail_docname")==voucher_detail_no:
+ buying_amount += get_buying_amount(voucher_type, voucher_no, voucher_detail_no,
+ stock_ledger_entries.get((bom_item.item_code, warehouse), []))
+
+ return buying_amount
-def _get_buying_amount(voucher_type, voucher_no, item_row, stock_ledger_entries):
+def get_buying_amount(voucher_type, voucher_no, item_row, stock_ledger_entries):
# IMP NOTE
# stock_ledger_entries should already be filtered by item_code and warehouse and
# sorted by posting_date desc, posting_time desc
diff --git a/utilities/demo/demo-login.html b/utilities/demo/demo-login.html
index ef24678e27a..4595cb7d355 100644
--- a/utilities/demo/demo-login.html
+++ b/utilities/demo/demo-login.html
@@ -8,7 +8,7 @@
+ class="form-control" placeholder="Your Email Id (optional)">