public CashierDayEndReport GetCashierReport(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();
            #endregion

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

            report.Cashier = cashierrep.GetCashier(EmployeeId);
            report.CashMovements = cashmovementrep.GetCashMovementsPerEmployeeReport(EmployeeId, ActualDate,1);
            report.ElectronicFunds = elecrep.GetElectronicFundsPerEmployee(EmployeeId, ActualDate);
            report.Pickups = pickuprep.GetPickUpsPerEmployee(EmployeeId, ActualDate,1);
            report.Recons = cashreconrep.GetCashReconcilationsPerEmployee(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.SigmaTotal = 0;
            report.CashReconTotal = 0;
            report.EFTReconTotal = 0;
            report.EFTTotal = 0;
            report.EFTFinal = 0;
            report.CashFinal = 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;
                    case 3: report.SigmaTotal += item.Amount; break;
                    case 4: report.CashReconTotal += item.Amount; break;
                    case 5: report.EFTReconTotal += item.Amount; break;
                }
            }

            report.Expected = report.FloatTotal + report.ExtraFloatTotal + report.SigmaTotal  - report.SassaTotal;
            report.Declared = report.PickupTotal + report.CashTotal;
            report.Final = report.Declared - report.Expected;

            report.EFTTotal = report.CardsTotal + report.ChequeTotal;
            report.EFTFinal = report.EFTTotal - report.EFTReconTotal;

            report.CashFinal = report.CashTotal - report.CashReconTotal;

            return report;
        }
Ejemplo n.º 2
0
        public CashierDayEndReport GetCashierReport(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();
            #endregion

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


            report.Cashier         = cashierrep.GetCashier(EmployeeId);
            report.CashMovements   = cashmovementrep.GetCashMovementsPerEmployeeReport(EmployeeId, ActualDate, 1);
            report.ElectronicFunds = elecrep.GetElectronicFundsPerEmployee(EmployeeId, ActualDate);
            report.Pickups         = pickuprep.GetPickUpsPerEmployee(EmployeeId, ActualDate, 1);
            report.Recons          = cashreconrep.GetCashReconcilationsPerEmployee(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.SigmaTotal      = 0;
            report.CashReconTotal  = 0;
            report.EFTReconTotal   = 0;
            report.EFTTotal        = 0;
            report.EFTFinal        = 0;
            report.CashFinal       = 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;

                case 3: report.SigmaTotal += item.Amount; break;

                case 4: report.CashReconTotal += item.Amount; break;

                case 5: report.EFTReconTotal += item.Amount; break;
                }
            }

            report.Expected = report.FloatTotal + report.ExtraFloatTotal + report.SigmaTotal - report.SassaTotal;
            report.Declared = report.PickupTotal + report.CashTotal;
            report.Final    = report.Declared - report.Expected;

            report.EFTTotal = report.CardsTotal + report.ChequeTotal;
            report.EFTFinal = report.EFTTotal - report.EFTReconTotal;

            report.CashFinal = report.CashTotal - report.CashReconTotal;

            return(report);
        }