[fix] re-make setup wizard slides on change of language

This commit is contained in:
Anand Doshi 2015-11-16 12:58:14 +05:30
parent 834b3e6f83
commit 1ed82834ce
2 changed files with 354 additions and 351 deletions

View File

@ -5,404 +5,407 @@ frappe.pages['setup-wizard'].on_page_load = function(wrapper) {
frappe.set_route("desk"); frappe.set_route("desk");
return; return;
} }
} };
$.extend(erpnext.wiz, { function load_erpnext_slides() {
region: { $.extend(erpnext.wiz, {
title: __("Region"), region: {
icon: "icon-flag", title: __("Region"),
help: __("Select your Country, Time Zone and Currency"), icon: "icon-flag",
fields: [ help: __("Select your Country, Time Zone and Currency"),
{ fieldname: "country", label: __("Country"), reqd:1, fields: [
fieldtype: "Select" }, { fieldname: "country", label: __("Country"), reqd:1,
{ fieldname: "timezone", label: __("Time Zone"), reqd:1, fieldtype: "Select" },
fieldtype: "Select" }, { fieldname: "timezone", label: __("Time Zone"), reqd:1,
{ fieldname: "currency", label: __("Currency"), reqd:1, fieldtype: "Select" },
fieldtype: "Select" }, { fieldname: "currency", label: __("Currency"), reqd:1,
], fieldtype: "Select" },
],
onload: function(slide) { onload: function(slide) {
frappe.call({ frappe.call({
method:"frappe.geo.country_info.get_country_timezone_info", method:"frappe.geo.country_info.get_country_timezone_info",
callback: function(data) { callback: function(data) {
erpnext.wiz.region.data = data.message; erpnext.wiz.region.data = data.message;
erpnext.wiz.region.setup_fields(slide); erpnext.wiz.region.setup_fields(slide);
erpnext.wiz.region.bind_events(slide); erpnext.wiz.region.bind_events(slide);
} }
}); });
}, },
css_class: "single-column", css_class: "single-column",
setup_fields: function(slide) { setup_fields: function(slide) {
var data = erpnext.wiz.region.data;
slide.get_input("country").empty()
.add_options([""].concat(keys(data.country_info).sort()));
slide.get_input("currency").empty()
.add_options(frappe.utils.unique([""].concat($.map(data.country_info,
function(opts, country) { return opts.currency; }))).sort());
slide.get_input("timezone").empty()
.add_options([""].concat(data.all_timezones));
if (data.default_country) {
slide.set_input("country", data.default_country);
}
},
bind_events: function(slide) {
slide.get_input("country").on("change", function() {
var country = slide.get_input("country").val();
var $timezone = slide.get_input("timezone");
var data = erpnext.wiz.region.data; var data = erpnext.wiz.region.data;
$timezone.empty(); slide.get_input("country").empty()
.add_options([""].concat(keys(data.country_info).sort()));
// add country specific timezones first slide.get_input("currency").empty()
if(country) { .add_options(frappe.utils.unique([""].concat($.map(data.country_info,
var timezone_list = data.country_info[country].timezones || []; function(opts, country) { return opts.currency; }))).sort());
$timezone.add_options(timezone_list.sort());
slide.get_field("currency").set_input(data.country_info[country].currency); slide.get_input("timezone").empty()
slide.get_field("currency").$input.trigger("change"); .add_options([""].concat(data.all_timezones));
if (data.default_country) {
slide.set_input("country", data.default_country);
} }
},
// add all timezones at the end, so that user has the option to change it to any timezone bind_events: function(slide) {
$timezone.add_options([""].concat(data.all_timezones)); slide.get_input("country").on("change", function() {
var country = slide.get_input("country").val();
var $timezone = slide.get_input("timezone");
var data = erpnext.wiz.region.data;
slide.get_field("timezone").set_input($timezone.val()); $timezone.empty();
// temporarily set date format // add country specific timezones first
frappe.boot.sysdefaults.date_format = (data.country_info[country].date_format if(country) {
|| "dd-mm-yyyy"); var timezone_list = data.country_info[country].timezones || [];
}); $timezone.add_options(timezone_list.sort());
slide.get_field("currency").set_input(data.country_info[country].currency);
slide.get_input("currency").on("change", function() { slide.get_field("currency").$input.trigger("change");
var currency = slide.get_input("currency").val();
if (!currency) return;
frappe.model.with_doc("Currency", currency, function() {
frappe.provide("locals.:Currency." + currency);
var currency_doc = frappe.model.get_doc("Currency", currency);
var number_format = currency_doc.number_format;
if (number_format==="#.###") {
number_format = "#.###,##";
} else if (number_format==="#,###") {
number_format = "#,###.##"
} }
frappe.boot.sysdefaults.number_format = number_format; // add all timezones at the end, so that user has the option to change it to any timezone
locals[":Currency"][currency] = $.extend({}, currency_doc); $timezone.add_options([""].concat(data.all_timezones));
slide.get_field("timezone").set_input($timezone.val());
// temporarily set date format
frappe.boot.sysdefaults.date_format = (data.country_info[country].date_format
|| "dd-mm-yyyy");
}); });
});
}
},
user: { slide.get_input("currency").on("change", function() {
title: __("The First User: You"), var currency = slide.get_input("currency").val();
icon: "icon-user", if (!currency) return;
fields: [ frappe.model.with_doc("Currency", currency, function() {
{"fieldname": "first_name", "label": __("First Name"), "fieldtype": "Data", frappe.provide("locals.:Currency." + currency);
reqd:1}, var currency_doc = frappe.model.get_doc("Currency", currency);
{"fieldname": "last_name", "label": __("Last Name"), "fieldtype": "Data"}, var number_format = currency_doc.number_format;
{"fieldname": "email", "label": __("Email Address"), "fieldtype": "Data", if (number_format==="#.###") {
reqd:1, "description": __("You will use it to Login"), "options":"Email"}, number_format = "#.###,##";
{"fieldname": "password", "label": __("Password"), "fieldtype": "Password", } else if (number_format==="#,###") {
reqd:1}, number_format = "#,###.##"
{fieldtype:"Attach Image", fieldname:"attach_user", }
label: __("Attach Your Picture")},
],
help: __('The first user will become the System Manager (you can change this later).'),
onload: function(slide) {
if(user!=="Administrator") {
slide.form.fields_dict.password.$wrapper.toggle(false);
slide.form.fields_dict.email.$wrapper.toggle(false);
slide.form.fields_dict.first_name.set_input(frappe.boot.user.first_name);
slide.form.fields_dict.last_name.set_input(frappe.boot.user.last_name);
var user_image = frappe.get_cookie("user_image"); frappe.boot.sysdefaults.number_format = number_format;
if(user_image) { locals[":Currency"][currency] = $.extend({}, currency_doc);
var $attach_user = slide.form.fields_dict.attach_user.$wrapper; });
$attach_user.find(".missing-image").toggle(false); });
$attach_user.find("img").attr("src", decodeURIComponent(user_image)).toggle(true);
}
delete slide.form.fields_dict.email;
delete slide.form.fields_dict.password;
} }
}, },
css_class: "single-column"
},
org: { user: {
title: __("The Organization"), title: __("The First User: You"),
icon: "icon-building", icon: "icon-user",
fields: [ fields: [
{fieldname:'company_name', label: __('Company Name'), fieldtype:'Data', reqd:1, {"fieldname": "first_name", "label": __("First Name"), "fieldtype": "Data",
placeholder: __('e.g. "My Company LLC"')}, reqd:1},
{fieldname:'company_abbr', label: __('Company Abbreviation'), fieldtype:'Data', {"fieldname": "last_name", "label": __("Last Name"), "fieldtype": "Data"},
description: __('Max 5 characters'), placeholder: __('e.g. "MC"'), reqd:1}, {"fieldname": "email", "label": __("Email Address"), "fieldtype": "Data",
{fieldname:'company_tagline', label: __('What does it do?'), fieldtype:'Data', reqd:1, "description": __("You will use it to Login"), "options":"Email"},
placeholder:__('e.g. "Build tools for builders"'), reqd:1}, {"fieldname": "password", "label": __("Password"), "fieldtype": "Password",
{fieldname:'bank_account', label: __('Bank Account'), fieldtype:'Data', reqd:1},
placeholder: __('e.g. "XYZ National Bank"'), reqd:1 }, {fieldtype:"Attach Image", fieldname:"attach_user",
{fieldname:'chart_of_accounts', label: __('Chart of Accounts'), label: __("Attach Your Picture")},
options: "", fieldtype: 'Select'}, ],
help: __('The first user will become the System Manager (you can change this later).'),
onload: function(slide) {
if(user!=="Administrator") {
slide.form.fields_dict.password.$wrapper.toggle(false);
slide.form.fields_dict.email.$wrapper.toggle(false);
slide.form.fields_dict.first_name.set_input(frappe.boot.user.first_name);
slide.form.fields_dict.last_name.set_input(frappe.boot.user.last_name);
// TODO remove this var user_image = frappe.get_cookie("user_image");
{fieldtype: "Section Break"}, if(user_image) {
{fieldname:'fy_start_date', label:__('Financial Year Start Date'), fieldtype:'Date', var $attach_user = slide.form.fields_dict.attach_user.$wrapper;
description: __('Your financial year begins on'), reqd:1}, $attach_user.find(".missing-image").toggle(false);
{fieldname:'fy_end_date', label:__('Financial Year End Date'), fieldtype:'Date', $attach_user.find("img").attr("src", decodeURIComponent(user_image)).toggle(true);
description: __('Your financial year ends on'), reqd:1}, }
],
help: __('The name of your company for which you are setting up this system.'),
onload: function(slide) { delete slide.form.fields_dict.email;
erpnext.wiz.org.load_chart_of_accounts(slide); delete slide.form.fields_dict.password;
erpnext.wiz.org.bind_events(slide); }
erpnext.wiz.org.set_fy_dates(slide); },
css_class: "single-column"
}, },
css_class: "single-column", org: {
title: __("The Organization"),
icon: "icon-building",
fields: [
{fieldname:'company_name', label: __('Company Name'), fieldtype:'Data', reqd:1,
placeholder: __('e.g. "My Company LLC"')},
{fieldname:'company_abbr', label: __('Company Abbreviation'), fieldtype:'Data',
description: __('Max 5 characters'), placeholder: __('e.g. "MC"'), reqd:1},
{fieldname:'company_tagline', label: __('What does it do?'), fieldtype:'Data',
placeholder:__('e.g. "Build tools for builders"'), reqd:1},
{fieldname:'bank_account', label: __('Bank Account'), fieldtype:'Data',
placeholder: __('e.g. "XYZ National Bank"'), reqd:1 },
{fieldname:'chart_of_accounts', label: __('Chart of Accounts'),
options: "", fieldtype: 'Select'},
set_fy_dates: function(slide) { // TODO remove this
var country = slide.wiz.get_values().country; {fieldtype: "Section Break"},
{fieldname:'fy_start_date', label:__('Financial Year Start Date'), fieldtype:'Date',
description: __('Your financial year begins on'), reqd:1},
{fieldname:'fy_end_date', label:__('Financial Year End Date'), fieldtype:'Date',
description: __('Your financial year ends on'), reqd:1},
],
help: __('The name of your company for which you are setting up this system.'),
if(country) { onload: function(slide) {
var fy = erpnext.wiz.fiscal_years[country]; erpnext.wiz.org.load_chart_of_accounts(slide);
var current_year = moment(new Date()).year(); erpnext.wiz.org.bind_events(slide);
var next_year = current_year + 1; erpnext.wiz.org.set_fy_dates(slide);
if(!fy) { },
fy = ["01-01", "12-31"];
next_year = current_year; css_class: "single-column",
set_fy_dates: function(slide) {
var country = slide.wiz.get_values().country;
if(country) {
var fy = erpnext.wiz.fiscal_years[country];
var current_year = moment(new Date()).year();
var next_year = current_year + 1;
if(!fy) {
fy = ["01-01", "12-31"];
next_year = current_year;
}
slide.get_field("fy_start_date").set_input(current_year + "-" + fy[0]);
slide.get_field("fy_end_date").set_input(next_year + "-" + fy[1]);
} }
slide.get_field("fy_start_date").set_input(current_year + "-" + fy[0]); },
slide.get_field("fy_end_date").set_input(next_year + "-" + fy[1]);
}
}, load_chart_of_accounts: function(slide) {
var country = slide.wiz.get_values().country;
load_chart_of_accounts: function(slide) { if(country) {
var country = slide.wiz.get_values().country; frappe.call({
method: "erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts.get_charts_for_country",
args: {"country": country},
callback: function(r) {
if(r.message) {
slide.get_input("chart_of_accounts").empty()
.add_options(r.message);
if(country) { if (r.message.length===1) {
frappe.call({ var field = slide.get_field("chart_of_accounts");
method: "erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts.get_charts_for_country", field.set_value(r.message[0]);
args: {"country": country}, field.df.hidden = 1;
callback: function(r) { field.refresh();
if(r.message) { }
slide.get_input("chart_of_accounts").empty()
.add_options(r.message);
if (r.message.length===1) {
var field = slide.get_field("chart_of_accounts");
field.set_value(r.message[0]);
field.df.hidden = 1;
field.refresh();
} }
} }
} })
})
}
},
bind_events: function(slide) {
slide.get_input("company_name").on("change", function() {
var parts = slide.get_input("company_name").val().split(" ");
var abbr = $.map(parts, function(p) { return p ? p.substr(0,1) : null }).join("");
slide.get_field("company_abbr").set_input(abbr.slice(0, 5).toUpperCase());
}).val(frappe.boot.sysdefaults.company_name || "").trigger("change");
slide.get_input("company_abbr").on("change", function() {
if(slide.get_input("company_abbr").val().length > 5) {
msgprint("Company Abbreviation cannot have more than 5 characters");
slide.get_field("company_abbr").set_input("");
} }
});
// TODO remove this
slide.get_input("fy_start_date").on("change", function() {
var year_end_date =
frappe.datetime.add_days(frappe.datetime.add_months(
frappe.datetime.user_to_obj(slide.get_input("fy_start_date").val()), 12), -1);
slide.get_input("fy_end_date").val(frappe.datetime.obj_to_user(year_end_date));
});
}
},
branding: {
icon: "icon-bookmark",
title: __("The Brand"),
help: __('Upload your letter head and logo. (you can edit them later).'),
fields: [
{fieldtype:"Attach Image", fieldname:"attach_letterhead",
label: __("Attach Letterhead"),
description: __("Keep it web friendly 900px (w) by 100px (h)")
}, },
{fieldtype: "Column Break"},
{fieldtype:"Attach Image", fieldname:"attach_logo",
label:__("Attach Logo"),
description: __("100px by 100px")},
],
css_class: "two-column" bind_events: function(slide) {
}, slide.get_input("company_name").on("change", function() {
var parts = slide.get_input("company_name").val().split(" ");
var abbr = $.map(parts, function(p) { return p ? p.substr(0,1) : null }).join("");
slide.get_field("company_abbr").set_input(abbr.slice(0, 5).toUpperCase());
}).val(frappe.boot.sysdefaults.company_name || "").trigger("change");
users: { slide.get_input("company_abbr").on("change", function() {
icon: "icon-money", if(slide.get_input("company_abbr").val().length > 5) {
"title": __("Add Users"), msgprint("Company Abbreviation cannot have more than 5 characters");
"help": __("Add users to your organization, other than yourself"), slide.get_field("company_abbr").set_input("");
"fields": [], }
before_load: function(slide) { });
slide.fields = [];
for(var i=1; i<5; i++) { // TODO remove this
slide.fields = slide.fields.concat([ slide.get_input("fy_start_date").on("change", function() {
{fieldtype:"Section Break"}, var year_end_date =
{fieldtype:"Data", fieldname:"user_fullname_"+ i, frappe.datetime.add_days(frappe.datetime.add_months(
label:__("Full Name")}, frappe.datetime.user_to_obj(slide.get_input("fy_start_date").val()), 12), -1);
{fieldtype:"Data", fieldname:"user_email_" + i, slide.get_input("fy_end_date").val(frappe.datetime.obj_to_user(year_end_date));
label:__("Email ID"), placeholder:__("user@example.com"),
options: "Email"}, });
{fieldtype:"Column Break"},
{fieldtype: "Check", fieldname: "user_sales_" + i,
label:__("Sales"), default: 1},
{fieldtype: "Check", fieldname: "user_purchaser_" + i,
label:__("Purchaser"), default: 1},
{fieldtype: "Check", fieldname: "user_accountant_" + i,
label:__("Accountant"), default: 1},
]);
} }
}, },
css_class: "two-column"
},
taxes: { branding: {
icon: "icon-money", icon: "icon-bookmark",
"title": __("Add Taxes"), title: __("The Brand"),
"help": __("List your tax heads (e.g. VAT, Customs etc; they should have unique names) and their standard rates. This will create a standard template, which you can edit and add more later."), help: __('Upload your letter head and logo. (you can edit them later).'),
"fields": [], fields: [
before_load: function(slide) { {fieldtype:"Attach Image", fieldname:"attach_letterhead",
slide.fields = []; label: __("Attach Letterhead"),
for(var i=1; i<4; i++) { description: __("Keep it web friendly 900px (w) by 100px (h)")
slide.fields = slide.fields.concat([ },
{fieldtype:"Section Break"}, {fieldtype: "Column Break"},
{fieldtype:"Data", fieldname:"tax_"+ i, label:__("Tax") + " " + i, {fieldtype:"Attach Image", fieldname:"attach_logo",
placeholder:__("e.g. VAT") + " " + i}, label:__("Attach Logo"),
{fieldtype:"Column Break"}, description: __("100px by 100px")},
{fieldtype:"Float", fieldname:"tax_rate_" + i, label:__("Rate (%)"), placeholder:__("e.g. 5")}, ],
]);
} css_class: "two-column"
}, },
css_class: "two-column"
},
customers: { users: {
icon: "icon-group", icon: "icon-money",
"title": __("Your Customers"), "title": __("Add Users"),
"help": __("List a few of your customers. They could be organizations or individuals."), "help": __("Add users to your organization, other than yourself"),
"fields": [], "fields": [],
before_load: function(slide) { before_load: function(slide) {
slide.fields = []; slide.fields = [];
for(var i=1; i<6; i++) { for(var i=1; i<5; i++) {
slide.fields = slide.fields.concat([ slide.fields = slide.fields.concat([
{fieldtype:"Section Break"}, {fieldtype:"Section Break"},
{fieldtype:"Data", fieldname:"customer_" + i, label:__("Customer") + " " + i, {fieldtype:"Data", fieldname:"user_fullname_"+ i,
placeholder:__("Customer Name")}, label:__("Full Name")},
{fieldtype:"Column Break"}, {fieldtype:"Data", fieldname:"user_email_" + i,
{fieldtype:"Data", fieldname:"customer_contact_" + i, label:__("Email ID"), placeholder:__("user@example.com"),
label:__("Contact Name") + " " + i, placeholder:__("Contact Name")} options: "Email"},
]) {fieldtype:"Column Break"},
} {fieldtype: "Check", fieldname: "user_sales_" + i,
slide.fields[1].reqd = 1; label:__("Sales"), default: 1},
{fieldtype: "Check", fieldname: "user_purchaser_" + i,
label:__("Purchaser"), default: 1},
{fieldtype: "Check", fieldname: "user_accountant_" + i,
label:__("Accountant"), default: 1},
]);
}
},
css_class: "two-column"
}, },
css_class: "two-column"
},
suppliers: { taxes: {
icon: "icon-group", icon: "icon-money",
"title": __("Your Suppliers"), "title": __("Add Taxes"),
"help": __("List a few of your suppliers. They could be organizations or individuals."), "help": __("List your tax heads (e.g. VAT, Customs etc; they should have unique names) and their standard rates. This will create a standard template, which you can edit and add more later."),
"fields": [], "fields": [],
before_load: function(slide) { before_load: function(slide) {
slide.fields = []; slide.fields = [];
for(var i=1; i<6; i++) { for(var i=1; i<4; i++) {
slide.fields = slide.fields.concat([ slide.fields = slide.fields.concat([
{fieldtype:"Section Break"}, {fieldtype:"Section Break"},
{fieldtype:"Data", fieldname:"supplier_" + i, label:__("Supplier")+" " + i, {fieldtype:"Data", fieldname:"tax_"+ i, label:__("Tax") + " " + i,
placeholder:__("Supplier Name")}, placeholder:__("e.g. VAT") + " " + i},
{fieldtype:"Column Break"}, {fieldtype:"Column Break"},
{fieldtype:"Data", fieldname:"supplier_contact_" + i, {fieldtype:"Float", fieldname:"tax_rate_" + i, label:__("Rate (%)"), placeholder:__("e.g. 5")},
label:__("Contact Name") + " " + i, placeholder:__("Contact Name")}, ]);
]) }
} },
slide.fields[1].reqd = 1; css_class: "two-column"
}, },
css_class: "two-column"
},
items: { customers: {
icon: "icon-barcode", icon: "icon-group",
"title": __("Your Products or Services"), "title": __("Your Customers"),
"help": __("List your products or services that you buy or sell. Make sure to check the Item Group, Unit of Measure and other properties when you start."), "help": __("List a few of your customers. They could be organizations or individuals."),
"fields": [], "fields": [],
before_load: function(slide) { before_load: function(slide) {
slide.fields = []; slide.fields = [];
for(var i=1; i<6; i++) { for(var i=1; i<6; i++) {
slide.fields = slide.fields.concat([ slide.fields = slide.fields.concat([
{fieldtype:"Section Break", show_section_border: true}, {fieldtype:"Section Break"},
{fieldtype:"Data", fieldname:"item_" + i, label:__("Item") + " " + i, {fieldtype:"Data", fieldname:"customer_" + i, label:__("Customer") + " " + i,
placeholder:__("A Product or Service")}, placeholder:__("Customer Name")},
{fieldtype:"Select", label:__("Group"), fieldname:"item_group_" + i, {fieldtype:"Column Break"},
options:[__("Products"), __("Services"), {fieldtype:"Data", fieldname:"customer_contact_" + i,
__("Raw Material"), __("Consumable"), __("Sub Assemblies")], label:__("Contact Name") + " " + i, placeholder:__("Contact Name")}
"default": __("Products")}, ])
{fieldtype:"Select", fieldname:"item_uom_" + i, label:__("UOM"), }
options:[__("Unit"), __("Nos"), __("Box"), __("Pair"), __("Kg"), __("Set"), slide.fields[1].reqd = 1;
__("Hour"), __("Minute")], },
"default": __("Unit")}, css_class: "two-column"
{fieldtype: "Check", fieldname: "is_sales_item_" + i, label:__("We sell this Item"), default: 1},
{fieldtype: "Check", fieldname: "is_purchase_item_" + i, label:__("We buy this Item")},
{fieldtype:"Column Break"},
{fieldtype:"Currency", fieldname:"item_price_" + i, label:__("Rate")},
{fieldtype:"Attach Image", fieldname:"item_img_" + i, label:__("Attach Image")},
])
}
slide.fields[1].reqd = 1;
// dummy data
slide.fields.push({fieldtype: "Section Break"});
slide.fields.push({fieldtype: "Check", fieldname: "add_sample_data",
label: __("Add a few sample records"), "default": 1});
}, },
css_class: "two-column"
},
});
// Source: https://en.wikipedia.org/wiki/Fiscal_year suppliers: {
// default 1st Jan - 31st Dec icon: "icon-group",
"title": __("Your Suppliers"),
"help": __("List a few of your suppliers. They could be organizations or individuals."),
"fields": [],
before_load: function(slide) {
slide.fields = [];
for(var i=1; i<6; i++) {
slide.fields = slide.fields.concat([
{fieldtype:"Section Break"},
{fieldtype:"Data", fieldname:"supplier_" + i, label:__("Supplier")+" " + i,
placeholder:__("Supplier Name")},
{fieldtype:"Column Break"},
{fieldtype:"Data", fieldname:"supplier_contact_" + i,
label:__("Contact Name") + " " + i, placeholder:__("Contact Name")},
])
}
slide.fields[1].reqd = 1;
},
css_class: "two-column"
},
erpnext.wiz.fiscal_years = { items: {
"Afghanistan": ["12-20", "12-21"], icon: "icon-barcode",
"Australia": ["07-01", "06-30"], "title": __("Your Products or Services"),
"Bangladesh": ["07-01", "06-30"], "help": __("List your products or services that you buy or sell. Make sure to check the Item Group, Unit of Measure and other properties when you start."),
"Canada": ["04-01", "03-31"], "fields": [],
"Costa Rica": ["10-01", "09-30"], before_load: function(slide) {
"Egypt": ["07-01", "06-30"], slide.fields = [];
"Hong Kong": ["04-01", "03-31"], for(var i=1; i<6; i++) {
"India": ["04-01", "03-31"], slide.fields = slide.fields.concat([
"Iran": ["06-23", "06-22"], {fieldtype:"Section Break", show_section_border: true},
"Italy": ["07-01", "06-30"], {fieldtype:"Data", fieldname:"item_" + i, label:__("Item") + " " + i,
"Myanmar": ["04-01", "03-31"], placeholder:__("A Product or Service")},
"New Zealand": ["04-01", "03-31"], {fieldtype:"Select", label:__("Group"), fieldname:"item_group_" + i,
"Pakistan": ["07-01", "06-30"], options:[__("Products"), __("Services"),
"Singapore": ["04-01", "03-31"], __("Raw Material"), __("Consumable"), __("Sub Assemblies")],
"South Africa": ["03-01", "02-28"], "default": __("Products")},
"Thailand": ["10-01", "09-30"], {fieldtype:"Select", fieldname:"item_uom_" + i, label:__("UOM"),
"United Kingdom": ["04-01", "03-31"], options:[__("Unit"), __("Nos"), __("Box"), __("Pair"), __("Kg"), __("Set"),
} __("Hour"), __("Minute")],
"default": __("Unit")},
{fieldtype: "Check", fieldname: "is_sales_item_" + i, label:__("We sell this Item"), default: 1},
{fieldtype: "Check", fieldname: "is_purchase_item_" + i, label:__("We buy this Item")},
{fieldtype:"Column Break"},
{fieldtype:"Currency", fieldname:"item_price_" + i, label:__("Rate")},
{fieldtype:"Attach Image", fieldname:"item_img_" + i, label:__("Attach Image")},
])
}
slide.fields[1].reqd = 1;
// dummy data
slide.fields.push({fieldtype: "Section Break"});
slide.fields.push({fieldtype: "Check", fieldname: "add_sample_data",
label: __("Add a few sample records"), "default": 1});
},
css_class: "two-column"
},
});
// Source: https://en.wikipedia.org/wiki/Fiscal_year
// default 1st Jan - 31st Dec
erpnext.wiz.fiscal_years = {
"Afghanistan": ["12-20", "12-21"],
"Australia": ["07-01", "06-30"],
"Bangladesh": ["07-01", "06-30"],
"Canada": ["04-01", "03-31"],
"Costa Rica": ["10-01", "09-30"],
"Egypt": ["07-01", "06-30"],
"Hong Kong": ["04-01", "03-31"],
"India": ["04-01", "03-31"],
"Iran": ["06-23", "06-22"],
"Italy": ["07-01", "06-30"],
"Myanmar": ["04-01", "03-31"],
"New Zealand": ["04-01", "03-31"],
"Pakistan": ["07-01", "06-30"],
"Singapore": ["04-01", "03-31"],
"South Africa": ["03-01", "02-28"],
"Thailand": ["10-01", "09-30"],
"United Kingdom": ["04-01", "03-31"],
};
};
frappe.wiz.on("before_load", function() { frappe.wiz.on("before_load", function() {
load_erpnext_slides();
frappe.wiz.add_slide(erpnext.wiz.user); frappe.wiz.add_slide(erpnext.wiz.user);
frappe.wiz.add_slide(erpnext.wiz.org); frappe.wiz.add_slide(erpnext.wiz.org);
frappe.wiz.add_slide(erpnext.wiz.branding); frappe.wiz.add_slide(erpnext.wiz.branding);

View File

@ -18,7 +18,7 @@
<br> <br>
<hr> <hr>
<h3>Next Steps</h3> <h3>{%= __("Next Steps") %}</h3>
<ul class="list-unstyled"> <ul class="list-unstyled">
<li><a class="text-muted" href="#">{%= __("Go to the Desktop and start using ERPNext") %}</a></li> <li><a class="text-muted" href="#">{%= __("Go to the Desktop and start using ERPNext") %}</a></li>
<li><a class="text-muted" href="#Module/Learn">{%= __("View a list of all the help videos") %}</a></li> <li><a class="text-muted" href="#Module/Learn">{%= __("View a list of all the help videos") %}</a></li>