mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-21 14:09:19 +00:00
fix: Description on template selection
This commit is contained in:
@@ -20,14 +20,32 @@ frappe.ui.form.on('Chart of Accounts Importer', {
|
|||||||
},
|
},
|
||||||
|
|
||||||
download_template: function(frm) {
|
download_template: function(frm) {
|
||||||
|
|
||||||
|
if (!frm.doc.template_type) {
|
||||||
|
frappe.throw(__('Please select <b>Template Type</b> to download template'));
|
||||||
|
}
|
||||||
|
|
||||||
open_url_post(
|
open_url_post(
|
||||||
'/api/method/erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.download_template',
|
'/api/method/erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer.download_template',
|
||||||
{
|
{
|
||||||
file_type: frm.doc.file_type
|
file_type: frm.doc.file_type,
|
||||||
|
template_type: frm.doc.template_type
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
template_type: function(frm) {
|
||||||
|
if (frm.doc.template_type == 'Sample Template') {
|
||||||
|
frm.set_df_property('template_type', 'description',
|
||||||
|
`The Sample Template contains all the required accounts pre filled in the template.
|
||||||
|
You can add more accounts or change existing accounts in the template as per your choice.`)
|
||||||
|
} else {
|
||||||
|
frm.set_df_property('template_type', 'description',
|
||||||
|
`The Blank Template contains just the account type and root type required to build the Chart
|
||||||
|
of Accounts. Please enter the account names and add more rows as per your requirement.`)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
import_file: function (frm) {
|
import_file: function (frm) {
|
||||||
if (!frm.doc.import_file) {
|
if (!frm.doc.import_file) {
|
||||||
frm.page.set_indicator("");
|
frm.page.set_indicator("");
|
||||||
@@ -49,7 +67,8 @@ frappe.ui.form.on('Chart of Accounts Importer', {
|
|||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if(r.message===false) {
|
if(r.message===false) {
|
||||||
frm.set_value("company", "");
|
frm.set_value("company", "");
|
||||||
frappe.throw(__("Transactions against the company already exist! "));
|
frappe.throw(__(`Transactions against the company already exist!
|
||||||
|
Chart Of accounts can be imported for company with no transactions`));
|
||||||
} else {
|
} else {
|
||||||
frm.trigger("refresh");
|
frm.trigger("refresh");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user