Merge branch 'develop'
This commit is contained in:
commit
1a1ba38e95
@ -1,2 +1,2 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
__version__ = 'v5.0.0'
|
__version__ = '5.0.2'
|
||||||
|
@ -224,20 +224,6 @@ def sort_root_accounts(roots):
|
|||||||
|
|
||||||
roots.sort(compare_roots)
|
roots.sort(compare_roots)
|
||||||
|
|
||||||
def sort_root_accounts(roots):
|
|
||||||
"""Sort root types as Asset, Liability, Equity, Income, Expense"""
|
|
||||||
|
|
||||||
def compare_roots(a, b):
|
|
||||||
if a.report_type != b.report_type and a.report_type == "Balance Sheet":
|
|
||||||
return -1
|
|
||||||
if a.root_type != b.root_type and a.root_type == "Asset":
|
|
||||||
return -1
|
|
||||||
if a.root_type == "Liability" and b.root_type == "Equity":
|
|
||||||
return -1
|
|
||||||
return 1
|
|
||||||
|
|
||||||
roots.sort(compare_roots)
|
|
||||||
|
|
||||||
def get_gl_entries(company, from_date, to_date, root_lft, root_rgt, ignore_closing_entries=False):
|
def get_gl_entries(company, from_date, to_date, root_lft, root_rgt, ignore_closing_entries=False):
|
||||||
"""Returns a dict like { "account": [gl entries], ... }"""
|
"""Returns a dict like { "account": [gl entries], ... }"""
|
||||||
additional_conditions = []
|
additional_conditions = []
|
||||||
|
@ -421,8 +421,3 @@ def get_outstanding_invoices(amount_query, account, party_type, party):
|
|||||||
})
|
})
|
||||||
|
|
||||||
return all_outstanding_vouchers
|
return all_outstanding_vouchers
|
||||||
|
|
||||||
@frappe.whitelist()
|
|
||||||
def get_letter_head(company):
|
|
||||||
return frappe.db.get_value("Company",company,"default_letter_head")
|
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd. and Contributors"
|
|||||||
app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations"
|
app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations"
|
||||||
app_icon = "icon-th"
|
app_icon = "icon-th"
|
||||||
app_color = "#e74c3c"
|
app_color = "#e74c3c"
|
||||||
app_version = "v5.0.0"
|
app_version = "5.0.2"
|
||||||
|
|
||||||
error_report_email = "support@erpnext.com"
|
error_report_email = "support@erpnext.com"
|
||||||
|
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
|
||||||
# License: GNU General Public License v3. See license.txt
|
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
import frappe
|
|
||||||
|
|
||||||
def execute():
|
|
||||||
from erpnext.utilities.repost_stock import update_bin_qty, get_indented_qty
|
|
||||||
|
|
||||||
count=0
|
|
||||||
for item_code, warehouse in frappe.db.sql("""select distinct item_code, warehouse
|
|
||||||
from `tabMaterial Request Item` where docstatus = 1"""):
|
|
||||||
try:
|
|
||||||
count += 1
|
|
||||||
update_bin_qty(item_code, warehouse, {
|
|
||||||
"indented_qty": get_indented_qty(item_code, warehouse),
|
|
||||||
})
|
|
||||||
if count % 200 == 0:
|
|
||||||
frappe.db.commit()
|
|
||||||
except:
|
|
||||||
frappe.db.rollback()
|
|
@ -1,13 +0,0 @@
|
|||||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
|
||||||
# License: GNU General Public License v3. See license.txt
|
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
import frappe
|
|
||||||
|
|
||||||
def execute():
|
|
||||||
for dt in ("Sales Order", "Purchase Order"):
|
|
||||||
orders_with_advance = frappe.db.sql("""select name from `tab{0}`
|
|
||||||
where docstatus < 2 and ifnull(advance_paid, 0) != 0""".format(dt), as_dict=1)
|
|
||||||
|
|
||||||
for order in orders_with_advance:
|
|
||||||
frappe.get_doc(dt, order.name).set_total_advance_paid()
|
|
@ -194,6 +194,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
var fn = function() {
|
var fn = function() {
|
||||||
if(me.frm.doc.company && me.frm.fields_dict.currency) {
|
if(me.frm.doc.company && me.frm.fields_dict.currency) {
|
||||||
var company_currency = me.get_company_currency();
|
var company_currency = me.get_company_currency();
|
||||||
|
var company_doc = frappe.get_doc(":Company", me.frm.doc.company);
|
||||||
if (!me.frm.doc.currency) {
|
if (!me.frm.doc.currency) {
|
||||||
me.frm.set_value("currency", company_currency);
|
me.frm.set_value("currency", company_currency);
|
||||||
}
|
}
|
||||||
@ -204,6 +205,12 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
if (me.frm.doc.price_list_currency == company_currency) {
|
if (me.frm.doc.price_list_currency == company_currency) {
|
||||||
me.frm.set_value('plc_conversion_rate', 1.0);
|
me.frm.set_value('plc_conversion_rate', 1.0);
|
||||||
}
|
}
|
||||||
|
if (company_doc.default_letter_head) {
|
||||||
|
me.frm.set_value("letter_head", company_doc.default_letter_head);
|
||||||
|
}
|
||||||
|
if (company_doc.default_terms) {
|
||||||
|
me.frm.set_value("tc_name", company_doc.default_terms);
|
||||||
|
}
|
||||||
|
|
||||||
me.frm.script_manager.trigger("currency");
|
me.frm.script_manager.trigger("currency");
|
||||||
me.apply_pricing_rule();
|
me.apply_pricing_rule();
|
||||||
@ -213,7 +220,6 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
if (this.frm.doc.posting_date) var date = this.frm.doc.posting_date;
|
if (this.frm.doc.posting_date) var date = this.frm.doc.posting_date;
|
||||||
else var date = this.frm.doc.transaction_date;
|
else var date = this.frm.doc.transaction_date;
|
||||||
erpnext.get_fiscal_year(this.frm.doc.company, date, fn);
|
erpnext.get_fiscal_year(this.frm.doc.company, date, fn);
|
||||||
erpnext.get_letter_head(this.frm.doc.company);
|
|
||||||
|
|
||||||
if(this.frm.doc.company) {
|
if(this.frm.doc.company) {
|
||||||
erpnext.last_selected_company = this.frm.doc.company;
|
erpnext.last_selected_company = this.frm.doc.company;
|
||||||
|
@ -105,21 +105,7 @@ $.extend(erpnext, {
|
|||||||
|
|
||||||
d.show();
|
d.show();
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
|
|
||||||
get_letter_head: function(company) {
|
|
||||||
frappe.call({
|
|
||||||
type:"GET",
|
|
||||||
method: "erpnext.accounts.utils.get_letter_head",
|
|
||||||
args: {
|
|
||||||
"company": company
|
|
||||||
},
|
|
||||||
callback: function(r) {
|
|
||||||
if (!r.exe) cur_frm.set_value("letter_head", r.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ class Customer(TransactionBase):
|
|||||||
|
|
||||||
def validate_name_with_customer_group(self):
|
def validate_name_with_customer_group(self):
|
||||||
if frappe.db.exists("Customer Group", self.name):
|
if frappe.db.exists("Customer Group", self.name):
|
||||||
frappe.throw(_("A Customer Group exists with same name please change the Customer name or rename the Customer Group"))
|
frappe.throw(_("A Customer Group exists with same name please change the Customer name or rename the Customer Group"), frappe.NameError)
|
||||||
|
|
||||||
def delete_customer_address(self):
|
def delete_customer_address(self):
|
||||||
addresses = frappe.db.sql("""select name, lead from `tabAddress`
|
addresses = frappe.db.sql("""select name, lead from `tabAddress`
|
||||||
@ -125,9 +125,9 @@ def get_dashboard_info(customer):
|
|||||||
|
|
||||||
billing_this_year = frappe.db.sql("""select sum(base_grand_total)
|
billing_this_year = frappe.db.sql("""select sum(base_grand_total)
|
||||||
from `tabSales Invoice`
|
from `tabSales Invoice`
|
||||||
where customer=%s and docstatus = 1 and fiscal_year = %s""",
|
where customer=%s and docstatus = 1 and fiscal_year = %s""",
|
||||||
(customer, frappe.db.get_default("fiscal_year")))
|
(customer, frappe.db.get_default("fiscal_year")))
|
||||||
|
|
||||||
total_unpaid = frappe.db.sql("""select sum(outstanding_amount)
|
total_unpaid = frappe.db.sql("""select sum(outstanding_amount)
|
||||||
from `tabSales Invoice`
|
from `tabSales Invoice`
|
||||||
where customer=%s and docstatus = 1""", customer)
|
where customer=%s and docstatus = 1""", customer)
|
||||||
|
@ -52,14 +52,6 @@
|
|||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read_only": 0
|
"read_only": 0
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"fieldname": "default_letter_head",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Default Letter Head",
|
|
||||||
"options": "Letter Head",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": ""
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"fieldname": "domain",
|
"fieldname": "domain",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
@ -72,9 +64,17 @@
|
|||||||
"fieldname": "charts_section",
|
"fieldname": "charts_section",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"hidden": 0,
|
"hidden": 0,
|
||||||
"label": "Country Settings",
|
"label": "Default Values",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "default_letter_head",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Default Letter Head",
|
||||||
|
"options": "Letter Head",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": ""
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "default_holiday_list",
|
"fieldname": "default_holiday_list",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
@ -117,10 +117,18 @@
|
|||||||
"options": "",
|
"options": "",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "default_terms",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Default Terms",
|
||||||
|
"options": "Terms and Conditions",
|
||||||
|
"permlevel": 0,
|
||||||
|
"precision": ""
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "default_settings",
|
"fieldname": "default_settings",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break",
|
||||||
"label": "Default Settings",
|
"label": "Accounts Settings",
|
||||||
"oldfieldtype": "Section Break",
|
"oldfieldtype": "Section Break",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"read_only": 0
|
"read_only": 0
|
||||||
@ -406,7 +414,7 @@
|
|||||||
],
|
],
|
||||||
"icon": "icon-building",
|
"icon": "icon-building",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"modified": "2015-05-04 11:22:42.116328",
|
"modified": "2015-05-19 02:00:41.055138",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Setup",
|
"module": "Setup",
|
||||||
"name": "Company",
|
"name": "Company",
|
||||||
|
@ -63,6 +63,8 @@ class Company(Document):
|
|||||||
if self.default_currency:
|
if self.default_currency:
|
||||||
frappe.db.set_value("Currency", self.default_currency, "enabled", 1)
|
frappe.db.set_value("Currency", self.default_currency, "enabled", 1)
|
||||||
|
|
||||||
|
frappe.clear_cache()
|
||||||
|
|
||||||
def install_country_fixtures(self):
|
def install_country_fixtures(self):
|
||||||
if os.path.exists(os.path.join(os.path.dirname(__file__), "fixtures", self.country.lower())):
|
if os.path.exists(os.path.join(os.path.dirname(__file__), "fixtures", self.country.lower())):
|
||||||
frappe.get_attr("erpnext.setup.doctype.company.fixtures.{0}.install".format(self.country.lower()))(self)
|
frappe.get_attr("erpnext.setup.doctype.company.fixtures.{0}.install".format(self.country.lower()))(self)
|
||||||
@ -167,7 +169,7 @@ class Company(Document):
|
|||||||
where defkey='Company' and defvalue=%s""", (newdn, olddn))
|
where defkey='Company' and defvalue=%s""", (newdn, olddn))
|
||||||
|
|
||||||
frappe.defaults.clear_cache()
|
frappe.defaults.clear_cache()
|
||||||
|
|
||||||
def on_trash(self):
|
def on_trash(self):
|
||||||
"""
|
"""
|
||||||
Trash accounts and cost centers for this company if no gl entry exists
|
Trash accounts and cost centers for this company if no gl entry exists
|
||||||
@ -178,7 +180,7 @@ class Company(Document):
|
|||||||
frappe.db.sql("delete from `tabAccount` where company = %s", self.name)
|
frappe.db.sql("delete from `tabAccount` where company = %s", self.name)
|
||||||
|
|
||||||
# delete cost center child table - budget detail
|
# delete cost center child table - budget detail
|
||||||
frappe.db.sql("""delete bd.* from `tabBudget Detail` bd, `tabCost Center` cc
|
frappe.db.sql("""delete bd.* from `tabBudget Detail` bd, `tabCost Center` cc
|
||||||
where bd.parent = cc.name and cc.company = %s""", self.name)
|
where bd.parent = cc.name and cc.company = %s""", self.name)
|
||||||
#delete cost center
|
#delete cost center
|
||||||
frappe.db.sql("delete from `tabCost Center` WHERE company = %s", self.name)
|
frappe.db.sql("delete from `tabCost Center` WHERE company = %s", self.name)
|
||||||
|
@ -29,8 +29,9 @@ def boot_session(bootinfo):
|
|||||||
bootinfo.setup_complete = frappe.db.sql("""select name from
|
bootinfo.setup_complete = frappe.db.sql("""select name from
|
||||||
tabCompany limit 1""") and 'Yes' or 'No'
|
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"})
|
default_terms, default_letter_head from `tabCompany`""",
|
||||||
|
as_dict=1, update={"doctype":":Company"})
|
||||||
|
|
||||||
def load_country_and_currency(bootinfo):
|
def load_country_and_currency(bootinfo):
|
||||||
country = frappe.db.get_default("country")
|
country = frappe.db.get_default("country")
|
||||||
|
@ -7,9 +7,7 @@ from frappe import _
|
|||||||
from frappe.utils import flt, cint, getdate
|
from frappe.utils import flt, cint, getdate
|
||||||
|
|
||||||
def execute(filters=None):
|
def execute(filters=None):
|
||||||
if not filters: filters = {}
|
if not filters: filters = {}
|
||||||
|
|
||||||
float_precision = cint(frappe.db.get_default("float_precision")) or 3
|
|
||||||
|
|
||||||
float_precision = cint(frappe.db.get_default("float_precision")) or 3
|
float_precision = cint(frappe.db.get_default("float_precision")) or 3
|
||||||
|
|
||||||
|
2
setup.py
2
setup.py
@ -1,6 +1,6 @@
|
|||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
version = "v5.0.0"
|
version = "5.0.2"
|
||||||
|
|
||||||
with open("requirements.txt", "r") as f:
|
with open("requirements.txt", "r") as f:
|
||||||
install_requires = f.readlines()
|
install_requires = f.readlines()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user