@model Rs_system.Models.ContabilidadRegistro
@{
    ViewData["Title"] = "Nuevo Registro Contable";
}

<div class="row justify-content-center">
    <div class="col-md-8">
        <div class="card card-custom">
            <div class="card-header bg-white border-bottom-0 pt-4 pb-0">
                <h5 class="card-title mb-0">Nuevo Movimiento</h5>
            </div>
            <div class="card-body">
                <form asp-action="Create">
                    <div asp-validation-summary="ModelOnly" class="text-danger"></div>

                    <div class="mb-3">
                        <label asp-for="GrupoTrabajoId" class="form-label">Grupo de Trabajo</label>
                        <select asp-for="GrupoTrabajoId" class="form-select" asp-items="ViewBag.Grupos">
                            <option value="">Seleccione...</option>
                        </select>
                        <span asp-validation-for="GrupoTrabajoId" class="text-danger"></span>
                    </div>

                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <label asp-for="Tipo" class="form-label">Tipo de Movimiento</label>
                            <select asp-for="Tipo" class="form-select" asp-items="Html.GetEnumSelectList<Rs_system.Models.TipoMovimientoContable>()"></select>
                            <span asp-validation-for="Tipo" class="text-danger"></span>
                        </div>
                        <div class="col-md-6 mb-3">
                             <label asp-for="Fecha" class="form-label">Fecha</label>
                             <input asp-for="Fecha" type="date" class="form-control" value="@DateTime.Now.ToString("yyyy-MM-dd")" />
                             <span asp-validation-for="Fecha" class="text-danger"></span>
                        </div>
                    </div>

                    <div class="mb-3">
                        <label asp-for="Monto" class="form-label">Monto</label>
                        <div class="input-group">
                            <span class="input-group-text">$</span>
                            <input asp-for="Monto" class="form-control" type="number" step="0.01" />
                        </div>
                        <span asp-validation-for="Monto" class="text-danger"></span>
                    </div>

                    <div class="mb-3">
                        <label asp-for="Descripcion" class="form-label">Descripción</label>
                        <textarea asp-for="Descripcion" class="form-control" rows="3"></textarea>
                        <span asp-validation-for="Descripcion" class="text-danger"></span>
                    </div>

                    <div class="d-grid gap-2 d-md-flex justify-content-md-end">
                        <a asp-action="Index" class="btn btn-secondary">Cancelar</a>
                        <button type="submit" class="btn btn-primary">Guardar</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}
