|
14 | 14 | int uniqueIndex = 0; |
15 | 15 | } |
16 | 16 |
|
| 17 | +@functions |
| 18 | +{ |
| 19 | + public static string GetContainerValidationState(bool isValid) |
| 20 | + { |
| 21 | + return isValid ? "single-payment" : "single-payment bg-danger-subtle border-danger-subtle"; |
| 22 | + } |
| 23 | +} |
| 24 | + |
17 | 25 |
|
18 | | -<form method="post" asp-page-handler="OnPostAsync" id="paymentRequestStatus"> |
| 26 | +<form method="post" asp-page-handler="OnPostAsync" id="paymentRequestStatus" data-ajaxForm="true"> |
19 | 27 | <abp-modal size="ExtraLarge" id="payment-modal"> |
20 | 28 | @if (Model.IsApproval) |
21 | 29 | { |
|
32 | 40 | <abp-input id="PaymentThreshold" type="hidden" asp-for="PaymentThreshold" /> |
33 | 41 | <abp-input id="ApplicationCount" type="hidden" asp-for="PaymentGroupings.Count" /> |
34 | 42 |
|
35 | | - @if (Model.PaymentGroupings.Count >= 1) |
| 43 | + @if (Model.PaymentGroupings.Count > 0) |
36 | 44 | { |
37 | 45 | @for (int k = 0; k < Model.PaymentGroupings.Count; k++) |
38 | 46 | { |
|
45 | 53 |
|
46 | 54 | @for (int i = 0; i < Model.PaymentGroupings[k].Items.Count; i++) |
47 | 55 | { |
48 | | - <div id="@($"{@Model.PaymentGroupings[k].Items[i].Id}_container")" class="single-payment"> |
| 56 | + <div id="@($"{@Model.PaymentGroupings[k].Items[i].Id}_container")" class="@GetContainerValidationState(Model.PaymentGroupings[k].Items[i].IsValid)"> |
49 | 57 | <input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].Id" /> |
50 | 58 | <input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].ReferenceNumber" /> |
51 | 59 | <input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].Amount" /> |
|
57 | 65 | <input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].isPermitted" /> |
58 | 66 | <input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].IsL3ApprovalRequired" /> |
59 | 67 | <input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].ToStatus" /> |
60 | | - <abp-row class="m-0 p-2"> |
61 | | - <abp-column size="_11" class="px-1"><h6 class="single-payment-card-application-name">@Model.PaymentGroupings[k].Items[i].ApplicantName (@Model.PaymentGroupings[k].Items[i].InvoiceNumber)</h6></abp-column> |
62 | | - <abp-column size="_1" class="px-1 remove-single-payment"> <abp-button style="float: right" onclick='removeApplicationPayment("@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" /></abp-column> |
| 68 | + <input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].PreviousL1Approver" /> |
| 69 | + <input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].IsValid" /> |
| 70 | + <abp-row id=@($"{@Model.PaymentGroupings[k].Items[i].Id}_header") class=" m-0 p-2"> |
| 71 | + <abp-column size="_12" class="px-1 d-flex align-items-center"> |
| 72 | + <div class="w-100"> |
| 73 | + <h6 class="single-payment-card-application-name fw-bold"> |
| 74 | + @Model.PaymentGroupings[k].Items[i].ApplicantName (@Model.PaymentGroupings[k].Items[i].InvoiceNumber) |
| 75 | + </h6> |
| 76 | + </div> |
| 77 | + <div class="flex-shrink-1"> |
| 78 | + <abp-button onclick='removeApplicationPayment("@Model.PaymentGroupings[k].Items[i].Id" + "_container", @Model.PaymentGroupings[k].GroupId)' |
| 79 | + size="Small" icon-type="Other" class="m-0 p-0 remove-single-payment" icon="fa fa-times" |
| 80 | + data-parameter="@Model.PaymentGroupings[k].Items[i].CorrelationId" /> |
| 81 | + </div> |
| 82 | + </abp-column> |
63 | 83 | </abp-row> |
64 | 84 | <input type="hidden" asp-for="@Model.PaymentGroupings[k].Items[i].Id" /> |
65 | 85 | <input type="hidden" asp-for="@Model.IsApproval" /> |
|
81 | 101 | uniqueIndex++; |
82 | 102 | } |
83 | 103 |
|
84 | | - <abp-row class="m-0 p-3 payment-status-transition"> |
85 | | - <abp-column size="_4" class="text-center"> |
86 | | - @{ |
87 | | - var fromStatusText = UpdatePaymentRequestStatus.GetStatusText(@Model.PaymentGroupings[k].Items[0].Status); |
88 | | - var fromStatusTextColor = UpdatePaymentRequestStatus.GetStatusTextColor(@Model.PaymentGroupings[k].Items[0].Status); |
89 | | - } |
90 | | - <b style="color:@fromStatusTextColor ">@fromStatusText</b> |
91 | | - |
92 | | - </abp-column> |
93 | | - <abp-column size="_4" class="text-center"> |
94 | | - <span class="fa fa-chevron-right fa-solid fa-bold payment-status-transition-arrow"></span> <span class="fa fa-chevron-right fa-solid fa-bold payment-status-transition-arrow"></span> <span class="fa fa-chevron-right fa-solid fa-bold payment-status-transition-arrow"></span> |
95 | | - </abp-column> |
96 | | - <abp-column size="_4" class="text-center"> |
97 | | - @{ |
98 | | - var toStatusText = UpdatePaymentRequestStatus.GetStatusText(@Model.PaymentGroupings[k].ToStatus); |
99 | | - var toStatusTextColor = UpdatePaymentRequestStatus.GetStatusTextColor(@Model.PaymentGroupings[k].ToStatus); |
100 | | - } |
101 | | - <b style="color:@toStatusTextColor">@toStatusText</b> |
| 104 | + <abp-row class="m-0 payment-status-transition"> |
| 105 | + <abp-column size="_12" class="d-flex align-items-center p-0 text-center"> |
| 106 | + <div class="flex-fill"> |
| 107 | + @{ |
| 108 | + var fromStatusText = UpdatePaymentRequestStatus.GetStatusText(@Model.PaymentGroupings[k].Items[0].Status); |
| 109 | + var fromStatusTextColor = UpdatePaymentRequestStatus.GetStatusTextColor(@Model.PaymentGroupings[k].Items[0].Status); |
| 110 | + } |
| 111 | + <b style="color:@fromStatusTextColor ">@fromStatusText</b> |
| 112 | + </div> |
| 113 | + <div class="flex-fill"> |
| 114 | + @if (Model.PaymentGroupings[k].Items.Any(x => !x.IsValid)) |
| 115 | + { |
| 116 | + <span class="fa fa-ban fa-solid payment-status-transition-ban"></span> |
| 117 | + } |
| 118 | + else |
| 119 | + { |
| 120 | + <span class="fa fa-chevron-right fa-solid payment-status-transition-arrow"></span> |
| 121 | + <span class="fa fa-chevron-right fa-solid payment-status-transition-arrow"></span> |
| 122 | + <span class="fa fa-chevron-right fa-solid payment-status-transition-arrow"></span> |
| 123 | + } |
| 124 | + </div> |
| 125 | + <div class="flex-fill"> |
| 126 | + @{ |
| 127 | + var toStatusText = UpdatePaymentRequestStatus.GetStatusText(@Model.PaymentGroupings[k].ToStatus); |
| 128 | + var toStatusTextColor = UpdatePaymentRequestStatus.GetStatusTextColor(@Model.PaymentGroupings[k].ToStatus); |
| 129 | + } |
| 130 | + <b style="color:@toStatusTextColor">@toStatusText</b> |
| 131 | + </div> |
102 | 132 | </abp-column> |
103 | 133 | </abp-row> |
104 | 134 | </abp-container> |
|
110 | 140 | <abp-column size="_12" class="px-1"> <p>No Payments Selected</p></abp-column> |
111 | 141 | </abp-row> |
112 | 142 | } |
113 | | - <abp-column size="_12" class=" m-0 p-3 payment-error-column"> |
114 | | - <span><b>Note: </b>Only payments in @Model.FromStatusText status will appear in this list</span> |
| 143 | + <abp-column size="_12" class=" m-0 p-3 payment-error-column text-danger" abp-if="@(!ModelState.IsValid)"> |
| 144 | + @if(ModelState.ContainsKey(nameof(PaymentsApprovalModel.PreviousL1Approver)) |
| 145 | + && ModelState[nameof(PaymentsApprovalModel.PreviousL1Approver)]?.ValidationState == Microsoft.AspNetCore.Mvc.ModelBinding.ModelValidationState.Invalid) |
| 146 | + { |
| 147 | + <span>@L["ApplicationPaymentRequest:Validations:L2ApproverRestrictionBatch"]</span> |
| 148 | + } |
115 | 149 | </abp-column> |
116 | 150 | <abp-row class="m-0 p-2 no-payment-msg text-center" id="no-payment-msg" style="display: none;"> |
117 | 151 | <abp-column size="_12" class="px-1"> <p>No Payments Selected</p></abp-column> |
118 | 152 | </abp-row> |
119 | | - |
120 | 153 | </abp-card-body> |
121 | 154 | </abp-card> |
122 | 155 | </abp-modal-body> |
|
134 | 167 | </abp-modal> |
135 | 168 | </form> |
136 | 169 |
|
| 170 | +@section Scripts { |
| 171 | + <partial name="_ValidationScriptsPartial" /> |
| 172 | +} |
| 173 | + |
137 | 174 | <script defer> |
138 | 175 | (function () { |
139 | 176 | if (window.jQuery) { |
|
0 commit comments