feat: add VAT display to all DiscountStore pages — Products (note), ProductDetail (breakdown), Cart (summary line), Checkout (refactor to VATService), OrderDetail (financial summary)
Build and Deploy to Kubernetes / build-and-deploy (push) Has been cancelled
Build and Deploy to Kubernetes / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -6,6 +6,7 @@ namespace FrontOffice.Main.Pages.DiscountStore;
|
||||
public partial class Cart : IDisposable
|
||||
{
|
||||
[Inject] private DiscountCartService DiscountCart { get; set; } = default!;
|
||||
[Inject] private VATService VAT { get; set; } = default!;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
@@ -44,6 +45,18 @@ public partial class Cart : IDisposable
|
||||
Navigation.NavigateTo(RouteConstants.DiscountStore.Checkout);
|
||||
}
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
if (firstRender)
|
||||
{
|
||||
await VAT.LoadAsync();
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private long VatAmount => VAT.CalculateVAT(DiscountCart.FinalPrice);
|
||||
private long TotalWithVat => DiscountCart.FinalPrice + VatAmount;
|
||||
|
||||
private static string FormatPrice(long price) => $"{price:N0} ";
|
||||
|
||||
private static string GetImageUrl(string? imageUrl)
|
||||
|
||||
Reference in New Issue
Block a user