public IEnumerable <PostedVoucherViewModel> GetPostedVouchersByDateRangeAndCompany(DateTime fromdate, DateTime todate, [FromRoute] long companyid) { IList <PostedVoucherViewModel> PVVMs = new List <PostedVoucherViewModel>(); foreach (PostedVoucher PV in PostedVou_repo.GetList(a => a.CompanyId != null && a.CompanyId == companyid && a.Date.Value.Day >= fromdate.Day && a.Date.Value.Month >= fromdate.Month && a.Date.Value.Year >= fromdate.Year && a.Date.Value.Day >= todate.Day && a.Date.Value.Month >= todate.Month && a.Date.Value.Year >= todate.Year)) { PostedVoucherViewModel PVVM = new PostedVoucherViewModel() { PostedVoucherId = PV.PostedVoucherId, VoucherId = PV.VoucherId, Date = PV.Date, Description = PV.Description, TotalCreditAmount = PV.TotalCreditAmount, TotalDebitAmount = PV.TotalDebitAmount, FinancialYear = FinancialYear_Repo.GetFirst(a => a.FinancialYearId == PV.FinancialYearId), VoucherType = VoucherType_Repo.GetFirst(a => a.VoucherTypeId == PV.VoucherTypeId), VoucherDetails = VouDetail_repo.GetList(a => a.VoucherId == PV.VoucherId, b => b.Account) }; PVVMs.Add(PVVM); } return(PVVMs); }
public IEnumerable <PostedVoucherViewModel> GetPostedVouchersByDate(DateTime date) { IList <PostedVoucherViewModel> PVVMs = new List <PostedVoucherViewModel>(); foreach (PostedVoucher PV in PostedVou_repo.GetList(a => a.Date.Value.Year == date.Year && a.Date.Value.Month == date.Month && a.Date.Value.Day == date.Day)) { PostedVoucherViewModel PVVM = new PostedVoucherViewModel() { PostedVoucherId = PV.PostedVoucherId, VoucherId = PV.VoucherId, Date = PV.Date, Description = PV.Description, TotalCreditAmount = PV.TotalCreditAmount, TotalDebitAmount = PV.TotalDebitAmount, FinancialYear = FinancialYear_Repo.GetFirst(a => a.FinancialYearId == PV.FinancialYearId), VoucherType = VoucherType_Repo.GetFirst(a => a.VoucherTypeId == PV.VoucherTypeId), VoucherDetails = VouDetail_repo.GetList(a => a.VoucherId == PV.VoucherId, b => b.Account) }; PVVMs.Add(PVVM); } return(PVVMs); }
public IEnumerable <PostedVoucherViewModel> GetPostedVouchersByFinancialYear([FromRoute] long id) { IList <PostedVoucherViewModel> PVVMs = new List <PostedVoucherViewModel>(); foreach (PostedVoucher PV in PostedVou_repo.GetList(a => a.FinancialYearId == id)) { PostedVoucherViewModel PVVM = new PostedVoucherViewModel() { PostedVoucherId = PV.PostedVoucherId, VoucherId = PV.VoucherId, Date = PV.Date, Description = PV.Description, TotalCreditAmount = PV.TotalCreditAmount, TotalDebitAmount = PV.TotalDebitAmount, FinancialYear = FinancialYear_Repo.GetFirst(a => a.FinancialYearId == PV.FinancialYearId), VoucherType = VoucherType_Repo.GetFirst(a => a.VoucherTypeId == PV.VoucherTypeId), VoucherDetails = VouDetail_repo.GetList(a => a.VoucherId == PV.VoucherId, b => b.Account) }; PVVMs.Add(PVVM); } return(PVVMs); }