[setup] [fix] creation of fiscal year if start date is 1st Jan
diff --git a/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py b/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py
index 46ae842..9bea271 100644
--- a/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py
+++ b/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py
@@ -112,7 +112,7 @@
{
"doctype": "For Territory",
"parentfield": "valid_for_territories",
- "territory": "India"
+ "territory": "_Test Territory India"
}
],
[
diff --git a/public/js/complete_setup.js b/public/js/complete_setup.js
index 37c2fba..9d85979 100644
--- a/public/js/complete_setup.js
+++ b/public/js/complete_setup.js
@@ -84,6 +84,8 @@
wn.container.wntoolbar.set_user_name();
setTimeout(function() { window.location.reload(); }, 3000);
+ } else {
+ $(this).done_working();
}
});
diff --git a/setup/doctype/setup_control/setup_control.py b/setup/doctype/setup_control/setup_control.py
index c481edf..87d4c37 100644
--- a/setup/doctype/setup_control/setup_control.py
+++ b/setup/doctype/setup_control/setup_control.py
@@ -87,18 +87,20 @@
self.curr_fiscal_year = curr_fiscal_year
def create_price_lists(self, args):
- webnotes.bean({
- 'doctype': 'Price List',
- 'price_list_name': 'Standard Selling',
- "buying_or_selling": "Selling",
- "currency": args["currency"]
- }).insert(),
- webnotes.bean({
- 'doctype': 'Price List',
- 'price_list_name': 'Standard Buying',
- "buying_or_selling": "Buying",
- "currency": args["currency"]
- }).insert(),
+ for pl_type in ["Selling", "Buying"]:
+ webnotes.bean([
+ {
+ "doctype": "Price List",
+ "price_list_name": "Standard " + pl_type,
+ "buying_or_selling": pl_type,
+ "currency": args["currency"]
+ },
+ {
+ "doctype": "For Territory",
+ "parentfield": "valid_for_territories",
+ "territory": "All Territories"
+ }
+ ]).insert()
def set_defaults(self, args):
# enable default currency
@@ -207,15 +209,18 @@
# ------------------------
def get_fy_details(self, fy_start, last_year=False):
st = {'1st Jan':'01-01','1st Apr':'04-01','1st Jul':'07-01', '1st Oct': '10-01'}
- curr_year = getdate(nowdate()).year
- if last_year:
- curr_year = curr_year - 1
if cint(getdate(nowdate()).month) < cint((st[fy_start].split('-'))[0]):
curr_year = getdate(nowdate()).year - 1
+ else:
+ curr_year = getdate(nowdate()).year
+
+ if last_year:
+ curr_year = curr_year - 1
+
stdt = cstr(curr_year)+'-'+cstr(st[fy_start])
if(fy_start == '1st Jan'):
- fy = cstr(getdate(nowdate()).year)
+ fy = cstr(curr_year)
abbr = cstr(fy)[-2:]
else:
fy = cstr(curr_year) + '-' + cstr(curr_year+1)