@notrinos, Well
Look at my explanation in my former post. We are only interested in produced items (minus ev. disassemblies).
All deliveries and credits are of no interest for us. Isn't that right?
$sql .= "AND s.mb_flag='M' AND m.type <> ".ST_CUSTDELIVERY." AND m.type <> ".ST_CUSTCREDIT." ";
I have double checked this and it works.
I will rerun a commit now.
/Joe