Exemplo n.º 1
0
        public ActionResult Index()
        {
            InvoiceSvc svc = new InvoiceSvc();

            List<Invoice> OpenInvoicesLastYear = svc.GetByFilter(new List<Order.StatusOptions> { Order.StatusOptions.Paid }, null, common.Helper.DateRange.DateRangeFilter.Last365Days).ToList();
            decimal OpenInvOutstandingAmount = OpenInvoicesLastYear == null ? 0 : OpenInvoicesLastYear.Sum(i => i.AmountOutstanding);
            int TotalNumOfOpenInv = OpenInvoicesLastYear == null ? 0 : OpenInvoicesLastYear.Count();

            List<Order.StatusOptions> Closed = new List<Order.StatusOptions> {
                Order.StatusOptions.Unpaid,
                Order.StatusOptions.Partial,
                Order.StatusOptions.Overdue,
            };
            decimal ReceivedAmount = svc.GetByFilter(Closed, null, common.Helper.DateRange.DateRangeFilter.Last3Month)
                .Select(c => c.AmountPaid)
                .DefaultIfEmpty()
                .Sum();
            int TotalNumOfPaidInv = svc.GetByFilter(Closed, null, common.Helper.DateRange.DateRangeFilter.Last3Month)
                .Count();

            DashboardModel dashModel = new DashboardModel();
            dashModel.OpenInvOutstandingAmount = OpenInvOutstandingAmount;
            dashModel.TotalNumOfOpenInv = TotalNumOfOpenInv;

            dashModel.ReceivedAmount = ReceivedAmount;
            dashModel.TotalNumOfPaidInv = TotalNumOfPaidInv;

            return View(dashModel);
        }
Exemplo n.º 2
0
 public DataImportor(ICustomerRepo iCustomerRepo, IGSTRepo iGSTRepo,
     IInvoiceRepo iInvoiceRepo, IOrderDetailRepo iOrderDetailRepo, 
     ISalesmanRepo iSalesmanRepo,IPaymentRepo iPaymentRepo,IPaymentDetailRepo iPaymentDetailRepo)
 {
     custSvr = new CustomerSvc(iCustomerRepo);
     gstSvr = new GSTSvc(iGSTRepo);
     invSvr = new InvoiceSvc(iInvoiceRepo);
     orderDetailSvr = new OrderDetailSvc(iOrderDetailRepo);
     salesmanSvc = new SalesmanSvc(iSalesmanRepo);
     paymentSvc = new PaymentSvc(iPaymentRepo);
     paymentDetailSvc = new PaymentDetailSvc(iPaymentDetailRepo);
 }
Exemplo n.º 3
0
 public InvoiceController(IInvoiceRepo iInvoiceRepo,IOrderDetailRepo iOrderDetailRepo, IOptionsRepo ioptionsRepo)
 {
     svc = new InvoiceSvc(iInvoiceRepo);
     odSvc = new OrderDetailSvc(iOrderDetailRepo);
     optionsSvc = new OptionsSvc(ioptionsRepo);
 }