mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 11:19:09 +00:00
[Fixed] Merge conflict fixed
This commit is contained in:
@@ -115,11 +115,12 @@ def get_costcenter_account_month_map(filters):
|
||||
for month in tdd:
|
||||
cam_map.setdefault(ccd.name, {}).setdefault(ccd.account, {})\
|
||||
.setdefault(month, webnotes._dict({
|
||||
"target": 0.0, "actual": 0.0, "variance": 0.0
|
||||
"target": 0.0, "actual": 0.0
|
||||
}))
|
||||
|
||||
tav_dict = cam_map[ccd.name][ccd.account][month]
|
||||
tav_dict.target = flt(ccd.budget_allocated)*(tdd[month]["percentage_allocation"]/100)
|
||||
tav_dict.target = flt(ccd.budget_allocated) * \
|
||||
(tdd[month]["percentage_allocation"]/100)
|
||||
|
||||
for ad in actual_details:
|
||||
if ad.month_name == month and ad.account == ccd.account \
|
||||
|
||||
@@ -26,17 +26,23 @@ from utilities import build_filter_conditions
|
||||
|
||||
class FiscalYearError(webnotes.ValidationError): pass
|
||||
|
||||
def get_fiscal_year(date, verbose=1):
|
||||
return get_fiscal_years(date, verbose=1)[0]
|
||||
def get_fiscal_year(date=None, fiscal_year=None, verbose=1):
|
||||
return get_fiscal_years(date, fiscal_year, verbose=1)[0]
|
||||
|
||||
def get_fiscal_years(date, verbose=1):
|
||||
def get_fiscal_years(date=None, fiscal_year=None, verbose=1):
|
||||
# if year start date is 2012-04-01, year end date should be 2013-03-31 (hence subdate)
|
||||
cond = ""
|
||||
if fiscal_year:
|
||||
cond = "name = '%s'" % fiscal_year
|
||||
else:
|
||||
cond = "'%s' >= year_start_date and '%s' < adddate(year_start_date, interval 1 year)" % \
|
||||
(date, date)
|
||||
fy = webnotes.conn.sql("""select name, year_start_date,
|
||||
subdate(adddate(year_start_date, interval 1 year), interval 1 day)
|
||||
as year_end_date
|
||||
from `tabFiscal Year`
|
||||
where %s >= year_start_date and %s < adddate(year_start_date, interval 1 year)
|
||||
order by year_start_date desc""", (date, date))
|
||||
where %s
|
||||
order by year_start_date desc""" % cond)
|
||||
|
||||
if not fy:
|
||||
error_msg = """%s not in any Fiscal Year""" % formatdate(date)
|
||||
|
||||
Reference in New Issue
Block a user