Added invoice export function and started implementation of unitofwork pattern (#43)

* complete read invoices from db

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* updated nuget package spapi

* WIP

* wip, now test

* wip, jut need to fix tax inclusive line amounts not supported

* wip

* wip, before I f everything up

* no, it complies now, this is the one before I f everything up

* wip

* wip

* wip, logic ready for testing

* wip it builds!!!!

* wip tested, working, need to complete the gui section

* wip

* wip

* wip - created export invoice data delete, time for testing

* wip testing phase

* wip - delete function fully tested and working

* wip on to sorting out the issue with settlement invoices not tallying

* wip

* wip

* wip

* wip

* wip before I complete change the ReadInvoiceLineItem sections

* that appears to have worked, on with the main quest

* no it's doesn't work, saving before i remove the confusing cache system (just use a dictionary!!)

* wipping picadilli

* wip

* wip

* implemented uow on inovice export, now for testing

* wip

* wip all tested do invoice currency convertion fearure

* wip

* pretty much done so long as xero accepts the exported invoices

* Complete!
This commit is contained in:
Bobbie Hodgetts
2025-06-26 23:29:22 +01:00
committed by GitHub
parent 8bbf885a48
commit 29f9fae508
82 changed files with 4606 additions and 2837 deletions
+30 -6
View File
@@ -1,7 +1,8 @@
using System;
using System.Threading;
using bnhtrade.Core;
using System;
using System.Configuration;
using bnhtrade.Core;
using System.Threading;
using System.Transactions;
namespace bnhtradeScheduledTasks
{
@@ -13,6 +14,11 @@ namespace bnhtradeScheduledTasks
static void Main(string[] args)
{
if (OperatingSystem.IsWindows())
{
TransactionManager.ImplicitDistributedTransactions = false;
}
if (args.Length == 0)
{
string consoleHeader = "Welcome to THE application!\n";
@@ -58,6 +64,7 @@ namespace bnhtradeScheduledTasks
Console.WriteLine("<7> Update Fba Return Data");
Console.WriteLine("<8> (depreciated) Update Fba Adustment Data");
Console.WriteLine("<9> Update Fba Removal Order Data");
Console.WriteLine("<10> Add all invoices to export queue");
Console.WriteLine();
Console.WriteLine("<0> Back");
Console.WriteLine("");
@@ -93,7 +100,6 @@ namespace bnhtradeScheduledTasks
{
Console.Clear();
new bnhtrade.Core.Logic.Import.AmazonSettlement().SyncDatabase();
new bnhtrade.Core.Logic.Export.AmazonSettlement().ToInvoice();
Console.WriteLine("Complete, press any key to continue...");
Console.ReadKey();
}
@@ -132,6 +138,14 @@ namespace bnhtradeScheduledTasks
Console.WriteLine("Complete, press any key to continue...");
Console.ReadKey();
}
else if (input == "10")
{
Console.Clear();
new bnhtrade.Core.Logic.Export.AccountInvoice.QueueService().ImportAll();
Console.WriteLine("Complete, press any key to continue...");
Console.ReadKey();
}
} while (true);
}
else if (input == "2")
@@ -252,6 +266,7 @@ namespace bnhtradeScheduledTasks
Console.WriteLine("Main Menu > Account");
Console.WriteLine();
Console.WriteLine("<1> Update HMRC Exchange Rates");
Console.WriteLine("<2> Generate invoices for export queue");
Console.WriteLine();
Console.WriteLine("<0> Back");
Console.WriteLine("");
@@ -265,10 +280,19 @@ namespace bnhtradeScheduledTasks
else if (input == "1")
{
Console.Clear();
new bnhtrade.Core.Logic.Account.Currency().UpdateHmrcExchageRates();
new bnhtrade.Core.Logic.Account.CurrencyService().UpdateHmrcExchageRates();
Console.WriteLine("Complete, press any key to continue...");
Console.ReadKey();
}
else if (input == "2")
{
Console.Clear();
var queueService = new bnhtrade.Core.Logic.Export.AccountInvoice.QueueService();
queueService.ImportAll();
Console.WriteLine("Complete, press any key to continue...");
Console.ReadKey();
}
} while (true);
}
else if (input == "8")
@@ -329,7 +353,7 @@ namespace bnhtradeScheduledTasks
{
Console.Clear();
//new bnhtrade.Core.Test.Export.Export(dbCredentials.ConnectionString);
new bnhtrade.Core.Test.Export.Export();
Console.WriteLine("Done");
Console.WriteLine("Complete, press any key to continue...");