Showing posts with label Fetch Voucher Entries. Show all posts
Showing posts with label Fetch Voucher Entries. Show all posts

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 

Wednesday, July 27, 2011

SQL SELECT to fetch Voucher entries

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

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

SELECT all a.vchid,a.vchnumber,a.reference,a.vchdate,mv.name as vchtype,mv.parent as basevchtype,m.name as ledgername,v.amount
FROM vchled v,masterledger m,vchmain a,mastervouchertype mv
where a.companyguid='6f273852-3e2d-477b-9800-8d13d6fae87b' and v.ledgerguid=m.masterguid and
v.vchguid=a.vchguid and a.vchtypeguid=mv.masterguid