fix: Revert Changes

This commit is contained in:
Deepesh Garg 2021-06-26 23:49:32 +05:30
parent 0dfea4d134
commit 2908f2ee20
3 changed files with 81 additions and 32 deletions

View File

@ -139,10 +139,36 @@ erpnext.setup.slides_settings = [
}, },
validate: function () { validate: function () {
let me = this;
let exist;
if (!this.validate_fy_dates()) { if (!this.validate_fy_dates()) {
return false; return false;
} }
// Validate bank name
if(me.values.bank_account) {
frappe.call({
async: false,
method: "erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts.validate_bank_account",
args: {
"coa": me.values.chart_of_accounts,
"bank_account": me.values.bank_account
},
callback: function (r) {
if(r.message){
exist = r.message;
me.get_field("bank_account").set_value("");
let message = __('Account {0} already exists. Please enter a different name for your bank account.',
[me.values.bank_account]
);
frappe.msgprint(message);
}
}
});
return !exist; // Return False if exist = true
}
return true; return true;
}, },

View File

@ -1218,37 +1218,43 @@
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax SGST", "account_name": "Input Tax SGST",
"tax_rate": 9.00 "tax_rate": 9.00,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax CGST", "account_name": "Input Tax CGST",
"tax_rate": 9.00 "tax_rate": 9.00,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax IGST", "account_name": "Input Tax IGST",
"tax_rate": 18.00 "tax_rate": 18.00,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax SGST RCM", "account_name": "Input Tax SGST RCM",
"tax_rate": 9.00 "tax_rate": 9.00,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax CGST RCM", "account_name": "Input Tax CGST RCM",
"tax_rate": 9.00 "tax_rate": 9.00,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax IGST RCM", "account_name": "Input Tax IGST RCM",
"tax_rate": 18.00 "tax_rate": 18.00,
"root_type": "Asset"
} }
} }
] ]
@ -1277,37 +1283,43 @@
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax SGST", "account_name": "Input Tax SGST",
"tax_rate": 2.5 "tax_rate": 2.5,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax CGST", "account_name": "Input Tax CGST",
"tax_rate": 2.5 "tax_rate": 2.5,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax IGST", "account_name": "Input Tax IGST",
"tax_rate": 5.0 "tax_rate": 5.0,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax SGST RCM", "account_name": "Input Tax SGST RCM",
"tax_rate": 2.50 "tax_rate": 2.50,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax CGST RCM", "account_name": "Input Tax CGST RCM",
"tax_rate": 2.50 "tax_rate": 2.50,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax IGST RCM", "account_name": "Input Tax IGST RCM",
"tax_rate": 5.00 "tax_rate": 5.00,
"root_type": "Asset"
} }
} }
] ]
@ -1336,37 +1348,43 @@
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax SGST", "account_name": "Input Tax SGST",
"tax_rate": 6.0 "tax_rate": 6.0,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax CGST", "account_name": "Input Tax CGST",
"tax_rate": 6.0 "tax_rate": 6.0,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax IGST", "account_name": "Input Tax IGST",
"tax_rate": 12.0 "tax_rate": 12.0,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax SGST RCM", "account_name": "Input Tax SGST RCM",
"tax_rate": 6.00 "tax_rate": 6.00,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax CGST RCM", "account_name": "Input Tax CGST RCM",
"tax_rate": 6.00 "tax_rate": 6.00,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax IGST RCM", "account_name": "Input Tax IGST RCM",
"tax_rate": 12.00 "tax_rate": 12.00,
"root_type": "Asset"
} }
} }
] ]
@ -1395,37 +1413,43 @@
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax SGST", "account_name": "Input Tax SGST",
"tax_rate": 14.0 "tax_rate": 14.0,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax CGST", "account_name": "Input Tax CGST",
"tax_rate": 14.0 "tax_rate": 14.0,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax IGST", "account_name": "Input Tax IGST",
"tax_rate": 28.0 "tax_rate": 28.0,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax SGST RCM", "account_name": "Input Tax SGST RCM",
"tax_rate": 14.00 "tax_rate": 14.00,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax CGST RCM", "account_name": "Input Tax CGST RCM",
"tax_rate": 14.00 "tax_rate": 14.00,
"root_type": "Asset"
} }
}, },
{ {
"tax_type": { "tax_type": {
"account_name": "Input Tax IGST RCM", "account_name": "Input Tax IGST RCM",
"tax_rate": 28.00 "tax_rate": 28.00,
"root_type": "Asset"
} }
} }
] ]

View File

@ -202,16 +202,15 @@ def get_or_create_account(company_name, account):
existing_accounts = frappe.get_list('Account', existing_accounts = frappe.get_list('Account',
filters={ filters={
'account_name': account.get('account_name'), 'company': company_name,
'account_number': account.get('account_number', ''), 'root_type': root_type
'company': company_name
}, },
or_filters={ or_filters={
'company': company_name, 'account_name': account.get('account_name'),
'root_type': root_type, 'account_number': account.get('account_number')
'is_group': 0 })
}
) print(company_name, account, existing_accounts)
if existing_accounts: if existing_accounts:
return frappe.get_doc('Account', existing_accounts[0].name) return frappe.get_doc('Account', existing_accounts[0].name)