public Task <bool> CalcularReciboEmpleado(ReciboEmpleadoToCreateVM reciboEmpleadoToCreateVM) { var totalBruto = (reciboEmpleadoToCreateVM.ValorHora * reciboEmpleadoToCreateVM.HorasTrabajadas) + (reciboEmpleadoToCreateVM.Antiguedad * 30); var totalDescuento = (totalBruto * 0.13m); var totalNeto = totalBruto - totalDescuento; ReciboEmpleadoEntity entity = new ReciboEmpleadoEntity(); entity.Antiguedad = reciboEmpleadoToCreateVM.Antiguedad; entity.Nombre = reciboEmpleadoToCreateVM.Nombre; entity.TotalBruto = totalBruto; entity.TotalDescuento = totalDescuento; entity.ValorNeto = totalNeto; return(_empleadoRepository.RegistrarReciboEmpleado(entity)); }
public async Task <IActionResult> CrearEventoAsync([FromBody] ReciboEmpleadoToCreateVM reciboEmpleadoToCreateVM) { var result = await _empleadoService.CalcularReciboEmpleado(reciboEmpleadoToCreateVM); return(Ok(result)); }