Skip to content

[FR] Support Actual Cost of Build Outputs based on Cost of Parts #7279

Description

@cjdet

Please verify that this feature request has NOT been suggested before.

  • I checked and didn't find a similar feature request

Problem statement

When creating a build order to assemble parts with purchase cost data, the cost of the assembled output is not the sum of the cost of the parts. Instead a BOM range is used in the "stock value" for the output. This does not allow accurate tracking of the value of inventory we have, which fundamentally breaks the ability to use InvenTree as part of the accounting side of inventory management.

Here is a simple example to show how this can cause significant errors in the calculated "stock value" versions the actual value in stock:

Let’s say we just have two parts:

  • C1: is a component that we purchase from a vendor
  • A1: is an assembly that is just composed of one C1
    Purchase 10x C1 at $10 each
  • We have paid $100 and our stock value accurately reflects this at $100
    Build 5x A1s
  • We now have 5x C1s and 5x A1s and our stock value accurately reflects our overall inventory of $100
    Buy another C1 at $100 (say we needed a part real fast, so high cost)
  • Now we have $200 in inventory
  • The original 5 C1s that remain are still priced at $10 each ($50 total)
  • The new 1 C1 is priced at $100 ($100 total)
  • However, the A1s we built from the $10 C1s no longer say they are just $10 each, instead their stock value is listed as $10-$100 each.
    So our overall inventory is:
  • $50 from original C1s
  • $100 from new C1
  • $50-$500 from old A1s
    Total: $200-$650

With this very simple example you could just say take the low end, but that doesn’t work in more complex examples. Using stock item pricing age can help in some cases, but not others.

My company would likely be willing to support some of this development since right now this is creating significant overhead in accounting for what the value of our stock is.

Suggested solution

When build outputs are created from a build order, the cost of the assembled stock items should be the sum of all the stock items used.

Describe alternatives you've considered

Using "Stock Item Pricing Age" can help in some cases, but does not work well overall to solve this problem since some parts we have get turned over quickly, while others only transition slowly and can have significant cost changes.

It makes sense that when looking at a part that the BOM price range will used to give a sense of the overall price of making a part. However, when a build order is completed the newly built part has a very specific cost based on the exact cost of the stock that was allocated to build the new part.

Right now the solution involves either a lot of additional spreadsheets or we have to manually assign costs to assemblies.

Examples of other systems

No response

Do you want to develop this?

  • I want to develop this.

