Ok this officially could be tricky?
At first I thought I could JOIN Inventory Items WITH Period Consumptions and selecting the highest Period calculating Count LESS consumption.
Unfortunately this does not consider current period Sales like TAGS {REPORT INVENTORY} and {REPORT CONSUMPTION DETAILS}.
The {CALL} throws the output to a jscript parser that; runs a SQL query to select GROUPS; then runs through a MATCH; sorts the Result; trims the Result to remove Groups; creates some Headers; JOINS the lot back together; and finally returns the Result set like a Samba Report.
Really
So @QMcKay when he arrives will do this in 1 SQL line and I still would prefer that syntax over mine but the current Orders not included in Consumptions was always going to be the trick…
Nothing changed?
I am now doing the most automated setup
And I want a flaw in the audit automatically split by flow in terms of money
something like this:
C.In Stock - C.Physical Inventory * C.Cost = deficit ($)
but to divide it into flow (sushi,pizza,bar), I need expression
something like this:
{REPORT CONSUMPTION DETAILS:X:(Groupcode=bar)}
okay, I.GroupCode work like a field.
but logically it should not work as expression (and does not work) because “I.GroupCode” takes data from another table.
how to force it to work in one line that data could be used in rules?
I think @emre would recommend using a script.
But I, as always, do not have enough knowledge of Jscript
@bezdelmax I.GroupCode expected to work. it will be awesome if you can let us know how you’ve used I.GorupCode and determined it does not work. Maybe you made a syntax error…