diff --git a/BlazorApp-Investment Tax Calculator/Components/DividendTable.razor b/BlazorApp-Investment Tax Calculator/Components/DividendTable.razor new file mode 100644 index 00000000..42d323b1 --- /dev/null +++ b/BlazorApp-Investment Tax Calculator/Components/DividendTable.razor @@ -0,0 +1,45 @@ +@using Model +@using Model.Interfaces; +@using Syncfusion.Blazor.Grids; + +@inject IDividendLists dividendList + +

Imported Dividends and withholding taxes

+ + + + + + + + + + + + + + + +@code { + private SfGrid importedDividendGrid = new(); + + public async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs args) + { + if (args.Item.Id == "ImportedDividendGrid_pdfexport") //Id is combination of Grid's ID and itemname + { + var pdfExportProperties = new PdfExportProperties() + { + PageOrientation = PageOrientation.Landscape, + PageSize = PdfPageSize.A4 + }; + await importedDividendGrid.ExportToPdfAsync(pdfExportProperties); + } + if (args.Item.Id == "ImportedDividendGrid_excelexport") //Id is combination of Grid's ID and itemname + { + await importedDividendGrid.ExportToExcelAsync(); + } + } +} + diff --git a/BlazorApp-Investment Tax Calculator/Components/TaxCalculationTable.razor b/BlazorApp-Investment Tax Calculator/Components/TaxCalculationTable.razor index 20463ca8..9607d155 100644 --- a/BlazorApp-Investment Tax Calculator/Components/TaxCalculationTable.razor +++ b/BlazorApp-Investment Tax Calculator/Components/TaxCalculationTable.razor @@ -19,7 +19,7 @@ - + @@ -47,11 +47,16 @@ public async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs args) { - if (args.Item.Id == "ResultGrid_pdfexport") //Id is combination of Grid's ID and itemname + if (args.Item.Id == "DisposalCalculationGrid_pdfexport") //Id is combination of Grid's ID and itemname { - await disposalCalculationGrid.ExportToPdfAsync(); + var pdfExportProperties = new PdfExportProperties() + { + PageOrientation = PageOrientation.Landscape, + PageSize = PdfPageSize.A4 + }; + await disposalCalculationGrid.ExportToPdfAsync(pdfExportProperties); } - if (args.Item.Id == "ResultGrid_excelexport") //Id is combination of Grid's ID and itemname + if (args.Item.Id == "DisposalCalculationGrid_excelexport") //Id is combination of Grid's ID and itemname { await disposalCalculationGrid.ExportToExcelAsync(); } diff --git a/BlazorApp-Investment Tax Calculator/Model/DescribedMoney.cs b/BlazorApp-Investment Tax Calculator/Model/DescribedMoney.cs index 6c5f07c7..b5ee9649 100644 --- a/BlazorApp-Investment Tax Calculator/Model/DescribedMoney.cs +++ b/BlazorApp-Investment Tax Calculator/Model/DescribedMoney.cs @@ -24,13 +24,10 @@ public string PrintToTextFile() public string Display() { - string outputString; - if (Description == string.Empty) outputString = Amount.ToString(); - else outputString = $"{Description}: {Amount}"; if (FxRate == 1) { - return outputString; + return BaseCurrencyAmount.ToString(); } - else return $"{BaseCurrencyAmount} ({outputString})"; + else return $"{BaseCurrencyAmount} ({Amount})"; } } diff --git a/BlazorApp-Investment Tax Calculator/Pages/DividendDataPage.razor b/BlazorApp-Investment Tax Calculator/Pages/DividendDataPage.razor new file mode 100644 index 00000000..3f9fd8af --- /dev/null +++ b/BlazorApp-Investment Tax Calculator/Pages/DividendDataPage.razor @@ -0,0 +1,5 @@ +@page "/DividendDataPage" + +@using BlazorApp_Investment_Tax_Calculator.Components + + diff --git a/BlazorApp-Investment Tax Calculator/Pages/Index.razor b/BlazorApp-Investment Tax Calculator/Pages/Index.razor index 539f69a4..0a01afdb 100644 --- a/BlazorApp-Investment Tax Calculator/Pages/Index.razor +++ b/BlazorApp-Investment Tax Calculator/Pages/Index.razor @@ -8,7 +8,8 @@

To sum up, this application assist you filling out the SA106, SA108 tax form.

-

Currently only the import/export tab is usable. To get started gather some sample XML files and try to import it by going to the import/export tab.

+

Currently you can import/export and view calulations and dividend data, the add missing trade tab is not functional. + To get started gather some sample XML files and try to import it by going to the import/export tab.

Your trade data is not uploaded anywhere. They never leave your browser thanks to Blazor WASM framework. The calculation is entirely done in your browser.

diff --git a/BlazorApp-Investment Tax Calculator/Pages/NavMenu.razor b/BlazorApp-Investment Tax Calculator/Pages/NavMenu.razor index a6f82fe3..6adca0be 100644 --- a/BlazorApp-Investment Tax Calculator/Pages/NavMenu.razor +++ b/BlazorApp-Investment Tax Calculator/Pages/NavMenu.razor @@ -21,7 +21,7 @@ new listData {Id="1", Text = "Home", IconCss = "sb-icons icon-grid e-sb-icon control-icon", PageAddress = ""}, new listData {Id="2",Text = "Import/Export", IconCss = "sb-icons icon-chart e-sb-icon control-icon", PageAddress = "MainCalculatorPage"}, new listData {Id="3",Text = "Disposal Summary", IconCss = "sb-icons icon-datepicker e-sb-icon control-icon", PageAddress = "CalculationViewPage"}, - new listData {Id="4", Text = "Dividend Data", IconCss = "sb-icons icon-dialog e-sb-icon control-icon", PageAddress = "MainCalculatorPage"}, + new listData {Id="4", Text = "Dividend Data", IconCss = "sb-icons icon-dialog e-sb-icon control-icon", PageAddress = "DividendDataPage"}, new listData {Id="5", Text = "Add missing trade", IconCss = "sb-icons icon-dropdownlist e-sb-icon control-icon", PageAddress = "MainCalculatorPage"} }; public class listData diff --git a/README.md b/README.md index fb1ef1c9..adb3e41e 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Anyone interested can implement a new parser implementing ITaxEventFileParser. https://github.com/alexpung/UK-Investment-tax-calculator/tree/master/BlazorApp-Investment%20Tax%20Calculator/Parser/InteractiveBrokersXml ## Current functionality -#### Parsed trade type: +### Parsed trade type: 1. Trades: 1. Stock orders 2. Dividend income @@ -31,11 +31,12 @@ https://github.com/alexpung/UK-Investment-tax-calculator/tree/master/BlazorApp-I 3. Dividend in Lieu. 3. Corporate actions 1. Forward split only +4. View trade calculations and dividend data in a table #### Pending implementation FX, Futures (not sure if I want to handle delivery calculation.....) More corporate actions -Viewing your imported trade in a separate table. +Viewing imported trade and flattened trade matching details in tables. Add missing trade and export it. Tests and feedback are welcome, bugs are to be expected.