Activity

  1. added
    enhancement
    triage:not-checked
    on May 21, 2024
  2. LavissaWoW commented on May 26, 2024

    @LavissaWoW
    Contributor

    I've been meeting similar questions from my own management.
    I do think the pre-requisites are present for this to be easy to implement.

    Sure, InvenTree isn't an accounting tool. And half-assing one is worse than not having one.
    But I do agree that it wouldn't be a bad idea to populate the purchase_price field for a build Output, basing the cost on the actual costs of the stock items used.

    Doing this will also yield more accurate tracking of increasing production costs, as the price range of a given part will be based on the actual production cost, not just the projected future cost.

  3. added
    pricing
    and removed
    triage:not-checked
    on May 27, 2024
  4. added this to the horizon milestone on May 27, 2024
  5. SchrodingersGat commented on May 27, 2024

    @SchrodingersGat
    Member

    @cjdet your suggestion is a good one. There is another similar issue floating around which raises the same idea, however I can't find it right now (the curse of having > 200 open issues and only a handful of active developers).

    I have been pondering on this one, I think it calls for an extension of the existing pricing system:

    • Allow individual stock items (i.e. build outputs) to have a more generic "unit cost" field (which is sourced from a purchase order, or build order, or manual input)
    • Allow unit cost to be generated from a build order by looking at the sum of component items which were consumed
    • Expose pricing to the plugin system and allow plugins to augment these calculated values

    Further ideas / discussions welcome. One additional consideration is for things like labour costs, and additional "costs to build" which are not part of the Bill of Materials

  6. added
    question
    build
    on May 27, 2024
  7. cjdet commented on May 27, 2024

    @cjdet
    Author

    Thanks for the consideration and feedback. I searched a whole bunch of FRs and Bugs and didn't find anything along these lines, but I'm sure there are other related ones. Here are some additional thoughts:

    • I agree that a basic propagation to purchase_price would be straight forward, however, it does raise the question of what to do if one of the sub-components does not have a purchase_price.
      • It would be nice if there were a warning either when allocating stock or before completing the build output, which would require a bit more effort to implement this and adds complexity. This might be the ideal option as it makes the user think about what they want to do.
      • It could default to using "stock value" if purchase_price is unavailable, but then it does raise the question of which end of the range to select. So probably this just adds unneeded complexity.
      • The simplest would be to just use zero. I think this is reasonable at least as a first past.
    • Adding "unit cost" would make a lot of sense.
      • In addition to adding labor costs, this would be an opportunity to add shipping costs as well. If this is the route, it would be great to be able to add line items for these things to purchase orders as well and have them automatically spread across the unit cost. We add shipping costs manually right now during purchase orders. This is related to #3928 which requests this as well.
      • While this is probably the best way to do it, if this revamp of the pricing system isn't going to happen soon, then I'd say it would be better to just use purchase_price for storing this for assemblies since it is still flagged as something assembled to differentiate from something just purchased.

    While InvenTree certainly isn't an accounting system, it is tightly tied to accounting since at least in the US you can't deduct cost of goods sold until the inventory goes out the door. So knowing how much the parts of an assembly you just sold cost is very important. Regardless, InvenTree has really streamlined out inventory management and build proces, thanks!

  8. added
    Seeking Funding
    on May 27, 2024
  9. SchrodingersGat commented on May 27, 2024

    @SchrodingersGat
    Member

    @cjdet given the vast quantity of outstanding issues, this concept (while important, and I support it) is getting added to a very big pile of things to do.. Our development team is very under resourced unfortunately.

    If your comapny is willing to fund this issue, or even contribute code I'd be happy to discuss further!

  10. matmair commented on May 27, 2024

    @matmair
    Member

    I expect whoever adds this functionality to commit to maintaining it, I guarantee I will neither handle bug reports, fixes, reviews or code quality for it.
    And I expect the person to write documentation that ensures InvenTree is not mistaken for an accounting system, driving some small businesses into the ground come tax time.

  11. cjdet commented on May 29, 2024

    @cjdet
    Author

    @SchrodingersGat we would certainly be willing to talk about funding this or contributing code. Would you be open to just propagating purchase_price into the purchase_price of the assembly? If so that could be a straightforward PR that we could probably do. If it is revamping to add unit_cost, that would require a lot more in-depth knowledge.

  12. removed
    Seeking Funding
    on Mar 21, 2025
  13. gunstr commented on Oct 21, 2025

    @gunstr
    Contributor

    As the concept with "Internal Price" is already implemented I would suggest to use that as "Unit Price" for new stock items created as build output, that would solve the stock valuation issue discussed above.

    It will require manual work to set and maintain the "Internal Price" but I do not really think there is a way around that. In my production environment I have actually taken that one step further - the "Internal Price" is manually maintained for most parts, not only assemblies but also purchased parts. That comes with the advantage that the calculated BoM prices for assemblies are always relevant.

    This method works very well and the only feature I'm missing is to have InvenTree to pick the Internal Price (if it exists) for an assembly and automatically use that as the Unit Price for each new stock item created as build output.

  14. SchrodingersGat commented on Oct 21, 2025

    @SchrodingersGat
    Member

    the only feature I'm missing is to have InvenTree to pick the Internal Price (if it exists)

    The key issue here is that the "internal price" is actually a "range" of prices. So, which price do you actually pick?

    Also, note that the actual "cost" of the component parts used in the assembly may be different - if each part was purchased separately, or itself had a different cost of manufacture, then there's not a clear single value to pick here.

    If we can come up with a good solution here, I'd like to implement this soon

  15. gunstr commented on Oct 21, 2025

    @gunstr
    Contributor

    The key issue here is that the "internal price" is actually a "range" of prices. So, which price do you actually pick?

    There is a lot of flexibility built into InvenTree but for the internal price I do not see a usecase for a range why I always set the price for qty 1. When using the internal price for stock valuation it has to be a fixed value irrespective of volume.

    Also, note that the actual "cost" of the component parts used in the assembly may be different - if each part was purchased separately, or itself had a different cost of manufacture, then there's not a clear single value to pick here.

    I take care of that by also maintaining the "Internal Price" for purchased parts. For cheap "commodity" type of components the price is reviewed and uppdated one or two times per year while the most expensive parts are being reviewed for every PO. As there is an "Internal Price" for each part the BoM cost calculated by InvenTree can be used directly as input when it's time to update the Internal Price for assemblies. The BoM cost will vary over time but only as a consequence of updates of the Internal Price for sub components. This could potentially be automated but I actually prefer to do a quick review before updating the Internal price, normally the sales prices are also updated at the same time.

    It's a bit difficult to find a good trigger for when to Review/update the Internal Price for asseblies but typically that is done before large build orders are opened or when the Internal Price is changed for more expensive parts (the "Used In" analysis comes in handy for that).

    Until now I have not realized that the "Purchase price" can be set also for asssembly atok items and is used as Unit Price, As we have discussed it now I tested to do that manually for last weeks build output and it looks really promising. If the Internal Price for the part could be mapped automatically to the stock item(s) when build output is created I would be super happy. And as you suggested in #10625 mabye rename the "Purchase price" field for stock items to "Unit price" to avoid confusion.

  16. SchrodingersGat commented on Oct 21, 2025

    @SchrodingersGat
    Member

    For your application it sounds like you have a simplified solution and are happy with a significant amount of manual data entry - however many users will have large datasets with a complex purchasing history where the cost range of any given part is substantial. Extend this to dozens of line items in a BOM and it gets complicated!

    I think that the solution here looks like:

    • Providing a default "pricing plugin" which provides a reasonably generic solution
    • Uses can write their own pricing plugin if they require a custom solution
  17. gunstr commented on Oct 22, 2025

    @gunstr
    Contributor

    A few experiences from working in a large company with hundred of thousands different part to maintain are:

    1. The internal price for each item should be fixed and only changed following a strict schedule. The main reason is that changes to internal prices will change the overall stock value and will obviously have an impact on the financial reporting.
    2. Updates of the internal prices are done based on a mix of analysis of historical purchase data as well as predictions / proposals from vendors
    3. Tools are required for this to be done efficiently in large scale, both for analysis and certain bulk updates (such as price update of commodity parts like resistors)

    This is the kind of general principles I have scaled down to the smaller dataset (currently ~1k parts) I use InvenTree for now and I think your suggestion sounds very reasonable. As I see it all basic functionality is already there in InvenTree, it's more about using it in a proper way and possibly add plugins to support or automate certain tasks. I have not looked into it, but I guess setting the "Unit Price" = "Part Internal Price" for build outputs should already now be possible to implement as a plugin - correct? It would probably also be possible to raise a flag if there is no internal price set - or if there is more than one as that is not allowed in my case.

    Irrespective of different decisions on update strategies I see maintaining the "Internal Price" field for Parts and "Unit Price" field for stock items as the core to keep stability and consistency wrt. pricing.

    Looking at @cjdet original problem description in this issue the decision on how to handle the corner case with one single component having an extremely high peak cost I beleive will always require a manual decision how to handle.

  18. modified the milestones: horizon, 2.0.0 on Feb 12, 2026
  19. matmair commented on Feb 12, 2026

    @matmair
    Member

    @SchrodingersGat I feel like this might be an important one when / if we ever get to the pricing refactor

  20. SchrodingersGat commented on Feb 13, 2026

    @SchrodingersGat
    Member

    Agreed, it is on my radar too

  21. PTrUNB commented on Aug 10, 2026

    @PTrUNB

    Currently price max.1 and min.0 are available in reports.
    Could we get a BOM price based on primary supplier as a work around ?

  22. added
    Seeking Funding
    on Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Seeking Fundingbuildenhancementpluginpricingquestion

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions