Exemple #1
0
        public IActionResult Detail(int id)
        {
            var paymentRecord = _payComputationService.GetPaymentRecordById(id);

            if (paymentRecord == null)
            {
                return(NotFound());
            }

            var model = new PaymentRecordDetailViewModel()
            {
                Id                  = paymentRecord.Id,
                EmployeeId          = paymentRecord.EmployeeId,
                FullName            = paymentRecord.FullName,
                NiNo                = paymentRecord.NiNo,
                PayDate             = paymentRecord.PayDate,
                PayMonth            = paymentRecord.PayMonth,
                TaxYearId           = paymentRecord.TaxYearId,
                Year                = _payComputationService.GetTaxYearById(paymentRecord.TaxYearId).YearofTax,
                TaxCode             = paymentRecord.TaxCode,
                HourlyRate          = paymentRecord.HourlyRate,
                HourWorked          = paymentRecord.HourWorked,
                ContractualHours    = paymentRecord.ContractualHours,
                OvertimeHours       = paymentRecord.OvertimeHours,
                OvertimeRate        = _payComputationService.OvertimeRate(paymentRecord.HourlyRate),
                ContractualEarnings = paymentRecord.ContractualEarnings,
                OvertimeEarnings    = paymentRecord.OvertimeEarnings,
                Tax                 = paymentRecord.Tax,
                Nic                 = paymentRecord.Nic,
                UnionFee            = paymentRecord.UnionFee,
                SLC                 = paymentRecord.SLC,
                TotalEarnings       = paymentRecord.TotalEarnings,
                TotalDeducation     = paymentRecord.TotalDeducation,
                Employee            = paymentRecord.Employee,
                TaxYear             = paymentRecord.TaxYear,
                NetPayment          = paymentRecord.NetPayment
            };

            return(View(model));
        }