public CashierInstantMoneyReport GetCashierInstantMoneyReport(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();
            InstantMoneyRepository IMRep = new InstantMoneyRepository();
            #endregion

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

            report.Cashier = cashierrep.GetCashier(EmployeeId);
            report.CashMovements = cashmovementrep.GetCashMovementsPerEmployeeReport(EmployeeId, ActualDate,4);
            report.ElectronicFunds = elecrep.GetElectronicFundsPerEmployee(EmployeeId, ActualDate,4);
            report.Pickups = pickuprep.GetPickUpsPerEmployee(EmployeeId, ActualDate,4);
            report.Recons = cashreconrep.GetCashReconcilationsPerEmployee(EmployeeId, ActualDate);
            report.IM = IMRep.GetInstantMoneysPerEmployee(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;

            //...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 2: report.ExtraFloatTotal += item.Amount; break;
                }
            }
             foreach(InstantMoney item in report.IM)
             {
             switch(item.InstantMoneyTypeID)
             {
                 case 1: report.FloatTotal += item.Amount; break;
                 case 2: report.RecievedTotal += item.Amount; break;
                 case 3: report.PaidTotal += item.Amount; break;
             }
             }

             report.BigFloatTotal = report.FloatTotal + report.ExtraFloatTotal;
             report.ExpectedTotal = report.BigFloatTotal + report.RecievedTotal - report.PaidTotal;
             report.DeclaredTotal = report.CashTotal + report.CardsTotal + report.ChequeTotal + report.PickupTotal;
             report.Final = report.DeclaredTotal - report.ExpectedTotal;

            return report;
        }
Esempio n. 2
0
        public CashierInstantMoneyReport GetCashierInstantMoneyReport(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();
            InstantMoneyRepository       IMRep           = new InstantMoneyRepository();
            #endregion

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


            report.Cashier         = cashierrep.GetCashier(EmployeeId);
            report.CashMovements   = cashmovementrep.GetCashMovementsPerEmployeeReport(EmployeeId, ActualDate, 4);
            report.ElectronicFunds = elecrep.GetElectronicFundsPerEmployee(EmployeeId, ActualDate, 4);
            report.Pickups         = pickuprep.GetPickUpsPerEmployee(EmployeeId, ActualDate, 4);
            report.Recons          = cashreconrep.GetCashReconcilationsPerEmployee(EmployeeId, ActualDate);
            report.IM = IMRep.GetInstantMoneysPerEmployee(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;

            //...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 2: report.ExtraFloatTotal += item.Amount; break;
                }
            }
            foreach (InstantMoney item in report.IM)
            {
                switch (item.InstantMoneyTypeID)
                {
                case 1: report.FloatTotal += item.Amount; break;

                case 2: report.RecievedTotal += item.Amount; break;

                case 3: report.PaidTotal += item.Amount; break;
                }
            }

            report.BigFloatTotal = report.FloatTotal + report.ExtraFloatTotal;
            report.ExpectedTotal = report.BigFloatTotal + report.RecievedTotal - report.PaidTotal;
            report.DeclaredTotal = report.CashTotal + report.CardsTotal + report.ChequeTotal + report.PickupTotal;
            report.Final         = report.DeclaredTotal - report.ExpectedTotal;

            return(report);
        }