Description
Checklist
Please make sure you have performed the following steps before submitting a new feature request, change [ ]
to [x]
to mark it as done
- I have read the Contributing Guidelines and Scope and Purpose
- I have searched through existing issues.
Description
Currently, when using the "Copy Attachments" option while adding a supply to a service/repair/upgrade, all attachments ever associated with that supply are copied over, regardless of when the attachments were added.
Reproduction Steps:
- Add a supply item and attach a file (e.g.,
receipt_v1.pdf
). - Use that supply in a service/repair/upgrade with Copy Attachments enabled → Attachment is correctly copied.
- Replenish the same supply (same name, same ID), and add a new attachment (e.g.,
receipt_v2.pdf
). - Use the same supply again in a new service/repair/upgrade with Copy Attachments → Both
receipt_v1.pdf
andreceipt_v2.pdf
are copied over.
Desired Behavior:
Only the attachment(s) relevant to the currently used supply quantity should be copied, not all historical attachments for the supply.
Suggested Solution:
Associate attachments with the supply quantity at the time of attachment. That way:
- When a supply is replenished and a new attachment is added, that attachment is only associated with the new quantity.
- Future services using that supply will only copy the attachments relevant to the portion of stock being used.
This avoids the need to create a completely new supply entry with a different name just to avoid attachment carryover, which IMHO is an error-prone workaround.