Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are the changes about?
Added a unified stock transaction log to the product card. The new page (
lager/productCardIncludes/stockLog.php) collects all stock-related tables into one centralized view so users can see exactly how a product's stock level has evolved over time.The complete stock log can also be used as an auditing tool, letting the user check if they remembered to add an item into stock, remembered to remove something from stock that was removed from inventory or something similar. (This was requested by my boss for this reason)
Changes
New file:
lager/productCardIncludes/stockLog.phpUNION ALLquery:stocklog- manual adjustments with reason and initialsbatch_kob- incoming stock from purchase orders (lines grouped per order)batch_salg- outgoing stock from sales orders (lines grouped per order, negated)regulering- physical inventory counts (posted and unposted)lagerstatusvalue and working backwards through each transactionbatch_kobrows created as a FIFO side-effect of a manual adjustment (same quantity, within 10 seconds) are hidden since they are already represented by thestocklogentryordre_id = 0are kept as individual rows to avoid incorrect groupingHAVING SUM(antal) <> 0)bogfort = false) are excluded from the running balance but still shown in the logThe page admittedly does not use the data table framework that the rest of the system has been migrated to as #214 has not been merged and a fatal error bug that the PR aimed to fix has not been resolved. If this bug does get fixed / the PR merged i will gladly update this page to use the framework.
Have you checked the following?
https://docs.google.com/document/d/1GOmomtvKf21OV2VWNOIPweDi4gJHpMCK5qXzrPrypUc/edit?usp=sharing