Thanks for the response, here is the query. In the query
ReceiptRepository.NoTracking just gets System.Linq.IQueryable(of RECEIPT)

>From r In ReceiptRepository.NoTracking
Where r.ID >= sReceipt And
r.ID <= eReceipt
Order By r.ID
Select New SalesReceipt With {
    .Id = r.ID,
    .ReceiptDate = r.RECEIPTDATE,
    .Customer = If(r.RECEIPTCUSTOMERs.Any,
r.RECEIPTCUSTOMERs.FirstOrDefault.CUSTOMER.PERSON.FULLNAME, String.Empty),
    .Cashier = r.SESSION.USER.USERNAME,
    .Cash = r.RECEIPTPAYMENTs.Where(Function(p) p.PAYMENTTYPE.TENDERTYPE =
1).Sum(Function(p) p.AMOUNT),
    .Card = r.RECEIPTPAYMENTs.Where(Function(p) p.PAYMENTTYPE.TENDERTYPE =
2).Sum(Function(p) p.AMOUNT),
    .Check = r.RECEIPTPAYMENTs.Where(Function(p) p.PAYMENTTYPE.TENDERTYPE =
3).Sum(Function(p) p.AMOUNT),
    .Others = r.RECEIPTPAYMENTs.Where(Function(p) p.PAYMENTTYPE.TENDERTYPE >
3).Sum(Function(p) p.AMOUNT),
    .Discount = r.RECEIPTLINEs.Sum(Function(l)
l.RECEIPTDISCOUNTs.Sum(Function(d) d.DISCOUNT)),
    .SalesReturn = r.RECEIPTLINEs.Where(Function(l) l.QUANTITY <
0).Sum(Function(l) l.QUANTITY * l.PRICE - If(l.RECEIPTDISCOUNTs.Any,
l.RECEIPTDISCOUNTs.Sum(Function(d) d.DISCOUNT), 0)),
    .Tax = r.RECEIPTLINEs.Where(Function(l) l.TAXABLE =
True).Sum(Function(l) l.QUANTITY * l.PRICE - If(l.RECEIPTDISCOUNTs.Any,
l.RECEIPTDISCOUNTs.Sum(Function(d) d.DISCOUNT), 0)),
    .Amount = r.RECEIPTPAYMENTs.Sum(Function(p) p.AMOUNT)}).ToList

-----Original Message-----
From: Jiri Cincura [mailto:disk...@cincura.net] 
Sent: Monday, April 30, 2012 1:34 AM
To: For users and developers of the Firebird .NET providers
Subject: Re: [Firebird-net-provider] Version 2.7.5.0 throwing Value Cannot
be Null

On Sat, Apr 28, 2012 at 10:41 PM, Muthu Annamalai
<muthuannama...@sbcglobal.net> wrote:
> some LINQ

And what about providing that query?

--
Jiri {x2} Cincura (x2develop.com founder) http://blog.cincura.net/ |
http://www.ID3renamer.com

----------------------------------------------------------------------------
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat
landscape has changed and how IT managers can respond. Discussions will
include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to