VbzCart/docs/queries/discarded/qryCbx Restocks byPurchOrd
Jump to navigation
Jump to search
Details
- Status: deleted (uses old restock table, and no longer works)
- Requires: Template:Vbzcart/table
- Used by: qryCbx_Restocks
SQL
<mysql>CREATE OR REPLACE VIEW qryCbx_Restocks_byPurchOrd AS SELECT
r.ID, CAST(r.PurchOrdNum AS CHAR) AS Descr, NOT IsLocked AS IsOpen, r.WhenOrdered, r.WhenReceived, r.WhenConfirmed, r.ID_Supplier
FROM core_restocks AS r WHERE r.PurchOrdNum IS NOT NULL ORDER BY COALESCE(r.WhenKilled,r.WhenReceived,r.WhenOrdered,r.WhenDebited,r.WhenCreated) DESC;</mysql>