-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathUpdatePaymentRequestStatus.cshtml
More file actions
211 lines (197 loc) · 13.5 KB
/
UpdatePaymentRequestStatus.cshtml
File metadata and controls
211 lines (197 loc) · 13.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
@page
@using Microsoft.Extensions.Localization
@using Unity.Payments.Localization
@using Unity.Payments.Web.Pages.PaymentApprovals
@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
@model Unity.Payments.Web.Pages.PaymentApprovals.UpdatePaymentRequestStatus
@inject IStringLocalizer<PaymentsResource> L
@{
Layout = null;
}
@{
int uniqueIndex = 0;
}
@functions
{
public static string GetContainerValidationState(bool isValid)
{
return isValid ? "single-payment payment-item" : "single-payment bg-danger-subtle border-danger-subtle";
}
}
<form method="post" asp-page-handler="OnPostAsync" id="paymentRequestStatus" data-ajaxForm="true">
<abp-modal size="ExtraLarge" id="payment-modal">
@if (Model.IsApproval)
{
<abp-modal-header class="payment-modal-header" title="@L["ApplicationPaymentStatusRequest:ApproveTitle"].Value"></abp-modal-header>
}
else
{
<abp-modal-header class="payment-modal-header" title="@L["ApplicationPaymentStatusRequest:DeclineTitle"].Value"></abp-modal-header>
}
<abp-modal-body>
<abp-card class="pb-0">
<abp-card-body class="pb-0 mb-0">
<abp-row class="m-0 p-1">
<abp-column size="_4">
<label for="@Model.PaymentGroupings?.Count" class="form-label unt-form-label-primary">@L["ApplicationPaymentRequest:NumberPayment"]</label>
<input type="text" class="form-control" id="ApplicationCount" value="@(Model.PaymentGroupings?.Sum(g => g.Items.Count) ?? 0)" disabled />
</abp-column>
<abp-column size="_4">
<label for="@Model.TotalAmount" class="form-label unt-form-label-primary">@L["ApplicationPaymentRequest:TotalAmount"]</label>
<input type="text" class="form-control totalAmount unity-currency-input" id="UpdateTotalAmount" value="@Model.TotalAmount" disabled />
</abp-column>
<abp-column size="_4">
<label for="Note" class="form-label unt-form-label-primary">@L["ApplicationPaymentRequest:BatchNote"]</label>
<input type="text" class="form-control" asp-for="Note" />
</abp-column>
</abp-row>
</abp-card-body>
</abp-card>
<abp-card>
<abp-card-body class="payment-card">
<abp-input id="PaymentThreshold" type="hidden" asp-for="PaymentThreshold" />
<abp-input id="UserPaymentThreshold" type="hidden" asp-for="UserPaymentThreshold" />
<abp-input id="ApplicationCount" type="hidden" asp-for="PaymentGroupings.Count" />
@if (Model.PaymentGroupings.Count > 0)
{
@for (int k = 0; k < Model.PaymentGroupings.Count; k++)
{
<abp-container id="@($"{Model.PaymentGroupings[k].GroupId}_container")">
<abp-input id="@($"{Model.PaymentGroupings[k].GroupId}_count")" type="hidden" asp-for="@Model.PaymentGroupings[k].Items.Count" />
<input name="PaymentGroupings.Index" type="hidden" value="@Model.PaymentGroupings[k].GroupId" />
<input type="hidden" asp-for="@Model.PaymentGroupings[k].GroupId" />
<input type="hidden" asp-for="@Model.PaymentGroupings[k].ToStatus" />
@for (int i = 0; i < Model.PaymentGroupings[k].Items.Count; i++)
{
<div id="@($"{@Model.PaymentGroupings[k].Items[i].Id}_container")" class="@GetContainerValidationState(Model.PaymentGroupings[k].Items[i].IsValid)">
<input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].Id" />
<input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].ReferenceNumber" />
<input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].Amount" />
<input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].Description" />
<input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].InvoiceNumber" />
<input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].CorrelationId" />
<input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].ApplicantName" />
<input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].Status" />
<input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].isPermitted" />
<input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].IsL3ApprovalRequired" />
<input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].ToStatus" />
<input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].PreviousL1Approver" />
<input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].IsValid" />
<input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].HasUserPaymentThreshold" />
<abp-row id=@($"{@Model.PaymentGroupings[k].Items[i].Id}_header") class=" m-0 p-2">
<abp-column size="_12" class="px-1 d-flex align-items-center">
<div class="w-100">
<h6 class="single-payment-card-application-name fw-bold">
@Model.PaymentGroupings[k].Items[i].ApplicantName (@Model.PaymentGroupings[k].Items[i].InvoiceNumber)
</h6>
</div>
<div class="flex-shrink-1">
<abp-button onclick='removeApplicationPaymentApproval("@Model.PaymentGroupings[k].Items[i].Id" + "_container", @Model.PaymentGroupings[k].GroupId)'
size="Small" icon-type="Other" class="m-0 p-0 remove-single-payment" icon="fa fa-times"
data-parameter="@Model.PaymentGroupings[k].Items[i].CorrelationId" />
</div>
</abp-column>
</abp-row>
<input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].Id" />
<input type="hidden" asp-for="@Model.IsApproval" />
<abp-row class="m-0 p-3">
<abp-column size="_4" class="px-1">
<abp-input asp-for="@Model.PaymentGroupings[k].Items[i].ReferenceNumber" disabled />
</abp-column>
<abp-column size="_3" class="px-1">
<abp-input asp-for="@Model.PaymentGroupings[k].Items[i].Amount"
class="amount unity-currency-input"
disabled />
</abp-column>
<abp-column size="_5" class="px-1">
<abp-input asp-for="@Model.PaymentGroupings[k].Items[i].Description" disabled />
</abp-column>
</abp-row>
</div>
uniqueIndex++;
}
<abp-row class="m-0 payment-status-transition">
<abp-column size="_12" class="d-flex align-items-center p-0 text-center">
<div class="flex-fill">
@{
var fromStatusText = UpdatePaymentRequestStatus.GetStatusText(@Model.PaymentGroupings[k].Items[0].Status);
var fromStatusTextColor = UpdatePaymentRequestStatus.GetStatusTextColor(@Model.PaymentGroupings[k].Items[0].Status);
}
<b style="color:@fromStatusTextColor ">@fromStatusText</b>
</div>
<div class="flex-fill">
@if (Model.PaymentGroupings[k].Items.Any(x => !x.IsValid))
{
<span class="fa fa-ban fa-solid payment-status-transition-ban"></span>
}
else
{
<span class="fa fa-chevron-right fa-solid payment-status-transition-arrow"></span>
<span class="fa fa-chevron-right fa-solid payment-status-transition-arrow"></span>
<span class="fa fa-chevron-right fa-solid payment-status-transition-arrow"></span>
}
</div>
<div class="flex-fill">
@{
var toStatusText = UpdatePaymentRequestStatus.GetStatusText(@Model.PaymentGroupings[k].ToStatus);
var toStatusTextColor = UpdatePaymentRequestStatus.GetStatusTextColor(@Model.PaymentGroupings[k].ToStatus);
}
<b style="color:@toStatusTextColor">@toStatusText</b>
</div>
</abp-column>
</abp-row>
</abp-container>
}
}
else
{
<abp-row class="m-0 p-2 g text-center">
<abp-column size="_12" class="px-1"> <p>No Payments Selected</p></abp-column>
</abp-row>
}
<abp-column size="_12" class=" m-0 p-3 payment-error-column text-danger" abp-if="@(!ModelState.IsValid)">
@if (ModelState.ContainsKey(nameof(PaymentsApprovalModel.PreviousL1Approver))
&& ModelState[nameof(PaymentsApprovalModel.PreviousL1Approver)]?.ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid)
{
var previousL1ApproverState = ModelState[nameof(PaymentsApprovalModel.PreviousL1Approver)];
if (previousL1ApproverState != null)
{
foreach (var error in previousL1ApproverState.Errors)
{
<span>@error.ErrorMessage</span>
}
}
}
</abp-column>
<abp-row class="m-0 p-2 no-payment-msg text-center" id="no-payment-msg" style="display: none;">
<abp-column size="_12" class="px-1"> <p>No Payments Selected</p></abp-column>
</abp-row>
</abp-card-body>
</abp-card>
</abp-modal-body>
<abp-modal-footer>
@if (Model.IsApproval)
{
<abp-button id="btnSubmitPayment" class="btn btn-primary" text="@L["ApplicationPaymentStatusRequest:ApproveButtonText"].Value" onclick="submitPaymentApprovals()" disabled="@Model.DisableSubmit" type="submit"></abp-button>
}
else
{
<abp-button id="btnSubmitPayment" class="btn btn-danger" text="@L["ApplicationPaymentStatusRequest:DeclineButtonText"].Value" disabled="@Model.DisableSubmit" type="submit"></abp-button>
}
<abp-button class="btn btn-secondary" text="@L["ApplicationPaymentStatusRequest:CancelButtonText"].Value" data-dismiss="modal" onclick="closePaymentModal()"></abp-button>
</abp-modal-footer>
</abp-modal>
</form>
@section Scripts {
<partial name="_ValidationScriptsPartial" />
}
<script defer>
(function () {
if (window.jQuery) {
let currencyInputs = $('.unity-currency-input');
if (currencyInputs && currencyInputs.maskMoney === 'function') {
currencyInputs.maskMoney();
}
}
})();
</script>