mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-17 02:26:33 +00:00
chore: use selectbox instead of checkbox
This commit is contained in:
@@ -724,7 +724,10 @@ def get_daily_prorata_based_straight_line_depr(
|
||||
|
||||
|
||||
def get_daily_depr_amount(asset, row, schedule_idx, amount):
|
||||
if cint(frappe.db.get_single_value("Accounts Settings", "calculate_depr_using_total_days")):
|
||||
if (
|
||||
frappe.db.get_single_value("Accounts Settings", "calculate_daily_depreciation_using")
|
||||
== "Total days in depreciation period"
|
||||
):
|
||||
total_days = (
|
||||
date_diff(
|
||||
get_last_day(
|
||||
|
||||
@@ -85,7 +85,9 @@ class TestAssetDepreciationSchedule(IntegrationTestCase):
|
||||
self.assertEqual(schedules, expected_schedules)
|
||||
|
||||
def test_schedule_for_slm_for_existing_asset_daily_pro_rata_enabled(self):
|
||||
frappe.db.set_single_value("Accounts Settings", "calculate_depr_using_total_days", 1)
|
||||
frappe.db.set_single_value(
|
||||
"Accounts Settings", "calculate_daily_depreciation_using", "Total days in depreciation period"
|
||||
)
|
||||
asset = create_asset(
|
||||
calculate_depreciation=1,
|
||||
depreciation_method="Straight Line",
|
||||
@@ -123,7 +125,9 @@ class TestAssetDepreciationSchedule(IntegrationTestCase):
|
||||
for d in get_depr_schedule(asset.name, "Draft")
|
||||
]
|
||||
self.assertEqual(schedules, expected_schedules)
|
||||
frappe.db.set_single_value("Accounts Settings", "calculate_depr_using_total_days", 0)
|
||||
frappe.db.set_single_value(
|
||||
"Accounts Settings", "calculate_daily_depreciation_using", "Total years in depreciation period"
|
||||
)
|
||||
|
||||
def test_schedule_for_slm_for_existing_asset(self):
|
||||
asset = create_asset(
|
||||
@@ -196,7 +200,9 @@ class TestAssetDepreciationSchedule(IntegrationTestCase):
|
||||
|
||||
# Enable Checkbox to Calculate depreciation using total days in depreciation period
|
||||
def test_daily_prorata_based_depr_after_enabling_configuration(self):
|
||||
frappe.db.set_single_value("Accounts Settings", "calculate_depr_using_total_days", 1)
|
||||
frappe.db.set_single_value(
|
||||
"Accounts Settings", "calculate_daily_depreciation_using", "Total days in depreciation period"
|
||||
)
|
||||
|
||||
asset = create_asset(
|
||||
calculate_depreciation=1,
|
||||
@@ -254,7 +260,9 @@ class TestAssetDepreciationSchedule(IntegrationTestCase):
|
||||
for d in get_depr_schedule(asset.name, "Draft")
|
||||
]
|
||||
self.assertEqual(schedules, expected_schedule)
|
||||
frappe.db.set_single_value("Accounts Settings", "calculate_depr_using_total_days", 0)
|
||||
frappe.db.set_single_value(
|
||||
"Accounts Settings", "calculate_daily_depreciation_using", "Total years in depreciation period"
|
||||
)
|
||||
|
||||
# Test for Written Down Value Method
|
||||
# Frequency of deprciation = 3
|
||||
|
||||
Reference in New Issue
Block a user