Skip to content

Conversation

@iryadifarhan
Copy link

@iryadifarhan iryadifarhan commented Nov 26, 2025

Hello there! So apparently, I'm laying my hands on the code around reporting and stumbled upon this bug.

And.. yes, I have tested this on the demo website, and it appears to still be there :0

Here, I would give the exact steps (preconditions) on how I reproduce the bug, and also my proposed solution.

Feel free to adjust if it's not quite well!
Thanks!

Preconditions 📝

  • I have an asset with information as below
    asset-information

Current date when testing this was 26th November 2025, so the asset would fully depreciate at 1st of December 2025

  • Depreciation type being used is defined as below
    depreciation-type-detail
  • System is using linear method
    depreciation-setting

Bug 🐛

On Depreciation Report page, it displayed an inaccurate value for Monthly Depreciation as DepreciationReportTransformer ignores the floor value!
*based from Straight-line Depreciation calculation
report-before

Proposed Solution 💡

Utilize defined formula at parent class app\Models\Depreciable.php

public function getMonthlyDepreciation()
{

    return ($this->purchase_cost-$this->calculateDepreciation())/$this->get_depreciation()->months;

}

Fixed Result ✅

report-after

@iryadifarhan iryadifarhan requested a review from snipe as a code owner November 26, 2025 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant