Merge pull request #1702 from pdvyas/put-version-in-file
keep version in separate file
diff --git a/erpnext/accounts/doctype/account/account.json b/erpnext/accounts/doctype/account/account.json
index 28a0329..dc83351 100644
--- a/erpnext/accounts/doctype/account/account.json
+++ b/erpnext/accounts/doctype/account/account.json
@@ -80,6 +80,7 @@
"oldfieldtype": "Link",
"options": "Account",
"permlevel": 0,
+ "reqd": 1,
"search_index": 1
},
{
@@ -209,7 +210,7 @@
"icon": "icon-money",
"idx": 1,
"in_create": 1,
- "modified": "2014-05-21 11:42:47.255511",
+ "modified": "2014-06-03 18:27:58.109303",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Account",
diff --git a/erpnext/accounts/doctype/c_form/c_form.py b/erpnext/accounts/doctype/c_form/c_form.py
index 11d0547..e0f008f 100644
--- a/erpnext/accounts/doctype/c_form/c_form.py
+++ b/erpnext/accounts/doctype/c_form/c_form.py
@@ -64,13 +64,3 @@
'net_total' : inv.net_total,
'grand_total' : inv.grand_total
}
-
-def get_invoice_nos(doctype, txt, searchfield, start, page_len, filters):
- from erpnext.utilities import build_filter_conditions
- conditions, filter_values = build_filter_conditions(filters)
-
- return frappe.db.sql("""select name from `tabSales Invoice` where docstatus = 1
- and c_form_applicable = 'Yes' and ifnull(c_form_no, '') = '' %s
- and %s like %s order by name limit %s, %s""" %
- (conditions, searchfield, "%s", "%s", "%s"),
- tuple(filter_values + ["%%%s%%" % txt, start, page_len]))
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.js b/erpnext/accounts/doctype/pricing_rule/pricing_rule.js
new file mode 100644
index 0000000..356cc0d
--- /dev/null
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.js
@@ -0,0 +1,64 @@
+// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+// License: GNU General Public License v3. See license.txt
+
+frappe.ui.form.on("Pricing Rule", "refresh", function(frm) {
+ var help_content = ['<table class="table table-bordered" style="background-color: #f9f9f9;">',
+ '<tr><td>',
+ '<h4><i class="icon-hand-right"></i> ',
+ __('Notes'),
+ ':</h4>',
+ '<ul>',
+ '<li>',
+ __("Pricing Rule is made to overwrite Price List / define discount percentage, based on some criteria."),
+ '</li>',
+ '<li>',
+ __("If selected Pricing Rule is made for 'Price', it will overwrite Price List. Pricing Rule price is the final price, so no further discount should be applied. Hence, in transactions like Sales Order, Purchase Order etc, it will be fetched in 'Rate' field, rather than 'Price List Rate' field."),
+ '</li>',
+ '<li>',
+ __('Discount Percentage can be applied either against a Price List or for all Price List.'),
+ '</li>',
+ '<li>',
+ __('To not apply Pricing Rule in a particular transaction, all applicable Pricing Rules should be disabled.'),
+ '</li>',
+ '</ul>',
+ '</td></tr>',
+ '<tr><td>',
+ '<h4><i class="icon-question-sign"></i> ',
+ __('How Pricing Rule is applied?'),
+ '</h4>',
+ '<ol>',
+ '<li>',
+ __("Pricing Rule is first selected based on 'Apply On' field, which can be Item, Item Group or Brand."),
+ '</li>',
+ '<li>',
+ __("Then Pricing Rules are filtered out based on Customer, Customer Group, Territory, Supplier, Supplier Type, Campaign, Sales Partner etc."),
+ '</li>',
+ '<li>',
+ __('Pricing Rules are further filtered based on quantity.'),
+ '</li>',
+ '<li>',
+ __('If two or more Pricing Rules are found based on the above conditions, Priority is applied. Priority is a number between 0 to 20 while default value is zero (blank). Higher number means it will take precedence if there are multiple Pricing Rules with same conditions.'),
+ '</li>',
+ '<li>',
+ __('Even if there are multiple Pricing Rules with highest priority, then following internal priorities are applied:'),
+ '<ul>',
+ '<li>',
+ __('Item Code > Item Group > Brand'),
+ '</li>',
+ '<li>',
+ __('Customer > Customer Group > Territory'),
+ '</li>',
+ '<li>',
+ __('Supplier > Supplier Type'),
+ '</li>',
+ '</ul>',
+ '</li>',
+ '<li>',
+ __('If multiple Pricing Rules continue to prevail, users are asked to set Priority manually to resolve conflict.'),
+ '</li>',
+ '</ol>',
+ '</td></tr>',
+ '</table>'].join("\n");
+
+ set_field_options("pricing_rule_help", help_content);
+});
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.json b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
index baefde2..e023dd0 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json
@@ -132,6 +132,13 @@
"permlevel": 0
},
{
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "label": "Company",
+ "options": "Company",
+ "permlevel": 0
+ },
+ {
"default": "Today",
"fieldname": "valid_from",
"fieldtype": "Date",
@@ -198,12 +205,25 @@
"label": "For Price List",
"options": "Price List",
"permlevel": 0
+ },
+ {
+ "fieldname": "help_section",
+ "fieldtype": "Section Break",
+ "label": "",
+ "options": "Simple",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "pricing_rule_help",
+ "fieldtype": "HTML",
+ "label": "Pricing Rule Help",
+ "permlevel": 0
}
],
"icon": "icon-gift",
"idx": 1,
"istable": 0,
- "modified": "2014-05-12 16:24:52.005162",
+ "modified": "2014-05-28 15:36:29.403659",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Pricing Rule",
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
index 39260a2..61e7ade 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
@@ -15,7 +15,6 @@
self.validate_min_max_qty()
self.cleanup_fields_value()
-
def validate_mandatory(self):
for field in ["apply_on", "applicable_for", "price_or_discount"]:
tocheck = frappe.scrub(self.get(field) or "")
@@ -26,7 +25,6 @@
if self.min_qty and self.max_qty and flt(self.min_qty) > flt(self.max_qty):
throw(_("Min Qty can not be greater than Max Qty"))
-
def cleanup_fields_value(self):
for logic_field in ["apply_on", "applicable_for", "price_or_discount"]:
fieldname = frappe.scrub(self.get(logic_field) or "")
diff --git a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
index 003c6e6..b17c995 100644
--- a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
+++ b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py
@@ -20,6 +20,7 @@
"price_or_discount": "Discount Percentage",
"price": 0,
"discount_percentage": 10,
+ "company": "_Test Company"
}
frappe.get_doc(test_record.copy()).insert()
@@ -36,7 +37,6 @@
"transaction_type": "selling",
"customer": "_Test Customer",
})
-
details = get_item_details(args)
self.assertEquals(details.get("discount_percentage"), 10)
@@ -72,7 +72,7 @@
frappe.db.sql("update `tabPricing Rule` set priority=NULL where campaign='_Test Campaign'")
from erpnext.stock.get_item_details import MultiplePricingRuleConflict
- self.assertRaises (MultiplePricingRuleConflict, get_item_details, args)
+ self.assertRaises(MultiplePricingRuleConflict, get_item_details, args)
args.item_code = "_Test Item 2"
details = get_item_details(args)
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
index 158dec2..d87456d 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
@@ -77,16 +77,19 @@
},
supplier: function() {
+ var me = this;
if(this.frm.updating_party_details)
return;
- erpnext.utils.get_party_details(this.frm,
- "erpnext.accounts.party.get_party_details", {
+ erpnext.utils.get_party_details(this.frm, "erpnext.accounts.party.get_party_details",
+ {
posting_date: this.frm.doc.posting_date,
party: this.frm.doc.supplier,
party_type: "Supplier",
account: this.frm.doc.debit_to,
price_list: this.frm.doc.buying_price_list,
- })
+ }, function() {
+ me.apply_pricing_rule();
+ })
},
credit_to: function() {
diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
index 26f3be7..d3b4606 100755
--- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
+++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json
@@ -1,6 +1,6 @@
{
"autoname": "EVD.######",
- "creation": "2013-05-22 12:43:10.000000",
+ "creation": "2013-05-22 12:43:10",
"docstatus": 0,
"doctype": "DocType",
"fields": [
@@ -193,17 +193,9 @@
"reqd": 1
},
{
- "fieldname": "pricing_rule_for_price",
+ "fieldname": "pricing_rule",
"fieldtype": "Link",
- "label": "Pricing Rule For Price",
- "options": "Pricing Rule",
- "permlevel": 0,
- "read_only": 1
- },
- {
- "fieldname": "pricing_rule_for_discount",
- "fieldtype": "Link",
- "label": "Pricing Rule For Discount",
+ "label": "Pricing Rule",
"options": "Pricing Rule",
"permlevel": 0,
"read_only": 1
@@ -429,9 +421,12 @@
],
"idx": 1,
"istable": 1,
- "modified": "2014-02-28 11:27:53.000000",
+ "modified": "2014-05-28 12:43:40.647183",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice Item",
- "owner": "Administrator"
+ "owner": "Administrator",
+ "permissions": [],
+ "sort_field": "modified",
+ "sort_order": "DESC"
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.json b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.json
index 8bc96e2..6f95a16 100644
--- a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.json
+++ b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.json
@@ -1,431 +1,430 @@
{
- "_last_update": null,
- "_user_tags": null,
- "allow_attach": null,
- "allow_copy": null,
- "allow_email": null,
- "allow_import": null,
- "allow_print": null,
- "allow_rename": null,
- "allow_trash": null,
- "autoname": "PVTD.######",
- "change_log": null,
- "client_script": null,
- "client_script_core": null,
- "client_string": null,
- "colour": null,
- "creation": "2013-05-21 16:16:04",
- "custom": null,
- "default_print_format": null,
- "description": null,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": null,
- "dt_template": null,
+ "_last_update": null,
+ "_user_tags": null,
+ "allow_attach": null,
+ "allow_copy": null,
+ "allow_email": null,
+ "allow_import": null,
+ "allow_print": null,
+ "allow_rename": null,
+ "allow_trash": null,
+ "autoname": "PVTD.######",
+ "change_log": null,
+ "client_script": null,
+ "client_script_core": null,
+ "client_string": null,
+ "colour": null,
+ "creation": "2013-05-21 16:16:04",
+ "custom": null,
+ "default_print_format": null,
+ "description": null,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": null,
+ "dt_template": null,
"fields": [
{
- "allow_on_submit": null,
- "default": "Valuation and Total",
- "depends_on": null,
- "description": null,
- "fieldname": "category",
- "fieldtype": "Select",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 0,
- "label": "Consider Tax or Charge for",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "category",
- "oldfieldtype": "Select",
- "options": "Valuation and Total\nValuation\nTotal",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": 0,
- "report_hide": null,
- "reqd": 1,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": "Valuation and Total",
+ "depends_on": null,
+ "description": null,
+ "fieldname": "category",
+ "fieldtype": "Select",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 0,
+ "label": "Consider Tax or Charge for",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "category",
+ "oldfieldtype": "Select",
+ "options": "Valuation and Total\nValuation\nTotal",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": 0,
+ "report_hide": null,
+ "reqd": 1,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": "Add",
- "depends_on": null,
- "description": null,
- "fieldname": "add_deduct_tax",
- "fieldtype": "Select",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": null,
- "label": "Add or Deduct",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "add_deduct_tax",
- "oldfieldtype": "Select",
- "options": "Add\nDeduct",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": 0,
- "report_hide": null,
- "reqd": 1,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": "Add",
+ "depends_on": null,
+ "description": null,
+ "fieldname": "add_deduct_tax",
+ "fieldtype": "Select",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": null,
+ "label": "Add or Deduct",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "add_deduct_tax",
+ "oldfieldtype": "Select",
+ "options": "Add\nDeduct",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": 0,
+ "report_hide": null,
+ "reqd": 1,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "charge_type",
- "fieldtype": "Select",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 1,
- "label": "Type",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "charge_type",
- "oldfieldtype": "Select",
- "options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": 0,
- "report_hide": null,
- "reqd": 1,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "charge_type",
+ "fieldtype": "Select",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 1,
+ "label": "Type",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "charge_type",
+ "oldfieldtype": "Select",
+ "options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": 0,
+ "report_hide": null,
+ "reqd": 1,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1",
- "description": null,
- "fieldname": "row_id",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": null,
- "label": "Reference Row #",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "row_id",
- "oldfieldtype": "Data",
- "options": null,
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": 0,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1",
+ "description": null,
+ "fieldname": "row_id",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": null,
+ "label": "Reference Row #",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "row_id",
+ "oldfieldtype": "Data",
+ "options": null,
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": 0,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "description",
- "fieldtype": "Small Text",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 1,
- "label": "Description",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "options": null,
- "permlevel": 0,
- "print_hide": null,
- "print_width": "300px",
- "read_only": 0,
- "report_hide": null,
- "reqd": 1,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 1,
+ "label": "Description",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "options": null,
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": "300px",
+ "read_only": 0,
+ "report_hide": null,
+ "reqd": 1,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": "300px"
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "col_break1",
- "fieldtype": "Column Break",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": null,
- "label": null,
- "no_column": null,
- "no_copy": null,
- "oldfieldname": null,
- "oldfieldtype": null,
- "options": null,
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": null,
+ "label": null,
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": null,
+ "oldfieldtype": null,
+ "options": null,
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "account_head",
- "fieldtype": "Link",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 0,
- "label": "Account Head",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "account_head",
- "oldfieldtype": "Link",
- "options": "Account",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": 0,
- "report_hide": null,
- "reqd": 1,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "account_head",
+ "fieldtype": "Link",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 0,
+ "label": "Account Head",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "account_head",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": 0,
+ "report_hide": null,
+ "reqd": 1,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": ":Company",
- "depends_on": null,
- "description": null,
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 0,
- "label": "Cost Center",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "cost_center",
- "oldfieldtype": "Link",
- "options": "Cost Center",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": 0,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": ":Company",
+ "depends_on": null,
+ "description": null,
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 0,
+ "label": "Cost Center",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "cost_center",
+ "oldfieldtype": "Link",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": 0,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "rate",
- "fieldtype": "Float",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 1,
- "label": "Rate",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "rate",
- "oldfieldtype": "Currency",
- "options": null,
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": 0,
- "report_hide": null,
- "reqd": 0,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "rate",
+ "fieldtype": "Float",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 1,
+ "label": "Rate",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "rate",
+ "oldfieldtype": "Currency",
+ "options": null,
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": 0,
+ "report_hide": null,
+ "reqd": 0,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "tax_amount",
- "fieldtype": "Currency",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 1,
- "label": "Amount",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "tax_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": 1,
- "report_hide": null,
- "reqd": 0,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "tax_amount",
+ "fieldtype": "Currency",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 1,
+ "label": "Amount",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "tax_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": 1,
+ "report_hide": null,
+ "reqd": 0,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "total",
- "fieldtype": "Currency",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": null,
- "label": "Total",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": 1,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "total",
+ "fieldtype": "Currency",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": null,
+ "label": "Total",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": 1,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "item_wise_tax_detail",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": null,
- "label": "Item Wise Tax Detail ",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "item_wise_tax_detail",
- "oldfieldtype": "Small Text",
- "options": null,
- "permlevel": 0,
- "print_hide": 1,
- "print_width": null,
- "read_only": 1,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "item_wise_tax_detail",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": null,
+ "label": "Item Wise Tax Detail ",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "item_wise_tax_detail",
+ "oldfieldtype": "Small Text",
+ "options": null,
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": null,
+ "read_only": 1,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "parenttype",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_restrictions": null,
- "in_filter": 1,
- "in_list_view": null,
- "label": "Parenttype",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "parenttype",
- "oldfieldtype": "Data",
- "options": null,
- "permlevel": 0,
- "print_hide": 1,
- "print_width": null,
- "read_only": 0,
- "report_hide": null,
- "reqd": null,
- "search_index": 0,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "parenttype",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_restrictions": null,
+ "in_filter": 1,
+ "in_list_view": null,
+ "label": "Parenttype",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "parenttype",
+ "oldfieldtype": "Data",
+ "options": null,
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": null,
+ "read_only": 0,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": 0,
+ "set_only_once": null,
+ "trigger": null,
"width": null
}
- ],
- "hide_heading": 1,
- "hide_toolbar": null,
- "icon": null,
- "idx": 1,
- "in_create": null,
- "in_dialog": null,
- "is_submittable": null,
- "is_transaction_doc": null,
- "issingle": null,
- "istable": 1,
- "max_attachments": null,
- "menu_index": null,
- "modified": "2014-04-15 09:48:45.892548",
- "modified_by": "Administrator",
- "module": "Accounts",
- "name": "Purchase Taxes and Charges",
- "name_case": null,
- "owner": "Administrator",
- "parent": null,
- "parent_node": null,
- "parentfield": null,
- "parenttype": null,
- "permissions": [],
- "plugin": null,
- "print_outline": null,
- "read_only": null,
- "read_only_onload": null,
- "search_fields": null,
- "section_style": null,
- "server_code": null,
- "server_code_compiled": null,
- "server_code_core": null,
- "server_code_error": null,
- "show_in_menu": null,
- "smallicon": null,
- "subject": null,
- "tag_fields": null,
- "title_field": null,
- "use_template": null,
+ ],
+ "hide_heading": 1,
+ "hide_toolbar": null,
+ "icon": null,
+ "idx": 1,
+ "in_create": null,
+ "in_dialog": null,
+ "is_submittable": null,
+ "is_transaction_doc": null,
+ "issingle": null,
+ "istable": 1,
+ "max_attachments": null,
+ "menu_index": null,
+ "modified": "2014-04-15 09:48:45.892548",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Purchase Taxes and Charges",
+ "name_case": null,
+ "owner": "Administrator",
+ "parent": null,
+ "parent_node": null,
+ "parentfield": null,
+ "parenttype": null,
+ "permissions": [],
+ "plugin": null,
+ "print_outline": null,
+ "read_only": null,
+ "read_only_onload": null,
+ "search_fields": null,
+ "server_code": null,
+ "server_code_compiled": null,
+ "server_code_core": null,
+ "server_code_error": null,
+ "show_in_menu": null,
+ "smallicon": null,
+ "subject": null,
+ "tag_fields": null,
+ "title_field": null,
+ "use_template": null,
"version": null
-}
\ No newline at end of file
+}
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index a5707bb..21b42a5 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -155,8 +155,9 @@
},
customer: function() {
- if(this.frm.updating_party_details)
- return;
+ var me = this;
+ if(this.frm.updating_party_details) return;
+
erpnext.utils.get_party_details(this.frm,
"erpnext.accounts.party.get_party_details", {
posting_date: this.frm.doc.posting_date,
@@ -164,7 +165,9 @@
party_type: "Customer",
account: this.frm.doc.debit_to,
price_list: this.frm.doc.selling_price_list,
- })
+ }, function() {
+ me.apply_pricing_rule();
+ })
},
debit_to: function() {
diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
index 527213b..5b3bd9d 100644
--- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
+++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json
@@ -1,6 +1,6 @@
{
"autoname": "INVD.######",
- "creation": "2013-06-04 11:02:19.000000",
+ "creation": "2013-06-04 11:02:19",
"docstatus": 0,
"doctype": "DocType",
"fields": [
@@ -201,17 +201,9 @@
"reqd": 1
},
{
- "fieldname": "pricing_rule_for_price",
+ "fieldname": "pricing_rule",
"fieldtype": "Link",
- "label": "Pricing Rule For Price",
- "options": "Pricing Rule",
- "permlevel": 0,
- "read_only": 1
- },
- {
- "fieldname": "pricing_rule_for_discount",
- "fieldtype": "Link",
- "label": "Pricing Rule For Discount",
+ "label": "Pricing Rule",
"options": "Pricing Rule",
"permlevel": 0,
"read_only": 1
@@ -456,9 +448,12 @@
],
"idx": 1,
"istable": 1,
- "modified": "2014-02-28 11:04:19.000000",
+ "modified": "2014-05-28 12:42:28.209942",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",
- "owner": "Administrator"
+ "owner": "Administrator",
+ "permissions": [],
+ "sort_field": "modified",
+ "sort_order": "DESC"
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.json b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.json
index c47990f..0b0703f 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.json
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.json
@@ -1,431 +1,430 @@
{
- "_last_update": null,
- "_user_tags": null,
- "allow_attach": null,
- "allow_copy": null,
- "allow_email": null,
- "allow_import": null,
- "allow_print": null,
- "allow_rename": null,
- "allow_trash": null,
- "autoname": "INVTD.######",
- "change_log": null,
- "client_script": null,
- "client_script_core": null,
- "client_string": null,
- "colour": null,
- "creation": "2013-04-24 11:39:32",
- "custom": null,
- "default_print_format": null,
- "description": null,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": null,
- "dt_template": null,
+ "_last_update": null,
+ "_user_tags": null,
+ "allow_attach": null,
+ "allow_copy": null,
+ "allow_email": null,
+ "allow_import": null,
+ "allow_print": null,
+ "allow_rename": null,
+ "allow_trash": null,
+ "autoname": "INVTD.######",
+ "change_log": null,
+ "client_script": null,
+ "client_script_core": null,
+ "client_string": null,
+ "colour": null,
+ "creation": "2013-04-24 11:39:32",
+ "custom": null,
+ "default_print_format": null,
+ "description": null,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": null,
+ "dt_template": null,
"fields": [
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "charge_type",
- "fieldtype": "Select",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 1,
- "label": "Type",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "charge_type",
- "oldfieldtype": "Select",
- "options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": 1,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "charge_type",
+ "fieldtype": "Select",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 1,
+ "label": "Type",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "charge_type",
+ "oldfieldtype": "Select",
+ "options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": 1,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1",
- "description": null,
- "fieldname": "row_id",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": null,
- "label": "Reference Row #",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "row_id",
- "oldfieldtype": "Data",
- "options": null,
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": "eval:[\"On Previous Row Amount\", \"On Previous Row Total\"].indexOf(doc.charge_type)!==-1",
+ "description": null,
+ "fieldname": "row_id",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": null,
+ "label": "Reference Row #",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "row_id",
+ "oldfieldtype": "Data",
+ "options": null,
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "description",
- "fieldtype": "Small Text",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 1,
- "label": "Description",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "options": null,
- "permlevel": 0,
- "print_hide": null,
- "print_width": "300px",
- "read_only": null,
- "report_hide": null,
- "reqd": 1,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 1,
+ "label": "Description",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "options": null,
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": "300px",
+ "read_only": null,
+ "report_hide": null,
+ "reqd": 1,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": "300px"
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "col_break_1",
- "fieldtype": "Column Break",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": null,
- "label": null,
- "no_column": null,
- "no_copy": null,
- "oldfieldname": null,
- "oldfieldtype": null,
- "options": null,
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "col_break_1",
+ "fieldtype": "Column Break",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": null,
+ "label": null,
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": null,
+ "oldfieldtype": null,
+ "options": null,
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": "50%"
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "account_head",
- "fieldtype": "Link",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 0,
- "label": "Account Head",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "account_head",
- "oldfieldtype": "Link",
- "options": "Account",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": 1,
- "search_index": 1,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "account_head",
+ "fieldtype": "Link",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 0,
+ "label": "Account Head",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "account_head",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": 1,
+ "search_index": 1,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": ":Company",
- "depends_on": null,
- "description": null,
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 0,
- "label": "Cost Center",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "cost_center_other_charges",
- "oldfieldtype": "Link",
- "options": "Cost Center",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": ":Company",
+ "depends_on": null,
+ "description": null,
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 0,
+ "label": "Cost Center",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "cost_center_other_charges",
+ "oldfieldtype": "Link",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "rate",
- "fieldtype": "Float",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 1,
- "label": "Rate",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "rate",
- "oldfieldtype": "Currency",
- "options": null,
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": 1,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "rate",
+ "fieldtype": "Float",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 1,
+ "label": "Rate",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "rate",
+ "oldfieldtype": "Currency",
+ "options": null,
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": 1,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "tax_amount",
- "fieldtype": "Currency",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 1,
- "label": "Amount",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "tax_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": 1,
- "report_hide": null,
- "reqd": 0,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "tax_amount",
+ "fieldtype": "Currency",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 1,
+ "label": "Amount",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "tax_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": 1,
+ "report_hide": null,
+ "reqd": 0,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "total",
- "fieldtype": "Currency",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": null,
- "label": "Total",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": 1,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "total",
+ "fieldtype": "Currency",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": null,
+ "label": "Total",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": 1,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": 0,
- "default": null,
- "depends_on": null,
- "description": "If checked, the tax amount will be considered as already included in the Print Rate / Print Amount",
- "fieldname": "included_in_print_rate",
- "fieldtype": "Check",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": null,
- "label": "Is this Tax included in Basic Rate?",
- "no_column": null,
- "no_copy": 0,
- "oldfieldname": null,
- "oldfieldtype": null,
- "options": null,
- "permlevel": 0,
- "print_hide": 1,
- "print_width": "150px",
- "read_only": null,
- "report_hide": 1,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": 0,
+ "default": null,
+ "depends_on": null,
+ "description": "If checked, the tax amount will be considered as already included in the Print Rate / Print Amount",
+ "fieldname": "included_in_print_rate",
+ "fieldtype": "Check",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": null,
+ "label": "Is this Tax included in Basic Rate?",
+ "no_column": null,
+ "no_copy": 0,
+ "oldfieldname": null,
+ "oldfieldtype": null,
+ "options": null,
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": null,
+ "report_hide": 1,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": "150px"
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "tax_amount_after_discount_amount",
- "fieldtype": "Currency",
- "hidden": 1,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": null,
- "label": "Tax Amount After Discount Amount",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": null,
- "oldfieldtype": null,
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": 1,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "tax_amount_after_discount_amount",
+ "fieldtype": "Currency",
+ "hidden": 1,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": null,
+ "label": "Tax Amount After Discount Amount",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": null,
+ "oldfieldtype": null,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": 1,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "item_wise_tax_detail",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": null,
- "label": "Item Wise Tax Detail",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "item_wise_tax_detail",
- "oldfieldtype": "Small Text",
- "options": null,
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": 1,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "item_wise_tax_detail",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": null,
+ "label": "Item Wise Tax Detail",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "item_wise_tax_detail",
+ "oldfieldtype": "Small Text",
+ "options": null,
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": 1,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "parenttype",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_restrictions": null,
- "in_filter": 1,
- "in_list_view": null,
- "label": "Parenttype",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "parenttype",
- "oldfieldtype": "Data",
- "options": null,
- "permlevel": 0,
- "print_hide": 1,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": null,
- "search_index": 1,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "parenttype",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_restrictions": null,
+ "in_filter": 1,
+ "in_list_view": null,
+ "label": "Parenttype",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "parenttype",
+ "oldfieldtype": "Data",
+ "options": null,
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": 1,
+ "set_only_once": null,
+ "trigger": null,
"width": null
}
- ],
- "hide_heading": 1,
- "hide_toolbar": null,
- "icon": null,
- "idx": 1,
- "in_create": null,
- "in_dialog": null,
- "is_submittable": null,
- "is_transaction_doc": null,
- "issingle": null,
- "istable": 1,
- "max_attachments": null,
- "menu_index": null,
- "modified": "2014-04-14 18:40:48.450796",
- "modified_by": "Administrator",
- "module": "Accounts",
- "name": "Sales Taxes and Charges",
- "name_case": null,
- "owner": "Administrator",
- "parent": null,
- "parent_node": null,
- "parentfield": null,
- "parenttype": null,
- "permissions": [],
- "plugin": null,
- "print_outline": null,
- "read_only": null,
- "read_only_onload": null,
- "search_fields": null,
- "section_style": null,
- "server_code": null,
- "server_code_compiled": null,
- "server_code_core": null,
- "server_code_error": null,
- "show_in_menu": null,
- "smallicon": null,
- "subject": null,
- "tag_fields": null,
- "title_field": null,
- "use_template": null,
+ ],
+ "hide_heading": 1,
+ "hide_toolbar": null,
+ "icon": null,
+ "idx": 1,
+ "in_create": null,
+ "in_dialog": null,
+ "is_submittable": null,
+ "is_transaction_doc": null,
+ "issingle": null,
+ "istable": 1,
+ "max_attachments": null,
+ "menu_index": null,
+ "modified": "2014-04-14 18:40:48.450796",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Sales Taxes and Charges",
+ "name_case": null,
+ "owner": "Administrator",
+ "parent": null,
+ "parent_node": null,
+ "parentfield": null,
+ "parenttype": null,
+ "permissions": [],
+ "plugin": null,
+ "print_outline": null,
+ "read_only": null,
+ "read_only_onload": null,
+ "search_fields": null,
+ "server_code": null,
+ "server_code_compiled": null,
+ "server_code_core": null,
+ "server_code_error": null,
+ "show_in_menu": null,
+ "smallicon": null,
+ "subject": null,
+ "tag_fields": null,
+ "title_field": null,
+ "use_template": null,
"version": null
-}
\ No newline at end of file
+}
diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js
index ca6ebff..552ec2a 100644
--- a/erpnext/accounts/page/accounts_browser/accounts_browser.js
+++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js
@@ -238,6 +238,9 @@
method: 'erpnext.accounts.utils.add_ac',
callback: function(r) {
d.hide();
+ if(node.expanded) {
+ node.toggle_node();
+ }
node.reload();
}
});
@@ -281,6 +284,9 @@
method: 'erpnext.accounts.utils.add_cc',
callback: function(r) {
d.hide();
+ if(node.expanded) {
+ node.toggle_node();
+ }
node.reload();
}
});
diff --git a/erpnext/accounts/page/financial_analytics/financial_analytics.js b/erpnext/accounts/page/financial_analytics/financial_analytics.js
index f3452e8..df30d83 100644
--- a/erpnext/accounts/page/financial_analytics/financial_analytics.js
+++ b/erpnext/accounts/page/financial_analytics/financial_analytics.js
@@ -17,8 +17,9 @@
erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({
filters: [
{
- fieldtype:"Select", label: __("PL or BS"),
- options:["Profit and Loss", "Balance Sheet"],
+ fieldtype:"Select", label: __("PL or BS"), fieldname: "pl_or_bs",
+ options:[{"label": __("Profit and Loss"), "value": "Profit and Loss"},
+ {"label": __("Balance Sheet"), "value": "Balance Sheet"}],
filter: function(val, item, opts, me) {
if(item._show) return true;
@@ -31,21 +32,23 @@
}
},
{
- fieldtype:"Select", label: __("Company"),
- link:"Company", default_value: "Select Company...",
+ fieldtype:"Select", label: __("Company"), fieldname: "company",
+ link:"Company", default_value: __("Select Company..."),
filter: function(val, item, opts) {
return item.company == val || val == opts.default_value || item._show;
}
},
- {fieldtype:"Select", label: __("Fiscal Year"), link:"Fiscal Year",
- default_value: "Select Fiscal Year..."},
- {fieldtype:"Date", label: __("From Date")},
+ {fieldtype:"Select", label: __("Fiscal Year"), link:"Fiscal Year", fieldname: "fiscal_year",
+ default_value: __("Select Fiscal Year...")},
+ {fieldtype:"Date", label: __("From Date"), fieldname: "from_date"},
{fieldtype:"Label", label: __("To")},
- {fieldtype:"Date", label: __("To Date")},
- {fieldtype:"Select", label: __("Range"),
- options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
+ {fieldtype:"Date", label: __("To Date"), fieldname: "to_date"},
+ {fieldtype:"Select", label: __("Range"), fieldname: "range",
+ options:[{label: __("Daily"), value: "Daily"}, {label: __("Weekly"), value: "Weekly"},
+ {label: __("Monthly"), value: "Monthly"}, {label: __("Quarterly"), value: "Quarterly"},
+ {label: __("Yearly"), value: "Yearly"}]},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
- {fieldtype:"Button", label: __("Reset Filters")}
+ {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
],
setup_columns: function() {
var std_columns = [
diff --git a/erpnext/accounts/page/trial_balance/trial_balance.js b/erpnext/accounts/page/trial_balance/trial_balance.js
index 9581809..e73e1d4 100644
--- a/erpnext/accounts/page/trial_balance/trial_balance.js
+++ b/erpnext/accounts/page/trial_balance/trial_balance.js
@@ -3,7 +3,7 @@
frappe.require("assets/erpnext/js/account_tree_grid.js");
-frappe.pages['trial-balance'].onload = function(wrapper) {
+frappe.pages['trial-balance'].onload = function(wrapper) {
frappe.ui.make_app_page({
parent: wrapper,
title: __('Trial Balance'),
@@ -13,26 +13,26 @@
init: function(wrapper, title) {
var me = this;
this._super(wrapper, title);
-
+
// period closing entry checkbox
this.wrapper.bind("make", function() {
$('<div style="margin: 10px 0px; "\
- class="with_period_closing_entry"><input type="checkbox" checked="checked">' +
+ class="with_period_closing_entry"><input type="checkbox" checked="checked">' +
__("With period closing entry") + '</div>')
.appendTo(me.wrapper)
.find("input").click(function() { me.refresh(); });
});
},
-
+
prepare_balances: function() {
// store value of with closing entry
this.with_period_closing_entry = this.wrapper
.find(".with_period_closing_entry input:checked").length;
this._super();
},
-
+
update_balances: function(account, posting_date, v) {
- // for period closing voucher,
+ // for period closing voucher,
// only consider them when adding "With Closing Entry is checked"
if(v.voucher_type === "Period Closing Voucher") {
if(this.with_period_closing_entry) {
@@ -44,8 +44,8 @@
},
})
erpnext.trial_balance = new TrialBalance(wrapper, 'Trial Balance');
-
+
wrapper.appframe.add_module_icon("Accounts")
-
-}
\ No newline at end of file
+
+}
diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js
index 09fbd3e..300c228 100644
--- a/erpnext/accounts/report/accounts_payable/accounts_payable.js
+++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js
@@ -18,7 +18,7 @@
"get_query": function() {
var company = frappe.query_report.filters_by_name.company.get_value();
return {
- "query": "erpnext.accounts.utils.get_account_list",
+ "query": "erpnext.controllers.queries.get_account_list",
"filters": {
"report_type": "Balance Sheet",
"company": company,
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
index 1cf0941..304c21b 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.js
@@ -18,7 +18,7 @@
"get_query": function() {
var company = frappe.query_report.filters_by_name.company.get_value();
return {
- "query": "erpnext.accounts.utils.get_account_list",
+ "query": "erpnext.controllers.queries.get_account_list",
"filters": {
"report_type": "Balance Sheet",
"company": company,
diff --git a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js
index abeaba8..c28ba70 100644
--- a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js
+++ b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.js
@@ -23,7 +23,7 @@
"options": "Account",
"get_query": function() {
return {
- "query": "erpnext.accounts.utils.get_account_list",
+ "query": "erpnext.controllers.queries.get_account_list",
"filters": [
['Account', 'account_type', 'in', 'Bank, Cash'],
['Account', 'group_or_ledger', '=', 'Ledger'],
diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js
index 5316b58..adc9ca2 100644
--- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js
+++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.js
@@ -11,7 +11,7 @@
"reqd": 1,
"get_query": function() {
return {
- "query": "erpnext.accounts.utils.get_account_list",
+ "query": "erpnext.controllers.queries.get_account_list",
"filters": [
['Account', 'account_type', 'in', 'Bank, Cash'],
['Account', 'group_or_ledger', '=', 'Ledger'],
@@ -27,4 +27,4 @@
"reqd": 1
},
]
-}
\ No newline at end of file
+}
diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py
index 2b1923b..e87fbd3 100644
--- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py
+++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py
@@ -7,10 +7,13 @@
def execute(filters=None):
if not filters: filters = {}
-
+
columns = get_columns()
+
+ if not filters.get("account"): return columns, []
+
data = get_entries(filters)
-
+
from erpnext.accounts.utils import get_balance_on
balance_as_per_company = get_balance_on(filters["account"], filters["report_date"])
@@ -19,34 +22,34 @@
total_debit += flt(d[4])
total_credit += flt(d[5])
- bank_bal = flt(balance_as_per_company) + flt(total_debit) - flt(total_credit)
-
+ bank_bal = flt(balance_as_per_company) - flt(total_debit) + flt(total_credit)
+
data += [
get_balance_row("Balance as per company books", balance_as_per_company),
- ["", "", "", "Amounts not reflected in bank", total_debit, total_credit],
+ ["", "", "", "Amounts not reflected in bank", total_debit, total_credit],
get_balance_row("Balance as per bank", bank_bal)
]
-
+
return columns, data
-
+
def get_columns():
- return ["Journal Voucher:Link/Journal Voucher:140", "Posting Date:Date:100",
- "Clearance Date:Date:110", "Against Account:Link/Account:200",
+ return ["Journal Voucher:Link/Journal Voucher:140", "Posting Date:Date:100",
+ "Clearance Date:Date:110", "Against Account:Link/Account:200",
"Debit:Currency:120", "Credit:Currency:120"
]
-
+
def get_entries(filters):
- entries = frappe.db.sql("""select
+ entries = frappe.db.sql("""select
jv.name, jv.posting_date, jv.clearance_date, jvd.against_account, jvd.debit, jvd.credit
- from
- `tabJournal Voucher Detail` jvd, `tabJournal Voucher` jv
- where jvd.parent = jv.name and jv.docstatus=1
- and jvd.account = %(account)s and jv.posting_date <= %(report_date)s
+ from
+ `tabJournal Voucher Detail` jvd, `tabJournal Voucher` jv
+ where jvd.parent = jv.name and jv.docstatus=1
+ and jvd.account = %(account)s and jv.posting_date <= %(report_date)s
and ifnull(jv.clearance_date, '4000-01-01') > %(report_date)s
order by jv.name DESC""", filters, as_list=1)
-
+
return entries
-
+
def get_balance_row(label, amount):
if amount > 0:
return ["", "", "", label, amount, 0]
diff --git a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js
index 402f894..13c0edc 100644
--- a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js
+++ b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.js
@@ -30,7 +30,7 @@
"get_query": function() {
var company = frappe.query_report.filters_by_name.company.get_value();
return {
- "query": "erpnext.accounts.utils.get_account_list",
+ "query": "erpnext.controllers.queries.get_account_list",
"filters": {
"report_type": "Balance Sheet",
"company": company,
diff --git a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js
index 3264da7..79b1785 100644
--- a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js
+++ b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.js
@@ -24,7 +24,7 @@
"get_query": function() {
var company = frappe.query_report.filters_by_name.company.get_value();
return {
- "query": "erpnext.accounts.utils.get_account_list",
+ "query": "erpnext.controllers.queries.get_account_list",
"filters": {
"report_type": "Balance Sheet",
"company": company,
diff --git a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js
index b0833b5..bff3f70 100644
--- a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js
+++ b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.js
@@ -29,7 +29,7 @@
options: "Account",
get_query: function() {
return {
- query: "erpnext.accounts.utils.get_account_list",
+ query: "erpnext.controllers.queries.get_account_list",
filters: {
"report_type": "Balance Sheet",
company: frappe.query_report.filters_by_name.company.get_value()
diff --git a/erpnext/accounts/report/purchase_register/purchase_register.js b/erpnext/accounts/report/purchase_register/purchase_register.js
index 7e999de..a1a41a5 100644
--- a/erpnext/accounts/report/purchase_register/purchase_register.js
+++ b/erpnext/accounts/report/purchase_register/purchase_register.js
@@ -24,7 +24,7 @@
"get_query": function() {
var company = frappe.query_report.filters_by_name.company.get_value();
return {
- "query": "erpnext.accounts.utils.get_account_list",
+ "query": "erpnext.controllers.queries.get_account_list",
"filters": {
"report_type": "Balance Sheet",
"company": company,
diff --git a/erpnext/accounts/report/sales_register/sales_register.js b/erpnext/accounts/report/sales_register/sales_register.js
index 0cc48a6..ac30562 100644
--- a/erpnext/accounts/report/sales_register/sales_register.js
+++ b/erpnext/accounts/report/sales_register/sales_register.js
@@ -24,7 +24,7 @@
"get_query": function() {
var company = frappe.query_report.filters_by_name.company.get_value();
return {
- "query": "erpnext.accounts.utils.get_account_list",
+ "query": "erpnext.controllers.queries.get_account_list",
"filters": {
"report_type": "Balance Sheet",
"company": company,
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index 1a09d38..160514b 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -7,8 +7,7 @@
from frappe.utils import nowdate, cstr, flt, now, getdate, add_months
from frappe import throw, _
from frappe.utils import formatdate
-from erpnext.utilities import build_filter_conditions
-
+import frappe.widgets.reportview
class FiscalYearError(frappe.ValidationError): pass
class BudgetError(frappe.ValidationError): pass
@@ -196,28 +195,6 @@
jv_obj.ignore_validate_update_after_submit = True
jv_obj.save()
-def get_account_list(doctype, txt, searchfield, start, page_len, filters):
- if not filters.get("group_or_ledger"):
- filters["group_or_ledger"] = "Ledger"
-
- conditions, filter_values = build_filter_conditions(filters)
-
- return frappe.db.sql("""select name, parent_account from `tabAccount`
- where docstatus < 2 %s and %s like %s order by name limit %s, %s""" %
- (conditions, searchfield, "%s", "%s", "%s"),
- tuple(filter_values + ["%%%s%%" % txt, start, page_len]))
-
-def get_cost_center_list(doctype, txt, searchfield, start, page_len, filters):
- if not filters.get("group_or_ledger"):
- filters["group_or_ledger"] = "Ledger"
-
- conditions, filter_values = build_filter_conditions(filters)
-
- return frappe.db.sql("""select name, parent_cost_center from `tabCost Center`
- where docstatus < 2 %s and %s like %s order by name limit %s, %s""" %
- (conditions, searchfield, "%s", "%s", "%s"),
- tuple(filter_values + ["%%%s%%" % txt, start, page_len]))
-
def remove_against_link_from_jv(ref_type, ref_no, against_field):
linked_jv = frappe.db.sql_list("""select parent from `tabJournal Voucher Detail`
where `%s`=%s and docstatus < 2""" % (against_field, "%s"), (ref_no))
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js
index c50dc3b..c3ef365 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.js
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.js
@@ -62,7 +62,8 @@
},
supplier: function() {
- erpnext.utils.get_party_details(this.frm);
+ var me = this;
+ erpnext.utils.get_party_details(this.frm, null, null, function(){me.apply_pricing_rule()});
},
supplier_address: function() {
@@ -110,7 +111,7 @@
var item = frappe.get_doc(cdt, cdn);
if(item.item_code && item.uom) {
return this.frm.call({
- method: "erpnext.buying.utils.get_conversion_factor",
+ method: "erpnext.stock.get_item_details.get_conversion_factor",
child: item,
args: {
item_code: item.item_code,
@@ -143,7 +144,7 @@
var item = frappe.get_doc(cdt, cdn);
if(item.item_code && item.warehouse) {
return this.frm.call({
- method: "erpnext.buying.utils.get_projected_qty",
+ method: "erpnext.stock.get_item_details.get_projected_qty",
child: item,
args: {
item_code: item.item_code,
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py
index 8d6ba46..91cc865 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.py
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.py
@@ -45,6 +45,7 @@
self.validate_with_previous_doc()
self.validate_for_subcontracting()
+ self.validate_minimum_order_qty()
self.create_raw_materials_supplied("po_raw_material_details")
def validate_with_previous_doc(self):
@@ -61,6 +62,13 @@
}
})
+ def validate_minimum_order_qty(self):
+ itemwise_min_order_qty = frappe._dict(frappe.db.sql("select name, min_order_qty from tabItem"))
+
+ for d in self.get("po_details"):
+ if flt(d.qty) < flt(itemwise_min_order_qty.get(d.item_code)):
+ frappe.throw(_("Row #{0}: Ordered qty can not less than item's minimum order qty (defined in item master).").format(d.idx))
+
def get_schedule_dates(self):
for d in self.get('po_details'):
if d.prevdoc_detail_docname and not d.schedule_date:
diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json
index 23fb1c0..224f784 100755
--- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json
+++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json
@@ -1,6 +1,6 @@
{
"autoname": "POD/.#####",
- "creation": "2013-05-24 19:29:06.000000",
+ "creation": "2013-05-24 19:29:06",
"docstatus": 0,
"doctype": "DocType",
"fields": [
@@ -252,17 +252,9 @@
"reqd": 1
},
{
- "fieldname": "pricing_rule_for_price",
+ "fieldname": "pricing_rule",
"fieldtype": "Link",
- "label": "Pricing Rule For Price",
- "options": "Pricing Rule",
- "permlevel": 0,
- "read_only": 1
- },
- {
- "fieldname": "pricing_rule_for_discount",
- "fieldtype": "Link",
- "label": "Pricing Rule For Discount",
+ "label": "Pricing Rule",
"options": "Pricing Rule",
"permlevel": 0,
"read_only": 1
@@ -474,9 +466,12 @@
],
"idx": 1,
"istable": 1,
- "modified": "2014-02-28 11:26:25.000000",
+ "modified": "2014-05-28 12:42:53.018610",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order Item",
- "owner": "Administrator"
+ "owner": "Administrator",
+ "permissions": [],
+ "sort_field": "modified",
+ "sort_order": "DESC"
}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json
index 11cb9d9..65dfe97 100644
--- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json
+++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json
@@ -1,6 +1,6 @@
{
"autoname": "SQI-.#####",
- "creation": "2013-05-22 12:43:10.000000",
+ "creation": "2013-05-22 12:43:10",
"docstatus": 0,
"doctype": "DocType",
"fields": [
@@ -195,17 +195,9 @@
"reqd": 1
},
{
- "fieldname": "pricing_rule_for_price",
+ "fieldname": "pricing_rule",
"fieldtype": "Link",
- "label": "Pricing Rule For Price",
- "options": "Pricing Rule",
- "permlevel": 0,
- "read_only": 1
- },
- {
- "fieldname": "pricing_rule_for_discount",
- "fieldtype": "Link",
- "label": "Pricing Rule For Discount",
+ "label": "Pricing Rule",
"options": "Pricing Rule",
"permlevel": 0,
"read_only": 1
@@ -354,9 +346,12 @@
],
"idx": 1,
"istable": 1,
- "modified": "2014-02-28 11:25:38.000000",
+ "modified": "2014-05-28 12:44:17.347236",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Quotation Item",
- "owner": "Administrator"
+ "owner": "Administrator",
+ "permissions": [],
+ "sort_field": "modified",
+ "sort_order": "DESC"
}
\ No newline at end of file
diff --git a/erpnext/buying/page/purchase_analytics/purchase_analytics.js b/erpnext/buying/page/purchase_analytics/purchase_analytics.js
index 614b40d..f1c050d 100644
--- a/erpnext/buying/page/purchase_analytics/purchase_analytics.js
+++ b/erpnext/buying/page/purchase_analytics/purchase_analytics.js
@@ -1,18 +1,18 @@
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
-frappe.pages['purchase-analytics'].onload = function(wrapper) {
+frappe.pages['purchase-analytics'].onload = function(wrapper) {
frappe.ui.make_app_page({
parent: wrapper,
title: __('Purchase Analytics'),
single_column: true
- });
-
+ });
+
new erpnext.PurchaseAnalytics(wrapper);
-
+
wrapper.appframe.add_module_icon("Buying")
-
+
}
erpnext.PurchaseAnalytics = frappe.views.TreeGridReport.extend({
@@ -22,19 +22,19 @@
page: wrapper,
parent: $(wrapper).find('.layout-main'),
appframe: wrapper.appframe,
- doctypes: ["Item", "Item Group", "Supplier", "Supplier Type", "Company", "Fiscal Year",
- "Purchase Invoice", "Purchase Invoice Item",
- "Purchase Order", "Purchase Order Item[Purchase Analytics]",
+ doctypes: ["Item", "Item Group", "Supplier", "Supplier Type", "Company", "Fiscal Year",
+ "Purchase Invoice", "Purchase Invoice Item",
+ "Purchase Order", "Purchase Order Item[Purchase Analytics]",
"Purchase Receipt", "Purchase Receipt Item[Purchase Analytics]"],
tree_grid: { show: true }
});
-
+
this.tree_grids = {
"Supplier Type": {
label: __("Supplier Type / Supplier"),
- show: true,
+ show: true,
item_key: "supplier",
- parent_field: "parent_supplier_type",
+ parent_field: "parent_supplier_type",
formatter: function(item) {
// return repl('<a href="#Report/stock-invoices/customer=%(enc_value)s">%(value)s</a>', {
// value: item.name,
@@ -45,29 +45,29 @@
},
"Supplier": {
label: __("Supplier"),
- show: false,
+ show: false,
item_key: "supplier",
formatter: function(item) {
return item.name;
}
- },
+ },
"Item Group": {
label: "Item",
- show: true,
- parent_field: "parent_item_group",
+ show: true,
+ parent_field: "parent_item_group",
item_key: "item_code",
formatter: function(item) {
return item.name;
}
- },
+ },
"Item": {
label: "Item",
- show: false,
+ show: false,
item_key: "item_code",
formatter: function(item) {
return item.name;
}
- },
+ },
}
},
setup_columns: function() {
@@ -82,35 +82,38 @@
formatter: this.currency_formatter}
];
- this.make_date_range_columns();
+ this.make_date_range_columns();
this.columns = std_columns.concat(this.columns);
},
filters: [
- {fieldtype:"Select", label: __("Tree Type"), options:["Supplier Type", "Supplier",
- "Item Group", "Item"],
+ {fieldtype:"Select", label: __("Tree Type"), fieldname: "tree_type",
+ options:["Supplier Type", "Supplier", "Item Group", "Item"],
filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me);
}},
- {fieldtype:"Select", label: __("Based On"), options:["Purchase Invoice",
- "Purchase Order", "Purchase Receipt"]},
- {fieldtype:"Select", label: __("Value or Qty"), options:["Value", "Quantity"]},
- {fieldtype:"Select", label: __("Company"), link:"Company",
- default_value: "Select Company..."},
- {fieldtype:"Date", label: __("From Date")},
+ {fieldtype:"Select", label: __("Based On"), fieldname: "based_on",
+ options:["Purchase Invoice", "Purchase Order", "Purchase Receipt"]},
+ {fieldtype:"Select", label: __("Value or Qty"), fieldname: "value_or_qty",
+ options:["Value", "Quantity"]},
+ {fieldtype:"Select", label: __("Company"), link:"Company", fieldname: "company",
+ default_value: __("Select Company...")},
+ {fieldtype:"Date", label: __("From Date"), fieldname: "from_date"},
{fieldtype:"Label", label: __("To")},
- {fieldtype:"Date", label: __("To Date")},
- {fieldtype:"Select", label: __("Range"),
- options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
+ {fieldtype:"Date", label: __("To Date"), fieldname: "to_date"},
+ {fieldtype:"Select", label: __("Range"), fieldname: "range",
+ options:[{label: __("Daily"), value: "Daily"}, {label: __("Weekly"), value: "Weekly"},
+ {label: __("Monthly"), value: "Monthly"}, {label: __("Quarterly"), value: "Quarterly"},
+ {label: __("Yearly"), value: "Yearly"}]},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
- {fieldtype:"Button", label: __("Reset Filters")}
+ {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
],
setup_filters: function() {
var me = this;
this._super();
-
+
this.trigger_refresh_on_change(["value_or_qty", "tree_type", "based_on", "company"]);
- this.show_zero_check()
+ this.show_zero_check()
this.setup_plot_check();
},
init_filter_values: function() {
@@ -124,34 +127,34 @@
// Add 'All Supplier Types' Supplier Type
// (Supplier / Item are not mandatory!!)
// Set parent supplier type for tree view
-
+
$.each(frappe.report_dump.data["Supplier Type"], function(i, v) {
- v['parent_supplier_type'] = "All Supplier Types"
+ v['parent_supplier_type'] = __("All Supplier Types")
})
-
+
frappe.report_dump.data["Supplier Type"] = [{
- name: __("All Supplier Types"),
+ name: __("All Supplier Types"),
id: "All Supplier Types",
}].concat(frappe.report_dump.data["Supplier Type"]);
-
+
frappe.report_dump.data["Supplier"].push({
- name: __("Not Set"),
- parent_supplier_type: "All Supplier Types",
+ name: __("Not Set"),
+ parent_supplier_type: __("All Supplier Types"),
id: "Not Set",
});
frappe.report_dump.data["Item"].push({
- name: __("Not Set"),
+ name: __("Not Set"),
parent_item_group: "All Item Groups",
id: "Not Set",
});
}
-
+
if (!this.tl || !this.tl[this.based_on]) {
this.make_transaction_list(this.based_on, this.based_on + " Item");
}
-
-
+
+
if(!this.data || me.item_type != me.tree_type) {
if(me.tree_type=='Supplier') {
var items = frappe.report_dump.data["Supplier"];
@@ -177,20 +180,20 @@
me.parent_map[d.name] = d[me.tree_grid.parent_field];
}
me.reset_item_values(d);
- });
-
+ });
+
this.set_indent();
-
+
} else {
// otherwise, only reset values
$.each(this.data, function(i, d) {
me.reset_item_values(d);
});
}
-
+
this.prepare_balances();
if(me.tree_grid.show) {
- this.set_totals(false);
+ this.set_totals(false);
this.update_groups();
} else {
this.set_totals(true);
@@ -201,14 +204,14 @@
var from_date = dateutil.str_to_obj(this.from_date);
var to_date = dateutil.str_to_obj(this.to_date);
var is_val = this.value_or_qty == 'Value';
-
+
$.each(this.tl[this.based_on], function(i, tl) {
- if (me.is_default('company') ? true : tl.company === me.company) {
+ if (me.is_default('company') ? true : tl.company === me.company) {
var posting_date = dateutil.str_to_obj(tl.posting_date);
if (posting_date >= from_date && posting_date <= to_date) {
- var item = me.item_by_name[tl[me.tree_grid.item_key]] ||
+ var item = me.item_by_name[tl[me.tree_grid.item_key]] ||
me.item_by_name['Not Set'];
- item[me.column_map[tl.posting_date].field] += (is_val ? tl.amount : tl.qty);
+ item[me.column_map[tl.posting_date].field] += (is_val ? tl.base_amount : tl.qty);
}
}
});
@@ -219,11 +222,11 @@
$.each(this.data, function(i, item) {
var parent = me.parent_map[item.name];
while(parent) {
- parent_group = me.item_by_name[parent];
-
+ var parent_group = me.item_by_name[parent];
+
$.each(me.columns, function(c, col) {
if (col.formatter == me.currency_formatter) {
- parent_group[col.field] =
+ parent_group[col.field] =
flt(parent_group[col.field])
+ flt(item[col.field]);
}
@@ -235,10 +238,10 @@
set_totals: function(sort) {
var me = this;
var checked = false;
- $.each(this.data, function(i, d) {
+ $.each(this.data, function(i, d) {
d.total = 0.0;
$.each(me.columns, function(i, col) {
- if(col.formatter==me.currency_formatter && !col.hidden && col.field!="total")
+ if(col.formatter==me.currency_formatter && !col.hidden && col.field!="total")
d.total += d[col.field];
if(d.checked) checked = true;
})
@@ -251,7 +254,7 @@
}
},
get_plot_points: function(item, col, idx) {
- return [[dateutil.str_to_obj(col.id).getTime(), item[col.field]],
+ return [[dateutil.str_to_obj(col.id).getTime(), item[col.field]],
[dateutil.user_to_obj(col.name).getTime(), item[col.field]]];
}
-});
\ No newline at end of file
+});
diff --git a/erpnext/config/selling.py b/erpnext/config/selling.py
index 4d3e059..bb70ac9 100644
--- a/erpnext/config/selling.py
+++ b/erpnext/config/selling.py
@@ -156,6 +156,11 @@
"name": "Industry Type",
"description": _("Track Leads by Industry Type.")
},
+ {
+ "type": "doctype",
+ "name": "SMS Settings",
+ "description": _("Setup SMS gateway settings")
+ },
]
},
{
diff --git a/erpnext/config/setup.py b/erpnext/config/setup.py
index e538de5..66b44e2 100644
--- a/erpnext/config/setup.py
+++ b/erpnext/config/setup.py
@@ -83,6 +83,11 @@
"name": "Jobs Email Settings",
"description": _("Setup incoming server for jobs email id. (e.g. jobs@example.com)")
},
+ {
+ "type": "doctype",
+ "name": "SMS Settings",
+ "description": _("Setup SMS gateway settings")
+ },
]
},
{
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 9033065..4567dd7 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -97,11 +97,17 @@
args = item.as_dict()
args.update(parent_dict)
ret = get_item_details(args)
+
for fieldname, value in ret.items():
if item.meta.get_field(fieldname) and \
item.get(fieldname) is None and value is not None:
item.set(fieldname, value)
+ if ret.get("pricing_rule"):
+ for field in ["base_price_list_rate", "price_list_rate",
+ "discount_percentage", "base_rate", "rate"]:
+ item.set(field, ret.get(field))
+
def set_taxes(self, tax_parentfield, tax_master_field):
if not self.meta.get_field(tax_parentfield):
return
@@ -409,7 +415,7 @@
if total_billed_amt - max_allowed_amt > 0.01:
reduce_by = total_billed_amt - max_allowed_amt
- frappe.throw(_("Cannot overbill for Item {0} in row {0} more than {1}. To allow overbilling, please set in 'Setup' > 'Global Defaults'").format(item.item_code, item.row, max_allowed_amt))
+ frappe.throw(_("Cannot overbill for Item {0} in row {0} more than {1}. To allow overbilling, please set in Stock Settings").format(item.item_code, item.idx, max_allowed_amt))
def get_company_default(self, fieldname):
from erpnext.accounts.utils import get_company_default
diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py
index 5cc7f64..a30cde7 100644
--- a/erpnext/controllers/queries.py
+++ b/erpnext/controllers/queries.py
@@ -234,3 +234,15 @@
'posting_date': filters['posting_date'], 'txt': "%%%s%%" % txt,
'mcond':get_match_cond(doctype),'start': start,
'page_len': page_len})
+
+def get_account_list(doctype, txt, searchfield, start, page_len, filters):
+ if isinstance(filters, dict):
+ if not filters.get("group_or_ledger"):
+ filters["group_or_ledger"] = "Ledger"
+ elif isinstance(filters, list):
+ if "group_or_ledger" not in [d[0] for d in filters]:
+ filters.append(["Account", "group_or_ledger", "=", "Ledger"])
+
+ return frappe.widgets.reportview.execute("Account", filters = filters,
+ fields = ["name", "parent_account"],
+ limit_start=start, limit_page_length=page_len, as_list=True)
diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py
index 0e4ac31..9322ca6 100644
--- a/erpnext/controllers/status_updater.py
+++ b/erpnext/controllers/status_updater.py
@@ -156,8 +156,8 @@
item['max_allowed'] = flt(item[args['target_ref_field']] * (100+tolerance)/100)
item['reduce_by'] = item[args['target_field']] - item['max_allowed']
- msgprint(_("Allowance for over-delivery / over-billing crossed for Item {0}").format(item["item_code"]))
- throw(_("{0} must be less than or equal to {1}").format(_(item["target_ref_field"]), item[args["max_allowed"]]))
+ msgprint(_("Allowance for over-delivery / over-billing crossed for Item {0}.").format(item["item_code"]))
+ throw(_("{0} must be less than or equal to {1}").format(item["target_ref_field"].title(), item["max_allowed"]))
def update_qty(self, change_modified=True):
"""
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py
index 9ae394b..232d6a9 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.py
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.py
@@ -33,8 +33,8 @@
return struct and struct[0][0] or ''
def pull_sal_struct(self, struct):
- from erpnext.hr.doctype.salary_structure.salary_structure import get_mapped_doc
- self.update(get_mapped_doc(struct, self))
+ from erpnext.hr.doctype.salary_structure.salary_structure import make_salary_slip
+ self.update(make_salary_slip(struct, self).as_dict())
def pull_emp_details(self):
emp = frappe.db.get_value("Employee", self.employee,
diff --git a/erpnext/hr/doctype/upload_attendance/upload_attendance.py b/erpnext/hr/doctype/upload_attendance/upload_attendance.py
index af86eb9..b6e56d0 100644
--- a/erpnext/hr/doctype/upload_attendance/upload_attendance.py
+++ b/erpnext/hr/doctype/upload_attendance/upload_attendance.py
@@ -100,6 +100,7 @@
from frappe.modules import scrub
rows = read_csv_content_from_uploaded_file()
+ rows = filter(lambda x: x and any(x), rows)
if not rows:
msg = [_("Please select a csv file")]
return {"messages": msg, "error": msg}
diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js
index ac023f3..1cee6b9 100644
--- a/erpnext/manufacturing/doctype/bom/bom.js
+++ b/erpnext/manufacturing/doctype/bom/bom.js
@@ -4,11 +4,11 @@
// On REFRESH
cur_frm.cscript.refresh = function(doc,dt,dn){
cur_frm.toggle_enable("item", doc.__islocal);
-
+
if (!doc.__islocal && doc.docstatus<2) {
cur_frm.add_custom_button(__("Update Cost"), cur_frm.cscript.update_cost);
}
-
+
cur_frm.cscript.with_operations(doc);
set_operation_no(doc);
}
@@ -41,14 +41,14 @@
var op = op_table[i].operation_no;
if (op && !inList(operations, op)) operations.push(op);
}
-
- frappe.meta.get_docfield("BOM Item", "operation_no",
+
+ frappe.meta.get_docfield("BOM Item", "operation_no",
cur_frm.docname).options = operations.join("\n");
-
+
$.each(doc.bom_materials || [], function(i, v) {
if(!inList(operations, cstr(v.operation_no))) v.operation_no = null;
});
-
+
refresh_field("bom_materials");
}
@@ -97,7 +97,7 @@
doc: cur_frm.doc,
method: "get_bom_material_detail",
args: {
- 'item_code': d.item_code,
+ 'item_code': d.item_code,
'bom_no': d.bom_no != null ? d.bom_no: '',
'qty': d.qty
},
@@ -131,7 +131,7 @@
}
}
-var calculate_op_cost = function(doc) {
+var calculate_op_cost = function(doc) {
var op = doc.bom_operations || [];
total_op_cost = 0;
for(var i=0;i<op.length;i++) {
@@ -143,13 +143,13 @@
refresh_field('operating_cost');
}
-var calculate_rm_cost = function(doc) {
+var calculate_rm_cost = function(doc) {
var rm = doc.bom_materials || [];
total_rm_cost = 0;
for(var i=0;i<rm.length;i++) {
amt = flt(rm[i].rate) * flt(rm[i].qty);
set_multiple('BOM Item',rm[i].name, {'amount': amt}, 'bom_materials');
- set_multiple('BOM Item',rm[i].name,
+ set_multiple('BOM Item',rm[i].name,
{'qty_consumed_per_unit': flt(rm[i].qty)/flt(doc.quantity)}, 'bom_materials');
total_rm_cost += amt;
}
@@ -196,7 +196,7 @@
'is_active': 1,
'docstatus': 1
}
- }
+ }
}
cur_frm.cscript.validate = function(doc, dt, dn) {
diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py
index c39a5b7..ffcbbd9 100644
--- a/erpnext/manufacturing/doctype/bom/bom.py
+++ b/erpnext/manufacturing/doctype/bom/bom.py
@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
-from frappe.utils import cint, cstr, flt, now, nowdate
+from frappe.utils import cint, cstr, flt
from frappe import _
from frappe.model.document import Document
@@ -54,7 +54,7 @@
def get_item_det(self, item_code):
item = frappe.db.sql("""select name, is_asset_item, is_purchase_item,
docstatus, description, is_sub_contracted_item, stock_uom, default_bom,
- last_purchase_rate, standard_rate, is_manufactured_item
+ last_purchase_rate, is_manufactured_item
from `tabItem` where name=%s""", item_code, as_dict = 1)
return item
@@ -111,8 +111,6 @@
frappe.throw(_("Please select Price List"))
rate = frappe.db.get_value("Item Price", {"price_list": self.buying_price_list,
"item_code": arg["item_code"]}, "price_list_rate") or 0
- elif self.rm_cost_as_per == 'Standard Rate':
- rate = arg['standard_rate']
return rate
@@ -134,26 +132,15 @@
return bom and bom[0]['unit_cost'] or 0
def get_valuation_rate(self, args):
- """ Get average valuation rate of relevant warehouses
- as per valuation method (MAR/FIFO)
- as on costing date
- """
- from erpnext.stock.utils import get_incoming_rate
- posting_date, posting_time = nowdate(), now().split()[1]
- warehouse = frappe.db.sql("select warehouse from `tabBin` where item_code = %s", args['item_code'])
- rate = []
- for wh in warehouse:
- r = get_incoming_rate({
- "item_code": args.get("item_code"),
- "warehouse": wh[0],
- "posting_date": posting_date,
- "posting_time": posting_time,
- "qty": args.get("qty") or 0
- })
- if r:
- rate.append(r)
+ """ Get weighted average of valuation rate from all warehouses """
- return rate and flt(sum(rate))/len(rate) or 0
+ total_qty, total_value = 0.0, 0.0
+ for d in frappe.db.sql("""select actual_qty, stock_value from `tabBin`
+ where item_code=%s and actual_qty > 0""", args['item_code'], as_dict=1):
+ total_qty += flt(d.actual_qty)
+ total_value += flt(d.stock_value)
+
+ return total_value / total_qty if total_qty else 0.0
def manage_default_bom(self):
""" Uncheck others if current one is selected as default,
diff --git a/erpnext/manufacturing/doctype/bom_item/bom_item.json b/erpnext/manufacturing/doctype/bom_item/bom_item.json
index fbf478c..0231a70 100644
--- a/erpnext/manufacturing/doctype/bom_item/bom_item.json
+++ b/erpnext/manufacturing/doctype/bom_item/bom_item.json
@@ -1,5 +1,5 @@
{
- "creation": "2013-02-22 01:27:49.000000",
+ "creation": "2013-02-22 01:27:49",
"docstatus": 0,
"doctype": "DocType",
"fields": [
@@ -79,7 +79,8 @@
"fieldtype": "Float",
"in_list_view": 1,
"label": "Rate",
- "permlevel": 0
+ "permlevel": 0,
+ "reqd": 1
},
{
"fieldname": "col_break2",
@@ -133,9 +134,12 @@
],
"idx": 1,
"istable": 1,
- "modified": "2014-02-03 12:47:39.000000",
+ "modified": "2014-05-29 15:56:31.859868",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "BOM Item",
- "owner": "Administrator"
+ "owner": "Administrator",
+ "permissions": [],
+ "sort_field": "modified",
+ "sort_order": "DESC"
}
\ No newline at end of file
diff --git a/erpnext/public/js/account_tree_grid.js b/erpnext/public/js/account_tree_grid.js
index df39d3f..87fb7a9 100644
--- a/erpnext/public/js/account_tree_grid.js
+++ b/erpnext/public/js/account_tree_grid.js
@@ -5,12 +5,12 @@
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
-//
+//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
-//
+//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
@@ -23,8 +23,8 @@
appframe: wrapper.appframe,
doctypes: ["Company", "Fiscal Year", "Account", "GL Entry", "Cost Center"],
tree_grid: {
- show: true,
- parent_field: "parent_account",
+ show: true,
+ parent_field: "parent_account",
formatter: function(item) {
return repl("<a \
onclick='frappe.cur_grid_report.show_general_ledger(\"%(value)s\")'>\
@@ -37,7 +37,7 @@
},
setup_columns: function() {
this.columns = [
- {id: "name", name: __("Account"), field: "name", width: 300, cssClass: "cell-title",
+ {id: "name", name: __("Account"), field: "name", width: 300, cssClass: "cell-title",
formatter: this.tree_formatter},
{id: "opening_dr", name: __("Opening (Dr)"), field: "opening_dr", width: 100,
formatter: this.currency_formatter},
@@ -55,21 +55,22 @@
},
filters: [
- {fieldtype: "Select", label: __("Company"), link:"Company", default_value: "Select Company...",
+ {fieldtype: "Select", label: __("Company"), link:"Company", fieldname: "company",
+ default_value: __("Select Company..."),
filter: function(val, item, opts, me) {
if (item.company == val || val == opts.default_value) {
return me.apply_zero_filter(val, item, opts, me);
}
return false;
}},
- {fieldtype: "Select", label: __("Fiscal Year"), link:"Fiscal Year",
- default_value: "Select Fiscal Year..."},
- {fieldtype: "Date", label: __("From Date")},
+ {fieldtype: "Select", label: "Fiscal Year", link:"Fiscal Year", fieldname: "fiscal_year",
+ default_value: __("Select Fiscal Year...")},
+ {fieldtype: "Date", label: __("From Date"), fieldname: "from_date"},
{fieldtype: "Label", label: __("To")},
- {fieldtype: "Date", label: __("To Date")},
+ {fieldtype: "Date", label: __("To Date"), fieldname: "to_date"},
{fieldtype: "Button", label: __("Refresh"), icon:"icon-refresh icon-white",
cssClass:"btn-info"},
- {fieldtype: "Button", label: __("Reset Filters")},
+ {fieldtype: "Button", label: __("Reset Filters"), icon: "icon-filter"},
],
setup_filters: function() {
this._super();
@@ -83,7 +84,7 @@
me.filter_inputs.to_date.val(dateutil.str_to_user(v.year_end_date));
}
});
- me.set_route();
+ me.refresh();
});
me.show_zero_check()
if(me.ignore_closing_entry) me.ignore_closing_entry();
@@ -105,21 +106,21 @@
me.parent_map[d.name] = d.parent_account;
}
});
-
+
me.primary_data = [].concat(me.data);
}
-
+
me.data = [].concat(me.primary_data);
$.each(me.data, function(i, d) {
me.init_account(d);
});
-
+
this.set_indent();
this.prepare_balances();
-
+
},
init_account: function(d) {
- this.reset_item_values(d);
+ this.reset_item_values(d);
},
prepare_balances: function() {
@@ -132,7 +133,7 @@
if (!this.fiscal_year) return;
$.each(this.data, function(i, v) {
- v.opening_dr = v.opening_cr = v.debit
+ v.opening_dr = v.opening_cr = v.debit
= v.credit = v.closing_dr = v.closing_cr = 0;
});
@@ -145,15 +146,16 @@
this.update_groups();
},
update_balances: function(account, posting_date, v) {
- var bal = flt(account.opening_dr) - flt(account.opening_cr) + flt(v.debit) - flt(v.credit);
// opening
if (posting_date < this.opening_date || v.is_opening === "Yes") {
- if (account.report_type === "Profit and Loss" &&
+ if (account.report_type === "Profit and Loss" &&
posting_date <= dateutil.str_to_obj(this.fiscal_year[1])) {
- // balance of previous fiscal_year should
+ // balance of previous fiscal_year should
// not be part of opening of pl account balance
} else {
- this.set_debit_or_credit(account, "opening", bal);
+ var opening_bal = flt(account.opening_dr) - flt(account.opening_cr) +
+ flt(v.debit) - flt(v.credit);
+ this.set_debit_or_credit(account, "opening", opening_bal);
}
} else if (this.opening_date <= posting_date && posting_date <= this.closing_date) {
// in between
@@ -161,7 +163,9 @@
account.credit += flt(v.credit);
}
// closing
- this.set_debit_or_credit(account, "closing", bal);
+ var closing_bal = flt(account.opening_dr) - flt(account.opening_cr) +
+ flt(account.debit) - flt(account.credit);
+ this.set_debit_or_credit(account, "closing", closing_bal);
},
set_debit_or_credit: function(account, field, balance) {
if(balance > 0) {
@@ -184,25 +188,25 @@
$.each(me.columns, function(c, col) {
if (col.formatter == me.currency_formatter) {
if(col.field=="opening_dr") {
- var bal = flt(parent_account.opening_dr) -
- flt(parent_account.opening_cr) +
+ var bal = flt(parent_account.opening_dr) -
+ flt(parent_account.opening_cr) +
flt(account.opening_dr) - flt(account.opening_cr);
me.set_debit_or_credit(parent_account, "opening", bal);
} else if(col.field=="closing_dr") {
- var bal = flt(parent_account.closing_dr) -
- flt(parent_account.closing_cr) +
+ var bal = flt(parent_account.closing_dr) -
+ flt(parent_account.closing_cr) +
flt(account.closing_dr) - flt(account.closing_cr);
me.set_debit_or_credit(parent_account, "closing", bal);
} else if(in_list(["debit", "credit"], col.field)) {
- parent_account[col.field] = flt(parent_account[col.field]) +
+ parent_account[col.field] = flt(parent_account[col.field]) +
flt(account[col.field]);
}
}
});
parent = me.parent_map[parent];
- }
+ }
}
- });
+ });
},
set_fiscal_year: function() {
@@ -214,7 +218,7 @@
this.fiscal_year = null;
var me = this;
$.each(frappe.report_dump.data["Fiscal Year"], function(i, v) {
- if (me.opening_date >= dateutil.str_to_obj(v.year_start_date) &&
+ if (me.opening_date >= dateutil.str_to_obj(v.year_start_date) &&
me.closing_date <= dateutil.str_to_obj(v.year_end_date)) {
me.fiscal_year = v;
}
@@ -225,7 +229,7 @@
return;
}
},
-
+
show_general_ledger: function(account) {
frappe.route_options = {
account: account,
@@ -235,4 +239,4 @@
};
frappe.set_route("query-report", "General Ledger");
}
-});
\ No newline at end of file
+});
diff --git a/erpnext/public/js/conf.js b/erpnext/public/js/conf.js
index 65ffe2d..176e13a 100644
--- a/erpnext/public/js/conf.js
+++ b/erpnext/public/js/conf.js
@@ -16,25 +16,3 @@
"white-space": "nowrap"
});
});
-
-frappe.provide('frappe.ui.misc');
-frappe.ui.misc.about = function() {
- if(!frappe.ui.misc.about_dialog) {
- var d = new frappe.ui.Dialog({title: __('About')})
-
- $(d.body).html(repl("<div>\
- <h2>ERPNext</h2> \
- <h4 class='text-muted'>"+__("Built on") + " Frappe Framework"+"</h4> \
- <p>"+__("Open source ERP built for the web") + "</p>" +
- "<p>"+__("To report an issue, go to ")+"<a href='https://github.com/frappe/erpnext/issues'>GitHub Issues</a></p> \
- <p><a href='http://erpnext.org' target='_blank'>http://erpnext.org</a>.</p>\
- <p><a href='http://www.gnu.org/copyleft/gpl.html'>License: GNU General Public License Version 3</a></p>\
- <hr>\
- <p>© 2014 Web Notes Technologies Pvt. Ltd and contributers </p> \
- </div>", frappe.app));
-
- frappe.ui.misc.about_dialog = d;
- }
-
- frappe.ui.misc.about_dialog.show();
-}
diff --git a/erpnext/public/js/stock_analytics.js b/erpnext/public/js/stock_analytics.js
index d62a1da..d4f43e9 100644
--- a/erpnext/public/js/stock_analytics.js
+++ b/erpnext/public/js/stock_analytics.js
@@ -10,11 +10,11 @@
page: wrapper,
parent: $(wrapper).find('.layout-main'),
appframe: wrapper.appframe,
- doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand",
+ doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand",
"Fiscal Year", "Serial No"],
tree_grid: {
- show: true,
- parent_field: "parent_item_group",
+ show: true,
+ parent_field: "parent_item_group",
formatter: function(item) {
if(!item.is_group) {
return repl("<a \
@@ -25,13 +25,13 @@
} else {
return item.name;
}
-
+
}
},
}
-
+
if(opts) $.extend(args, opts);
-
+
this._super(args);
},
setup_columns: function() {
@@ -50,28 +50,29 @@
this.columns = std_columns.concat(this.columns);
},
filters: [
- {fieldtype:"Select", label: __("Value or Qty"), options:["Value", "Quantity"],
+ {fieldtype:"Select", label: __("Value or Qty"), fieldname: "value_or_qty",
+ options:["Value", "Quantity"],
filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me);
}},
- {fieldtype:"Select", label: __("Brand"), link:"Brand",
- default_value: "Select Brand...", filter: function(val, item, opts) {
+ {fieldtype:"Select", label: __("Brand"), link:"Brand", fieldname: "brand",
+ default_value: __("Select Brand..."), filter: function(val, item, opts) {
return val == opts.default_value || item.brand == val || item._show;
}, link_formatter: {filter_input: "brand"}},
- {fieldtype:"Select", label: __("Warehouse"), link:"Warehouse",
- default_value: "Select Warehouse..."},
- {fieldtype:"Date", label: __("From Date")},
+ {fieldtype:"Select", label: __("Warehouse"), link:"Warehouse", fieldname: "warehouse",
+ default_value: __("Select Warehouse...")},
+ {fieldtype:"Date", label: __("From Date"), fieldname: "from_date"},
{fieldtype:"Label", label: __("To")},
- {fieldtype:"Date", label: __("To Date")},
- {fieldtype:"Select", label: __("Range"),
+ {fieldtype:"Date", label: __("To Date"), fieldname: "to_date"},
+ {fieldtype:"Select", label: __("Range"), fieldname: "range",
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
- {fieldtype:"Button", label: __("Reset Filters")}
+ {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
],
setup_filters: function() {
var me = this;
this._super();
-
+
this.trigger_refresh_on_change(["value_or_qty", "brand", "warehouse", "range"]);
this.show_zero_check();
@@ -83,7 +84,7 @@
},
prepare_data: function() {
var me = this;
-
+
if(!this.data) {
var items = this.prepare_tree("Item", "Item Group");
@@ -109,10 +110,10 @@
me.reset_item_values(d);
});
}
-
+
this.prepare_balances();
this.update_groups();
-
+
},
prepare_balances: function() {
var me = this;
@@ -127,16 +128,16 @@
var sl = data[i];
sl.posting_datetime = sl.posting_date + " " + sl.posting_time;
var posting_datetime = dateutil.str_to_obj(sl.posting_datetime);
-
+
if(me.is_default("warehouse") ? true : me.warehouse == sl.warehouse) {
var item = me.item_by_name[sl.item_code];
-
+
if(me.value_or_qty!="Quantity") {
var wh = me.get_item_warehouse(sl.warehouse, sl.item_code);
- var valuation_method = item.valuation_method ?
+ var valuation_method = item.valuation_method ?
item.valuation_method : sys_defaults.valuation_method;
var is_fifo = valuation_method == "FIFO";
-
+
var diff = me.get_value_diff(wh, sl, is_fifo);
} else {
var diff = sl.qty;
@@ -165,13 +166,13 @@
balance = item[col.field];
}
});
-
+
var parent = me.parent_map[item.name];
while(parent) {
parent_group = me.item_by_name[parent];
$.each(me.columns, function(c, col) {
if (col.formatter == me.currency_formatter) {
- parent_group[col.field] =
+ parent_group[col.field] =
flt(parent_group[col.field])
+ flt(item[col.field]);
}
@@ -192,4 +193,4 @@
};
frappe.set_route("query-report", "Stock Ledger");
}
-});
\ No newline at end of file
+});
diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js
index e12a30e..6d30ef0 100644
--- a/erpnext/public/js/transaction.js
+++ b/erpnext/public/js/transaction.js
@@ -194,6 +194,7 @@
}
this.frm.script_manager.trigger("currency");
+ this.apply_pricing_rule()
}
},
@@ -225,7 +226,9 @@
this.frm.doc.plc_conversion_rate !== this.frm.doc.conversion_rate) {
this.frm.set_value("plc_conversion_rate", this.frm.doc.conversion_rate);
}
- if(flt(this.frm.doc.conversion_rate)>0.0) this.calculate_taxes_and_totals();
+ if(flt(this.frm.doc.conversion_rate)>0.0) {
+ this.apply_pricing_rule();
+ }
},
get_price_list_currency: function(buying_or_selling) {
@@ -278,12 +281,12 @@
}
if(this.frm.doc.price_list_currency === this.frm.doc.currency) {
this.frm.set_value("conversion_rate", this.frm.doc.plc_conversion_rate);
- this.calculate_taxes_and_totals();
+ this.apply_pricing_rule();
}
},
qty: function(doc, cdt, cdn) {
- this.calculate_taxes_and_totals();
+ this.apply_pricing_rule(frappe.get_doc(cdt, cdn));
},
// tax rate
@@ -326,6 +329,53 @@
this.calculate_taxes_and_totals();
},
+ apply_pricing_rule: function(item) {
+ var me = this;
+
+ var _apply_pricing_rule = function(item) {
+ return me.frm.call({
+ method: "erpnext.stock.get_item_details.apply_pricing_rule",
+ child: item,
+ args: {
+ args: {
+ item_code: item.item_code,
+ item_group: item.item_group,
+ brand: item.brand,
+ qty: item.qty,
+ customer: me.frm.doc.customer,
+ customer_group: me.frm.doc.customer_group,
+ territory: me.frm.doc.territory,
+ supplier: me.frm.doc.supplier,
+ supplier_type: me.frm.doc.supplier_type,
+ currency: me.frm.doc.currency,
+ conversion_rate: me.frm.doc.conversion_rate,
+ price_list: me.frm.doc.selling_price_list ||
+ me.frm.doc.buying_price_list,
+ plc_conversion_rate: me.frm.doc.plc_conversion_rate,
+ company: me.frm.doc.company,
+ transaction_date: me.frm.doc.transaction_date || me.frm.doc.posting_date,
+ campaign: me.frm.doc.campaign,
+ sales_partner: me.frm.doc.sales_partner
+ }
+ },
+ callback: function(r) {
+ if(!r.exc) {
+ me.frm.script_manager.trigger("price_list_rate", item.doctype, item.name);
+ }
+ }
+ });
+ }
+
+
+ if(item) {
+ _apply_pricing_rule(item);
+ } else {
+ $.each(this.get_item_doclist(), function(n, item) {
+ _apply_pricing_rule(item);
+ });
+ }
+ },
+
included_in_print_rate: function(doc, cdt, cdn) {
var tax = frappe.get_doc(cdt, cdn);
try {
diff --git a/erpnext/public/js/utils/party.js b/erpnext/public/js/utils/party.js
index 31abbb3..40db97f 100644
--- a/erpnext/public/js/utils/party.js
+++ b/erpnext/public/js/utils/party.js
@@ -2,7 +2,7 @@
// License: GNU General Public License v3. See license.txt
frappe.provide("erpnext.utils");
-erpnext.utils.get_party_details = function(frm, method, args) {
+erpnext.utils.get_party_details = function(frm, method, args, callback) {
if(!method) {
method = "erpnext.accounts.party.get_party_details";
}
@@ -33,6 +33,7 @@
frm.updating_party_details = true;
frm.set_value(r.message);
frm.updating_party_details = false;
+ if(callback) callback();
}
}
});
diff --git a/erpnext/selling/doctype/campaign/campaign.json b/erpnext/selling/doctype/campaign/campaign.json
index 7d02d22..7764a23 100644
--- a/erpnext/selling/doctype/campaign/campaign.json
+++ b/erpnext/selling/doctype/campaign/campaign.json
@@ -1,237 +1,236 @@
{
- "_last_update": null,
- "_user_tags": null,
- "allow_attach": null,
- "allow_copy": null,
- "allow_email": null,
- "allow_import": 1,
- "allow_print": null,
- "allow_rename": 1,
- "allow_trash": null,
- "autoname": "naming_series:",
- "change_log": null,
- "client_script": null,
- "client_script_core": null,
- "client_string": null,
- "colour": null,
- "creation": "2013-01-10 16:34:18",
- "custom": null,
- "default_print_format": null,
- "description": "Keep Track of Sales Campaigns. Keep track of Leads, Quotations, Sales Order etc from Campaigns to gauge Return on Investment. ",
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "Master",
- "dt_template": null,
+ "_last_update": null,
+ "_user_tags": null,
+ "allow_attach": null,
+ "allow_copy": null,
+ "allow_email": null,
+ "allow_import": 1,
+ "allow_print": null,
+ "allow_rename": 1,
+ "allow_trash": null,
+ "autoname": "naming_series:",
+ "change_log": null,
+ "client_script": null,
+ "client_script_core": null,
+ "client_string": null,
+ "colour": null,
+ "creation": "2013-01-10 16:34:18",
+ "custom": null,
+ "default_print_format": null,
+ "description": "Keep Track of Sales Campaigns. Keep track of Leads, Quotations, Sales Order etc from Campaigns to gauge Return on Investment. ",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "dt_template": null,
"fields": [
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "campaign",
- "fieldtype": "Section Break",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 0,
- "label": "Campaign",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": null,
- "oldfieldtype": "Section Break",
- "options": null,
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "campaign",
+ "fieldtype": "Section Break",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 0,
+ "label": "Campaign",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": null,
+ "oldfieldtype": "Section Break",
+ "options": null,
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "campaign_name",
- "fieldtype": "Data",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 1,
- "label": "Campaign Name",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "campaign_name",
- "oldfieldtype": "Data",
- "options": null,
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": 1,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "campaign_name",
+ "fieldtype": "Data",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 1,
+ "label": "Campaign Name",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "campaign_name",
+ "oldfieldtype": "Data",
+ "options": null,
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": 1,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 0,
- "label": "Naming Series",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": null,
- "oldfieldtype": null,
- "options": "Campaign-.####",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": 0,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 0,
+ "label": "Naming Series",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": null,
+ "oldfieldtype": null,
+ "options": "Campaign-.####",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": 0,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "description",
- "fieldtype": "Text",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 1,
- "label": "Description",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "options": null,
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 1,
+ "label": "Description",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "options": null,
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": "300px"
}
- ],
- "hide_heading": null,
- "hide_toolbar": null,
- "icon": "icon-bullhorn",
- "idx": 1,
- "in_create": null,
- "in_dialog": null,
- "is_submittable": null,
- "is_transaction_doc": null,
- "issingle": null,
- "istable": null,
- "max_attachments": null,
- "menu_index": null,
- "modified": "2014-04-16 12:36:34.606593",
- "modified_by": "Administrator",
- "module": "Selling",
- "name": "Campaign",
- "name_case": null,
- "owner": "Administrator",
- "parent": null,
- "parent_node": null,
- "parentfield": null,
- "parenttype": null,
+ ],
+ "hide_heading": null,
+ "hide_toolbar": null,
+ "icon": "icon-bullhorn",
+ "idx": 1,
+ "in_create": null,
+ "in_dialog": null,
+ "is_submittable": null,
+ "is_transaction_doc": null,
+ "issingle": null,
+ "istable": null,
+ "max_attachments": null,
+ "menu_index": null,
+ "modified": "2014-04-16 12:36:34.606593",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Campaign",
+ "name_case": null,
+ "owner": "Administrator",
+ "parent": null,
+ "parent_node": null,
+ "parentfield": null,
+ "parenttype": null,
"permissions": [
{
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 1,
- "export": null,
- "import": 0,
- "match": null,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 0,
- "restrict": null,
- "restricted": null,
- "role": "Sales Manager",
- "submit": 0,
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "export": null,
+ "import": 0,
+ "match": null,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "restrict": null,
+ "restricted": null,
+ "role": "Sales Manager",
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "email": 1,
- "export": null,
- "import": null,
- "match": null,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "restrict": null,
- "restricted": null,
- "role": "Sales User",
- "submit": 0,
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "export": null,
+ "import": null,
+ "match": null,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "restrict": null,
+ "restricted": null,
+ "role": "Sales User",
+ "submit": 0,
"write": 0
- },
+ },
{
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": null,
- "import": null,
- "match": null,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "restrict": null,
- "restricted": null,
- "role": "Sales Master Manager",
- "submit": 0,
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": null,
+ "import": null,
+ "match": null,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "restrict": null,
+ "restricted": null,
+ "role": "Sales Master Manager",
+ "submit": 0,
"write": 1
}
- ],
- "plugin": null,
- "print_outline": null,
- "read_only": null,
- "read_only_onload": null,
- "search_fields": null,
- "section_style": null,
- "server_code": null,
- "server_code_compiled": null,
- "server_code_core": null,
- "server_code_error": null,
- "show_in_menu": null,
- "smallicon": null,
- "subject": null,
- "tag_fields": null,
- "title_field": null,
- "use_template": null,
+ ],
+ "plugin": null,
+ "print_outline": null,
+ "read_only": null,
+ "read_only_onload": null,
+ "search_fields": null,
+ "server_code": null,
+ "server_code_compiled": null,
+ "server_code_core": null,
+ "server_code_error": null,
+ "show_in_menu": null,
+ "smallicon": null,
+ "subject": null,
+ "tag_fields": null,
+ "title_field": null,
+ "use_template": null,
"version": null
-}
\ No newline at end of file
+}
diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.json b/erpnext/selling/doctype/quotation_item/quotation_item.json
index 4e19ee7..a1807dd 100644
--- a/erpnext/selling/doctype/quotation_item/quotation_item.json
+++ b/erpnext/selling/doctype/quotation_item/quotation_item.json
@@ -1,6 +1,6 @@
{
"autoname": "QUOD/.#####",
- "creation": "2013-03-07 11:42:57.000000",
+ "creation": "2013-03-07 11:42:57",
"docstatus": 0,
"doctype": "DocType",
"fields": [
@@ -231,17 +231,9 @@
"width": "100px"
},
{
- "fieldname": "pricing_rule_for_price",
+ "fieldname": "pricing_rule",
"fieldtype": "Link",
- "label": "Pricing Rule For Price",
- "options": "Pricing Rule",
- "permlevel": 0,
- "read_only": 1
- },
- {
- "fieldname": "pricing_rule_for_discount",
- "fieldtype": "Link",
- "label": "Pricing Rule For Discount",
+ "label": "Pricing Rule",
"options": "Pricing Rule",
"permlevel": 0,
"read_only": 1
@@ -353,9 +345,12 @@
],
"idx": 1,
"istable": 1,
- "modified": "2014-02-28 11:20:34.000000",
+ "modified": "2014-05-28 12:41:40.811916",
"modified_by": "Administrator",
"module": "Selling",
"name": "Quotation Item",
- "owner": "Administrator"
+ "owner": "Administrator",
+ "permissions": [],
+ "sort_field": "modified",
+ "sort_order": "DESC"
}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index dce9916..06eb470 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -89,7 +89,7 @@
var item = frappe.get_doc(cdt, cdn);
if(item.item_code && item.warehouse) {
return this.frm.call({
- method: "erpnext.selling.utils.get_available_qty",
+ method: "erpnext.stock.get_item_details.get_available_qty",
child: item,
args: {
item_code: item.item_code,
diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.json b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
index 9d0ae0e..13ee085 100644
--- a/erpnext/selling/doctype/sales_order_item/sales_order_item.json
+++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.json
@@ -1,6 +1,6 @@
{
"autoname": "SOD/.#####",
- "creation": "2013-03-07 11:42:58.000000",
+ "creation": "2013-03-07 11:42:58",
"docstatus": 0,
"doctype": "DocType",
"fields": [
@@ -217,17 +217,9 @@
"width": "100px"
},
{
- "fieldname": "pricing_rule_for_price",
+ "fieldname": "pricing_rule",
"fieldtype": "Link",
- "label": "Pricing Rule For Price",
- "options": "Pricing Rule",
- "permlevel": 0,
- "read_only": 1
- },
- {
- "fieldname": "pricing_rule_for_discount",
- "fieldtype": "Link",
- "label": "Pricing Rule For Discount",
+ "label": "Pricing Rule",
"options": "Pricing Rule",
"permlevel": 0,
"read_only": 1
@@ -439,9 +431,12 @@
],
"idx": 1,
"istable": 1,
- "modified": "2014-02-28 11:20:05.000000",
+ "modified": "2014-05-27 14:41:14.996650",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order Item",
- "owner": "Administrator"
+ "owner": "Administrator",
+ "permissions": [],
+ "sort_field": "modified",
+ "sort_order": "DESC"
}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/selling_settings/selling_settings.json b/erpnext/selling/doctype/selling_settings/selling_settings.json
index ec3096c..948d6ad 100644
--- a/erpnext/selling/doctype/selling_settings/selling_settings.json
+++ b/erpnext/selling/doctype/selling_settings/selling_settings.json
@@ -1,367 +1,366 @@
{
- "_last_update": null,
- "_user_tags": null,
- "allow_attach": null,
- "allow_copy": null,
- "allow_email": null,
- "allow_import": null,
- "allow_print": null,
- "allow_rename": null,
- "allow_trash": null,
- "autoname": null,
- "change_log": null,
- "client_script": null,
- "client_script_core": null,
- "client_string": null,
- "colour": null,
- "creation": "2013-06-25 10:25:16",
- "custom": null,
- "default_print_format": null,
- "description": "Settings for Selling Module",
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "Other",
- "dt_template": null,
+ "_last_update": null,
+ "_user_tags": null,
+ "allow_attach": null,
+ "allow_copy": null,
+ "allow_email": null,
+ "allow_import": null,
+ "allow_print": null,
+ "allow_rename": null,
+ "allow_trash": null,
+ "autoname": null,
+ "change_log": null,
+ "client_script": null,
+ "client_script_core": null,
+ "client_string": null,
+ "colour": null,
+ "creation": "2013-06-25 10:25:16",
+ "custom": null,
+ "default_print_format": null,
+ "description": "Settings for Selling Module",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Other",
+ "dt_template": null,
"fields": [
{
- "allow_on_submit": null,
- "default": "Customer Name",
- "depends_on": null,
- "description": null,
- "fieldname": "cust_master_name",
- "fieldtype": "Select",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 1,
- "label": "Customer Naming By",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": null,
- "oldfieldtype": null,
- "options": "Customer Name\nNaming Series",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": "Customer Name",
+ "depends_on": null,
+ "description": null,
+ "fieldname": "cust_master_name",
+ "fieldtype": "Select",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 1,
+ "label": "Customer Naming By",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": null,
+ "oldfieldtype": null,
+ "options": "Customer Name\nNaming Series",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "campaign_naming_by",
- "fieldtype": "Select",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 1,
- "label": "Campaign Naming By",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": null,
- "oldfieldtype": null,
- "options": "Campaign Name\nNaming Series",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "campaign_naming_by",
+ "fieldtype": "Select",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 1,
+ "label": "Campaign Naming By",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": null,
+ "oldfieldtype": null,
+ "options": "Campaign Name\nNaming Series",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 1,
- "label": "Default Customer Group",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": null,
- "oldfieldtype": null,
- "options": "Customer Group",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 1,
+ "label": "Default Customer Group",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": null,
+ "oldfieldtype": null,
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "fieldname": "territory",
- "fieldtype": "Link",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 1,
- "label": "Default Territory",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": null,
- "oldfieldtype": null,
- "options": "Territory",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 1,
+ "label": "Default Territory",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": null,
+ "oldfieldtype": null,
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "selling_price_list",
- "fieldtype": "Link",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": 1,
- "label": "Default Price List",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": null,
- "oldfieldtype": null,
- "options": "Price List",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "selling_price_list",
+ "fieldtype": "Link",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": 1,
+ "label": "Default Price List",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": null,
+ "oldfieldtype": null,
+ "options": "Price List",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "column_break_5",
- "fieldtype": "Column Break",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": null,
- "label": null,
- "no_column": null,
- "no_copy": null,
- "oldfieldname": null,
- "oldfieldtype": null,
- "options": null,
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "column_break_5",
+ "fieldtype": "Column Break",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": null,
+ "label": null,
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": null,
+ "oldfieldtype": null,
+ "options": null,
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "so_required",
- "fieldtype": "Select",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": null,
- "label": "Sales Order Required",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": null,
- "oldfieldtype": null,
- "options": "No\nYes",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "so_required",
+ "fieldtype": "Select",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": null,
+ "label": "Sales Order Required",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": null,
+ "oldfieldtype": null,
+ "options": "No\nYes",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "dn_required",
- "fieldtype": "Select",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": null,
- "label": "Delivery Note Required",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": null,
- "oldfieldtype": null,
- "options": "No\nYes",
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "dn_required",
+ "fieldtype": "Select",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": null,
+ "label": "Delivery Note Required",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": null,
+ "oldfieldtype": null,
+ "options": "No\nYes",
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "maintain_same_sales_rate",
- "fieldtype": "Check",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": null,
- "label": "Maintain Same Rate Throughout Sales Cycle",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": null,
- "oldfieldtype": null,
- "options": null,
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "maintain_same_sales_rate",
+ "fieldtype": "Check",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": null,
+ "label": "Maintain Same Rate Throughout Sales Cycle",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": null,
+ "oldfieldtype": null,
+ "options": null,
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
- },
+ },
{
- "allow_on_submit": null,
- "default": null,
- "depends_on": null,
- "description": null,
- "fieldname": "editable_price_list_rate",
- "fieldtype": "Check",
- "hidden": null,
- "ignore_restrictions": null,
- "in_filter": null,
- "in_list_view": null,
- "label": "Allow user to edit Price List Rate in transactions",
- "no_column": null,
- "no_copy": null,
- "oldfieldname": null,
- "oldfieldtype": null,
- "options": null,
- "permlevel": 0,
- "print_hide": null,
- "print_width": null,
- "read_only": null,
- "report_hide": null,
- "reqd": null,
- "search_index": null,
- "set_only_once": null,
- "trigger": null,
+ "allow_on_submit": null,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "fieldname": "editable_price_list_rate",
+ "fieldtype": "Check",
+ "hidden": null,
+ "ignore_restrictions": null,
+ "in_filter": null,
+ "in_list_view": null,
+ "label": "Allow user to edit Price List Rate in transactions",
+ "no_column": null,
+ "no_copy": null,
+ "oldfieldname": null,
+ "oldfieldtype": null,
+ "options": null,
+ "permlevel": 0,
+ "print_hide": null,
+ "print_width": null,
+ "read_only": null,
+ "report_hide": null,
+ "reqd": null,
+ "search_index": null,
+ "set_only_once": null,
+ "trigger": null,
"width": null
}
- ],
- "hide_heading": null,
- "hide_toolbar": null,
- "icon": "icon-cog",
- "idx": 1,
- "in_create": null,
- "in_dialog": null,
- "is_submittable": null,
- "is_transaction_doc": null,
- "issingle": 1,
- "istable": null,
- "max_attachments": null,
- "menu_index": null,
- "modified": "2014-04-16 12:21:36.117261",
- "modified_by": "Administrator",
- "module": "Selling",
- "name": "Selling Settings",
- "name_case": null,
- "owner": "Administrator",
- "parent": null,
- "parent_node": null,
- "parentfield": null,
- "parenttype": null,
+ ],
+ "hide_heading": null,
+ "hide_toolbar": null,
+ "icon": "icon-cog",
+ "idx": 1,
+ "in_create": null,
+ "in_dialog": null,
+ "is_submittable": null,
+ "is_transaction_doc": null,
+ "issingle": 1,
+ "istable": null,
+ "max_attachments": null,
+ "menu_index": null,
+ "modified": "2014-04-16 12:21:36.117261",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Selling Settings",
+ "name_case": null,
+ "owner": "Administrator",
+ "parent": null,
+ "parent_node": null,
+ "parentfield": null,
+ "parenttype": null,
"permissions": [
{
- "amend": null,
- "cancel": null,
- "create": 1,
- "delete": null,
- "email": 1,
- "export": null,
- "import": null,
- "match": null,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": null,
- "restrict": null,
- "restricted": null,
- "role": "System Manager",
- "submit": null,
+ "amend": null,
+ "cancel": null,
+ "create": 1,
+ "delete": null,
+ "email": 1,
+ "export": null,
+ "import": null,
+ "match": null,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": null,
+ "restrict": null,
+ "restricted": null,
+ "role": "System Manager",
+ "submit": null,
"write": 1
}
- ],
- "plugin": null,
- "print_outline": null,
- "read_only": null,
- "read_only_onload": null,
- "search_fields": null,
- "section_style": null,
- "server_code": null,
- "server_code_compiled": null,
- "server_code_core": null,
- "server_code_error": null,
- "show_in_menu": null,
- "smallicon": null,
- "subject": null,
- "tag_fields": null,
- "title_field": null,
- "use_template": null,
+ ],
+ "plugin": null,
+ "print_outline": null,
+ "read_only": null,
+ "read_only_onload": null,
+ "search_fields": null,
+ "server_code": null,
+ "server_code_compiled": null,
+ "server_code_core": null,
+ "server_code_error": null,
+ "show_in_menu": null,
+ "smallicon": null,
+ "subject": null,
+ "tag_fields": null,
+ "title_field": null,
+ "use_template": null,
"version": null
-}
\ No newline at end of file
+}
diff --git a/erpnext/selling/page/sales_analytics/sales_analytics.js b/erpnext/selling/page/sales_analytics/sales_analytics.js
index 25c8f80..3480866 100644
--- a/erpnext/selling/page/sales_analytics/sales_analytics.js
+++ b/erpnext/selling/page/sales_analytics/sales_analytics.js
@@ -1,17 +1,17 @@
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
-frappe.pages['sales-analytics'].onload = function(wrapper) {
+frappe.pages['sales-analytics'].onload = function(wrapper) {
frappe.ui.make_app_page({
parent: wrapper,
title: __('Sales Analytics'),
single_column: true
});
new erpnext.SalesAnalytics(wrapper);
-
+
wrapper.appframe.add_module_icon("Selling")
-
+
}
erpnext.SalesAnalytics = frappe.views.TreeGridReport.extend({
@@ -21,55 +21,55 @@
page: wrapper,
parent: $(wrapper).find('.layout-main'),
appframe: wrapper.appframe,
- doctypes: ["Item", "Item Group", "Customer", "Customer Group", "Company", "Territory",
- "Fiscal Year", "Sales Invoice", "Sales Invoice Item",
- "Sales Order", "Sales Order Item[Sales Analytics]",
+ doctypes: ["Item", "Item Group", "Customer", "Customer Group", "Company", "Territory",
+ "Fiscal Year", "Sales Invoice", "Sales Invoice Item",
+ "Sales Order", "Sales Order Item[Sales Analytics]",
"Delivery Note", "Delivery Note Item[Sales Analytics]"],
tree_grid: { show: true }
});
-
+
this.tree_grids = {
"Customer Group": {
label: __("Customer Group / Customer"),
- show: true,
+ show: true,
item_key: "customer",
- parent_field: "parent_customer_group",
+ parent_field: "parent_customer_group",
formatter: function(item) { return item.name; }
},
"Customer": {
label: __("Customer"),
- show: false,
+ show: false,
item_key: "customer",
formatter: function(item) {
return item.name;
}
- },
+ },
"Item Group": {
label: __("Item"),
- show: true,
- parent_field: "parent_item_group",
+ show: true,
+ parent_field: "parent_item_group",
item_key: "item_code",
formatter: function(item) {
return item.name;
}
- },
+ },
"Item": {
label: __("Item"),
- show: false,
+ show: false,
item_key: "item_code",
formatter: function(item) {
return item.name;
}
- },
+ },
"Territory": {
label: __("Territory / Customer"),
- show: true,
+ show: true,
item_key: "customer",
- parent_field: "parent_territory",
+ parent_field: "parent_territory",
formatter: function(item) {
return item.name;
}
- }
+ }
}
},
setup_columns: function() {
@@ -84,35 +84,38 @@
formatter: this.currency_formatter}
];
- this.make_date_range_columns();
+ this.make_date_range_columns();
this.columns = std_columns.concat(this.columns);
},
filters: [
- {fieldtype:"Select", fieldname: "tree_type", label: __("Tree Type"), options:["Customer Group", "Customer",
+ {fieldtype:"Select", fieldname: "tree_type", label: __("Tree Type"), options:["Customer Group", "Customer",
"Item Group", "Item", "Territory"],
filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me);
}},
- {fieldtype:"Select", fieldname: "based_on", label: __("Based On"), options:["Sales Invoice",
+ {fieldtype:"Select", fieldname: "based_on", label: __("Based On"), options:["Sales Invoice",
"Sales Order", "Delivery Note"]},
- {fieldtype:"Select", fieldname: "value_or_qty", label: __("Value or Qty"), options:["Value", "Quantity"]},
- {fieldtype:"Select", fieldname: "company", label: __("Company"), link:"Company",
- default_value: "Select Company..."},
+ {fieldtype:"Select", fieldname: "value_or_qty", label: __("Value or Qty"),
+ options:[{label: __("Value"), value: "Value"}, {label: __("Quantity"), value: "Quantity"}]},
+ {fieldtype:"Select", fieldname: "company", label: __("Company"), link:"Company",
+ default_value: __("Select Company...")},
{fieldtype:"Date", fieldname: "from_date", label: __("From Date")},
{fieldtype:"Label", fieldname: "to", label: __("To")},
{fieldtype:"Date", fieldname: "to_date", label: __("To Date")},
- {fieldtype:"Select", fieldname: "range", label: __("Range"),
- options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
+ {fieldtype:"Select", label: __("Range"), fieldname: "range",
+ options:[{label: __("Daily"), value: "Daily"}, {label: __("Weekly"), value: "Weekly"},
+ {label: __("Monthly"), value: "Monthly"}, {label: __("Quarterly"), value: "Quarterly"},
+ {label: __("Yearly"), value: "Yearly"}]},
{fieldtype:"Button", fieldname: "refresh", label: __("Refresh"), icon:"icon-refresh"},
{fieldtype:"Button", fieldname: "reset_filters", label: __("Reset Filters"), icon:"icon-filter"}
],
setup_filters: function() {
var me = this;
this._super();
-
+
this.trigger_refresh_on_change(["value_or_qty", "tree_type", "based_on", "company"]);
- this.show_zero_check()
+ this.show_zero_check()
this.setup_plot_check();
},
init_filter_values: function() {
@@ -125,14 +128,14 @@
// add 'Not Set' Customer & Item
// (Customer / Item are not mandatory!!)
frappe.report_dump.data["Customer"].push({
- name: "Not Set",
+ name: "Not Set",
parent_customer_group: "All Customer Groups",
parent_territory: "All Territories",
id: "Not Set",
});
frappe.report_dump.data["Item"].push({
- name: "Not Set",
+ name: "Not Set",
parent_item_group: "All Item Groups",
id: "Not Set",
});
@@ -141,7 +144,7 @@
if (!this.tl || !this.tl[this.based_on]) {
this.make_transaction_list(this.based_on, this.based_on + " Item");
}
-
+
if(!this.data || me.item_type != me.tree_type) {
if(me.tree_type=='Customer') {
var items = frappe.report_dump.data["Customer"];
@@ -159,7 +162,7 @@
me.parent_map = {};
me.item_by_name = {};
me.data = [];
-
+
$.each(items, function(i, v) {
var d = copy_dict(v);
@@ -169,20 +172,20 @@
me.parent_map[d.name] = d[me.tree_grid.parent_field];
}
me.reset_item_values(d);
- });
-
+ });
+
this.set_indent();
-
+
} else {
// otherwise, only reset values
$.each(this.data, function(i, d) {
me.reset_item_values(d);
});
}
-
+
this.prepare_balances();
if(me.tree_grid.show) {
- this.set_totals(false);
+ this.set_totals(false);
this.update_groups();
} else {
this.set_totals(true);
@@ -194,14 +197,14 @@
var from_date = dateutil.str_to_obj(this.from_date);
var to_date = dateutil.str_to_obj(this.to_date);
var is_val = this.value_or_qty == 'Value';
-
+
$.each(this.tl[this.based_on], function(i, tl) {
- if (me.is_default('company') ? true : tl.company === me.company) {
+ if (me.is_default('company') ? true : tl.company === me.company) {
var posting_date = dateutil.str_to_obj(tl.posting_date);
if (posting_date >= from_date && posting_date <= to_date) {
- var item = me.item_by_name[tl[me.tree_grid.item_key]] ||
+ var item = me.item_by_name[tl[me.tree_grid.item_key]] ||
me.item_by_name['Not Set'];
- item[me.column_map[tl.posting_date].field] += (is_val ? tl.amount : tl.qty);
+ item[me.column_map[tl.posting_date].field] += (is_val ? tl.base_amount : tl.qty);
}
}
});
@@ -213,10 +216,10 @@
var parent = me.parent_map[item.name];
while(parent) {
parent_group = me.item_by_name[parent];
-
+
$.each(me.columns, function(c, col) {
if (col.formatter == me.currency_formatter) {
- parent_group[col.field] =
+ parent_group[col.field] =
flt(parent_group[col.field])
+ flt(item[col.field]);
}
@@ -228,10 +231,10 @@
set_totals: function(sort) {
var me = this;
var checked = false;
- $.each(this.data, function(i, d) {
+ $.each(this.data, function(i, d) {
d.total = 0.0;
$.each(me.columns, function(i, col) {
- if(col.formatter==me.currency_formatter && !col.hidden && col.field!="total")
+ if(col.formatter==me.currency_formatter && !col.hidden && col.field!="total")
d.total += d[col.field];
if(d.checked) checked = true;
})
@@ -244,7 +247,7 @@
}
},
get_plot_points: function(item, col, idx) {
- return [[dateutil.str_to_obj(col.id).getTime(), item[col.field]],
+ return [[dateutil.str_to_obj(col.id).getTime(), item[col.field]],
[dateutil.user_to_obj(col.name).getTime(), item[col.field]]];
}
});
diff --git a/erpnext/selling/page/sales_browser/sales_browser.js b/erpnext/selling/page/sales_browser/sales_browser.js
index 950e3f6..a8fd464 100644
--- a/erpnext/selling/page/sales_browser/sales_browser.js
+++ b/erpnext/selling/page/sales_browser/sales_browser.js
@@ -147,10 +147,10 @@
callback: function(r) {
if(!r.exc) {
d.hide();
- node.reload();
- if(!node.expanded) {
+ if(node.expanded) {
node.toggle_node();
}
+ node.reload();
}
}
});
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index 1e9643a..260fbe5 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -104,7 +104,8 @@
},
customer: function() {
- erpnext.utils.get_party_details(this.frm);
+ var me = this;
+ erpnext.utils.get_party_details(this.frm, null, null, function(){me.apply_pricing_rule()});
},
customer_address: function() {
@@ -119,6 +120,14 @@
erpnext.utils.get_contact_details(this.frm);
},
+ sales_partner: function() {
+ this.apply_pricing_rule();
+ },
+
+ campaign: function() {
+ this.apply_pricing_rule();
+ },
+
barcode: function(doc, cdt, cdn) {
this.item_code(doc, cdt, cdn);
},
@@ -206,7 +215,7 @@
var item = frappe.get_doc(cdt, cdn);
if(item.item_code && item.warehouse) {
return this.frm.call({
- method: "erpnext.selling.utils.get_available_qty",
+ method: "erpnext.stock.get_item_details.get_available_qty",
child: item,
args: {
item_code: item.item_code,
diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py
index 2c019d9..789a7f1 100644
--- a/erpnext/setup/doctype/company/company.py
+++ b/erpnext/setup/doctype/company/company.py
@@ -91,6 +91,8 @@
for d in self.fld_dict.keys():
account.set(d, (d == 'parent_account' and lst[self.fld_dict[d]]) and lst[self.fld_dict[d]] +' - '+ self.abbr or lst[self.fld_dict[d]])
+ if not account.parent_account:
+ account.ignore_mandatory = True
account.insert()
def set_default_accounts(self):
diff --git a/erpnext/startup/boot.py b/erpnext/startup/boot.py
index 1d5a6d2..c7acba7 100644
--- a/erpnext/startup/boot.py
+++ b/erpnext/startup/boot.py
@@ -8,39 +8,68 @@
def boot_session(bootinfo):
"""boot session - send website info if guest"""
import frappe
-
- bootinfo['custom_css'] = frappe.db.get_value('Style Settings', None, 'custom_css') or ''
- bootinfo['website_settings'] = frappe.get_doc('Website Settings')
+
+ bootinfo.custom_css = frappe.db.get_value('Style Settings', None, 'custom_css') or ''
+ bootinfo.website_settings = frappe.get_doc('Website Settings')
if frappe.session['user']!='Guest':
- bootinfo['letter_heads'] = get_letter_heads()
-
- load_country_and_currency(bootinfo)
-
- bootinfo['notification_settings'] = frappe.get_doc("Notification Control",
- "Notification Control")
-
- # if no company, show a dialog box to create a new company
- bootinfo["customer_count"] = frappe.db.sql("""select count(*) from tabCustomer""")[0][0]
+ bootinfo.letter_heads = get_letter_heads()
- if not bootinfo["customer_count"]:
- bootinfo['setup_complete'] = frappe.db.sql("""select name from
+ update_page_info(bootinfo)
+
+ load_country_and_currency(bootinfo)
+
+ bootinfo.notification_settings = frappe.get_doc("Notification Control",
+ "Notification Control")
+
+ # if no company, show a dialog box to create a new company
+ bootinfo.customer_count = frappe.db.sql("""select count(*) from tabCustomer""")[0][0]
+
+ if not bootinfo.customer_count:
+ bootinfo.setup_complete = frappe.db.sql("""select name from
tabCompany limit 1""") and 'Yes' or 'No'
-
- bootinfo['docs'] += frappe.db.sql("""select name, default_currency, cost_center
+
+ bootinfo.docs += frappe.db.sql("""select name, default_currency, cost_center
from `tabCompany`""", as_dict=1, update={"doctype":":Company"})
def load_country_and_currency(bootinfo):
country = frappe.db.get_default("country")
if country and frappe.db.exists("Country", country):
- bootinfo["docs"] += [frappe.get_doc("Country", country)]
-
- bootinfo["docs"] += frappe.db.sql("""select * from tabCurrency
+ bootinfo.docs += [frappe.get_doc("Country", country)]
+
+ bootinfo.docs += frappe.db.sql("""select * from tabCurrency
where ifnull(enabled,0)=1""", as_dict=1, update={"doctype":":Currency"})
def get_letter_heads():
import frappe
- ret = frappe.db.sql("""select name, content from `tabLetter Head`
+ ret = frappe.db.sql("""select name, content from `tabLetter Head`
where ifnull(disabled,0)=0""")
return dict(ret)
-
+
+def update_page_info(bootinfo):
+ bootinfo.page_info.update({
+ "Chart of Accounts": {
+ "title": "Chart of Accounts",
+ "route": "Accounts Browser/Account"
+ },
+ "Chart of Cost Centers": {
+ "title": "Chart of Cost Centers",
+ "route": "Accounts Browser/Cost Center"
+ },
+ "Item Group Tree": {
+ "title": "Item Group Tree",
+ "route": "Sales Browser/Item Group"
+ },
+ "Customer Group Tree": {
+ "title": "Customer Group Tree",
+ "route": "Sales Browser/Customer Group"
+ },
+ "Territory Tree": {
+ "title": "Territory Tree",
+ "route": "Sales Browser/Territory"
+ },
+ "Sales Person Tree": {
+ "title": "Sales Person Tree",
+ "route": "Sales Browser/Sales Person"
+ }
+ })
diff --git a/erpnext/startup/report_data_map.py b/erpnext/startup/report_data_map.py
index e614c71..ce71310 100644
--- a/erpnext/startup/report_data_map.py
+++ b/erpnext/startup/report_data_map.py
@@ -18,14 +18,14 @@
# Accounts
"Account": {
- "columns": ["name", "parent_account", "lft", "rgt", "report_type",
+ "columns": ["name", "parent_account", "lft", "rgt", "report_type",
"company", "group_or_ledger"],
"conditions": ["docstatus < 2"],
"order_by": "lft",
"links": {
"company": ["Company", "name"],
}
-
+
},
"Cost Center": {
"columns": ["name", "lft", "rgt"],
@@ -33,7 +33,7 @@
"order_by": "lft"
},
"GL Entry": {
- "columns": ["name", "account", "posting_date", "cost_center", "debit", "credit",
+ "columns": ["name", "account", "posting_date", "cost_center", "debit", "credit",
"is_opening", "company", "voucher_type", "voucher_no", "remarks"],
"order_by": "posting_date, account",
"links": {
@@ -45,8 +45,8 @@
# Stock
"Item": {
- "columns": ["name", "if(item_name=name, '', item_name) as item_name", "description",
- "item_group as parent_item_group", "stock_uom", "brand", "valuation_method",
+ "columns": ["name", "if(item_name=name, '', item_name) as item_name", "description",
+ "item_group as parent_item_group", "stock_uom", "brand", "valuation_method",
"re_order_level", "re_order_qty"],
# "conditions": ["docstatus < 2"],
"order_by": "name",
@@ -76,7 +76,7 @@
"order_by": "name"
},
"Stock Ledger Entry": {
- "columns": ["name", "posting_date", "posting_time", "item_code", "warehouse",
+ "columns": ["name", "posting_date", "posting_time", "item_code", "warehouse",
"actual_qty as qty", "voucher_type", "voucher_no", "project",
"ifnull(incoming_rate,0) as incoming_rate", "stock_uom", "serial_no"],
"order_by": "posting_date, posting_time, name",
@@ -98,8 +98,8 @@
"order_by": "posting_date, posting_time, name",
},
"Production Order": {
- "columns": ["name", "production_item as item_code",
- "(ifnull(qty, 0) - ifnull(produced_qty, 0)) as qty",
+ "columns": ["name", "production_item as item_code",
+ "(ifnull(qty, 0) - ifnull(produced_qty, 0)) as qty",
"fg_warehouse as warehouse"],
"conditions": ["docstatus=1", "status != 'Stopped'", "ifnull(fg_warehouse, '')!=''",
"ifnull(qty, 0) > ifnull(produced_qty, 0)"],
@@ -109,7 +109,7 @@
},
},
"Material Request Item": {
- "columns": ["item.name as name", "item_code", "warehouse",
+ "columns": ["item.name as name", "item_code", "warehouse",
"(ifnull(qty, 0) - ifnull(ordered_qty, 0)) as qty"],
"from": "`tabMaterial Request Item` item, `tabMaterial Request` main",
"conditions": ["item.parent = main.name", "main.docstatus=1", "main.status != 'Stopped'",
@@ -120,21 +120,21 @@
},
},
"Purchase Order Item": {
- "columns": ["item.name as name", "item_code", "warehouse",
+ "columns": ["item.name as name", "item_code", "warehouse",
"(ifnull(qty, 0) - ifnull(received_qty, 0)) as qty"],
"from": "`tabPurchase Order Item` item, `tabPurchase Order` main",
- "conditions": ["item.parent = main.name", "main.docstatus=1", "main.status != 'Stopped'",
+ "conditions": ["item.parent = main.name", "main.docstatus=1", "main.status != 'Stopped'",
"ifnull(warehouse, '')!=''", "ifnull(qty, 0) > ifnull(received_qty, 0)"],
"links": {
"item_code": ["Item", "name"],
"warehouse": ["Warehouse", "name"]
},
},
-
+
"Sales Order Item": {
"columns": ["item.name as name", "item_code", "(ifnull(qty, 0) - ifnull(delivered_qty, 0)) as qty", "warehouse"],
"from": "`tabSales Order Item` item, `tabSales Order` main",
- "conditions": ["item.parent = main.name", "main.docstatus=1", "main.status != 'Stopped'",
+ "conditions": ["item.parent = main.name", "main.docstatus=1", "main.status != 'Stopped'",
"ifnull(warehouse, '')!=''", "ifnull(qty, 0) > ifnull(delivered_qty, 0)"],
"links": {
"item_code": ["Item", "name"],
@@ -144,7 +144,7 @@
# Sales
"Customer": {
- "columns": ["name", "if(customer_name=name, '', customer_name) as customer_name",
+ "columns": ["name", "if(customer_name=name, '', customer_name) as customer_name",
"customer_group as parent_customer_group", "territory as parent_territory"],
"conditions": ["docstatus < 2"],
"order_by": "name",
@@ -218,7 +218,7 @@
}
},
"Supplier": {
- "columns": ["name", "if(supplier_name=name, '', supplier_name) as supplier_name",
+ "columns": ["name", "if(supplier_name=name, '', supplier_name) as supplier_name",
"supplier_type as parent_supplier_type"],
"conditions": ["docstatus < 2"],
"order_by": "name",
@@ -291,5 +291,5 @@
"conditions": ["docstatus < 2"],
"order_by": "creation"
}
-
+
}
diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
index e093def..13307ef 100644
--- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
+++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json
@@ -1,6 +1,6 @@
{
"autoname": "DND/.#######",
- "creation": "2013-04-22 13:15:44.000000",
+ "creation": "2013-04-22 13:15:44",
"docstatus": 0,
"doctype": "DocType",
"fields": [
@@ -225,17 +225,9 @@
"width": "100px"
},
{
- "fieldname": "pricing_rule_for_price",
+ "fieldname": "pricing_rule",
"fieldtype": "Link",
- "label": "Pricing Rule For Price",
- "options": "Pricing Rule",
- "permlevel": 0,
- "read_only": 1
- },
- {
- "fieldname": "pricing_rule_for_discount",
- "fieldtype": "Link",
- "label": "Pricing Rule For Discount",
+ "label": "Pricing Rule",
"options": "Pricing Rule",
"permlevel": 0,
"read_only": 1
@@ -437,9 +429,12 @@
],
"idx": 1,
"istable": 1,
- "modified": "2014-02-28 11:20:58.000000",
+ "modified": "2014-05-28 12:42:05.788579",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note Item",
- "owner": "Administrator"
+ "owner": "Administrator",
+ "permissions": [],
+ "sort_field": "modified",
+ "sort_order": "DESC"
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index 0e12cd2..92c16f8 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -441,16 +441,6 @@
},
{
"depends_on": "eval:doc.is_purchase_item==\"Yes\"",
- "fieldname": "standard_rate",
- "fieldtype": "Float",
- "label": "Standard Rate",
- "oldfieldname": "standard_rate",
- "oldfieldtype": "Currency",
- "permlevel": 0,
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
"fieldname": "column_break2",
"fieldtype": "Column Break",
"oldfieldtype": "Column Break",
@@ -835,7 +825,7 @@
"icon": "icon-tag",
"idx": 1,
"max_attachments": 1,
- "modified": "2014-05-21 15:37:30.124881",
+ "modified": "2014-05-29 16:05:53.126214",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 104f905..6d6db94 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -137,7 +137,6 @@
bom = frappe.db.sql("""select name from `tabBOM` where item = %s
and is_active = 1""", (self.name,))
if bom and bom[0][0]:
- print self.name
frappe.throw(_("""Allow Bill of Materials should be 'Yes'. Because one or many active BOMs present for this item"""))
def fill_customer_code(self):
diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.py b/erpnext/stock/doctype/packing_slip/packing_slip.py
index e3d0199..63657b7 100644
--- a/erpnext/stock/doctype/packing_slip/packing_slip.py
+++ b/erpnext/stock/doctype/packing_slip/packing_slip.py
@@ -141,7 +141,7 @@
note
"""
recommended_case_no = frappe.db.sql("""SELECT MAX(to_case_no) FROM `tabPacking Slip`
- WHERE delivery_note = %(delivery_note)s AND docstatus=1""", self.as_dict())
+ WHERE delivery_note = %s AND docstatus=1""", self.delivery_note)
return cint(recommended_case_no[0][0]) + 1
diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
index 0c8100c..548a7da 100755
--- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
+++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json
@@ -1,6 +1,6 @@
{
"autoname": "GRND/.#######",
- "creation": "2013-05-24 19:29:10.000000",
+ "creation": "2013-05-24 19:29:10",
"docstatus": 0,
"doctype": "DocType",
"fields": [
@@ -256,17 +256,9 @@
"width": "100px"
},
{
- "fieldname": "pricing_rule_for_price",
+ "fieldname": "pricing_rule",
"fieldtype": "Link",
- "label": "Pricing Rule For Price",
- "options": "Pricing Rule",
- "permlevel": 0,
- "read_only": 1
- },
- {
- "fieldname": "pricing_rule_for_discount",
- "fieldtype": "Link",
- "label": "Pricing Rule For Discount",
+ "label": "Pricing Rule",
"options": "Pricing Rule",
"permlevel": 0,
"read_only": 1
@@ -553,9 +545,12 @@
],
"idx": 1,
"istable": 1,
- "modified": "2014-02-28 11:27:09.000000",
+ "modified": "2014-05-28 12:43:16.669040",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt Item",
- "owner": "Administrator"
+ "owner": "Administrator",
+ "permissions": [],
+ "sort_field": "modified",
+ "sort_order": "DESC"
}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 900474b..ac81f88 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -41,6 +41,7 @@
self.validate_return_reference_doc()
self.validate_with_material_request()
self.validate_fiscal_year()
+ self.validate_valuation_rate()
self.set_total_amount()
def on_submit(self):
@@ -170,11 +171,26 @@
frappe.throw(_("Stock Entries already created for Production Order ")
+ self.production_order + ":" + ", ".join(other_ste), DuplicateEntryForProductionOrderError)
+ def validate_valuation_rate(self):
+ if self.purpose == "Manufacture/Repack":
+ valuation_at_source, valuation_at_target = 0, 0
+ for d in self.get("mtn_details"):
+ if d.s_warehouse and not d.t_warehouse:
+ valuation_at_source += flt(d.amount)
+ if d.t_warehouse and not d.s_warehouse:
+ valuation_at_target += flt(d.amount)
+
+ if valuation_at_target < valuation_at_source:
+ frappe.throw(_("Total valuation for manufactured or repacked item(s) can not be less than total valuation of raw materials"))
+
def set_total_amount(self):
self.total_amount = sum([flt(item.amount) for item in self.get("mtn_details")])
def get_stock_and_rate(self):
"""get stock and incoming rate on posting date"""
+
+ raw_material_cost = 0.0
+
for d in self.get('mtn_details'):
args = frappe._dict({
"item_code": d.item_code,
@@ -182,17 +198,28 @@
"posting_date": self.posting_date,
"posting_time": self.posting_time,
"qty": d.s_warehouse and -1*d.transfer_qty or d.transfer_qty,
- "serial_no": d.serial_no,
- "bom_no": d.bom_no,
+ "serial_no": d.serial_no
})
# get actual stock at source warehouse
d.actual_qty = get_previous_sle(args).get("qty_after_transaction") or 0
# get incoming rate
- if not flt(d.incoming_rate):
- d.incoming_rate = self.get_incoming_rate(args)
+ if not d.bom_no:
+ if not flt(d.incoming_rate):
+ d.incoming_rate = self.get_incoming_rate(args)
- d.amount = flt(d.transfer_qty) * flt(d.incoming_rate)
+ d.amount = flt(d.transfer_qty) * flt(d.incoming_rate)
+ raw_material_cost += flt(d.amount)
+
+ # set incoming rate for fg item
+ if self.production_order and self.purpose == "Manufacture/Repack":
+ for d in self.get("mtn_details"):
+ if d.bom_no:
+ if not flt(d.incoming_rate):
+ bom = frappe.db.get_value("BOM", d.bom_no, ["operating_cost", "quantity"], as_dict=1)
+ operation_cost_per_unit = flt(bom.operating_cost) / flt(bom.quantity)
+ d.incoming_rate = operation_cost_per_unit + (raw_material_cost / flt(d.transfer_qty))
+ d.amount = flt(d.transfer_qty) * flt(d.incoming_rate)
def get_incoming_rate(self, args):
incoming_rate = 0
@@ -270,8 +297,8 @@
frappe.DoesNotExistError)
# validate quantity <= ref item's qty - qty already returned
- ref_item = ref.doc.getone({"item_code": item.item_code})
- returnable_qty = ref_item.qty - flt(already_returned_item_qty.get(item.item_code))
+ ref_item_qty = sum([flt(d.qty) for d in ref.doc.get({"item_code": item.item_code})])
+ returnable_qty = ref_item_qty - flt(already_returned_item_qty.get(item.item_code))
if not returnable_qty:
frappe.throw(_("Item {0} has already been returned").format(item.item_code), StockOverReturnError)
elif item.transfer_qty > returnable_qty:
@@ -365,17 +392,18 @@
ret.update(stock_and_rate)
return ret
- def get_uom_details(self, arg = ''):
- arg, ret = eval(arg), {}
- uom = frappe.db.sql("""select conversion_factor from `tabUOM Conversion Detail`
- where parent = %s and uom = %s""", (arg['item_code'], arg['uom']), as_dict = 1)
- if not uom or not flt(uom[0].conversion_factor):
- frappe.msgprint(_("UOM coversion factor required for UOM {0} in Item {1}").format(arg["uom"], arg["item_code"]))
+ def get_uom_details(self, args):
+ conversion_factor = frappe.db.get_value("UOM Conversion Detail", {"parent": args.get("item_code"),
+ "uom": args.get("uom")}, "conversion_factor")
+
+ if not conversion_factor:
+ frappe.msgprint(_("UOM coversion factor required for UOM: {0} in Item: {1}")
+ .format(args.get("uom"), args.get("item_code")))
ret = {'uom' : ''}
else:
ret = {
- 'conversion_factor' : flt(uom[0]['conversion_factor']),
- 'transfer_qty' : flt(arg['qty']) * flt(uom[0]['conversion_factor']),
+ 'conversion_factor' : flt(conversion_factor),
+ 'transfer_qty' : flt(args.get("qty")) * flt(conversion_factor)
}
return ret
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
index 35030a6..78cf194 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
@@ -11,8 +11,11 @@
from erpnext.controllers.stock_controller import StockController
class StockReconciliation(StockController):
- def validate(self):
+ def __init__(self, arg1, arg2=None):
+ super(StockReconciliation, self).__init__(arg1, arg2)
self.head_row = ["Item Code", "Warehouse", "Quantity", "Valuation Rate"]
+
+ def validate(self):
self.entries = []
self.validate_data()
@@ -300,4 +303,5 @@
@frappe.whitelist()
def upload():
from frappe.utils.datautils import read_csv_content_from_uploaded_file
- return read_csv_content_from_uploaded_file()
+ csv_content = read_csv_content_from_uploaded_file()
+ return filter(lambda x: x and any(x), csv_content)
diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py
index cc61d56..2b68928 100644
--- a/erpnext/stock/doctype/warehouse/warehouse.py
+++ b/erpnext/stock/doctype/warehouse/warehouse.py
@@ -38,8 +38,7 @@
def create_account_head(self):
if cint(frappe.defaults.get_global_default("auto_accounting_for_stock")):
if not frappe.db.get_value("Account", {"account_type": "Warehouse",
- "master_name": self.name}) and not frappe.db.get_value("Account",
- {"account_name": self.warehouse_name}):
+ "master_name": self.name}):
if self.get("__islocal") or not frappe.db.get_value(
"Stock Ledger Entry", {"warehouse": self.name}):
self.validate_parent_account()
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index f9c7526..9c251b8 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -68,7 +68,12 @@
if args.transaction_type == "selling" and cint(args.is_pos):
out.update(get_pos_settings_item_details(args.company, args))
- apply_pricing_rule(out, args)
+ # update args with out, if key or value not exists
+ for key, value in out.iteritems():
+ if args.get(key) is None:
+ args[key] = value
+
+ out.update(apply_pricing_rule(args))
if args.get("doctype") in ("Sales Invoice", "Delivery Note"):
if item_doc.has_serial_no == "Yes" and not args.serial_no:
@@ -243,36 +248,52 @@
return pos_settings and pos_settings[0] or None
-def apply_pricing_rule(out, args):
- args_dict = frappe._dict().update(args)
- args_dict.update(out)
- all_pricing_rules = get_pricing_rules(args_dict)
+@frappe.whitelist()
+def apply_pricing_rule(args):
+ if isinstance(args, basestring):
+ args = json.loads(args)
- rule_for_price = False
- for rule_for in ["price", "discount_percentage"]:
- pricing_rules = filter(lambda x: x[rule_for] > 0.0, all_pricing_rules)
- if rule_for_price:
- pricing_rules = filter(lambda x: not x["for_price_list"], pricing_rules)
+ args = frappe._dict(args)
+ out = frappe._dict()
+ if not args.get("item_code"): return
- pricing_rule = filter_pricing_rules(args_dict, pricing_rules)
+ if not args.get("item_group") or not args.get("brand"):
+ args.item_group, args.brand = frappe.db.get_value("Item",
+ args.item_code, ["item_group", "brand"])
- if pricing_rule:
- if rule_for == "discount_percentage":
- out["discount_percentage"] = pricing_rule["discount_percentage"]
- out["pricing_rule_for_discount"] = pricing_rule["name"]
- else:
- out["base_price_list_rate"] = pricing_rule["price"]
- out["price_list_rate"] = pricing_rule["price"] * \
- flt(args_dict.plc_conversion_rate) / flt(args_dict.conversion_rate)
- out["pricing_rule_for_price"] = pricing_rule["name"]
- rule_for_price = True
+ if args.get("customer") and (not args.get("customer_group") or not args.get("territory")):
+ args.customer_group, args.territory = frappe.db.get_value("Customer",
+ args.customer, ["customer_group", "territory"])
-def get_pricing_rules(args_dict):
+ if args.get("supplier") and not args.get("supplier_type"):
+ args.supplier_type = frappe.db.get_value("Supplier", args.supplier, "supplier_type")
+
+ pricing_rules = get_pricing_rules(args)
+
+ pricing_rule = filter_pricing_rules(args, pricing_rules)
+
+ if pricing_rule:
+ out.pricing_rule = pricing_rule.name
+ if pricing_rule.price_or_discount == "Price":
+ out.base_price_list_rate = pricing_rule.price
+ out.price_list_rate = pricing_rule.price*flt(args.plc_conversion_rate)/flt(args.conversion_rate)
+ out.base_rate = out.base_price_list_rate
+ out.rate = out.price_list_rate
+ out.discount_percentage = 0.0
+ else:
+ out.discount_percentage = pricing_rule.discount_percentage
+ else:
+ out.pricing_rule = None
+
+ return out
+
+
+def get_pricing_rules(args):
def _get_tree_conditions(doctype, allow_blank=True):
field = frappe.scrub(doctype)
condition = ""
- if args_dict.get(field):
- lft, rgt = frappe.db.get_value(doctype, args_dict[field], ["lft", "rgt"])
+ if args.get(field):
+ lft, rgt = frappe.db.get_value(doctype, args[field], ["lft", "rgt"])
parent_groups = frappe.db.sql_list("""select name from `tab%s`
where lft<=%s and rgt>=%s""" % (doctype, '%s', '%s'), (lft, rgt))
@@ -284,8 +305,8 @@
conditions = ""
- for field in ["customer", "supplier", "supplier_type", "campaign", "sales_partner"]:
- if args_dict.get(field):
+ for field in ["company", "customer", "supplier", "supplier_type", "campaign", "sales_partner"]:
+ if args.get(field):
conditions += " and ifnull("+field+", '') in (%("+field+")s, '')"
else:
conditions += " and ifnull("+field+", '') = ''"
@@ -297,8 +318,7 @@
conditions += " and ifnull(for_price_list, '') in (%(price_list)s, '')"
-
- if args_dict.get("transaction_date"):
+ if args.get("transaction_date"):
conditions += """ and %(transaction_date)s between ifnull(valid_from, '2000-01-01')
and ifnull(valid_upto, '2500-12-31')"""
@@ -307,13 +327,13 @@
and docstatus < 2 and ifnull(disable, 0) = 0 {conditions}
order by priority desc, name desc""".format(
item_group_condition=_get_tree_conditions("Item Group", False), conditions=conditions),
- args_dict, as_dict=1)
+ args, as_dict=1)
-def filter_pricing_rules(args_dict, pricing_rules):
+def filter_pricing_rules(args, pricing_rules):
# filter for qty
- if pricing_rules and args_dict.get("qty"):
- pricing_rules = filter(lambda x: (args_dict.qty>=flt(x.min_qty)
- and (args_dict.qty<=x.max_qty if x.max_qty else True)), pricing_rules)
+ if pricing_rules and args.get("qty"):
+ pricing_rules = filter(lambda x: (args.qty>=flt(x.min_qty)
+ and (args.qty<=x.max_qty if x.max_qty else True)), pricing_rules)
# find pricing rule with highest priority
if pricing_rules:
@@ -323,17 +343,23 @@
# apply internal priority
all_fields = ["item_code", "item_group", "brand", "customer", "customer_group", "territory",
- "supplier", "supplier_type", "campaign", "for_price_list", "sales_partner"]
+ "supplier", "supplier_type", "campaign", "sales_partner"]
if len(pricing_rules) > 1:
for field_set in [["item_code", "item_group", "brand"],
["customer", "customer_group", "territory"], ["supplier", "supplier_type"]]:
remaining_fields = list(set(all_fields) - set(field_set))
if if_all_rules_same(pricing_rules, remaining_fields):
- pricing_rules = apply_internal_priority(pricing_rules, field_set, args_dict)
+ pricing_rules = apply_internal_priority(pricing_rules, field_set, args)
break
if len(pricing_rules) > 1:
+ price_or_discount = list(set([d.price_or_discount for d in pricing_rules]))
+ if len(price_or_discount) == 1 and price_or_discount[0] == "Discount Percentage":
+ pricing_rules = filter(lambda x: x.for_price_list==args.price_list, pricing_rules) \
+ or pricing_rules
+
+ if len(pricing_rules) > 1:
frappe.throw(_("Multiple Price Rule exists with same criteria, please resolve \
conflict by assigning priority. Price Rules: {0}")
.format("\n".join([d.name for d in pricing_rules])), MultiplePricingRuleConflict)
@@ -350,11 +376,11 @@
return all_rules_same
-def apply_internal_priority(pricing_rules, field_set, args_dict):
+def apply_internal_priority(pricing_rules, field_set, args):
filtered_rules = []
for field in field_set:
- if args_dict.get(field):
- filtered_rules = filter(lambda x: x[field]==args_dict[field], pricing_rules)
+ if args.get(field):
+ filtered_rules = filter(lambda x: x[field]==args[field], pricing_rules)
if filtered_rules: break
return filtered_rules or pricing_rules
diff --git a/erpnext/stock/page/stock_ageing/stock_ageing.js b/erpnext/stock/page/stock_ageing/stock_ageing.js
index c16e2ec..f774010 100644
--- a/erpnext/stock/page/stock_ageing/stock_ageing.js
+++ b/erpnext/stock/page/stock_ageing/stock_ageing.js
@@ -60,7 +60,7 @@
options: ["Average Age", "Earliest", "Latest"]},
{fieldtype:"Date", label: __("To Date")},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
- {fieldtype:"Button", label: __("Reset Filters")}
+ {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
],
setup_filters: function() {
var me = this;
diff --git a/erpnext/stock/page/stock_balance/stock_balance.js b/erpnext/stock/page/stock_balance/stock_balance.js
index 52e73f1..0503c8b 100644
--- a/erpnext/stock/page/stock_balance/stock_balance.js
+++ b/erpnext/stock/page/stock_balance/stock_balance.js
@@ -3,18 +3,18 @@
frappe.require("assets/erpnext/js/stock_analytics.js");
-frappe.pages['stock-balance'].onload = function(wrapper) {
+frappe.pages['stock-balance'].onload = function(wrapper) {
frappe.ui.make_app_page({
parent: wrapper,
title: __('Stock Balance'),
single_column: true
});
-
+
new erpnext.StockBalance(wrapper);
-
+
wrapper.appframe.add_module_icon("Stock")
-
+
}
erpnext.StockBalance = erpnext.StockAnalytics.extend({
@@ -30,59 +30,61 @@
{id: "name", name: __("Item"), field: "name", width: 300,
formatter: this.tree_formatter},
{id: "item_name", name: __("Item Name"), field: "item_name", width: 100},
- {id: "description", name: __("Description"), field: "description", width: 200,
+ {id: "description", name: __("Description"), field: "description", width: 200,
formatter: this.text_formatter},
{id: "brand", name: __("Brand"), field: "brand", width: 100},
{id: "stock_uom", name: __("UOM"), field: "stock_uom", width: 100},
- {id: "opening_qty", name: __("Opening Qty"), field: "opening_qty", width: 100,
+ {id: "opening_qty", name: __("Opening Qty"), field: "opening_qty", width: 100,
formatter: this.currency_formatter},
- {id: "inflow_qty", name: __("In Qty"), field: "inflow_qty", width: 100,
+ {id: "inflow_qty", name: __("In Qty"), field: "inflow_qty", width: 100,
formatter: this.currency_formatter},
- {id: "outflow_qty", name: __("Out Qty"), field: "outflow_qty", width: 100,
+ {id: "outflow_qty", name: __("Out Qty"), field: "outflow_qty", width: 100,
formatter: this.currency_formatter},
- {id: "closing_qty", name: __("Closing Qty"), field: "closing_qty", width: 100,
+ {id: "closing_qty", name: __("Closing Qty"), field: "closing_qty", width: 100,
formatter: this.currency_formatter},
-
- {id: "opening_value", name: __("Opening Value"), field: "opening_value", width: 100,
+
+ {id: "opening_value", name: __("Opening Value"), field: "opening_value", width: 100,
formatter: this.currency_formatter},
- {id: "inflow_value", name: __("In Value"), field: "inflow_value", width: 100,
+ {id: "inflow_value", name: __("In Value"), field: "inflow_value", width: 100,
formatter: this.currency_formatter},
- {id: "outflow_value", name: __("Out Value"), field: "outflow_value", width: 100,
+ {id: "outflow_value", name: __("Out Value"), field: "outflow_value", width: 100,
formatter: this.currency_formatter},
- {id: "closing_value", name: __("Closing Value"), field: "closing_value", width: 100,
+ {id: "closing_value", name: __("Closing Value"), field: "closing_value", width: 100,
+ formatter: this.currency_formatter},
+ {id: "valuation_rate", name: __("Valuation Rate"), field: "valuation_rate", width: 100,
formatter: this.currency_formatter},
];
},
-
+
filters: [
- {fieldtype:"Select", label: __("Brand"), link:"Brand",
- default_value: "Select Brand...", filter: function(val, item, opts) {
+ {fieldtype:"Select", label: __("Brand"), link:"Brand", fieldname: "brand",
+ default_value: __("Select Brand..."), filter: function(val, item, opts) {
return val == opts.default_value || item.brand == val || item._show;
}, link_formatter: {filter_input: "brand"}},
- {fieldtype:"Select", label: __("Warehouse"), link:"Warehouse",
- default_value: "Select Warehouse...", filter: function(val, item, opts, me) {
+ {fieldtype:"Select", label: __("Warehouse"), link:"Warehouse", fieldname: "warehouse",
+ default_value: __("Select Warehouse..."), filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me);
}},
- {fieldtype:"Select", label: __("Project"), link:"Project",
- default_value: "Select Project...", filter: function(val, item, opts, me) {
+ {fieldtype:"Select", label: __("Project"), link:"Project", fieldname: "project",
+ default_value: __("Select Project..."), filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me);
}, link_formatter: {filter_input: "project"}},
- {fieldtype:"Date", label: __("From Date")},
+ {fieldtype:"Date", label: __("From Date"), fieldname: "from_date"},
{fieldtype:"Label", label: __("To")},
- {fieldtype:"Date", label: __("To Date")},
+ {fieldtype:"Date", label: __("To Date"), fieldname: "to_date"},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
- {fieldtype:"Button", label: __("Reset Filters")}
+ {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
],
-
+
setup_plot_check: function() {
return;
},
-
+
prepare_data: function() {
this.stock_entry_map = this.make_name_map(frappe.report_dump.data["Stock Entry"], "name");
this._super();
},
-
+
prepare_balances: function() {
var me = this;
var from_date = dateutil.str_to_obj(this.from_date);
@@ -95,26 +97,26 @@
for(var i=0, j=data.length; i<j; i++) {
var sl = data[i];
var sl_posting_date = dateutil.str_to_obj(sl.posting_date);
-
+
if((me.is_default("warehouse") ? true : me.warehouse == sl.warehouse) &&
(me.is_default("project") ? true : me.project == sl.project)) {
var item = me.item_by_name[sl.item_code];
var wh = me.get_item_warehouse(sl.warehouse, sl.item_code);
- var valuation_method = item.valuation_method ?
+ var valuation_method = item.valuation_method ?
item.valuation_method : sys_defaults.valuation_method;
var is_fifo = valuation_method == "FIFO";
var qty_diff = sl.qty;
var value_diff = me.get_value_diff(wh, sl, is_fifo);
-
+
if(sl_posting_date < from_date) {
item.opening_qty += qty_diff;
item.opening_value += value_diff;
} else if(sl_posting_date <= to_date) {
var ignore_inflow_outflow = this.is_default("warehouse")
- && sl.voucher_type=="Stock Entry"
+ && sl.voucher_type=="Stock Entry"
&& this.stock_entry_map[sl.voucher_no].purpose=="Material Transfer";
-
+
if(!ignore_inflow_outflow) {
if(qty_diff < 0) {
item.outflow_qty += Math.abs(qty_diff);
@@ -126,7 +128,7 @@
} else {
item.inflow_value += value_diff;
}
-
+
item.closing_qty += qty_diff;
item.closing_value += value_diff;
}
@@ -138,13 +140,18 @@
}
// opening + diff = closing
- // adding opening, since diff already added to closing
+ // adding opening, since diff already added to closing
$.each(me.item_by_name, function(key, item) {
item.closing_qty += item.opening_qty;
item.closing_value += item.opening_value;
+
+ // valuation rate
+ if(!item.is_group && flt(item.closing_qty) > 0)
+ item.valuation_rate = flt(item.closing_value) / flt(item.closing_qty);
+ else item.valuation_rate = 0.0
});
},
-
+
update_groups: function() {
var me = this;
@@ -155,24 +162,22 @@
while(parent) {
parent_group = me.item_by_name[parent];
$.each(me.columns, function(c, col) {
- if (col.formatter == me.currency_formatter) {
- parent_group[col.field] =
- flt(parent_group[col.field])
- + flt(item[col.field]);
+ if (col.formatter == me.currency_formatter && col.field != "valuation_rate") {
+ parent_group[col.field] = flt(parent_group[col.field]) + flt(item[col.field]);
}
});
-
+
// show parent if filtered by brand
if(item.brand == me.brand)
parent_group._show = true;
-
+
parent = me.parent_map[parent];
}
}
});
},
-
+
get_plot_data: function() {
return;
}
-});
\ No newline at end of file
+});
diff --git a/erpnext/stock/page/stock_ledger/stock_ledger.js b/erpnext/stock/page/stock_ledger/stock_ledger.js
index 4e31e37..b4086dc 100644
--- a/erpnext/stock/page/stock_ledger/stock_ledger.js
+++ b/erpnext/stock/page/stock_ledger/stock_ledger.js
@@ -1,13 +1,13 @@
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
-frappe.pages['stock-ledger'].onload = function(wrapper) {
+frappe.pages['stock-ledger'].onload = function(wrapper) {
frappe.ui.make_app_page({
parent: wrapper,
title: __('Stock Ledger'),
single_column: true
});
-
+
new erpnext.StockLedger(wrapper);
wrapper.appframe.add_module_icon("Stock")
}
@@ -30,7 +30,7 @@
this.columns = [
{id: "posting_datetime", name: __("Posting Date"), field: "posting_datetime", width: 120,
formatter: this.date_formatter},
- {id: "item_code", name: __("Item Code"), field: "item_code", width: 160,
+ {id: "item_code", name: __("Item Code"), field: "item_code", width: 160,
link_formatter: {
filter_input: "item_code",
open_btn: true,
@@ -57,10 +57,10 @@
doctype: "dataContext.voucher_type"
}},
];
-
+
},
filters: [
- {fieldtype:"Select", label: __("Warehouse"), link:"Warehouse",
+ {fieldtype:"Select", label: __("Warehouse"), link:"Warehouse",
default_value: "Select Warehouse...", filter: function(val, item, opts) {
return item.warehouse == val || val == opts.default_value;
}},
@@ -68,7 +68,7 @@
filter: function(val, item, opts) {
return item.item_code == val || !val;
}},
- {fieldtype:"Select", label: "Brand", link:"Brand",
+ {fieldtype:"Select", label: "Brand", link:"Brand",
default_value: "Select Brand...", filter: function(val, item, opts) {
return val == opts.default_value || item.brand == val || item._show;
}, link_formatter: {filter_input: "brand"}},
@@ -85,19 +85,19 @@
return dateutil.str_to_obj(val) >= dateutil.str_to_obj(item.posting_date);
}},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
- {fieldtype:"Button", label: __("Reset Filters")}
+ {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
],
-
+
setup_filters: function() {
var me = this;
this._super();
-
+
this.wrapper.bind("apply_filters_from_route", function() { me.toggle_enable_brand(); });
this.filter_inputs.item_code.change(function() { me.toggle_enable_brand(); });
-
+
this.trigger_refresh_on_change(["item_code", "warehouse", "brand"]);
},
-
+
toggle_enable_brand: function() {
if(!this.filter_inputs.item_code.val()) {
this.filter_inputs.brand.prop("disabled", false);
@@ -107,7 +107,7 @@
.prop("disabled", true);
}
},
-
+
init_filter_values: function() {
this._super();
this.filter_inputs.warehouse.get(0).selectedIndex = 0;
@@ -131,19 +131,19 @@
item_code: "Total Out", qty: 0.0, balance: 0.0, balance_value: 0.0,
id:"_total_out", _show: true, _style: "font-weight: bold"
}
-
+
// clear balance
$.each(frappe.report_dump.data["Item"], function(i, item) {
- item.balance = item.balance_value = 0.0;
+ item.balance = item.balance_value = 0.0;
});
-
+
// initialize warehouse-item map
this.item_warehouse = {};
this.serialized_buying_rates = this.get_serialized_buying_rates();
var from_datetime = dateutil.str_to_obj(me.from_date + " 00:00:00");
var to_datetime = dateutil.str_to_obj(me.to_date + " 23:59:59");
-
- //
+
+ //
for(var i=0, j=data.length; i<j; i++) {
var sl = data[i];
var item = me.item_by_name[sl.item_code]
@@ -152,8 +152,8 @@
sl.posting_datetime = sl.posting_date + " " + (sl.posting_time || "00:00:00");
sl.brand = item.brand;
var posting_datetime = dateutil.str_to_obj(sl.posting_datetime);
-
- var is_fifo = item.valuation_method ? item.valuation_method=="FIFO"
+
+ var is_fifo = item.valuation_method ? item.valuation_method=="FIFO"
: sys_defaults.valuation_method=="FIFO";
var value_diff = me.get_value_diff(wh, sl, is_fifo);
@@ -175,27 +175,27 @@
}
}
}
-
+
if(!before_end) break;
// apply filters
if(me.apply_filters(sl)) {
out.push(sl);
}
-
+
// update balance
if((!me.is_default("warehouse") ? me.apply_filter(sl, "warehouse") : true)) {
sl.balance = me.item_by_name[sl.item_code].balance + sl.qty;
me.item_by_name[sl.item_code].balance = sl.balance;
-
+
sl.balance_value = me.item_by_name[sl.item_code].balance_value + value_diff;
- me.item_by_name[sl.item_code].balance_value = sl.balance_value;
+ me.item_by_name[sl.item_code].balance_value = sl.balance_value;
}
}
-
+
if(me.item_code && !me.voucher_no) {
var closing = {
- item_code: "On " + dateutil.str_to_user(this.to_date),
+ item_code: "On " + dateutil.str_to_user(this.to_date),
balance: (out.length ? out[out.length-1].balance : 0), qty: 0,
balance_value: (out.length ? out[out.length-1].balance_value : 0),
id:"_closing", _show: true, _style: "font-weight: bold"
@@ -203,7 +203,7 @@
total_out.balance_value = -total_out.balance_value;
var out = [opening].concat(out).concat([total_in, total_out, closing]);
}
-
+
this.data = out;
},
get_plot_data: function() {
@@ -231,7 +231,7 @@
get_plot_options: function() {
return {
grid: { hoverable: true, clickable: true },
- xaxis: { mode: "time",
+ xaxis: { mode: "time",
min: dateutil.str_to_obj(this.from_date).getTime(),
max: dateutil.str_to_obj(this.to_date).getTime(),
},
@@ -244,4 +244,4 @@
var value = format_number(y);
return value.bold() + " on " + date;
}
-});
\ No newline at end of file
+});
diff --git a/erpnext/stock/page/stock_level/stock_level.js b/erpnext/stock/page/stock_level/stock_level.js
index b04882f..8659c28 100644
--- a/erpnext/stock/page/stock_level/stock_level.js
+++ b/erpnext/stock/page/stock_level/stock_level.js
@@ -99,7 +99,7 @@
return val == opts.default_value || item.brand == val;
}},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
- {fieldtype:"Button", label: __("Reset Filters")}
+ {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
],
setup_filters: function() {
diff --git a/erpnext/stock/print_format/delivery_note_packing_list_wise/delivery_note_packing_list_wise.json b/erpnext/stock/print_format/delivery_note_packing_list_wise/delivery_note_packing_list_wise.json
deleted file mode 100644
index a971a10..0000000
--- a/erpnext/stock/print_format/delivery_note_packing_list_wise/delivery_note_packing_list_wise.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "creation": "2011-08-23 16:49:40",
- "docstatus": 0,
- "doctype": "Print Format",
- "html": "<html>\n<head>\n\n<script>\nfunction replaceAll(s,s1,s2){ return s.split(s1).join(s2);}\n\nfunction get_letter_head() {\n\t// add letter head\n\tvar cp = locals['Control Panel']['Control Panel'];\n\tif(doc.letter_head)\n\t\tvar lh= cstr(_p.letter_heads[doc.letter_head]);\n\telse if(cp.letter_head)\n\t\tvar lh= cp.letter_head;\n\telse \n\t\tvar lh= '';\n\t\t\n\treturn lh;\n}\n\n</script>\n<style>\n.cust_tbl { border-collapse:collapse; }\n.cust_tbl td { border:1px solid #848484; font-size: 13px}\n.large_font td {font-size: 13px}\n</style>\n</head>\n\n<body>\n<script>\nreplaceAll(doc.print_packing_slip,'[HEADER GOES HERE]',get_letter_head());\n</script>\n</body>\n</html>",
- "idx": 1,
- "modified": "2014-05-13 16:07:19.133031",
- "modified_by": "Administrator",
- "module": "Stock",
- "name": "Delivery Note Packing List Wise",
- "owner": "Administrator",
- "standard": "Yes"
-}
\ No newline at end of file
diff --git a/erpnext/stock/report/item_prices/item_prices.py b/erpnext/stock/report/item_prices/item_prices.py
index 0d5539e..d2da54f 100644
--- a/erpnext/stock/report/item_prices/item_prices.py
+++ b/erpnext/stock/report/item_prices/item_prices.py
@@ -7,7 +7,7 @@
def execute(filters=None):
if not filters: filters = {}
-
+
columns = get_columns(filters)
item_map = get_item_details()
pl = get_price_list()
@@ -19,34 +19,33 @@
precision = get_currency_precision() or 2
data = []
for item in sorted(item_map):
- data.append([item, item_map[item]["item_name"],
- item_map[item]["description"], item_map[item]["stock_uom"],
- flt(last_purchase_rate.get(item, 0), precision),
- flt(val_rate_map.get(item, 0), precision),
- pl.get(item, {}).get("Selling"),
- pl.get(item, {}).get("Buying"),
- flt(bom_rate.get(item, 0), precision),
- flt(item_map[item]["standard_rate"], precision)
+ data.append([item, item_map[item]["item_name"],
+ item_map[item]["description"], item_map[item]["stock_uom"],
+ flt(last_purchase_rate.get(item, 0), precision),
+ flt(val_rate_map.get(item, 0), precision),
+ pl.get(item, {}).get("Selling"),
+ pl.get(item, {}).get("Buying"),
+ flt(bom_rate.get(item, 0), precision)
])
-
+
return columns, data
def get_columns(filters):
"""return columns based on filters"""
-
- columns = ["Item:Link/Item:100", "Item Name::150", "Description::150", "UOM:Link/UOM:80",
- "Last Purchase Rate:Currency:90", "Valuation Rate:Currency:80", "Sales Price List::80",
- "Purchase Price List::80", "BOM Rate:Currency:90", "Standard Rate:Currency:100"]
+
+ columns = ["Item:Link/Item:100", "Item Name::150", "Description::150", "UOM:Link/UOM:80",
+ "Last Purchase Rate:Currency:90", "Valuation Rate:Currency:80", "Sales Price List::80",
+ "Purchase Price List::80", "BOM Rate:Currency:90"]
return columns
def get_item_details():
"""returns all items details"""
-
+
item_map = {}
-
+
for i in frappe.db.sql("select name, item_name, description, \
- stock_uom, standard_rate from tabItem \
+ stock_uom from tabItem \
order by item_code", as_dict=1):
item_map.setdefault(i.name, i)
@@ -57,42 +56,42 @@
rate = {}
- price_list = frappe.db.sql("""select ip.item_code, ip.buying, ip.selling,
- concat(ip.price_list, " - ", ip.currency, " ", ip.price_list_rate) as price
- from `tabItem Price` ip, `tabPrice List` pl
+ price_list = frappe.db.sql("""select ip.item_code, ip.buying, ip.selling,
+ concat(ip.price_list, " - ", ip.currency, " ", ip.price_list_rate) as price
+ from `tabItem Price` ip, `tabPrice List` pl
where ip.price_list=pl.name and pl.enabled=1""", as_dict=1)
for j in price_list:
if j.price:
rate.setdefault(j.item_code, {}).setdefault("Buying" if j.buying else "Selling", []).append(j.price)
item_rate_map = {}
-
+
for item in rate:
for buying_or_selling in rate[item]:
- item_rate_map.setdefault(item, {}).setdefault(buying_or_selling,
+ item_rate_map.setdefault(item, {}).setdefault(buying_or_selling,
", ".join(rate[item].get(buying_or_selling, [])))
-
+
return item_rate_map
def get_last_purchase_rate():
item_last_purchase_rate_map = {}
- query = """select * from (select
+ query = """select * from (select
result.item_code,
result.base_rate
from (
- (select
+ (select
po_item.item_code,
po_item.item_name,
po.transaction_date as posting_date,
- po_item.base_price_list_rate,
- po_item.discount_percentage,
+ po_item.base_price_list_rate,
+ po_item.discount_percentage,
po_item.base_rate
from `tabPurchase Order` po, `tabPurchase Order Item` po_item
where po.name = po_item.parent and po.docstatus = 1)
union
- (select
+ (select
pr_item.item_code,
pr_item.item_name,
pr.posting_date,
@@ -114,8 +113,8 @@
"""Get BOM rate of an item from BOM"""
item_bom_map = {}
-
- for b in frappe.db.sql("""select item, (total_cost/quantity) as bom_rate
+
+ for b in frappe.db.sql("""select item, (total_cost/quantity) as bom_rate
from `tabBOM` where is_active=1 and is_default=1""", as_dict=1):
item_bom_map.setdefault(b.item, flt(b.bom_rate))
@@ -125,8 +124,8 @@
"""Get an average valuation rate of an item from all warehouses"""
item_val_rate_map = {}
-
- for d in frappe.db.sql("""select item_code,
+
+ for d in frappe.db.sql("""select item_code,
sum(actual_qty*valuation_rate)/sum(actual_qty) as val_rate
from tabBin where actual_qty > 0 group by item_code""", as_dict=1):
item_val_rate_map.setdefault(d.item_code, d.val_rate)
diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.py b/erpnext/stock/report/stock_ledger/stock_ledger.py
index 5068326..73a2c2a 100644
--- a/erpnext/stock/report/stock_ledger/stock_ledger.py
+++ b/erpnext/stock/report/stock_ledger/stock_ledger.py
@@ -17,23 +17,25 @@
% ("/".join(["#Form", sle.voucher_type, sle.voucher_no]),)
data.append([sle.date, sle.item_code, item_detail.item_name, item_detail.item_group,
- item_detail.brand, item_detail.description, sle.warehouse, item_detail.stock_uom,
- sle.actual_qty, sle.qty_after_transaction, sle.valuation_rate, sle.stock_value,
- sle.voucher_type, sle.voucher_no, voucher_link_icon, sle.batch_no, sle.serial_no, sle.company])
+ item_detail.brand, item_detail.description, sle.warehouse,
+ item_detail.stock_uom, sle.actual_qty, sle.qty_after_transaction,
+ (sle.incoming_rate if sle.actual_qty > 0 else 0.0),
+ sle.valuation_rate, sle.stock_value, sle.voucher_type, sle.voucher_no,
+ voucher_link_icon, sle.batch_no, sle.serial_no, sle.company])
return columns, data
def get_columns():
- return ["Date:Datetime:95", "Item:Link/Item:130", "Item Name::100",
- "Item Group:Link/Item Group:100", "Brand:Link/Brand:100",
- "Description::200", "Warehouse:Link/Warehouse:100",
- "Stock UOM:Link/UOM:100", "Qty:Float:50", "Balance Qty:Float:100", "Valuation Rate:Currency:110",
- "Balance Value:Currency:110", "Voucher Type::110", "Voucher #::100", "Link::30",
- "Batch:Link/Batch:100", "Serial #:Link/Serial No:100", "Company:Link/Company:100"]
+ return ["Date:Datetime:95", "Item:Link/Item:130", "Item Name::100", "Item Group:Link/Item Group:100",
+ "Brand:Link/Brand:100", "Description::200", "Warehouse:Link/Warehouse:100",
+ "Stock UOM:Link/UOM:100", "Qty:Float:50", "Balance Qty:Float:100",
+ "Incoming Rate:Currency:110", "Valuation Rate:Currency:110", "Balance Value:Currency:110",
+ "Voucher Type::110", "Voucher #::100", "Link::30", "Batch:Link/Batch:100",
+ "Serial #:Link/Serial No:100", "Company:Link/Company:100"]
def get_stock_ledger_entries(filters):
return frappe.db.sql("""select concat_ws(" ", posting_date, posting_time) as date,
- item_code, warehouse, actual_qty, qty_after_transaction, valuation_rate,
+ item_code, warehouse, actual_qty, qty_after_transaction, incoming_rate, valuation_rate,
stock_value, voucher_type, voucher_no, batch_no, serial_no, company
from `tabStock Ledger Entry`
where company = %(company)s and
diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py
index 8fe5284..252a296 100644
--- a/erpnext/stock/utils.py
+++ b/erpnext/stock/utils.py
@@ -68,10 +68,6 @@
in_rate = 0
if args.get("serial_no"):
in_rate = get_avg_purchase_rate(args.get("serial_no"))
- elif args.get("bom_no"):
- result = frappe.db.sql("""select ifnull(total_cost, 0) / ifnull(quantity, 1)
- from `tabBOM` where name = %s and docstatus=1 and is_active=1""", args.get("bom_no"))
- in_rate = result and flt(result[0][0]) or 0
else:
valuation_method = get_valuation_method(args.get("item_code"))
previous_sle = get_previous_sle(args)
@@ -179,6 +175,11 @@
def reorder_item():
""" Reorder item if stock reaches reorder level"""
+
+ # if initial setup not completed, return
+ if not frappe.db.sql("select name from `tabFiscal Year` limit 1"):
+ return
+
if getattr(frappe.local, "auto_indent", None) is None:
frappe.local.auto_indent = cint(frappe.db.get_value('Stock Settings', None, 'auto_indent'))
diff --git a/erpnext/support/doctype/support_ticket/support_ticket.json b/erpnext/support/doctype/support_ticket/support_ticket.json
index 5ea9ac5..fd97884 100644
--- a/erpnext/support/doctype/support_ticket/support_ticket.json
+++ b/erpnext/support/doctype/support_ticket/support_ticket.json
@@ -237,7 +237,7 @@
],
"icon": "icon-ticket",
"idx": 1,
- "modified": "2014-05-21 06:15:26.988620",
+ "modified": "2014-06-03 10:49:47.781578",
"modified_by": "Administrator",
"module": "Support",
"name": "Support Ticket",
@@ -286,6 +286,6 @@
"write": 1
}
],
- "search_fields": "status,customer,allocated_to,subject,raised_by",
+ "search_fields": "status,customer,subject,raised_by",
"title_field": "subject"
}
\ No newline at end of file
diff --git a/erpnext/support/page/support_analytics/support_analytics.js b/erpnext/support/page/support_analytics/support_analytics.js
index 5c2a722..b9db1f8 100644
--- a/erpnext/support/page/support_analytics/support_analytics.js
+++ b/erpnext/support/page/support_analytics/support_analytics.js
@@ -35,7 +35,7 @@
{fieldtype:"Select", label: __("Range"),
options:["Daily", "Weekly", "Monthly", "Quarterly", "Yearly"]},
{fieldtype:"Button", label: __("Refresh"), icon:"icon-refresh icon-white"},
- {fieldtype:"Button", label: __("Reset Filters")}
+ {fieldtype:"Button", label: __("Reset Filters"), icon: "icon-filter"}
],
setup_columns: function() {
diff --git a/erpnext/utilities/__init__.py b/erpnext/utilities/__init__.py
index e96ae83..bfb3fe4 100644
--- a/erpnext/utilities/__init__.py
+++ b/erpnext/utilities/__init__.py
@@ -22,12 +22,3 @@
def validate_status(status, options):
if status not in options:
frappe.throw(_("Status must be one of {0}").format(comma_or(options)))
-
-def build_filter_conditions(filters):
- conditions, filter_values = [], []
- for key in filters:
- conditions.append('`' + key + '` = %s')
- filter_values.append(filters[key])
-
- conditions = conditions and " and " + " and ".join(conditions) or ""
- return conditions, filter_values