Part-DB-server icon indicating copy to clipboard operation
Part-DB-server copied to clipboard

Project Component Lock & Negative Quantity

Open 0x915 opened this issue 8 months ago • 1 comments

Is your feature request related to a problem? Please describe. In production environment usage I found a major logic flaw in the project functionality: A project's components are shared with other projects before they are consumed in production.

This makes it impossible to correctly count the actual component consumption for multiple projects (planning production at the same time, and purchasing missing components for multiple projects at the same time) because the list of missing components indicated by [Parts not stocked] on the [Build] page for each project references the current inventory (shared by all projects).

Describe the solution you'd like I think adding component locking to the project system (or call it [pre-build], [scheduled build]) would solve the global component sharing problem. The simplest implementation: 0. If I need to build twenty [Project A].

  1. [Project A] -> [PreBuild] -> [Amount=20 and Request].
  2. the component adds the [LockedQuantity] attribute and calculates this value by iterating through all the project prebuild requests that exist.
  3. [PreBuild Request] does not actually subtract the component quantity, meaning that the PreBuild can be undone. The [PreBuild Request] contains a [Confirm Production] function, which when used, eliminates the [PreBuild Request] and actually subtracts the component quantity.
  4. In conjunction with the above design, the component quantity display [AMOUNT - LOCKED] may have a negative number [AMOUNT is less than LOCKED], but this is not currently supported, and a negative number may be recognized as [QUANTITY NEEDED TO BE REPLENISHED].

Describe alternatives you've considered There is no solution in the case that negative quantities are not currently supported, because the number of components will just be reduced to zero even if [Do not check quantities] is selected when the project is built, and there is no way to know the cumulative missing quantities when multiple projects are made.

Additional context

Image Image

I apologize for mentioning such a complex feature request, I haven't learned php so I can't be directly involved in the project.

0x915 avatar Apr 27 '25 03:04 0x915

Another kind of "locking" was proposed in #571.

d-buchmann avatar May 20 '25 12:05 d-buchmann