From 3fb0482285766a286967dd47b5647b4014566f8f Mon Sep 17 00:00:00 2001 From: India Compliance Bot Date: Fri, 10 Mar 2023 12:29:10 +0000 Subject: [PATCH 1/5] chore(release): Bumped to Version 14.3.0 # [14.3.0](https://github.com/resilient-tech/india-compliance/compare/v14.2.1...v14.3.0) (2023-03-10) ### Bug Fixes * **transaction:** only fetch party gst details if party name is available ([#494](https://github.com/resilient-tech/india-compliance/issues/494)) ([da5e1bd](https://github.com/resilient-tech/india-compliance/commit/da5e1bd53c21338d09cc131b307058a24fad6713)) ### Features * ability to edit Place of Supply ([39278fd](https://github.com/resilient-tech/india-compliance/commit/39278fd1437d8b43cc2c63b961e2eab702396d99)) --- india_compliance/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/india_compliance/__init__.py b/india_compliance/__init__.py index 4a77120ba1..f79d47d485 100644 --- a/india_compliance/__init__.py +++ b/india_compliance/__init__.py @@ -1 +1 @@ -__version__ = "14.2.1" +__version__ = "14.3.0" From 10e7fd8060bea4f745d2176e5bf07e2790ce4bc4 Mon Sep 17 00:00:00 2001 From: India Compliance Bot Date: Tue, 14 Mar 2023 08:59:16 +0000 Subject: [PATCH 2/5] chore(release): Bumped to Version 14.3.1 ## [14.3.1](https://github.com/resilient-tech/india-compliance/compare/v14.3.0...v14.3.1) (2023-03-14) ### Performance Improvements * Optimization of HSN-wise summary report ([14d63c0](https://github.com/resilient-tech/india-compliance/commit/14d63c0c319b7ab26b1464e898426131123db509)) --- india_compliance/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/india_compliance/__init__.py b/india_compliance/__init__.py index f79d47d485..b8d2e3e738 100644 --- a/india_compliance/__init__.py +++ b/india_compliance/__init__.py @@ -1 +1 @@ -__version__ = "14.3.0" +__version__ = "14.3.1" From a038033f469bb346854fa5dd7584e376b9e35836 Mon Sep 17 00:00:00 2001 From: India Compliance Bot Date: Fri, 24 Mar 2023 14:40:51 +0000 Subject: [PATCH 3/5] chore(release): Bumped to Version 14.4.0 # [14.4.0](https://github.com/resilient-tech/india-compliance/compare/v14.3.1...v14.4.0) (2023-03-24) ### Bug Fixes * ensure document isn't cancelled when generating e-Waybill / e-Invoice ([#517](https://github.com/resilient-tech/india-compliance/issues/517)) ([933735f](https://github.com/resilient-tech/india-compliance/commit/933735f7e21042389061dd8d4b5192c5a5e31938)) * invalid reference to older parameter name ([ff4a765](https://github.com/resilient-tech/india-compliance/commit/ff4a76589e1986782d13a811449aea8ddf71b9c2)) * misc fixes to Bill of Entry ([#525](https://github.com/resilient-tech/india-compliance/issues/525)) ([d0ed8d0](https://github.com/resilient-tech/india-compliance/commit/d0ed8d0e1f966675d7de2d99b76379a187f1021b)) * use `get_system_timezone` instead of `get_time_zone` ([#495](https://github.com/resilient-tech/india-compliance/issues/495)) ([77d0820](https://github.com/resilient-tech/india-compliance/commit/77d08205a567bb2e399647a7bd99a718a913f03e)) ### Features * Bill of entry for Import of Goods ([#470](https://github.com/resilient-tech/india-compliance/issues/470)) ([8293860](https://github.com/resilient-tech/india-compliance/commit/82938600e5c6e9319d2428750a5e11ab6532de82)) --- india_compliance/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/india_compliance/__init__.py b/india_compliance/__init__.py index b8d2e3e738..15fd90e442 100644 --- a/india_compliance/__init__.py +++ b/india_compliance/__init__.py @@ -1 +1 @@ -__version__ = "14.3.1" +__version__ = "14.4.0" From 09867b6f77ad7458da4ab4976dbde0c1e162ba3a Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Thu, 30 Mar 2023 00:49:20 +0530 Subject: [PATCH 4/5] refactor: get_depreciation_amount according to frappe/erpnext#34644 --- .../income_tax_india/overrides/asset.py | 75 +++++++++---------- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/india_compliance/income_tax_india/overrides/asset.py b/india_compliance/income_tax_india/overrides/asset.py index 48e240e8fb..6beb90504b 100644 --- a/india_compliance/income_tax_india/overrides/asset.py +++ b/india_compliance/income_tax_india/overrides/asset.py @@ -1,44 +1,43 @@ import frappe from frappe import _ -from frappe.utils import date_diff, flt +from frappe.utils import date_diff +from erpnext.assets.doctype.asset.asset import ( + get_straight_line_or_manual_depr_amount, + get_wdv_or_dd_depr_amount, +) -def get_depreciation_amount(asset, depreciable_value, row): - if row.depreciation_method in ("Straight Line", "Manual"): - # if the Depreciation Schedule is being prepared for the first time - if not asset.flags.increase_in_asset_life: - depreciation_amount = ( - flt(asset.gross_purchase_amount) - - flt(row.expected_value_after_useful_life) - ) / flt(row.total_number_of_depreciations) - # if the Depreciation Schedule is being modified after Asset Repair - else: - depreciation_amount = ( - flt(row.value_after_depreciation) - - flt(row.expected_value_after_useful_life) - ) / (date_diff(asset.to_date, asset.available_for_use_date) / 365) - - else: - rate_of_depreciation = row.rate_of_depreciation - # if its the first depreciation - if depreciable_value == asset.gross_purchase_amount: - if row.finance_book and frappe.db.get_value( - "Finance Book", row.finance_book, "for_income_tax" - ): - # as per IT act, if the asset is purchased in the 2nd half of fiscal year, then rate is divided by 2 - diff = date_diff( - row.depreciation_start_date, asset.available_for_use_date - ) - if diff <= 180: - rate_of_depreciation = rate_of_depreciation / 2 - frappe.msgprint( - _( - "As per IT Act, the rate of depreciation for the first" +def get_depreciation_amount( + asset, + depreciable_value, + row, + schedule_idx=0, + prev_depreciation_amount=0, + has_wdv_or_dd_non_yearly_pro_rata=False, +): + if row.depreciation_method in ("Straight Line", "Manual"): + return get_straight_line_or_manual_depr_amount(asset, row) + else: + rate_of_depreciation = row.rate_of_depreciation + # if its the first depreciation + if depreciable_value == asset.gross_purchase_amount: + if row.finance_book and frappe.db.get_value("Finance Book", row.finance_book, "for_income_tax"): + # as per IT act, if the asset is purchased in the 2nd half of fiscal year, then rate is divided by 2 + diff = date_diff(row.depreciation_start_date, asset.available_for_use_date) + if diff <= 180: + rate_of_depreciation = rate_of_depreciation / 2 + frappe.msgprint( + _( + "As per IT Act, the rate of depreciation for the first" " depreciation entry is reduced by 50%." - ) - ) - - depreciation_amount = flt(depreciable_value * (flt(rate_of_depreciation) / 100)) - - return depreciation_amount + ) + ) + return get_wdv_or_dd_depr_amount( + depreciable_value, + rate_of_depreciation, + row.frequency_of_depreciation, + schedule_idx, + prev_depreciation_amount, + has_wdv_or_dd_non_yearly_pro_rata, + ) From 46c1ffbcf8731a1eb9532bf20f4b9580d9fef783 Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Thu, 30 Mar 2023 00:53:21 +0530 Subject: [PATCH 5/5] chore: linting --- .../income_tax_india/overrides/asset.py | 69 ++++++++++--------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/india_compliance/income_tax_india/overrides/asset.py b/india_compliance/income_tax_india/overrides/asset.py index 6beb90504b..c17bdcf0cf 100644 --- a/india_compliance/income_tax_india/overrides/asset.py +++ b/india_compliance/income_tax_india/overrides/asset.py @@ -1,43 +1,46 @@ import frappe from frappe import _ from frappe.utils import date_diff - from erpnext.assets.doctype.asset.asset import ( - get_straight_line_or_manual_depr_amount, - get_wdv_or_dd_depr_amount, + get_straight_line_or_manual_depr_amount, + get_wdv_or_dd_depr_amount, ) def get_depreciation_amount( - asset, - depreciable_value, - row, - schedule_idx=0, - prev_depreciation_amount=0, - has_wdv_or_dd_non_yearly_pro_rata=False, + asset, + depreciable_value, + row, + schedule_idx=0, + prev_depreciation_amount=0, + has_wdv_or_dd_non_yearly_pro_rata=False, ): - if row.depreciation_method in ("Straight Line", "Manual"): - return get_straight_line_or_manual_depr_amount(asset, row) - else: - rate_of_depreciation = row.rate_of_depreciation - # if its the first depreciation - if depreciable_value == asset.gross_purchase_amount: - if row.finance_book and frappe.db.get_value("Finance Book", row.finance_book, "for_income_tax"): - # as per IT act, if the asset is purchased in the 2nd half of fiscal year, then rate is divided by 2 - diff = date_diff(row.depreciation_start_date, asset.available_for_use_date) - if diff <= 180: - rate_of_depreciation = rate_of_depreciation / 2 - frappe.msgprint( - _( - "As per IT Act, the rate of depreciation for the first" + if row.depreciation_method in ("Straight Line", "Manual"): + return get_straight_line_or_manual_depr_amount(asset, row) + else: + rate_of_depreciation = row.rate_of_depreciation + # if its the first depreciation + if depreciable_value == asset.gross_purchase_amount: + if row.finance_book and frappe.db.get_value( + "Finance Book", row.finance_book, "for_income_tax" + ): + # as per IT act, if the asset is purchased in the 2nd half of fiscal year, then rate is divided by 2 + diff = date_diff( + row.depreciation_start_date, asset.available_for_use_date + ) + if diff <= 180: + rate_of_depreciation = rate_of_depreciation / 2 + frappe.msgprint( + _( + "As per IT Act, the rate of depreciation for the first" " depreciation entry is reduced by 50%." - ) - ) - return get_wdv_or_dd_depr_amount( - depreciable_value, - rate_of_depreciation, - row.frequency_of_depreciation, - schedule_idx, - prev_depreciation_amount, - has_wdv_or_dd_non_yearly_pro_rata, - ) + ) + ) + return get_wdv_or_dd_depr_amount( + depreciable_value, + rate_of_depreciation, + row.frequency_of_depreciation, + schedule_idx, + prev_depreciation_amount, + has_wdv_or_dd_non_yearly_pro_rata, + )