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:
@@ -10,6 +10,7 @@ public partial class Checkout
|
||||
[Inject] private DiscountCartService DiscountCart { get; set; } = default!;
|
||||
[Inject] private DiscountOrderService DiscountOrderService { get; set; } = default!;
|
||||
[Inject] private UserAddressContract.UserAddressContractClient UserAddressContract { get; set; } = default!;
|
||||
[Inject] private VATService VAT { get; set; } = default!;
|
||||
|
||||
private List<CustomerAddressModel> _addresses = new();
|
||||
private CustomerAddressModel? _selectedAddress;
|
||||
@@ -18,13 +19,11 @@ public partial class Checkout
|
||||
private string? _notes;
|
||||
private bool _placing;
|
||||
|
||||
private const decimal VAT_RATE = 0.10m;
|
||||
|
||||
/// <summary>مبلغ درگاه قبل از مالیات (جمع کل - اعتبار)</summary>
|
||||
private long NetGatewayAmount => DiscountCart.TotalPrice - DiscountCart.TotalDiscount;
|
||||
|
||||
/// <summary>مالیات بر ارزش افزوده ۱۰٪</summary>
|
||||
private long VatAmount => (long)(NetGatewayAmount * VAT_RATE);
|
||||
/// <summary>مالیات بر ارزش افزوده</summary>
|
||||
private long VatAmount => VAT.CalculateVAT(NetGatewayAmount);
|
||||
|
||||
/// <summary>مبلغ نهایی قابل پرداخت (شامل VAT)</summary>
|
||||
private long FinalGatewayAmount => NetGatewayAmount + VatAmount;
|
||||
@@ -33,6 +32,7 @@ public partial class Checkout
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await VAT.LoadAsync();
|
||||
await DiscountCart.EnsureInitializedAsync();
|
||||
await LoadAddresses();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user