diff --git a/css/all-web.css b/css/all-web.css
index 1780c8adf3b..13ea8029536 100644
--- a/css/all-web.css
+++ b/css/all-web.css
@@ -1092,14 +1092,14 @@ header .topbar .container {
margin: auto;
}
-.web-head-section {
- margin-bottom: 20px
-}
-
.web-content input[type="text"], .web-content input[type="password"], .web-content select {
min-width: 180px;
}
+.web-head-section {
+ margin-bottom: 20px
+}
+
.web-main-section {
width: 65%;
float: left;
diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py
index 6c8003a5817..4cfd64d4a17 100644
--- a/erpnext/accounts/doctype/account/account.py
+++ b/erpnext/accounts/doctype/account/account.py
@@ -202,7 +202,6 @@ class DocType:
self.update_nsm_model()
# Add curret year balance
self.set_year_balance()
-
# Check user role for approval process
# ==================================================================
@@ -232,7 +231,7 @@ class DocType:
# ==================================================================
def check_balance_before_trash(self):
if self.check_gle_exists():
- msgprint("Account with existing transaction can not be trashed", raise_exception=1)
+ msgprint("Account with existing transaction (Sales Invoice / Purchase Invoice / Journal Voucher) can not be trashed", raise_exception=1)
if self.check_if_child_exists():
msgprint("Child account exists for this account. You can not trash this account.", raise_exception=1)
@@ -247,11 +246,15 @@ class DocType:
# ==================================================================
def on_trash(self):
# Check balance before trash
- self.check_balance_before_trash()
+ self.check_balance_before_trash()
+
# rebuild tree
set(self.doc,'old_parent', '')
self.update_nsm_model()
+ # delete all cancelled gl entry of this account
+ sql("delete from `tabGL Entry` where account = %s and ifnull(is_cancelled, 'No') = 'Yes'", self.doc.name)
+
#delete Account Balance
sql("delete from `tabAccount Balance` where account = %s", self.doc.name)
@@ -260,6 +263,8 @@ class DocType:
def on_restore(self):
# rebuild tree
self.update_nsm_model()
+ # intiate balances
+ self.set_year_balance()
# on rename
# ---------
diff --git a/erpnext/setup/page/import_data/import_data.html b/erpnext/setup/page/import_data/import_data.html
index d227c2c0beb..5f9556b5af1 100644
--- a/erpnext/setup/page/import_data/import_data.html
+++ b/erpnext/setup/page/import_data/import_data.html
@@ -10,7 +10,7 @@
Step 1. Download Template
-
Over-write records with same name?
+
Do you want to over-write records? Warning: Over-writing the data of child tables, will delete all old data. For more info see below
Step 2. Upload and Import
@@ -33,23 +33,31 @@
-
Data Import Guide
-
-
Get the template of the DocType for which you want to import in CSV (Comma seperated values) format.
-
Fill in the data in the template. You can remove columns that are not relevant
-
Save the template in CSV format
-
Select the saved CSV file, identify the date format if any
-
Click on "Import"
-
+
Data Import Guide
+
+
Get the template of the DocType for which you want to import in CSV (Comma seperated values) format.
+
Fill in the data in the template. You can remove columns that are not relevant
+
Save the template in CSV format
+
Select the saved CSV file, identify the date format if any
+
Click on "Import"
+
+
Over-writing Guide
+
+
To over-write data, click on "Do you want to over-write records?" and then download template
+
To over-write parent table data, mention existing ID in "Name" column
+
Over-writing of child table data will delete all previous data of child table and re-import. so before over-writing child tables, export all data from system, modify them and then re-import
+
Over-write checkbox will be checked while importing