public async void GetPayments(PaymentReportCriteria p)
 {
     Status = new StatusInfo
     {
         ErrorMessage = "",
         IsBusy = true,
         StatusMessage = "getting payments..."
     };
     try
     {
         Payments = await Task<ObservableCollection<vwVoidedPayment>>.Factory.StartNew(() =>
         {
             var task = RptSvc.GetVoidedPayments(p);
             return new ObservableCollection<vwVoidedPayment>(task.Result);
         });
     }
     catch (Exception e)
     {
         Status = new StatusInfo
         {
             StatusMessage = "Error loading payments",
             ErrorMessage = e.Message
         };
     }
 }
 public async void GetPayments(PaymentReportCriteria p)
 {
     Status = new StatusInfo
     {
         ErrorMessage = "",
         IsBusy = true,
         StatusMessage = "getting payments..."
     };
     try
     {
         ShowGridData = false;
         Payments = await Task<ObservableCollection<vwPayment>>.Factory.StartNew(() =>
         {
             var task = RptSvc.GetOpenPayments(p);
             var v = new ObservableCollection<vwPayment>(task.Result);
             return v;
         });
         HeadingText = string.Format("{0} Account Open Payment Report for Payments as of {1:ddd, MMM d, yyyy}",
             p.Account.account_name, p.EndDate);
     }
     catch (Exception e)
     {
         Status = new StatusInfo
         {
             StatusMessage = "Error loading payments",
             ErrorMessage = e.Message
         };
     }
 }
示例#3
0
 public static async Task<List<vwJobRpt>> GetJobRpt(PaymentReportCriteria grc)
 {
     using (var ctx = new CoopCheckEntities())
     {
         return await Task.Factory.StartNew(() =>
             ctx.GetJobPaymentsReport(grc.Account.account_id, grc.StartDate, grc.EndDate).ToList());
     }
 }
 public async void ResetState()
 {
     PaymentReportCriteria = new PaymentReportCriteria();
     PaymentReportCriteria.StartDate = new DateTime(DateTime.Now.Year, 1, 1);
     PaymentReportCriteria.EndDate = DateTime.Today.AddDays(1);
     Accounts = new ObservableCollection<bank_account>(await BankAccountSvc.GetAccounts());
     PaymentReportCriteria.Account =
         (from l in Accounts where l.IsDefault.GetValueOrDefault(false) select l).First();
     ShowGridData = false;
     EnableMiscFields = true;
     EnableCheckNum = true;
 }
示例#5
0
        public static async Task<List<vwBatchRpt>> GetBatchRpt(PaymentReportCriteria grc)
        {
            using (var ctx = new CoopCheckEntities())
            {
                return await Task.Factory.StartNew(() =>
                    ctx.GetBatchPaymentReport(grc.Account.account_id, grc.StartDate, grc.EndDate).ToList());

                //var x = await (
                //    from l in ctx.vwBatchRpts
                //    where ((l.batch_date >= grc.StartDate)
                //        && (l.batch_date <= grc.EndDate)
                //        && l.account_id == grc.Account.account_id)
                //    orderby l.batch_num
                //    select l).ToListAsync();
                //return x;
            }
        }
        public async void PrintReport(PaymentReportCriteria c)
        {
            var s = new OutstandingBalanceStats
            {
                AccountName = c.Account.account_name,
                AsOfDate = c.EndDate,
                ItemCount = PaymentsCnt.ToString(),
                OutstandingBalance = string.Format("{0:c}", PaymentsTotalDollars),
                PreparedBy = UserAuth.Instance.UserName
            };

            await OutstandingBalancePrintSvc.PrintOutstandingBalanceReportAsync(s);
        }
示例#7
0
        public static async Task<List<vwPayment>> GetPayments(PaymentReportCriteria crc)
        {
            IQueryable<vwPayment> query;
            List<vwPayment> v;
            using (var ctx = new CoopCheckEntities())
            {
                if (!string.IsNullOrEmpty(crc.CheckNumber))
                {
                    query = ctx.vwPayments.Where(x => x.check_num == crc.CheckNumber);
                }
                else
                {
                    query =
                        ctx.vwPayments.Where(
                            x => x.check_date >= crc.StartDate && x.check_date <= crc.EndDate);

                    if (crc.Account.account_id != BankAccountSvc.AllAccountsOption.account_id)
                        query = query.Where(x => x.account_id == crc.Account.account_id);

                    if (!string.IsNullOrWhiteSpace(crc.Email))
                    {
                        query = query.Where(x => x.email.Contains(crc.Email));
                    }

                    if (!string.IsNullOrWhiteSpace(crc.PhoneNumber))
                    {
                        query = query.Where(x => x.phone_number.Contains(crc.PhoneNumber));
                    }

                    if (!string.IsNullOrEmpty(crc.LastName))
                    {
                        query = query.Where(x => x.last_name.Contains(crc.LastName));
                    }

                    if (!string.IsNullOrEmpty(crc.FirstName))
                    {
                        query = query.Where(x => x.first_name.Contains(crc.FirstName));
                    }


                    if (crc.BatchNumber != null)
                    {
                        query =
                            query.Where(
                                x => x.batch_num == crc.BatchNumber);
                    }

                    if (!string.IsNullOrEmpty(crc.JobNumber))
                    {
                        query =
                            query.Where(
                                x =>
                                    SqlFunctions.StringConvert((double) x.job_num)
                                        .Contains(crc.JobNumber));
                    }
                    //string ob = String.IsNullOrEmpty(b.last_name) ? b.company : b.last_name;
                }
                v = await (from b in query
                    select b).ToListAsync();
            }
            return v;
        }
