Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

2.5 KB
Raw Blame
@{
    Layout = "";
    //page title
    ViewBag.Title = Loc["Admin.PaymentTransaction.Fields.PartialPaid"];
    var area = ViewContext.RouteData.Values["area"]?.ToString();
}
@model PaymentTransactionModel
<form id="PartiallyPaidPopup" asp-area="@area" asp-controller="PaymentTransaction" asp-action="PartiallyPaidPopup" method="post"
      asp-route-OrderId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["Id"])"
      asp-route-btnId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["btnId"])"
      asp-route-online="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["online"])"
      asp-route-formId="@HtmlExtensions.HtmlEncodeSafe(Context.Request.Query["formId"])">

    <input asp-for="Id" type="hidden"/>
    <input asp-for="MaxAmountToPaid" type="hidden"/>
    <input asp-for="CurrencyCode" type="hidden"/>

    @* the popup shell: the amount with its ceiling as the hint, one primary action *@
    <admin-popup title="@Loc["Admin.PaymentTransaction.Fields.PartialPaid"]" icon="bi-tag">
        <div class="grand-fields">
            <admin-field asp-for="AmountToPaid" size="md" suffix="@Model.CurrencyCode"
                         hint="@string.Format(Loc["Admin.PaymentTransaction.Fields.PartialPaid.AmountToPaid.Max"], Model.MaxAmountToPaid.ToString("N2"), Model.CurrencyCode)"/>
        </div>
        <div class="grand-popup__actions">
            <partial name="Partials/WidgetZone.PartiallyPaidButtons" model="Model"/>
            <input type="submit" name="partialpaidpaymenttransaction" value="@Loc["Admin.PaymentTransaction.Fields.Paid"]" id="partialpaidpaymenttransaction" class="btn btn-primary"/>
        </div>
    </admin-popup>

    <div asp-validation-summary="All"></div>
    @if (Model.RefreshPage)
    {
        <script>
            try {
                window.location.href = window.location.href;
            }
            catch (e) { }
        </script>
    }
    <script>
        $("#PartiallyPaidPopup").submit(function (e) {
            e.preventDefault();
            var form = $(this);
            var url = form.attr('action');
            $.ajax({
                type: "POST",
                url: url,
                data: form.serialize(),
                success: function (data) {
                    $.magnificPopup.open({
                        items: {
                            src: data,
                            type: 'inline'
                        }
                    });
                }
            });
        });
    </script>
</form>