fix(Asset Capitalization): Reverse depreciation on cancel

This commit is contained in:
Saif Ur Rehman 2021-11-04 14:15:47 +05:00
parent dc3c27fd1b
commit 85d1a237ce
2 changed files with 2 additions and 0 deletions

View File

@ -371,6 +371,7 @@ class AssetCapitalization(StockController):
self.set_consumed_asset_status(asset)
if asset.calculate_depreciation:
self.reverse_depreciation_entry_made_after_disposal(asset)
self.reset_depreciation_schedule(asset)
else:
if asset.calculate_depreciation:

View File

@ -174,6 +174,7 @@ class TestAssetCapitalization(unittest.TestCase):
self.assertEqual(actual_gle, expected_gle)
# Cancel Asset Capitalization and make test entries and status are reversed
asset_capitalization.reload()
asset_capitalization.cancel()
self.assertEqual(consumed_asset.db_get('status'), 'Partially Depreciated')
self.assertFalse(get_actual_gle_dict(asset_capitalization.name))