@using PantheonRA.BackOffice.Enums

<div class="modal inmodal fade" id="pay-orders-iris" style="z-index: 999" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-body">
                <div class="iris-title p-xxs">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <strong id="poIrisTitle1">@Loc.PoIrisTitle1 (<span id="poIrisSubj1"></span>) @Loc.PoIrisTitle2!</strong>
                </div>

                <p class="m-t-md" id="poIrisTitle2">
                    @Loc.PoIrisTitle1 (<span id="poIrisSubj2"></span>) @Loc.PoIrisTitle2, @Loc.PoIrisTitle3!
                </p>
                <div class="well well-sm well-bg clickable-icon m-t-sm m-b-sm" data-dismiss="modal" onclick="openSubjectSettings()">
                    <div class="row">
                        <div class="col-xs-3">
                            <div class="icon-arrow-right"></div>
                        </div>
                        <div class="col-xs-9 well-text-margin">
                            <strong>@Loc.PoIrisSubjectEditTitle</strong>
                            <p class="no-margins">@Loc.PoIrisSubjectEditTitleDesc</p>
                        </div>
                    </div>
                </div>
                <div class="well well-sm well-bg clickable-icon m-b-sm" onclick="cancelPoIris()" data-dismiss="modal">
                    <div class="row">
                        <div class="col-xs-3">
                            <div class="icon-arrow-right"></div>
                        </div>
                        <div class="col-xs-9 well-text-margin">
                            <strong>@Loc.PoIrisCancel</strong>
                            <p class="no-margins">@Loc.PoIrisCancelDesc</p>
                        </div>
                    </div>
                </div>
                <div class="well well-sm well-bg clickable-icon m-b-sm" onclick="window.open('@Loc.HelpUrl@HelpIds.PayOrdersIRIS','_blank');">
                    <div class="row">
                        <div class="col-xs-3">
                            <div class="icon-help"></div>
                        </div>
                        <div class="col-xs-9 well-text-margin">
                            <strong>@Loc.PoIrisHelp</strong>
                            <p class="no-margins">@Loc.PoIrisHelpDesc</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    function openSubjectSettings() {
        let subjectId = $("#SubjectId").val();
        if (!subjectId) {
            subjectId = $("#SupplierId").val();
        }

        $.get("@Url.Action("GetSubjectEditData", "Subjects")" + "?id=" + subjectId, function (response) {
            if (response) {
                $("#IsEdit").val("True");
                FillSubjectData(response);

                if (response && response.IsBuyer === true)
                    $('#IsBuyer').prop('checked', true);
                if (response && response.IsSupplier === true)
                    $('#IsSupplier').prop('checked', true);

                displaySubjectTypeData();
            }
        });

        openSubjectModal();
        openSubjectTrrModal();
    }

    function cancelPoIris() {

    }
</script>