Report: Entry by Warehouse and Product Group

Hey guys, I found a post where emre has shown a report that should do this, but it seems as the report does not really work, and I tried to use part of code from it but its not giving me the right display.

Here is what I have and how it looks:

CODE:

[Purchases by Group:1, 1]
{REPORT INVENTORY TRANSACTION DETAILS:T.ItemGroup,T.TotalPrice.Sum}
>Total|{REPORT INVENTORY TRANSACTION DETAILS:T.TotalPrice.Sum}

[ENTRADAS por ARMAZEM:3, 1, 1, 1, 1, 2, 2]
@{REPORT CONSUMPTION DETAILS:C.Warehouse.asc::{0}:,}
@{REPORT CONSUMPTION DETAILS:I.GroupCode.asc::,}
>>Item|Entr.|Trans.|Result.|Unid.|Custo Unt.|Custo Tot.
>>$1
>$2
{REPORT CONSUMPTION DETAILS:
C.Name.asc,
C.Added.sum,
C.Removed.sum,
[C.Added.sum]-[C.Removed.sum],
C.Unit,
C.Cost.sum,
[C.Cost.sum]*[C.Added.sum]:C.Added>0 and I.GroupCode="$2" and (PCW=$1) or C.Removed>0 and (PCW=$1)

}

So if I remove the I.GroupCode="$2" part the report works fine.

Help?

Did you define group codes for your products?

Yeees, in Inventory items I have them.

Where did you get that syntax from?
I had to write a JScript program just to reference GroupCode.

See my request here:

It’s in the post from Emre he linked.

Umm I reckon its a mistake?

Both Warehouse & GroupCode are in the Inventory File and not Consumptions - so why use “C” and then “I”. Also that Warehouse is Name not Code.

Nope I tested it and seems to work

1 Like

Try adding items to more than one warehouse, with me the report didn’t work when I did that, everything went weird.

I see so thats a known limitation with the way that feature works we need to rewrite it one sec you need to replace the first parameter with a script to get warehouse from sql.

2 Likes

Ok this is a Version thing @Jesse - does not work for 5.60! My mistake but did not read anywhere when it was introduced…

5.1.62 is latest release.

Hey guys, I didnt want to open a new topic since we are still very close on the same idea.

My question is, is there a way to subtract entries from a Specific Transaction Type?

Here is an example:

[ARMAZEM para COZINHA:3,2, 2,1, 2]
>Name|Target|Quantity|Unit|Amount
{REPORT INVENTORY TRANSACTION DETAILS:
T.Name,
T.Target,
T.Quantity.Sum,
T.Unit,
T.TotalPrice.Sum:(ITT=Transferencia Armazem para Cozinha)
}

[Compra para Armazem:3,2, 2,1, 2]
>Name|Target|Quantity|Unit|Amount
{REPORT INVENTORY TRANSACTION DETAILS:
T.Name,
T.Target,
T.Quantity.Sum,
T.Unit,
T.TotalPrice.Sum:(ITT=Compra para Armazem)
}

That works, and shows transactions only of a specific type as specified in (ITT=Name) … now is there a way for me to add something like:

(ITT=Name) subtract (ITT=Other Name) ???

In the sample above I would like to get:

(ITT=Compra para Armazem) - (ITT=Transferencia Armazem para Cozinha)

Possible? No? If it is possible then we would have a report that shows you warehouse purchases minus items that were transferred to other warehouses and you’d also see the document total price (costs of items), and that would be awesome!

Yes, you run the report tag twice and wrap it inside an expression. Here is an example, taken from my Cashout Report …

USD|[=F(TN('{REPORT TASK DETAILS:TSC.Total.Sum:(TST=CO Cash USD)}'),'0.00')]|[=F(TN('{REPORT TASK DETAILS:TSC.Total.Sum:(TST=CO Cash USD)}')-TN('{REPORT TASK DETAILS:TSC.Float.Sum:(TST=CO Cash USD)}'),'0.00')]|[=F(TN('{ACCOUNT TOTAL:Cash USD}'),'0.00')]|[=F(TN('{REPORT TASK DETAILS:TSC.Total.Sum:(TST=CO Cash USD)}')-TN('{REPORT TASK DETAILS:TSC.Float.Sum:(TST=CO Cash USD)}')-TN('{ACCOUNT TOTAL:Cash USD}'),'0.00')]

There are several expressions there for different columns, here is one of them, which produces a value that is the Count of Cash (Sum) minus the starting Float value for USD (this is using values set in Task Types, but the idea is the same:

[=F(TN('{REPORT TASK DETAILS:TSC.Total.Sum:(TST=CO Cash USD)}')-TN('{REPORT TASK DETAILS:TSC.Float.Sum:(TST=CO Cash USD)}'),'0.00')]

And the last epxression runs the tag 3 times to produce [CashCount(sum) - FloatValue - CashAccountBalance] to product over/short (+/-) …

[=F(TN('{REPORT TASK DETAILS:TSC.Total.Sum:(TST=CO Cash USD)}')-TN('{REPORT TASK DETAILS:TSC.Float.Sum:(TST=CO Cash USD)}')-TN('{ACCOUNT TOTAL:Cash USD}'),'0.00')]

It produces something like the following (the starting Float must have been 202.00 and we collected 92.75 in Cash Payments) …

3 Likes

You can also do some calculations in your Field Selection Section, as is done with the P&L Report …

[Products:5,5, 3, 3, 3, 3, 3, 3, 3]
@{REPORT COST DETAILS:M.GroupCode.asc::,}
>Name|Portion|Qty|Sales|Cost|Cost%|PM%|PM|P%
>>GROUP|$1|||||||
{REPORT COST DETAILS:C.Name.asc,C.PortionName,
C.Quantity.Sum,
[([C.AvgPrice]*[C.Quantity]).Sum],
[([C.Cost]*[C.Quantity]).Sum],
[($5/$4)];#0.00 %;-#0.00 %,
[($4-$5)/$3];#0.00 %;-#0.00 %,
[($4-$5)];0.00,
[(($4-$5)/$5)];#0.00 %;-#0.00 %:M.GroupCode="$1"}

But in your case, it is not quite what you are looking for, because you want different constraints/filters for each Tx Type.

Okay, I almost got it how it works, but my issue now is that its not being sorted by item, its just transforming it to number and adds all together?

I must be doing something wrong, or need to add more “wraps”?

[Compra para Armazem:3,2, 2,1, 2]
>Name|Target|Quantity|Unit|Amount
{REPORT INVENTORY TRANSACTION DETAILS:
T.Name,
T.Target,
[=F(TN('{REPORT INVENTORY TRANSACTION DETAILS:T.Quantity.Sum:(ITT=Inventory Purchase Transaction)}'),'0.00')]-[=F(TN('{REPORT INVENTORY TRANSACTION DETAILS:T.Quantity.Sum:(ITT=Transfer to Kitchen)}'),'0.00')],
T.Unit,
T.TotalPrice.Sum:(ITT=Inventory Purchase Transaction)
}