@@ -430,6 +430,7 @@ def _make_depr_schedule(
430
430
431
431
if not depreciation_amount :
432
432
continue
433
+ depreciation_amount = flt (depreciation_amount , asset_doc .precision ("gross_purchase_amount" ))
433
434
value_after_depreciation = flt (
434
435
value_after_depreciation - flt (depreciation_amount ),
435
436
asset_doc .precision ("gross_purchase_amount" ),
@@ -443,6 +444,7 @@ def _make_depr_schedule(
443
444
depreciation_amount += flt (value_after_depreciation ) - flt (
444
445
row .expected_value_after_useful_life
445
446
)
447
+ depreciation_amount = flt (depreciation_amount , asset_doc .precision ("gross_purchase_amount" ))
446
448
skip_row = True
447
449
448
450
if flt (depreciation_amount , asset_doc .precision ("gross_purchase_amount" )) > 0 :
@@ -517,10 +519,13 @@ def set_accumulated_depreciation(
517
519
i - 1
518
520
].accumulated_depreciation_amount
519
521
else :
520
- accumulated_depreciation = flt (self .opening_accumulated_depreciation )
522
+ accumulated_depreciation = flt (
523
+ self .opening_accumulated_depreciation ,
524
+ asset_doc .precision ("opening_accumulated_depreciation" ),
525
+ )
521
526
522
- depreciation_amount = flt (d .depreciation_amount , d . precision ( "depreciation_amount" ) )
523
- value_after_depreciation - = flt (depreciation_amount )
527
+ value_after_depreciation - = flt (d .depreciation_amount )
528
+ value_after_depreciation = flt (value_after_depreciation , d . precision ( " depreciation_amount" ) )
524
529
525
530
# for the last row, if depreciation method = Straight Line
526
531
if (
@@ -530,12 +535,11 @@ def set_accumulated_depreciation(
530
535
and not date_of_return
531
536
and not row .shift_based
532
537
):
533
- depreciation_amount += flt (
538
+ d . depreciation_amount += flt (
534
539
value_after_depreciation - flt (row .expected_value_after_useful_life ),
535
540
d .precision ("depreciation_amount" ),
536
541
)
537
542
538
- d .depreciation_amount = depreciation_amount
539
543
accumulated_depreciation += d .depreciation_amount
540
544
d .accumulated_depreciation_amount = flt (
541
545
accumulated_depreciation , d .precision ("accumulated_depreciation_amount" )
0 commit comments