LocalGovIMS_localgov-ims/src/Admin/Views/Transaction/_Search.cshtml
@model Admin.Models.Transaction.SearchCriteria

@using (Html.BeginForm(Model.SearchAction, "Transaction", FormMethod.Get, new { id = "search-form" }))
{

    @Html.HiddenFor(x => x.ImportId)

    <div>
        <div class="row">
            <div class="col-12 col-sm-6 col-md-4 col-lg-3 col-xxl-2">
                @Html.LabelFor(m => m.FundCode, new { @class = "form-label" })
                <select id="FundCode" name="FundCode">
                    <option value="">None</option>
                    @foreach (var item in Model.Funds.Items)
                    {
                        <option class="item" value="@item.Value" @(!Model.FundCode.IsNullOrEmpty() && Model.FundCode.Equals(item.Value) ? "selected" : String.Empty)>@item.Text</option>
                    }
                </select>
            </div>
            <div class="col-12 col-sm-6 col-md-4 col-lg-3 col-xxl-2 pt-2 pt-sm-0">
                @Html.LabelFor(m => m.MopCode, new { @class = "form-label" })
                <select id="MopCode" name="MopCode">
                    <option value="">None</option>
                    @foreach (var item in Model.Mops.Items)
                    {
                        <option class="item" value="@item.Value" @(!Model.MopCode.IsNullOrEmpty() && Model.MopCode.Equals(item.Value) ? "selected" : String.Empty)>@item.Text</option>
                    }
                </select>
            </div>
            <div class="col-12 col-sm-6 col-md-4 col-lg-3 col-xxl-2 pt-2 pt-md-0">
                @Html.LabelFor(m => m.StartDate, new { @class = "form-label" })
                @Html.TextBoxFor(m => m.StartDate, new { size = 10, placeholder = "Start date", type = "date", style = "min-width:145px;", @class = "form-control" })
            </div>
            <div class="col-12 col-sm-6 col-md-4 col-lg-3 col-xxl-2 pt-2 pt-lg-0">
                @Html.LabelFor(m => m.EndDate, new { @class = "form-label" })
                @Html.TextBoxFor(m => m.EndDate, new { size = 10, placeholder = "End date", type = "date", style = "min-width:145px;", @class = "form-control" })
            </div>
            <div class="col-12 col-sm-6 col-md-4 col-lg-3 col-xxl-2 pt-2 pt-xxl-0">
                @Html.LabelFor(m => m.CardPrefix, new { @class = "form-label" })
                @Html.TextBoxFor(m => m.CardPrefix, new { size = 6, placeholder = "Enter card prefix", @class = "form-control" })
            </div>
            <div class="col-12 col-sm-6 col-md-4 col-lg-3 col-xxl-2 pt-2 pt-xxl-0">
                @Html.LabelFor(m => m.CardSuffix, new { @class = "form-label" })
                @Html.TextBoxFor(m => m.CardSuffix, new { size = 4, placeholder = "Enter card suffix", @class = "form-control" })
            </div>
            <div class="col-12 col-sm-6 col-md-4 col-lg-3 col-xxl-2 pt-2">
                @Html.LabelFor(m => m.AccountReference, new { @class = "form-label" })
                @Html.TextBoxFor(m => m.AccountReference, new { size = 10, placeholder = "Enter account reference", @class = "form-control" })
                <div class="form-check form-switch">
                    @Html.CheckBoxFor(m => m.WildSearchAccountReference, new { @class = "form-check-input", role = "switch" })
                    <small>
                        @Html.LabelFor(m => m.WildSearchAccountReference, new { @class = "form-check-label" })
                    </small>
                </div>

            </div>
            <div class="col-12 col-sm-6 col-md-4 col-lg-3 col-xxl-2 pt-2">
                @Html.LabelFor(m => m.ReceiptNumber, new { @class = "form-label" })
                @Html.TextBoxFor(m => m.ReceiptNumber, new { size = 10, placeholder = "Enter receipt number", @class = "form-control" })
            </div>
            <div class="col-12 col-sm-6 col-md-4 col-lg-3 col-xxl-2 pt-2">
                @Html.LabelFor(m => m.Amount, new { @class = "form-label" })
                @Html.TextBoxFor(m => m.Amount, new { size = 6, style = "min-width:80px;", placeholder = "Enter amount", @class = "form-control monetary-amount" })
            </div>

            @if (User.IsInRole(Role.Finance) || User.IsInRole(Role.SystemAdmin))
            {
                <div class="col-12 col-sm-6 col-md-4 col-lg-3 col-xxl-2 pt-2">
                    @Html.LabelFor(m => m.InternalReference, new { @class = "form-label" })
                    @Html.TextBoxFor(m => m.InternalReference, new { size = 10, placeholder = "Enter internal reference", @class = "form-control" })
                </div>
                <div class="col-12 col-sm-6 col-md-4 col-lg-3 col-xxl-2 pt-2">
                    @Html.LabelFor(m => m.UserId, new { @class = "form-label" })
                    <select id="UserId" name="UserId">
                        <option value="">None</option>
                        @foreach (var item in Model.Users.Items)
                        {
                            <option class="item" value="@item.Value" @(!Model.UserId.ToString().IsNullOrEmpty() && Model.UserId.Equals(item.Value) ? "selected" : String.Empty)>@item.Text</option>
                        }
                    </select>
                </div>
                <div class="col-12 col-sm-6 col-md-4 col-lg-3 col-xxl-2 pt-2">
                    @Html.LabelFor(m => m.Narrative, new { @class = "form-label" })
                    @Html.TextBoxFor(m => m.Narrative, new { size = 20, placeholder = "Enter narrative", @class = "form-control" })
                </div>
            }
            <div class="col-12 pt-3 gap-2 d-flex align-self-end justify-content-end">
                <button class="btn btn-primary search" tabindex="0" type="submit">Search</button>

                @if (!Model.IsForAnImport)
                {
                    <a href="@Url.Action("Search", "Transaction")" class="btn btn-secondary" id="reset">Reset search</a>
                }

                @if (Model.IsForAnImport)
                {
                    <a href="@Url.Action("ListForTransactionImport", "Transaction", new { ImportId = Model.ImportId })" class="btn btn-secondary" id="reset">Reset search</a>
                }

            </div>
        </div>
    </div>
}

@section Scripts {
    @Scripts.Render("~/bundles/app/transaction")
}
