public ActionResult _KwikpayDayEndReportPDF(int ReportEmployeeID, DateTime ReportActualDate) { CashierKwikpayReport report = new CashierKwikpayReport(); report = RepRep.GetCashierKwikpayReport(ReportActualDate, ReportEmployeeID); return new Rotativa.ViewAsPdf("KwikpayReport", report); }
public CashierKwikpayReport GetCashierKwikpayReport(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(); KwikPayRepository KRep = new KwikPayRepository(); #endregion //...Get All Details CashierKwikpayReport report = new CashierKwikpayReport(); report.CashierId = EmployeeId; report.ReportDate = ActualDate; report.Cashier = cashierrep.GetCashier(EmployeeId); report.CashMovements = cashmovementrep.GetCashMovementsPerEmployeeReport(EmployeeId, ActualDate,3); report.ElectronicFunds = elecrep.GetElectronicFundsPerEmployee(EmployeeId, ActualDate,3); report.Pickups = pickuprep.GetPickUpsPerEmployee(EmployeeId, ActualDate,3); report.Recons = cashreconrep.GetCashReconcilationsPerEmployee(EmployeeId, ActualDate); report.Kwikpay = KRep.GetKwikPaysPerEmployee(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.ElectricityTotal = 0; report.AirTimeTotal = 0; report.AccountPaymentTotal = 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; case 3: report.SigmaTotal += item.Amount; break; } } foreach(KwikPay item in report.Kwikpay) { switch(item.KwikPayTypeID) { case 1: report.ElectricityTotal += item.Amount; break; case 2: report.AirTimeTotal += item.Amount; break; case 3: report.AccountPaymentTotal += item.Amount; break; } } report.ExpectedTotal = report.ElectricityTotal + report.AccountPaymentTotal + report.AirTimeTotal; report.DeclaredTotal = report.CashTotal + report.CardsTotal + report.PickupTotal + report.ChequeTotal; report.Final = report.DeclaredTotal - report.ExpectedTotal; return report; }
public CashierKwikpayReport GetCashierKwikpayReport(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(); KwikPayRepository KRep = new KwikPayRepository(); #endregion //...Get All Details CashierKwikpayReport report = new CashierKwikpayReport(); report.CashierId = EmployeeId; report.ReportDate = ActualDate; report.Cashier = cashierrep.GetCashier(EmployeeId); report.CashMovements = cashmovementrep.GetCashMovementsPerEmployeeReport(EmployeeId, ActualDate, 3); report.ElectronicFunds = elecrep.GetElectronicFundsPerEmployee(EmployeeId, ActualDate, 3); report.Pickups = pickuprep.GetPickUpsPerEmployee(EmployeeId, ActualDate, 3); report.Recons = cashreconrep.GetCashReconcilationsPerEmployee(EmployeeId, ActualDate); report.Kwikpay = KRep.GetKwikPaysPerEmployee(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.ElectricityTotal = 0; report.AirTimeTotal = 0; report.AccountPaymentTotal = 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; case 3: report.SigmaTotal += item.Amount; break; } } foreach (KwikPay item in report.Kwikpay) { switch (item.KwikPayTypeID) { case 1: report.ElectricityTotal += item.Amount; break; case 2: report.AirTimeTotal += item.Amount; break; case 3: report.AccountPaymentTotal += item.Amount; break; } } report.ExpectedTotal = report.ElectricityTotal + report.AccountPaymentTotal + report.AirTimeTotal; report.DeclaredTotal = report.CashTotal + report.CardsTotal + report.PickupTotal + report.ChequeTotal; report.Final = report.DeclaredTotal - report.ExpectedTotal; return(report); }