Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Purchase Cost to Asset Model #15273

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

Godmartinz
Copy link
Collaborator

@Godmartinz Godmartinz commented Aug 12, 2024

Description

This adds a purchase_cost to the models table. If an asset assigned the model leaves a blank purchase cost when creating a new asset, it will inherit the purchase cost from the model This only applies to when creating assets, and will not happen when updating or leaving the purchase cost blank in an edit
A help info line has been added to the create route.

image

On the create route:
image

On the Update/edit route:
image

Fixes #15237

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • [ x] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

  • PHP version:
  • MySQL version
  • Webserver version
  • OS version

Checklist:

Copy link

what-the-diff bot commented Aug 12, 2024

PR Summary

  • Introduction of Purchase Cost Field
    The code introduces a new field named purchase_cost. This means that both our asset models and individual assets will now have an additional piece of information related to their buying prices.

  • New Purchase Cost Calculation Method
    A new method named purchaseCostExplicit has been added to our assets. This new method will help us in calculating the explicit purchase cost more efficiently.

  • Database Update
    The database schemas for our model and asset tables have been updated to accommodate this new purchase_cost attribute. This is done by a newly added migration file.

  • New Cost Info View
    A new blade view file named purchase_cost.blade.php has been added to provide a dedicated view for this new purchase cost information. This will make it easier for users to view this information.

  • Modification for Existing View
    Additionally, a minor change has been made to the existing 'models' view file (edit.blade.php). This is done to incorporate the new purchase_cost field and provide a smoother user experience.

@snipe
Copy link
Owner

snipe commented Aug 12, 2024

I'm not sure we want to do an explicit thing here. I think (similar to the way eol date used to work) we just offer that as a prepopulated value when the asset gets created.

@Godmartinz
Copy link
Collaborator Author

Question: if there was purchase of a model with upgrades making it a different cost then the model, do we want to put an indicatior for some reason on the asset info page noting that?

@snipe
Copy link
Owner

snipe commented Aug 14, 2024

Question: if there was purchase of a model with upgrades making it a different cost then the model, do we want to put an indicator for some reason on the asset info page noting that?

Perhaps just noting the model's default price would be enough? That could get confusing if the model's cost went up over time though - could make it look like it's a cheaper machine, when really it's just an older machine.

@snipe
Copy link
Owner

snipe commented Aug 23, 2024

The challenge I see here is that if someone wants to deliberately leave a purchase cost blank on an asset, there isn't really a way to do it using this method.

@snipe
Copy link
Owner

snipe commented Sep 18, 2024

Ping @Godmartinz

@Godmartinz
Copy link
Collaborator Author

Godmartinz commented Sep 18, 2024

Should we maybe add a button next to the input Use Asset Model price that would populate the price? @snipe
We would avoid oversight and the need to search for the price that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants