Thursday, July 28, 2011

SQL SELECT to fetch Voucher entries (Stock details)

Here's a SQL SELECT statement to fetch the Voucher entries (Inventory details) only from various tables created by DX-Fusion utility :-

(: TO DO - Change the CompanyGUID below - a.companyguid='xxx' :)


SELECT all vchmain.vchid,vchmain.vchnumber,vchmain.reference,vchmain.vchdate,
mv.name as vchtype,mv.parent as basevchtype,ms.name as stockitem, 
vchinv.actualqty,vchinv.billedqty,mu.name as unit,vchinv.rate,vchinv.amount, 
vchinv.discount 
FROM vchinv,masterstockitem ms,vchmain,mastervouchertype mv,masterunit mu 
WHERE vchmain.companyguid='6f273852-3e2d-477b-9800-8d13d6fae87b' and 
vchinv.itemguid=ms.masterguid and vchinv.unitguid=mu.masterguid and 
vchinv.vchguid=vchmain.vchguid and vchmain.vchtypeguid=mv.masterguid 

No comments:

Post a Comment