public ActionResult _FNBDayEndReportPDF(int ReportEmployeeID, DateTime ReportActualDate)
        {
            CashierFNBReport report = new CashierFNBReport();
            report = RepRep.GetCashierFNBReport(ReportActualDate, ReportEmployeeID);

            return new Rotativa.ViewAsPdf("FNBReport", report);
        }
        public CashierFNBReport GetCashierFNBReport(DateTime ActualDate, int EmployeeId)
        {
            #region Repositories
            CashierRepository cashierrep = new CashierRepository();
            CashMovementRepository cashmovementrep = new CashMovementRepository();
            ElectronicFundRepository elecrep = new ElectronicFundRepository();
            PickUpRepository pickuprep = new PickUpRepository();
            CashReconciliationRepository cashreconrep = new CashReconciliationRepository();
            FNBRepository FNBRep = new FNBRepository();
            #endregion

            //...Get All Details
            CashierFNBReport report = new CashierFNBReport();
            report.CashierId = EmployeeId;
            report.ReportDate = ActualDate;

            report.Cashier = cashierrep.GetCashier(EmployeeId);
            report.CashMovements = cashmovementrep.GetCashMovementsPerEmployeeReport(EmployeeId, ActualDate, 2);
            report.ElectronicFunds = elecrep.GetElectronicFundsPerEmployee(EmployeeId, ActualDate, 2);
            report.Pickups = pickuprep.GetPickUpsPerEmployee(EmployeeId, ActualDate,2);
            report.Recons = cashreconrep.GetCashReconcilationsPerEmployee(EmployeeId, ActualDate);
            report.FNBs = FNBRep.GetFNBsPerEmployee(EmployeeId, ActualDate);
            //...Initialize Totals
            report.CashTotal = 0;
            report.CardsTotal = 0;
            report.ChequeTotal = 0;
            report.SassaTotal = 0;
            report.PickupTotal = 0;
            report.FloatTotal = 0;
            report.ExtraFloatTotal = 0;
            report.ReferenceTotal = 0;
            report.RefundTotal = 0;
            report.DeclaredTotal = 0;
            report.ExpectedTotal = 0;
            report.Final = 0;

            //...Get Totals
            foreach (CashMovement item in report.CashMovements)
            {
                report.CashTotal += item.Amount;
            }

            foreach (ElectronicFund item in report.ElectronicFunds)
            {
                switch (item.ElectronicTypeID)
                {
                    case 1: report.SassaTotal += item.Total; break;
                    case 2: report.CardsTotal += item.Total; break;
                    case 3: report.ChequeTotal += item.Total; break;
                }
            }

            foreach (PickUp item in report.Pickups)
            {
                report.PickupTotal += item.Amount;
            }

            foreach (CashReconciliation item in report.Recons)
            {
                switch (item.ReconciliationTypeID)
                {
                    case 1: report.FloatTotal += item.Amount; break;
                    case 2: report.ExtraFloatTotal += item.Amount; break;

                }
            }

            foreach (FNB item in report.FNBs)
            {
                switch (item.FNBTypeID)
                {
                    case 1: report.ReferenceTotal += item.Amount; break;
                    case 2: report.RefundTotal += item.Amount; break;
                }
            }

            report.ExpectedTotal = report.ReferenceTotal - report.RefundTotal;
            report.DeclaredTotal = report.CashTotal + report.CardsTotal + report.ChequeTotal + report.PickupTotal;

            report.Final = report.DeclaredTotal - report.ExpectedTotal;

            return report;
        }
Exemple #3
0
        public CashierFNBReport GetCashierFNBReport(DateTime ActualDate, int EmployeeId)
        {
            #region Repositories
            CashierRepository            cashierrep      = new CashierRepository();
            CashMovementRepository       cashmovementrep = new CashMovementRepository();
            ElectronicFundRepository     elecrep         = new ElectronicFundRepository();
            PickUpRepository             pickuprep       = new PickUpRepository();
            CashReconciliationRepository cashreconrep    = new CashReconciliationRepository();
            FNBRepository FNBRep = new FNBRepository();
            #endregion

            //...Get All Details
            CashierFNBReport report = new CashierFNBReport();
            report.CashierId  = EmployeeId;
            report.ReportDate = ActualDate;


            report.Cashier         = cashierrep.GetCashier(EmployeeId);
            report.CashMovements   = cashmovementrep.GetCashMovementsPerEmployeeReport(EmployeeId, ActualDate, 2);
            report.ElectronicFunds = elecrep.GetElectronicFundsPerEmployee(EmployeeId, ActualDate, 2);
            report.Pickups         = pickuprep.GetPickUpsPerEmployee(EmployeeId, ActualDate, 2);
            report.Recons          = cashreconrep.GetCashReconcilationsPerEmployee(EmployeeId, ActualDate);
            report.FNBs            = FNBRep.GetFNBsPerEmployee(EmployeeId, ActualDate);
            //...Initialize Totals
            report.CashTotal       = 0;
            report.CardsTotal      = 0;
            report.ChequeTotal     = 0;
            report.SassaTotal      = 0;
            report.PickupTotal     = 0;
            report.FloatTotal      = 0;
            report.ExtraFloatTotal = 0;
            report.ReferenceTotal  = 0;
            report.RefundTotal     = 0;
            report.DeclaredTotal   = 0;
            report.ExpectedTotal   = 0;
            report.Final           = 0;

            //...Get Totals
            foreach (CashMovement item in report.CashMovements)
            {
                report.CashTotal += item.Amount;
            }

            foreach (ElectronicFund item in report.ElectronicFunds)
            {
                switch (item.ElectronicTypeID)
                {
                case 1: report.SassaTotal += item.Total; break;

                case 2: report.CardsTotal += item.Total; break;

                case 3: report.ChequeTotal += item.Total; break;
                }
            }

            foreach (PickUp item in report.Pickups)
            {
                report.PickupTotal += item.Amount;
            }

            foreach (CashReconciliation item in report.Recons)
            {
                switch (item.ReconciliationTypeID)
                {
                case 1: report.FloatTotal += item.Amount; break;

                case 2: report.ExtraFloatTotal += item.Amount; break;
                }
            }

            foreach (FNB item in report.FNBs)
            {
                switch (item.FNBTypeID)
                {
                case 1: report.ReferenceTotal += item.Amount; break;

                case 2: report.RefundTotal += item.Amount; break;
                }
            }

            report.ExpectedTotal = report.ReferenceTotal - report.RefundTotal;
            report.DeclaredTotal = report.CashTotal + report.CardsTotal + report.ChequeTotal + report.PickupTotal;

            report.Final = report.DeclaredTotal - report.ExpectedTotal;

            return(report);
        }