mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 14:04:26 +01:00
Invoice: Unify status display and functionality (#5360)
* Invoice: Unify status display and functionality Consolidates the invoice status display and functionality (mark setted or invalid) across the dashboard, list and details pages. * Test fix --------- Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
This commit is contained in:
@@ -150,15 +150,14 @@ namespace BTCPayServer.Controllers
|
||||
Events = invoice.Events,
|
||||
Metadata = metaData,
|
||||
Archived = invoice.Archived,
|
||||
HasRefund = invoice.Refunds.Any(),
|
||||
CanRefund = invoiceState.CanRefund(),
|
||||
Refunds = invoice.Refunds,
|
||||
ShowCheckout = invoice.Status == InvoiceStatusLegacy.New,
|
||||
ShowReceipt = invoice.Status.ToModernStatus() == InvoiceStatus.Settled && (invoice.ReceiptOptions?.Enabled ?? receipt.Enabled is true),
|
||||
Deliveries = (await _InvoiceRepository.GetWebhookDeliveries(invoiceId))
|
||||
.Select(c => new Models.StoreViewModels.DeliveryViewModel(c))
|
||||
.ToList(),
|
||||
CanMarkInvalid = invoiceState.CanMarkInvalid(),
|
||||
CanMarkSettled = invoiceState.CanMarkComplete(),
|
||||
.ToList()
|
||||
};
|
||||
|
||||
var details = InvoicePopulatePayments(invoice);
|
||||
@@ -1154,7 +1153,7 @@ namespace BTCPayServer.Controllers
|
||||
CanMarkInvalid = state.CanMarkInvalid(),
|
||||
CanMarkSettled = state.CanMarkComplete(),
|
||||
Details = InvoicePopulatePayments(invoice),
|
||||
HasRefund = invoice.Refunds.Any(data => !data.PullPaymentData.Archived)
|
||||
HasRefund = invoice.Refunds.Any()
|
||||
});
|
||||
}
|
||||
return View(model);
|
||||
|
||||
Reference in New Issue
Block a user