Example #1
0
        public bool IsFullPaid()
        {
            decimal totalInvoiceAmount = SalesInvoiceLines.Sum(a => a.Amount);
            decimal totalPaidAmount    = 0;
            decimal totalAllocation    = CustomerAllocations.Sum(a => a.Amount);

            foreach (var line in SalesInvoiceLines)
            {
                totalPaidAmount += line.GetAmountPaid();
            }
            return((totalPaidAmount + totalAllocation) >= totalInvoiceAmount);
        }
 private decimal GetAvailableAmountToAllocate()
 {
     return(SalesReceiptLines.Sum(a => a.AmountPaid) - CustomerAllocations.Sum(a => a.Amount));
 }