Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 1 | frappe.provide("erpnext.setup"); |
Rushabh Mehta | 37b4d75 | 2015-11-09 16:53:11 +0530 | [diff] [blame] | 2 | |
| 3 | frappe.pages['setup-wizard'].on_page_load = function(wrapper) { |
Faris Ansari | ab74ca7 | 2017-05-30 12:54:42 +0530 | [diff] [blame] | 4 | if(frappe.sys_defaults.company) { |
Rushabh Mehta | 37b4d75 | 2015-11-09 16:53:11 +0530 | [diff] [blame] | 5 | frappe.set_route("desk"); |
| 6 | return; |
| 7 | } |
Anand Doshi | 1ed8283 | 2015-11-16 12:58:14 +0530 | [diff] [blame] | 8 | }; |
Rushabh Mehta | 37b4d75 | 2015-11-09 16:53:11 +0530 | [diff] [blame] | 9 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 10 | var erpnext_slides = [ |
| 11 | { |
| 12 | // Domain |
| 13 | name: 'domain', |
| 14 | domains: ["all"], |
| 15 | title: __('Select your Domain'), |
| 16 | fields: [ |
| 17 | { |
| 18 | fieldname: 'domain', label: __('Domain'), fieldtype: 'Select', |
| 19 | options: [ |
| 20 | { "label": __("Distribution"), "value": "Distribution" }, |
| 21 | { "label": __("Education"), "value": "Education" }, |
| 22 | { "label": __("Manufacturing"), "value": "Manufacturing" }, |
| 23 | { "label": __("Retail"), "value": "Retail" }, |
| 24 | { "label": __("Services"), "value": "Services" } |
| 25 | ], reqd: 1 |
Rushabh Mehta | 20038ad | 2016-07-21 16:01:59 +0530 | [diff] [blame] | 26 | }, |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 27 | ], |
| 28 | help: __('Select the nature of your business.'), |
| 29 | onload: function (slide) { |
| 30 | slide.get_input("domain").on("change", function () { |
| 31 | frappe.setup.domain = $(this).val(); |
| 32 | frappe.wizard.refresh_slides(); |
| 33 | }); |
Rushabh Mehta | 20038ad | 2016-07-21 16:01:59 +0530 | [diff] [blame] | 34 | }, |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 35 | }, |
Rushabh Mehta | 37b4d75 | 2015-11-09 16:53:11 +0530 | [diff] [blame] | 36 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 37 | { |
| 38 | // Brand |
| 39 | name: 'brand', |
| 40 | domains: ["all"], |
| 41 | icon: "fa fa-bookmark", |
| 42 | title: __("The Brand"), |
| 43 | help: __('Upload your letter head and logo. (you can edit them later).'), |
| 44 | fields: [ |
| 45 | { |
| 46 | fieldtype: "Attach Image", fieldname: "attach_logo", |
| 47 | label: __("Attach Logo"), |
| 48 | description: __("100px by 100px"), |
| 49 | is_private: 0 |
| 50 | }, |
| 51 | { |
| 52 | fieldname: 'company_name', |
| 53 | label: frappe.setup.domain === 'Education' ? |
| 54 | __('Institute Name') : __('Company Name'), |
| 55 | fieldtype: 'Data', reqd: 1 |
| 56 | }, |
| 57 | { |
| 58 | fieldname: 'company_abbr', |
| 59 | label: frappe.setup.domain === 'Education' ? |
| 60 | __('Institute Abbreviation') : __('Company Abbreviation'), |
| 61 | fieldtype: 'Data' |
| 62 | } |
| 63 | ], |
| 64 | onload: function(slide) { |
| 65 | this.bind_events(slide); |
| 66 | }, |
| 67 | bind_events: function (slide) { |
| 68 | slide.get_input("company_name").on("change", function () { |
| 69 | var parts = slide.get_input("company_name").val().split(" "); |
| 70 | var abbr = $.map(parts, function (p) { return p ? p.substr(0, 1) : null }).join(""); |
Makarand Bauskar | 30f2bcb | 2017-07-11 12:36:57 +0530 | [diff] [blame] | 71 | slide.get_field("company_abbr").set_value(abbr.slice(0, 5).toUpperCase()); |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 72 | }).val(frappe.boot.sysdefaults.company_name || "").trigger("change"); |
Rushabh Mehta | 37b4d75 | 2015-11-09 16:53:11 +0530 | [diff] [blame] | 73 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 74 | slide.get_input("company_abbr").on("change", function () { |
| 75 | if (slide.get_input("company_abbr").val().length > 5) { |
| 76 | frappe.msgprint("Company Abbreviation cannot have more than 5 characters"); |
Makarand Bauskar | 30f2bcb | 2017-07-11 12:36:57 +0530 | [diff] [blame] | 77 | slide.get_field("company_abbr").set_value(""); |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 78 | } |
| 79 | }); |
| 80 | } |
| 81 | }, |
| 82 | { |
| 83 | // Organisation |
| 84 | name: 'organisation', |
| 85 | domains: ["all"], |
| 86 | title: __("Your Organization"), |
| 87 | icon: "fa fa-building", |
| 88 | help: (frappe.setup.domain === 'Education' ? |
| 89 | __('The name of the institute for which you are setting up this system.') : |
| 90 | __('The name of your company for which you are setting up this system.')), |
| 91 | fields: [ |
| 92 | { |
| 93 | fieldname: 'company_tagline', |
| 94 | label: __('What does it do?'), |
| 95 | fieldtype: 'Data', |
| 96 | placeholder: frappe.setup.domain === 'Education' ? |
| 97 | __('e.g. "Primary School" or "University"') : |
| 98 | __('e.g. "Build tools for builders"'), |
| 99 | reqd: 1 |
| 100 | }, |
| 101 | { fieldname: 'bank_account', label: __('Bank Name'), fieldtype: 'Data', reqd: 1 }, |
| 102 | { |
| 103 | fieldname: 'chart_of_accounts', label: __('Chart of Accounts'), |
| 104 | options: "", fieldtype: 'Select' |
Anand Doshi | 1ed8283 | 2015-11-16 12:58:14 +0530 | [diff] [blame] | 105 | }, |
| 106 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 107 | { fieldtype: "Section Break", label: "Financial Year" }, |
| 108 | { fieldname: 'fy_start_date', label: __('Start Date'), fieldtype: 'Date', reqd: 1 }, |
| 109 | { fieldtype: "Column Break" }, |
| 110 | { fieldname: 'fy_end_date', label: __('End Date'), fieldtype: 'Date', reqd: 1 }, |
| 111 | ], |
| 112 | |
| 113 | onload: function (slide) { |
| 114 | this.load_chart_of_accounts(slide); |
| 115 | this.bind_events(slide); |
| 116 | this.set_fy_dates(slide); |
| 117 | }, |
| 118 | |
| 119 | validate: function () { |
| 120 | // validate fiscal year start and end dates |
| 121 | if (this.values.fy_start_date == 'Invalid date' || this.values.fy_end_date == 'Invalid date') { |
| 122 | frappe.msgprint(__("Please enter valid Financial Year Start and End Dates")); |
| 123 | return false; |
| 124 | } |
| 125 | |
| 126 | if ((this.values.company_name || "").toLowerCase() == "company") { |
| 127 | frappe.msgprint(__("Company Name cannot be Company")); |
| 128 | return false; |
| 129 | } |
| 130 | |
| 131 | return true; |
| 132 | }, |
| 133 | |
| 134 | set_fy_dates: function (slide) { |
| 135 | var country = frappe.wizard.values.country; |
| 136 | |
| 137 | if (country) { |
| 138 | var fy = erpnext.setup.fiscal_years[country]; |
| 139 | var current_year = moment(new Date()).year(); |
| 140 | var next_year = current_year + 1; |
| 141 | if (!fy) { |
Makarand Bauskar | bf66d7e | 2017-07-05 17:26:34 +0530 | [diff] [blame] | 142 | fy = ["01-01", "12-31"]; |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 143 | next_year = current_year; |
Anand Doshi | 5c3469a | 2015-11-24 17:06:54 +0530 | [diff] [blame] | 144 | } |
| 145 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 146 | var year_start_date = current_year + "-" + fy[0]; |
| 147 | if (year_start_date > frappe.datetime.get_today()) { |
Rushabh Mehta | 63b0642 | 2017-07-05 17:56:04 +0530 | [diff] [blame] | 148 | next_year = current_year; |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 149 | current_year -= 1; |
Anand Doshi | 5c3469a | 2015-11-24 17:06:54 +0530 | [diff] [blame] | 150 | } |
Rushabh Mehta | 63b0642 | 2017-07-05 17:56:04 +0530 | [diff] [blame] | 151 | slide.get_field("fy_start_date").set_value(current_year + '-' + fy[0]); |
| 152 | slide.get_field("fy_end_date").set_value(next_year + '-' + fy[1]); |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 153 | } |
Anand Doshi | 5c3469a | 2015-11-24 17:06:54 +0530 | [diff] [blame] | 154 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 155 | }, |
Anand Doshi | 5c3469a | 2015-11-24 17:06:54 +0530 | [diff] [blame] | 156 | |
Anand Doshi | 1ed8283 | 2015-11-16 12:58:14 +0530 | [diff] [blame] | 157 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 158 | load_chart_of_accounts: function (slide) { |
| 159 | var country = frappe.wizard.values.country; |
Anand Doshi | 1ed8283 | 2015-11-16 12:58:14 +0530 | [diff] [blame] | 160 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 161 | if (country) { |
| 162 | frappe.call({ |
| 163 | method: "erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts.get_charts_for_country", |
| 164 | args: { "country": country }, |
| 165 | callback: function (r) { |
| 166 | if (r.message) { |
| 167 | slide.get_input("chart_of_accounts").empty() |
| 168 | .add_options(r.message); |
Rushabh Mehta | 37b4d75 | 2015-11-09 16:53:11 +0530 | [diff] [blame] | 169 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 170 | if (r.message.length === 1) { |
| 171 | var field = slide.get_field("chart_of_accounts"); |
| 172 | field.set_value(r.message[0]); |
| 173 | field.df.hidden = 1; |
| 174 | field.refresh(); |
Rushabh Mehta | 37b4d75 | 2015-11-09 16:53:11 +0530 | [diff] [blame] | 175 | } |
| 176 | } |
Anand Doshi | 1ed8283 | 2015-11-16 12:58:14 +0530 | [diff] [blame] | 177 | } |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 178 | }) |
Rushabh Mehta | 37b4d75 | 2015-11-09 16:53:11 +0530 | [diff] [blame] | 179 | } |
| 180 | }, |
Rushabh Mehta | 37b4d75 | 2015-11-09 16:53:11 +0530 | [diff] [blame] | 181 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 182 | bind_events: function (slide) { |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 183 | slide.get_input("fy_start_date").on("change", function () { |
Rushabh Mehta | 63b0642 | 2017-07-05 17:56:04 +0530 | [diff] [blame] | 184 | var start_date = slide.form.fields_dict.fy_start_date.get_value(); |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 185 | var year_end_date = |
Rushabh Mehta | 63b0642 | 2017-07-05 17:56:04 +0530 | [diff] [blame] | 186 | frappe.datetime.add_days(frappe.datetime.add_months(start_date, 12), -1); |
| 187 | slide.form.fields_dict.fy_end_date.set_value(year_end_date); |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 188 | }); |
| 189 | } |
| 190 | }, |
Rushabh Mehta | 20038ad | 2016-07-21 16:01:59 +0530 | [diff] [blame] | 191 | |
Prateeksha Singh | 7d88543 | 2017-07-11 12:36:34 +0530 | [diff] [blame] | 192 | { |
| 193 | // Users |
| 194 | name: 'users', |
| 195 | domains: ["all"], |
| 196 | title: __("Add Users"), |
| 197 | help: __("Add users to your organization, other than yourself"), |
| 198 | add_more: 1, |
| 199 | max_count: 3, |
| 200 | fields: [ |
| 201 | {fieldtype:"Section Break"}, |
| 202 | {fieldtype:"Data", fieldname:"user_fullname", |
| 203 | label:__("Full Name"), static: 1}, |
| 204 | {fieldtype:"Data", fieldname:"user_email", label:__("Email ID"), |
| 205 | placeholder:__("user@example.com"), options: "Email", static: 1}, |
| 206 | {fieldtype:"Column Break"}, |
| 207 | {fieldtype: "Check", fieldname: "user_sales", |
| 208 | label:__("Sales"), "default": 1, static: 1, |
| 209 | hidden: frappe.setup.domain==='Education' ? 1 : 0}, |
| 210 | {fieldtype: "Check", fieldname: "user_purchaser", |
| 211 | label:__("Purchaser"), "default": 1, static: 1, |
| 212 | hidden: frappe.setup.domain==='Education' ? 1 : 0}, |
| 213 | {fieldtype: "Check", fieldname: "user_accountant", |
| 214 | label:__("Accountant"), "default": 1, static: 1, |
| 215 | hidden: frappe.setup.domain==='Education' ? 1 : 0}, |
| 216 | ] |
| 217 | }, |
Rushabh Mehta | 20038ad | 2016-07-21 16:01:59 +0530 | [diff] [blame] | 218 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 219 | { |
| 220 | // Taxes |
| 221 | name: 'taxes', |
| 222 | domains: ['manufacturing', 'services', 'retail', 'distribution'], |
| 223 | icon: "fa fa-money", |
| 224 | title: __("Add Taxes"), |
| 225 | 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."), |
| 226 | add_more: 1, |
Prateeksha Singh | 7d88543 | 2017-07-11 12:36:34 +0530 | [diff] [blame] | 227 | max_count: 3, |
| 228 | mandatory_entry: 1, |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 229 | fields: [ |
| 230 | {fieldtype:"Section Break"}, |
| 231 | {fieldtype:"Data", fieldname:"tax", label:__("Tax"), |
| 232 | placeholder:__("e.g. VAT")}, |
| 233 | {fieldtype:"Column Break"}, |
| 234 | {fieldtype:"Float", fieldname:"tax_rate", label:__("Rate (%)"), placeholder:__("e.g. 5")} |
| 235 | ] |
| 236 | }, |
Rushabh Mehta | 20038ad | 2016-07-21 16:01:59 +0530 | [diff] [blame] | 237 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 238 | { |
| 239 | // Customers |
| 240 | name: 'customers', |
| 241 | domains: ['manufacturing', 'services', 'retail', 'distribution'], |
| 242 | icon: "fa fa-group", |
| 243 | title: __("Add Customers"), |
| 244 | help: __("List a few of your customers. They could be organizations or individuals."), |
| 245 | add_more: 1, |
Prateeksha Singh | 7d88543 | 2017-07-11 12:36:34 +0530 | [diff] [blame] | 246 | max_count: 5, |
| 247 | mandatory_entry: 1, |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 248 | fields: [ |
| 249 | {fieldtype:"Section Break"}, |
| 250 | {fieldtype:"Data", fieldname:"customer", label:__("Customer"), |
| 251 | placeholder:__("Customer Name")}, |
| 252 | {fieldtype:"Column Break"}, |
| 253 | {fieldtype:"Data", fieldname:"customer_contact", |
| 254 | label:__("Contact Name"), placeholder:__("Contact Name")} |
| 255 | ], |
| 256 | }, |
Anand Doshi | 1ed8283 | 2015-11-16 12:58:14 +0530 | [diff] [blame] | 257 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 258 | { |
| 259 | // Suppliers |
| 260 | name: 'suppliers', |
| 261 | domains: ['manufacturing', 'services', 'retail', 'distribution'], |
| 262 | icon: "fa fa-group", |
| 263 | title: __("Your Suppliers"), |
| 264 | help: __("List a few of your suppliers. They could be organizations or individuals."), |
| 265 | add_more: 1, |
Prateeksha Singh | 7d88543 | 2017-07-11 12:36:34 +0530 | [diff] [blame] | 266 | max_count: 5, |
| 267 | mandatory_entry: 1, |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 268 | fields: [ |
| 269 | {fieldtype:"Section Break"}, |
| 270 | {fieldtype:"Data", fieldname:"supplier", label:__("Supplier"), |
| 271 | placeholder:__("Supplier Name")}, |
| 272 | {fieldtype:"Column Break"}, |
| 273 | {fieldtype:"Data", fieldname:"supplier_contact", |
| 274 | label:__("Contact Name"), placeholder:__("Contact Name")}, |
| 275 | ] |
| 276 | }, |
Anand Doshi | 1ed8283 | 2015-11-16 12:58:14 +0530 | [diff] [blame] | 277 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 278 | { |
| 279 | // Products |
| 280 | name: 'products', |
| 281 | domains: ['manufacturing', 'services', 'retail', 'distribution'], |
| 282 | icon: "fa fa-barcode", |
| 283 | title: __("Your Products or Services"), |
| 284 | 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."), |
| 285 | add_more: 1, |
Prateeksha Singh | 7d88543 | 2017-07-11 12:36:34 +0530 | [diff] [blame] | 286 | max_count: 5, |
| 287 | mandatory_entry: 1, |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 288 | fields: [ |
| 289 | {fieldtype:"Section Break", show_section_border: true}, |
| 290 | {fieldtype:"Data", fieldname:"item", label:__("Item"), |
| 291 | placeholder:__("A Product or Service")}, |
| 292 | {fieldtype:"Select", label:__("Group"), fieldname:"item_group", |
| 293 | options:[__("Products"), __("Services"), |
| 294 | __("Raw Material"), __("Consumable"), __("Sub Assemblies")], |
Prateeksha Singh | 7d88543 | 2017-07-11 12:36:34 +0530 | [diff] [blame] | 295 | "default": __("Products"), static: 1}, |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 296 | {fieldtype:"Select", fieldname:"item_uom", label:__("UOM"), |
| 297 | options:[__("Unit"), __("Nos"), __("Box"), __("Pair"), __("Kg"), __("Set"), |
| 298 | __("Hour"), __("Minute"), __("Litre"), __("Meter"), __("Gram")], |
Prateeksha Singh | 7d88543 | 2017-07-11 12:36:34 +0530 | [diff] [blame] | 299 | "default": __("Unit"), static: 1}, |
| 300 | {fieldtype: "Check", fieldname: "is_sales_item", label:__("We sell this Item"), default: 1, static: 1}, |
| 301 | {fieldtype: "Check", fieldname: "is_purchase_item", label:__("We buy this Item"), static: 1}, |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 302 | {fieldtype:"Column Break"}, |
Prateeksha Singh | 7d88543 | 2017-07-11 12:36:34 +0530 | [diff] [blame] | 303 | {fieldtype:"Currency", fieldname:"item_price", label:__("Rate"), static: 1}, |
| 304 | {fieldtype:"Attach Image", fieldname:"item_img", label:__("Attach Image"), is_private: 0, static: 1}, |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 305 | ], |
| 306 | get_item_count: function() { |
| 307 | return this.item_count; |
| 308 | } |
| 309 | }, |
Rushabh Mehta | 37b4d75 | 2015-11-09 16:53:11 +0530 | [diff] [blame] | 310 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 311 | { |
| 312 | // Program |
| 313 | name: 'program', |
| 314 | domains: ["education"], |
| 315 | title: __("Program"), |
| 316 | help: __("Example: Masters in Computer Science"), |
| 317 | add_more: 1, |
Prateeksha Singh | 7d88543 | 2017-07-11 12:36:34 +0530 | [diff] [blame] | 318 | max_count: 5, |
| 319 | mandatory_entry: 1, |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 320 | fields: [ |
| 321 | {fieldtype:"Section Break", show_section_border: true}, |
| 322 | {fieldtype:"Data", fieldname:"program", label:__("Program"), placeholder: __("Program Name")}, |
| 323 | ], |
| 324 | }, |
Rushabh Mehta | 20038ad | 2016-07-21 16:01:59 +0530 | [diff] [blame] | 325 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 326 | { |
| 327 | // Course |
| 328 | name: 'course', |
| 329 | domains: ["education"], |
| 330 | title: __("Course"), |
| 331 | help: __("Example: Basic Mathematics"), |
| 332 | add_more: 1, |
Prateeksha Singh | 7d88543 | 2017-07-11 12:36:34 +0530 | [diff] [blame] | 333 | max_count: 5, |
| 334 | mandatory_entry: 1, |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 335 | fields: [ |
| 336 | {fieldtype:"Section Break", show_section_border: true}, |
| 337 | {fieldtype:"Data", fieldname:"course", label:__("Course"), placeholder: __("Course Name")}, |
| 338 | ] |
| 339 | }, |
Anand Doshi | 3177138 | 2016-07-05 21:34:21 +0530 | [diff] [blame] | 340 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 341 | { |
| 342 | // Instructor |
| 343 | name: 'instructor', |
| 344 | domains: ["education"], |
| 345 | title: __("Instructor"), |
| 346 | help: __("People who teach at your organisation"), |
| 347 | add_more: 1, |
Prateeksha Singh | 7d88543 | 2017-07-11 12:36:34 +0530 | [diff] [blame] | 348 | max_count: 5, |
| 349 | mandatory_entry: 1, |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 350 | fields: [ |
| 351 | {fieldtype:"Section Break", show_section_border: true}, |
| 352 | {fieldtype:"Data", fieldname:"instructor", label:__("Instructor"), placeholder: __("Instructor Name")}, |
| 353 | ] |
| 354 | }, |
| 355 | |
| 356 | { |
| 357 | // Room |
| 358 | name: 'room', |
| 359 | domains: ["education"], |
| 360 | title: __("Room"), |
| 361 | help: __("Classrooms/ Laboratories etc where lectures can be scheduled."), |
| 362 | add_more: 1, |
Prateeksha Singh | 7d88543 | 2017-07-11 12:36:34 +0530 | [diff] [blame] | 363 | max_count: 3, |
| 364 | mandatory_entry: 1, |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 365 | fields: [ |
| 366 | {fieldtype:"Section Break", show_section_border: true}, |
| 367 | {fieldtype:"Data", fieldname:"room", label:__("Room")}, |
| 368 | {fieldtype:"Column Break"}, |
Prateeksha Singh | 7d88543 | 2017-07-11 12:36:34 +0530 | [diff] [blame] | 369 | {fieldtype:"Int", fieldname:"room_capacity", label:__("Room") + " Capacity", static: 1}, |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 370 | ] |
| 371 | }, |
| 372 | |
| 373 | { |
Prateeksha Singh | 7d88543 | 2017-07-11 12:36:34 +0530 | [diff] [blame] | 374 | // last slide: Sample Data |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 375 | name: 'bootstrap', |
| 376 | domains: ["all"], |
Prateeksha Singh | 7d88543 | 2017-07-11 12:36:34 +0530 | [diff] [blame] | 377 | title: __("Sample Data"), |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 378 | fields: [{fieldtype: "Section Break"}, |
| 379 | {fieldtype: "Check", fieldname: "add_sample_data", |
| 380 | label: __("Add a few sample records"), "default": 1}, |
| 381 | {fieldtype: "Check", fieldname: "setup_website", |
| 382 | label: __("Setup a simple website for my organization"), "default": 1} |
| 383 | ] |
Anand Doshi | 3177138 | 2016-07-05 21:34:21 +0530 | [diff] [blame] | 384 | } |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 385 | ]; |
Anand Doshi | 3177138 | 2016-07-05 21:34:21 +0530 | [diff] [blame] | 386 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 387 | // Source: https://en.wikipedia.org/wiki/Fiscal_year |
| 388 | // default 1st Jan - 31st Dec |
Rushabh Mehta | 20038ad | 2016-07-21 16:01:59 +0530 | [diff] [blame] | 389 | |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 390 | erpnext.setup.fiscal_years = { |
Makarand Bauskar | bf66d7e | 2017-07-05 17:26:34 +0530 | [diff] [blame] | 391 | "Afghanistan": ["12-20", "12-21"], |
| 392 | "Australia": ["07-01", "06-30"], |
| 393 | "Bangladesh": ["07-01", "06-30"], |
| 394 | "Canada": ["04-01", "03-31"], |
| 395 | "Costa Rica": ["10-01", "09-30"], |
| 396 | "Egypt": ["07-01", "06-30"], |
| 397 | "Hong Kong": ["04-01", "03-31"], |
| 398 | "India": ["04-01", "03-31"], |
| 399 | "Iran": ["06-23", "06-22"], |
| 400 | "Italy": ["07-01", "06-30"], |
| 401 | "Myanmar": ["04-01", "03-31"], |
| 402 | "New Zealand": ["04-01", "03-31"], |
| 403 | "Pakistan": ["07-01", "06-30"], |
| 404 | "Singapore": ["04-01", "03-31"], |
| 405 | "South Africa": ["03-01", "02-28"], |
| 406 | "Thailand": ["10-01", "09-30"], |
| 407 | "United Kingdom": ["04-01", "03-31"], |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 408 | }; |
| 409 | |
| 410 | frappe.setup.on("before_load", function () { |
| 411 | erpnext_slides.map(frappe.setup.add_slide); |
| 412 | |
| 413 | // change header brand |
| 414 | let $brand = $('header .setup-wizard-brand'); |
| 415 | if($brand.find('.erpnext-icon').length === 0) { |
| 416 | $brand.find('.frappe-icon').hide(); |
| 417 | $brand.append(`<span> |
| 418 | <img src="/assets/erpnext/images/erp-icon.svg" class="brand-icon erpnext-icon" |
| 419 | style="width:36px;"><span class="brand-name">ERPNext</span></span>`); |
Rushabh Mehta | 20038ad | 2016-07-21 16:01:59 +0530 | [diff] [blame] | 420 | } |
Rushabh Mehta | 37b4d75 | 2015-11-09 16:53:11 +0530 | [diff] [blame] | 421 | }); |
Rushabh Mehta | 20038ad | 2016-07-21 16:01:59 +0530 | [diff] [blame] | 422 | |
Faris Ansari | ab74ca7 | 2017-05-30 12:54:42 +0530 | [diff] [blame] | 423 | var test_values_edu = { |
Prateeksha Singh | 5e4c8ec | 2017-07-03 18:23:57 +0530 | [diff] [blame] | 424 | "language": "english", |
| 425 | "domain": "Education", |
| 426 | "country": "India", |
| 427 | "timezone": "Asia/Kolkata", |
| 428 | "currency": "INR", |
| 429 | "first_name": "Tester", |
| 430 | "email": "test@example.com", |
| 431 | "password": "test", |
| 432 | "company_name": "Hogwarts", |
| 433 | "company_abbr": "HS", |
| 434 | "company_tagline": "School for magicians", |
| 435 | "bank_account": "Gringotts Wizarding Bank", |
| 436 | "fy_start_date": "2016-04-01", |
| 437 | "fy_end_date": "2017-03-31" |
Rushabh Mehta | 20038ad | 2016-07-21 16:01:59 +0530 | [diff] [blame] | 438 | } |