示例#8
0
        public static async Task<List<vwVoidedPayment>> GetVoidedPayments(PaymentReportCriteria crc)
        {
            IQueryable<vwVoidedPayment> query;
            List<vwVoidedPayment> v;
            using (var ctx = new CoopCheckEntities())
            {
                query =
                    ctx.vwVoidedPayments.Where(x => x.account_id == crc.Account.account_id)
                        .OrderBy(x => x.check_num)
                        .ThenBy(x => x.check_date);
                ;
                // if they pass a check number in ignore other criteria
                if (!string.IsNullOrEmpty(crc.CheckNumber))
                {
                    query = query.Where(x => x.check_num == crc.CheckNumber);
                }
                else
                {
                    query = query.Where(x => x.check_date >= crc.StartDate && x.check_date <= crc.EndDate);

                    if (!string.IsNullOrWhiteSpace(crc.Email))
                    {
                        query = query.Where(x => x.email.Contains(crc.Email));
                    }

                    if (!string.IsNullOrWhiteSpace(crc.PhoneNumber))
                    {
                        query = query.Where(x => x.phone_number.Contains(crc.PhoneNumber));
                    }

                    if (!string.IsNullOrEmpty(crc.LastName))
                    {
                        query = query.Where(x => x.last_name.Contains(crc.LastName));
                    }

                    if (!string.IsNullOrEmpty(crc.FirstName))
                    {
                        query = query.Where(x => x.first_name.Contains(crc.FirstName));
                    }

                    if (crc.BatchNumber != null)
                    {
                        query =
                            query.Where(
                                x => x.batch_num == crc.BatchNumber);
                    }

                    if (!string.IsNullOrEmpty(crc.JobNumber))
                    {
                        query =
                            query.Where(
                                x =>
                                    SqlFunctions.StringConvert((double) x.job_num)
                                        .Contains(crc.JobNumber));
                    }
                }
                v = await (from b in query select b).ToListAsync();
            }
            return v;
        }
示例#9
0
 public static async Task<List<vwPayment>> GetOpenPayments(PaymentReportCriteria prc)
 {
     IQueryable<vwPayment> query;
     List<vwPayment> v;
     using (var ctx = new CoopCheckEntities())
     {
         query =
             ctx.vwPayments.Where(
                 x => x.check_date <= prc.EndDate
                      && x.account_id == prc.Account.account_id
                      && x.cleared_flag == false);
         v = await (from b in query
             select b).ToListAsync();
     }
     return v;
 }
示例#10
0
 public static async Task<List<vwPayment>> GetUnclearedCheckReport(PaymentReportCriteria grc)
 {
     using (var ctx = new CoopCheckEntities())
     {
         var x = await (
             from l in ctx.vwPayments
             where (l.account_id == grc.Account.account_id && !l.cleared_flag && l.check_num == grc.CheckNumber)
             orderby l.check_date
             select l).ToListAsync();
         return x;
     }
 }
示例#11
0
 public static async Task<List<vwPositivePay>> GetPositivePayRpt(PaymentReportCriteria grc)
 {
     using (var ctx = new CoopCheckEntities())
     {
         var x = await (
             from l in ctx.vwPositivePays
             where ((l.check_date >= grc.StartDate)
                    && (l.check_date <= grc.EndDate)
                    && l.account_number == grc.Account.account_number)
             orderby l.check_date
             select l).ToListAsync();
         return x;
     }
 }
示例#12
0
 public static async Task<List<vwPayment>> GetJobPayments(PaymentReportCriteria grc)
 {
     List<vwPayment> v;
     using (var ctx = new CoopCheckEntities())
     {
         v = await (from b in ctx.vwPayments
             where ((b.job_num.ToString() == grc.JobNumber)
                    && (b.check_date >= grc.StartDate)
                    && (b.check_date <= grc.EndDate))
             select b).ToListAsync();
     }
     return v;
 }