[fixes] production, added qty transferred, fix gantt, fiscal year (set fiscal year, instead of validation

This commit is contained in:
Rushabh Mehta
2015-02-19 14:51:58 +05:30
parent 3fa7cc524b
commit d60acb9f26
54 changed files with 955 additions and 867 deletions

View File

@@ -41,10 +41,13 @@ def get_fiscal_years(transaction_date=None, fiscal_year=None, label="Date", verb
raise FiscalYearError, error_msg
return fy
def validate_fiscal_year(date, fiscal_year, label="Date"):
def validate_fiscal_year(date, fiscal_year, label=_("Date"), doc=None):
years = [f[0] for f in get_fiscal_years(date, label=label)]
if fiscal_year not in years:
throw(_("{0} '{1}' not in Fiscal Year {2}").format(label, formatdate(date), fiscal_year))
if doc:
doc.fiscal_year = years[0]
else:
throw(_("{0} '{1}' not in Fiscal Year {2}").format(label, formatdate(date), fiscal_year))
@frappe.whitelist()
def get_balance_on(account=None, date=None, party_type=None, party=None):