diff --git a/Mapp.BusinessLogic.Invoices/AutoComplete/AutoKeyboardInputHelper.cs b/Mapp.BusinessLogic.Invoices/AutoComplete/AutoKeyboardInputHelper.cs index c963100..cfe7d0e 100644 --- a/Mapp.BusinessLogic.Invoices/AutoComplete/AutoKeyboardInputHelper.cs +++ b/Mapp.BusinessLogic.Invoices/AutoComplete/AutoKeyboardInputHelper.cs @@ -1,6 +1,7 @@ using System; using System.Threading.Tasks; using Mapp.Application.Interfaces; +using Mapp.Common; using WindowsInput.Native; namespace Mapp.BusinessLogic.AutoComplete; @@ -13,21 +14,24 @@ public interface IAutoKeyboardInputHelper : IDisposable public class AutoKeyboardInputHelper : IAutoKeyboardInputHelper { - private readonly IAutocompleteConfiguration _autocompleteConfiguration; + private readonly ISettingsWrapper _settingsWrapper; private IInputSimulator _inputSim; private IKeyboardHook _keyboardHook; private bool _isCommandPressed; - public AutoKeyboardInputHelper(IAutocompleteConfiguration autocompleteConfiguration, IKeyboardHook keyboardHook, IInputSimulator inputSimulator) + public AutoKeyboardInputHelper(ISettingsWrapper settingsWrapper, IKeyboardHook keyboardHook, IInputSimulator inputSimulator) { - _autocompleteConfiguration = autocompleteConfiguration; + _settingsWrapper = settingsWrapper; _inputSim = inputSimulator; _keyboardHook = keyboardHook; // TODO replace by https://www.nuget.org/packages/MouseKeyHook/ + +#if RELEASE _keyboardHook.KeyDown += keyboardHook_KeyDown; _keyboardHook.KeyUp += keyboardHook_KeyUp; //Installing the Keyboard Hooks _keyboardHook.Install(); +#endif } public void Dispose() @@ -48,7 +52,7 @@ private void keyboardHook_KeyDown(object sender, VKeys key) if (key == VKeys.F4 && _isCommandPressed) /*&& elapsedTime.Seconds > 2*/ { //_lastAutoinputTime = DateTime.Now; - _inputSim.TextEntry($"RR{_autocompleteConfiguration.TrackingCode}CZ"); + _inputSim.TextEntry($"RR{_settingsWrapper.TrackingCode}CZ"); _inputSim.KeyPress(VirtualKeyCode.TAB); Task.Delay(TimeSpan.FromMilliseconds(50)); _inputSim.TextEntry(DateTime.Now.ToString("dd.MM.yyyy")); @@ -70,13 +74,3 @@ private void keyboardHook_KeyUp(object sender, VKeys key) } } } - -public interface IAutocompleteConfiguration -{ - public string TrackingCode { get; set; } -} - -public class AutocompleteConfiguration : IAutocompleteConfiguration -{ - public string TrackingCode { get; set; } -} \ No newline at end of file diff --git a/Mapp.BusinessLogic.Invoices/Invoices/InvoiceConverter.cs b/Mapp.BusinessLogic.Invoices/Invoices/InvoiceConverter.cs index 0436c13..2e4f64e 100644 --- a/Mapp.BusinessLogic.Invoices/Invoices/InvoiceConverter.cs +++ b/Mapp.BusinessLogic.Invoices/Invoices/InvoiceConverter.cs @@ -9,6 +9,7 @@ namespace Mapp.BusinessLogic.Invoices { public interface IInvoiceConverter { + IAutocompleteData AutocompleteData { get; } IEnumerable LoadAmazonReports(IEnumerable reportsFileNames, InvoiceConversionContext conversionContext); void ProcessInvoices(IEnumerable invoices, string fileName); @@ -16,7 +17,7 @@ public interface IInvoiceConverter public class InvoiceConverter : IInvoiceConverter { - public readonly IAutocompleteData _autocompleteData; + public IAutocompleteData AutocompleteData { get; } private readonly ICurrencyConverter _currencyConverter; private readonly IInvoicesXmlManager _invoicesXmlManager; private readonly IAutocompleteDataLoader _autocompleteDataLoader; @@ -34,14 +35,15 @@ public InvoiceConverter( IAutocompleteDataLoader autocompleteDataLoader, IDialogService dialogService) { - _autocompleteData = autocompleteDataLoader.LoadSettings(); // TODO rewove!! _currencyConverter = currencyConverter; _invoicesXmlManager = invoicesXmlManager; _autocompleteDataLoader = autocompleteDataLoader; _dialogService = dialogService; - autocompleteDataLoader.LoadSettings(); + _rates = csvLoader.LoadFixedCurrencyRates(); // TODO make it possible to choose from settings _vatPercentage = csvLoader.LoadCountryVatRates(); // TODO make it possible to choose from settings + + AutocompleteData = _autocompleteDataLoader.LoadSettings(); } public IEnumerable LoadAmazonReports(IEnumerable reportsFileNames, InvoiceConversionContext conversionContext) @@ -148,9 +150,9 @@ private Invoice ProcessInvoiceLine(IReadOnlyDictionary valuesFro invoiceProduct.PackQuantityMultiplier = 1; if (!string.IsNullOrEmpty(invoiceProduct.AmazonSku) && - _autocompleteData.PackQuantitySku.ContainsKey(invoiceProduct.AmazonSku)) + AutocompleteData.PackQuantitySku.ContainsKey(invoiceProduct.AmazonSku)) { - invoiceProduct.PackQuantityMultiplier = uint.Parse(_autocompleteData.PackQuantitySku[invoiceProduct.AmazonSku]); + invoiceProduct.PackQuantityMultiplier = uint.Parse(AutocompleteData.PackQuantitySku[invoiceProduct.AmazonSku]); } invoiceItems.Add(invoiceItemProduct); @@ -229,7 +231,7 @@ private InvoiceItemBase FillInvoiceItem(InvoiceItemBase invoiceItem, string name public void ProcessInvoices(IEnumerable invoices, string fileName) { - _autocompleteDataLoader.SaveSettings(_autocompleteData); + _autocompleteDataLoader.SaveSettings(AutocompleteData); _invoicesXmlManager.SerializeXmlInvoice(fileName, invoices); } @@ -243,7 +245,7 @@ private string GetCustomsDeclarationBySkuOnlyForNonEu(string sku, InvoiceVatClas if (IsNonEuCountryByClassification(classification)) { return GetAutocompleteOrEmpty( - _autocompleteData.CustomsDeclarationBySku, + AutocompleteData.CustomsDeclarationBySku, sku, string.Empty); } @@ -254,7 +256,7 @@ private string GetSavedShippingType(string sku, ClientInfo clientInfo, InvoiceVa { string defaultShippingName = "Shipping"; - if (_autocompleteData.DefaultShippingByPartnerCountry.TryGetValue(clientInfo.Address.Country, out string countryDefaultShipping)) + if (AutocompleteData.DefaultShippingByPartnerCountry.TryGetValue(clientInfo.Address.Country, out string countryDefaultShipping)) { defaultShippingName = countryDefaultShipping; } @@ -266,7 +268,7 @@ private string GetSavedShippingType(string sku, ClientInfo clientInfo, InvoiceVa // only for non-EU return GetAutocompleteOrEmpty( // TODO ПРОБЛЕМА в том что при агригации шипиногов их названия будут стираться - _autocompleteData.ShippingNameBySku, + AutocompleteData.ShippingNameBySku, sku, defaultShippingName); } @@ -274,14 +276,14 @@ private string GetSavedShippingType(string sku, ClientInfo clientInfo, InvoiceVa private string GetSavedItemCodeBySku(string sku) { return GetAutocompleteOrEmpty( - _autocompleteData.PohodaProdCodeBySku, + AutocompleteData.PohodaProdCodeBySku, sku); } private string GetSavedWarehouseBySku(string sku) { return GetAutocompleteOrEmpty( - _autocompleteData.ProdWarehouseSectionBySku, + AutocompleteData.ProdWarehouseSectionBySku, sku); } diff --git a/Mapp.BusinessLogic.Invoices/StockQuantity/IStockQuantityUpdater.cs b/Mapp.BusinessLogic.Invoices/StockQuantity/IStockQuantityUpdater.cs index b65367f..17bda3a 100644 --- a/Mapp.BusinessLogic.Invoices/StockQuantity/IStockQuantityUpdater.cs +++ b/Mapp.BusinessLogic.Invoices/StockQuantity/IStockQuantityUpdater.cs @@ -6,5 +6,6 @@ namespace Mapp.BusinessLogic.StockQuantity; public interface IStockQuantityUpdater { - Task> ConvertWarehouseData(); + IReadOnlyList SourceDefinitions { get; } + Task> ConvertWarehouseData(IReadOnlyList sources); } \ No newline at end of file diff --git a/Mapp.BusinessLogic.Invoices/StockQuantity/StockQuantityUpdater.cs b/Mapp.BusinessLogic.Invoices/StockQuantity/StockQuantityUpdater.cs index 9cc6703..7340764 100644 --- a/Mapp.BusinessLogic.Invoices/StockQuantity/StockQuantityUpdater.cs +++ b/Mapp.BusinessLogic.Invoices/StockQuantity/StockQuantityUpdater.cs @@ -15,16 +15,16 @@ public class StockQuantityUpdater : IStockQuantityUpdater { private readonly IJsonManager _jsonManager; private readonly IDialogService _dialogService; - private readonly IEnumerable _sourceDefinitions; + public IReadOnlyList SourceDefinitions { get; } public StockQuantityUpdater(IJsonManager jsonManager, IDialogService dialogService) { _jsonManager = jsonManager; _dialogService = dialogService; - _sourceDefinitions = _jsonManager.LoadStockQuantityUpdaterConfigs(); + SourceDefinitions = _jsonManager.LoadStockQuantityUpdaterConfigs(); } - public async Task> ConvertWarehouseData() + public async Task> ConvertWarehouseData(IReadOnlyList sources) { var httpClient = new HttpClient(); @@ -32,7 +32,7 @@ public async Task> ConvertWarehouseData() Dictionary statistics = new Dictionary(); - foreach (var source in _sourceDefinitions) + foreach (var source in sources) { var stream = await (await httpClient.GetAsync(source.Url)).Content.ReadAsStreamAsync(); var stockData = ExtractStockData(stream, source); diff --git a/Mapp.BusinessLogic.Invoices/Transactions/MarketPlaceTransactionsConfig.cs b/Mapp.BusinessLogic.Invoices/Transactions/MarketPlaceTransactionsConfig.cs index c958af5..700af10 100644 --- a/Mapp.BusinessLogic.Invoices/Transactions/MarketPlaceTransactionsConfig.cs +++ b/Mapp.BusinessLogic.Invoices/Transactions/MarketPlaceTransactionsConfig.cs @@ -24,15 +24,16 @@ public string TimeSeparatorOverride get { return _timeSeparatorOverride; } set { + _timeSeparatorOverride = value; if (_dataCultureInfo != null) { - _dataCultureInfo.DateTimeFormat.TimeSeparator = TimeSeparatorOverride; + _dataCultureInfo.DateTimeFormat.TimeSeparator = _timeSeparatorOverride; } - - _timeSeparatorOverride = value; } } + public string NumericFormatSourceCultureName { get; set; } + private CultureInfo _dataCultureInfo; public CultureInfo DateCultureInfo @@ -45,7 +46,12 @@ public CultureInfo DateCultureInfo if (_timeSeparatorOverride != null) { _dataCultureInfo.DateTimeFormat.TimeSeparator = _timeSeparatorOverride; - } + } + if (NumericFormatSourceCultureName != null) + { + var numbericCultureInfo = new CultureInfo(NumericFormatSourceCultureName); + _dataCultureInfo.NumberFormat = numbericCultureInfo.NumberFormat; + } } return _dataCultureInfo; } diff --git a/Mapp.BusinessLogic.Invoices/Transactions/TransactionsReader.cs b/Mapp.BusinessLogic.Invoices/Transactions/TransactionsReader.cs index b928dda..2a78118 100644 --- a/Mapp.BusinessLogic.Invoices/Transactions/TransactionsReader.cs +++ b/Mapp.BusinessLogic.Invoices/Transactions/TransactionsReader.cs @@ -41,7 +41,6 @@ public IEnumerable ReadTransactionsFromMultipleFiles(IEnumerable GetAvailableMarketplaceConfigs() { - // TODO load only once var mapperConfiguration = new MapperConfiguration(cfg => { cfg.CreateMap(); }); @@ -110,7 +109,7 @@ private IEnumerable ReadTransactions(string fileName) } var validLines = lines.Skip(linesToSkip).ToList(); - var transactionsDict = new Dictionary(); + var transactionsDict = new Dictionary(StringComparer.OrdinalIgnoreCase); for (int columnIndex = 0; columnIndex < validLines[0].Length; ++columnIndex) { string columnNameKey = validLines[0][columnIndex].Trim(); //tolower? diff --git a/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.ConvertTransactions_ParsesAndConvertsTransactions_AmazonFR.verified.txt b/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.ConvertTransactions_ParsesAndConvertsTransactions_AmazonFR.verified.txt new file mode 100644 index 0000000..984e7b5 --- /dev/null +++ b/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.ConvertTransactions_ParsesAndConvertsTransactions_AmazonFR.verified.txt @@ -0,0 +1,5 @@ +0740000002001353907Czech Goods s.r.o. 01111900000013280900+00000016514842+000000461730770000000494070190011300424FIO +0750000002001353908000000000000000000000000000000000000026992951669712700000000000000000000000000408-0091951-6697127000124050224 +07500000020013539080000000000000000000000000000000000001062710000000000000000000000000000000000000000000000000000000000124170224 +0750000002001353908000000000000000000000000000000000000026992290539393600000000000000000000000000408-2472290-5393936000124230224 +0750000002001353908000000000000000000000000000000000000062002070906676300000000000000000000000000405-7042070-9066763000124260224 \ No newline at end of file diff --git a/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.ConvertTransactions_ParsesAndConvertsTransactions_AmazonMX.verified.txt b/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.ConvertTransactions_ParsesAndConvertsTransactions_AmazonMX.verified.txt index bcc68c2..f192118 100644 --- a/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.ConvertTransactions_ParsesAndConvertsTransactions_AmazonMX.verified.txt +++ b/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.ConvertTransactions_ParsesAndConvertsTransactions_AmazonMX.verified.txt @@ -1,8 +1,16 @@ 0740000002001353907Czech Goods s.r.o. 01111900000013280900+00000016514842+000000461730770000000494070190011300424FIO -07500000020013539020000000000000000000000000000000000007206310000000000000000000000000000000000000000000000000000000000124061120 -0750000002001353902000000000000000000000000000000000001577872514164104100000000000000000000000000702-5224514-1641041000124151120 -0750000002001353902000000000000000000000000000000000002077052965988102600000000000000000000000000702-3444965-9881026000124151120 -07500000020013539020000000000000000000000000000000000000352510000000000000000000000000000000000000000000000000000000000124201120 -0750000002001353902000000000000000000000000000000000002077052704294262500000000000000000000000000702-1622704-2942625000124241120 -0750000002001353902000000000000000000000000000000000002077052827234343700000000000000000000000000701-7796827-2343437000124241120 -0750000002001353902000000000000000000000000000000000001178982984649067200000000000000000000000000701-0090984-6490672000124261120 \ No newline at end of file +0750000002001353902000000000000000000000000000000000001195005698303945400000000000000000000000000702-1407698-3039454000124010224 +0750000002001353902000000000000000000000000000000000002195002542046746800000000000000000000000000702-6059542-0467468000124010224 +0750000002001353902000000000000000000000000000000000001195002372825940600000000000000000000000000702-7039372-8259406000124060224 +0750000002001353902000000000000000000000000000000000001595002681949946300000000000000000000000000701-6390681-9499463000124060224 +0750000002001353902000000000000000000000000000000000001195002238817546900000000000000000000000000702-1008238-8175469000124080224 +0750000002001353902000000000000000000000000000000000000950002051013140100000000000000000000000000701-0997051-0131401000124080224 +0750000002001353902000000000000000000000000000000000000950002051013140100000000000000000000000000701-0997051-0131401000124080224 +0750000002001353902000000000000000000000000000000000001195002897697466900000000000000000000000000702-3416897-6974669000124110224 +07500000020013539020000000000000000000000000000000000057319010000000000000000000000000000000000000000000000000000000000124120224 +0750000002001353902000000000000000000000000000000000001425002173601460200000000000000000000000000702-5970173-6014602000124130224 +0750000002001353902000000000000000000000000000000000001400002497863463800000000000000000000000000701-7451497-8634638000124190224 +0750000002001353902000000000000000000000000000000000000975002395548026400000000000000000000000000701-5926395-5480264000124220224 +0750000002001353902000000000000000000000000000000000000995002579507706300000000000000000000000000702-3541579-5077063000124250224 +0750000002001353902000000000000000000000000000000000002845002605247383000000000000000000000000000701-2609605-2473830000124250224 +07500000020013539020000000000000000000000000000000000091086110000000000000000000000000000000000000000000000000000000000124260224 \ No newline at end of file diff --git a/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.ConvertTransactions_ParsesAndConvertsTransactions_AmazonSE.verified.txt b/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.ConvertTransactions_ParsesAndConvertsTransactions_AmazonSE.verified.txt new file mode 100644 index 0000000..69d9ab2 --- /dev/null +++ b/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.ConvertTransactions_ParsesAndConvertsTransactions_AmazonSE.verified.txt @@ -0,0 +1,4 @@ +0740000002001353907Czech Goods s.r.o. 01111900000013280900+00000016514842+000000461730770000000494070190011300424FIO +07500000020013539130000000000000000000000000000000000005200021514960562000000000000000000000000002151496056200000000000124090224 +07500000020013539130000000000000000000000000000000000002790021514960562000000000000000000000000002151496056200000000000124230224 +07500000020013539130000000000000000000000000000000000004420011607040132000000000000000000000000002160704013200000000000124270224 \ No newline at end of file diff --git a/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.ConvertTransactions_ParsesAndConvertsTransactions_AmazonSG.verified.txt b/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.ConvertTransactions_ParsesAndConvertsTransactions_AmazonSG.verified.txt new file mode 100644 index 0000000..03417ba --- /dev/null +++ b/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.ConvertTransactions_ParsesAndConvertsTransactions_AmazonSG.verified.txt @@ -0,0 +1,6 @@ +0740000002001353907Czech Goods s.r.o. 01111900000013280900+00000016514842+000000461730770000000494070190011300424FIO +07500000020013539140000000000000000000000000000000000000640910000000000000000000000000000000000000000000000000000000000124060224 +0750000002001353914000000000000000000000000000000000000064222095799586500000000000000000000000000249-5935095-7995865000124110224 +0750000002001353914000000000000000000000000000000000000073382804361340400000000000000000000000000249-3345804-3613404000124140224 +0750000002001353914000000000000000000000000000000000000022932565422781400000000000000000000000000249-5071565-4227814000124150224 +07500000020013539140000000000000000000000000000000000001414510000000000000000000000000000000000000000000000000000000000124200224 \ No newline at end of file diff --git a/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.ConvertTransactions_ParsesAndConvertsTransactions_PaypalCZ.verified.txt b/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.ConvertTransactions_ParsesAndConvertsTransactions_PaypalCZ.verified.txt index 24794af..278e8a9 100644 --- a/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.ConvertTransactions_ParsesAndConvertsTransactions_PaypalCZ.verified.txt +++ b/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.ConvertTransactions_ParsesAndConvertsTransactions_PaypalCZ.verified.txt @@ -1,2 +1,42 @@ 0740000002001353907Czech Goods s.r.o. 01111900000013280900+00000016514842+000000461730770000000494070190011300424FIO -07500000020013539210000000000000000000000000000000000895356611132876594000000000000000000000000000140711328765940000000124100623 \ No newline at end of file +07500000020013539210000000000000000000000000000000000001567625139471830000000000000000000000000007405139471830000000000124020224 +07500000020013539210000000000000000000000000000000000001499123710872040000000000000000000000000002028371087204000000000124040224 +07500000020013539210000000000000000000000000000000000000262520972830262000000000000000000000000007609728302620000000000124040224 +07500000020013539210000000000000000000000000000000000000459722551712028000000000000000000000000000005125517120280000000124040224 +07500000020013539210000000000000000000000000000000000000299922596901400000000000000000000000000008792596901400000000000124060224 +07500000020013539210000000000000000000000000000000000001469427309933270000000000000000000000000002573099332700000000000124080224 +07500000020013539210000000000000000000000000000000000000349924909206737000000000000000000000000002234909206737000000000124120224 +07500000020013539210000000000000000000000000000000000000449921471843652000000000000000000000000008314718436520000000000124140224 +07500000020013539210000000000000000000000000000000000000249923173241248000000000000000000000000003673173241248000000000124140224 +07500000020013539210000000000000000000000000000000000001339523171275410000000000000000000000000009631712754100000000000124160224 +07500000020013539210000000000000000000000000000000000001415521720451730000000000000000000000000007057917204517300000000124180224 +07500000020013539210000000000000000000000000000000000001349625402068060000000000000000000000000006354020680600000000000124180224 +07500000020013539210000000000000000000000000000000000000159929553661420000000000000000000000000006679553661420000000000124200224 +07500000020013539210000000000000000000000000000000000000869722246933552000000000000000000000000003622469335520000000000124200224 +07500000020013539210000000000000000000000000000000000000482027534939723000000000000000000000000006507534939723000000000124210224 +07500000020013539210000000000000000000000000000000000000299929937876132000000000000000000000000008599378761320000000000124210224 +07500000020013539210000000000000000000000000000000000000819922814763604000000000000000000000000001367692814763604000000124270224 +07500000020013539210000000000000000000000000000000000001009629330693001000000000000000000000000006093306930010000000000124280224 +07500000020013539210000000000000000000000000000000000000299923296136841000000000000000000000000007832961368410000000000124280224 +07500000020013539210000000000000000000000000000000000000259921992095223000000000000000000000000000951992095223000000000124290224 +07500000020013539210000000000000000000000000000000000000349026341798984000000000000000000000000001696341798984000000000124050224 +07500000020013539210000000000000000000000000000000000000448028466027351000000000000000000000000002137846602735100000000124050224 +07500000020013539210000000000000000000000000000000000000560027431915332000000000000000000000000009510874319153320000000124120224 +07500000020013539210000000000000000000000000000000000000480025450610032000000000000000000000000000854506100320000000000124250224 +07500000020013539210000000000000000000000000000000000000450024099308604000000000000000000000000001474409930860400000000124280224 +07500000020013539210000000000000000000000000000000000497759823532556528000000000000000000000000003261353255652800000000124130224 +07500000020013539210000000000000000000000000000000000415218221597092060000000000000000000000000009461597092060000000000124130224 +07500000020013539210000000000000000000000000000000000000399020019402024000000000000000000000000002300019402024000000000124030224 +07500000020013539210000000000000000000000000000000000000184528183143704000000000000000000000000009208183143704000000000124050224 +07500000020013539210000000000000000000000000000000000000474026069139113000000000000000000000000002544606913911300000000124070224 +07500000020013539210000000000000000000000000000000000000275528950169118000000000000000000000000001258950169118000000000124080224 +07500000020013539210000000000000000000000000000000000000658521446773810000000000000000000000000008631144677381000000000124120224 +07500000020013539210000000000000000000000000000000000000355522362696614000000000000000000000000005892362696614000000000124150224 +07500000020013539210000000000000000000000000000000000000907529210563944000000000000000000000000002719210563944000000000124160224 +07500000020013539210000000000000000000000000000000000000657528333984902000000000000000000000000004120833398490200000000124170224 +07500000020013539210000000000000000000000000000000000000384527757401511000000000000000000000000002747757401511000000000124220224 +07500000020013539210000000000000000000000000000000000000518525451086150000000000000000000000000005765754510861500000000124230224 +07500000020013539210000000000000000000000000000000000000229020535011390000000000000000000000000009592053501139000000000124280224 +07500000020013539210000000000000000000000000000000000000500024858855452000000000000000000000000001148588554520000000000124170224 +07500000020013539210000000000000000000000000000000000004810020969446740000000000000000000000000001990969446740000000000124190224 +07500000020013539210000000000000000000000000000000000008330029943855731000000000000000000000000002150994385573100000000124230224 \ No newline at end of file diff --git a/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.cs b/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.cs index 3a11b1d..929cdbd 100644 --- a/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.cs +++ b/Mapp.BusinessLogic.Transactions.Tests/IntegrationTests.cs @@ -73,6 +73,25 @@ public async Task ConvertTransactions_ParsesAndConvertsTransactions_AmazonMX() await IntegrationTestBase("AmazonMX"); } + [Fact] + public async Task ConvertTransactions_ParsesAndConvertsTransactions_AmazonFR() + { + await IntegrationTestBase("AmazonFR"); + } + + [Fact] + public async Task ConvertTransactions_ParsesAndConvertsTransactions_AmazonSG() + { + await IntegrationTestBase("AmazonSG"); + } + + [Fact] + public async Task ConvertTransactions_ParsesAndConvertsTransactions_AmazonSE() + { + await IntegrationTestBase("AmazonSE"); + } + + [Fact] public async Task ConvertTransactions_ParsesAndConvertsTransactions_AmazonNL() { diff --git a/Mapp.BusinessLogic.Transactions.Tests/TestData/AmazonFR.csv b/Mapp.BusinessLogic.Transactions.Tests/TestData/AmazonFR.csv new file mode 100644 index 0000000..534585b --- /dev/null +++ b/Mapp.BusinessLogic.Transactions.Tests/TestData/AmazonFR.csv @@ -0,0 +1,12 @@ +"Comprend les transactions Amazon Marketplace, Expédié par Amazon et Boutique en ligne Amazon" +"Tous les montants sont en EUR, sauf indication contraire" +"Définitions :" +"Taxes de ventes prélevées : Inclut les taxes de vente prélevées auprès des acheteurs pour les ventes de produits, l’expédition et les emballages-cadeaux." +"Frais de vente : Comprend les frais de clôture estimés et les frais de vente." +"Autres frais de transaction : Comprend les rétrofacturations de l’expédition, les retenues sur l’expédition, les frais par article et les frais de recouvrement des taxes de vente." +"Autres : Inclut les montants des transactions non liées à une commande. Pour plus d’informations, consultez les colonnes « Type » et « Description » pour chaque numéro de commande." +"date/heure","Identifiant du paiement","type","Numéro de la commande","SKU","description","quantité","site de vente","expédition","ville de la commande","état de la commande","commande postale","ventes de produits","crédits d’expédition","crédits d’emballage-cadeau","Total des réductions","taxe de ventes prélevée","Taxe Marketplace Facilitator","frais de vente","Frais pour le service Expédié par Amazon","autres frais de transaction","autres","total" +"5 févr. 2024 07:53:07 UTC","21554144692","Commande","408-0091951-6697127","55-KOH-FR2110","KOH-I-NOOR Craies pour Tableaux Noirs - Blanc (Lot de 100)","1","amazon.com.be","Vendeur","Antwerpen","","2170","16,99","10,00","0","0","0","0","-4,05","0","0","0","22,94" +"17 févr. 2024 02:42:48 UTC","21642579362","Transférer","","","Sur le compte se terminant par : 907","","","","","","","0","0","0","0","0","0","0","0","0","-106,27","-106,27" +"23 févr. 2024 07:55:37 UTC","21642579362","Commande","408-2472290-5393936","55-KOH-FR2110","KOH-I-NOOR Craies pour Tableaux Noirs - Blanc (Lot de 100)","1","amazon.com.be","Vendeur","Antwerpen","","2170","16,99","10,00","0","0","0","0","-4,05","0","0","0","22,94" +"26 févr. 2024 07:33:16 UTC","21642579362","Commande","405-7042070-9066763","623016","Tescoma Delicia Plaque à pâtisserie 40 cm x 36 cm","2","amazon.com.be","Vendeur","Bruxelles","","1190","50,00","12,00","0","0","0","0","-9,30","0","0","0","52,70" diff --git a/Mapp.BusinessLogic.Transactions.Tests/TestData/AmazonMX.csv b/Mapp.BusinessLogic.Transactions.Tests/TestData/AmazonMX.csv index af5b8db..42fff5b 100644 --- a/Mapp.BusinessLogic.Transactions.Tests/TestData/AmazonMX.csv +++ b/Mapp.BusinessLogic.Transactions.Tests/TestData/AmazonMX.csv @@ -1,15 +1,25 @@ "Incluye transacciones de Amazon Marketplace, Fulfillment by Amazon (FBA) y Amazon Webstore" -"Todos los importes en dólares, a menos que se especifique" +"Todos los importes en MXN, a menos que se especifique" "Definiciones:" "Impuesto de venta cobrado: Incluye impuesto de venta cobrado a los compradores por ventas de productos, envíos y envoltorio de regalo." "Tarifas de venta: Incluye tarifas de cierre variable y de remisión." "Tarifas de otra transacción: Incluye reintegros de envío, retenciones de envío y tarifas de cobro de impuestos de venta." "Otro: Incluye otros importes de transacción no relacionados con el pedido. Para obtener más detalles, consulta las columnas ""Tipo"" y ""Descripción"" para cada Id. de pedido." -"fecha/hora","Id. de liquidación","tipo ","Id. del pedido","sku","descripción","cantidad","marketplace","cumplimiento","ciudad del pedido","estado del pedido","código postal del pedido","modelo de recaudación de impuestos","ventas de productos","impuesto de ventas de productos","créditos de envío","impuesto de abono de envío","créditos por envoltorio de regalo","impuesto de créditos de envoltura","descuentos promocionales","impuesto de reembolsos promocionales","impuesto de retenciones en la plataforma","tarifas de venta","tarifas fba","tarifas de otra transacción","otro","total" -"6 nov. 2020 6:22:34 GMT-8","13522125751","Trasferir","","","A la cuenta que finaliza en: 231","","","","","","","","0","0","0","0","0","0","0","0","0","0","0","0","-720.63","-720.63" -"15 nov. 2020 23:43:16 GMT-8","13522125751","Pedido","702-5224514-1641041","55-KOH-FR7263","Lighthouse Hardcover Stamp Album Stockbook with 16 Black Pages, Black, LS4/8 by Lighthouse","1","amazon.com.mx","Vendedor","CIUDAD DE MEXICO","CIUDAD DE MEXICO","03200","","872.87","0","705.00","0","0","0","0","0","0","-157.78","0","0","0","1,420.09" -"15 nov. 2020 23:49:02 GMT-8","13522125751","Pedido","702-3444965-9881026","GV-GY46-VBX2","Tescoma Delícia - Cuenco para masa (26 cm)","1","amazon.com.mx","Vendedor","Mexico City","Colonia Granada/Delegación Miguel Hidalgo","11520","","1,372.05","0","705.00","0","0","0","0","0","0","-311.56","0","0","0","1,765.49" -"20 nov. 2020 5:50:54 GMT-8","13566661631","Trasferir","","","A la cuenta que finaliza en: 231","","","","","","","","0","0","0","0","0","0","0","0","0","0","0","0","-35.25","-35.25" -"24 nov. 2020 23:45:57 GMT-8","13566661631","Pedido","702-1622704-2942625","GV-GY46-VBX2","Tescoma Delícia - Cuenco para masa (26 cm)","1","amazon.com.mx","Vendedor","GUADALAJARA","JALISCO","44600","","1,372.05","0","705.00","0","0","0","0","0","0","-311.56","0","0","0","1,765.49" -"24 nov. 2020 23:50:41 GMT-8","13566661631","Pedido","701-7796827-2343437","GV-GY46-VBX2","Tescoma Delícia - Cuenco para masa (26 cm)","1","amazon.com.mx","Vendedor","Agua Dulce","Veracruz","96620","","1,372.05","0","705.00","0","0","0","0","0","0","-311.56","0","0","0","1,765.49" -"26 nov. 2020 23:15:36 GMT-8","13566661631","Pedido","701-0090984-6490672","55-DJY4-FR1542","Tescoma Fondue Gel siesta, varios colores","1","amazon.com.mx","Vendedor","SAN PEDRO GARZA GARCIA","NUEVO LEON","66297","","473.98","0","705.00","0","0","0","0","0","0","-176.85","0","0","0","1,002.13" +"fecha/hora","Id. de liquidación","tipo ","Id. del pedido","sku","descripción","cantidad","marketplace","cumplimiento","ciudad del pedido","estado del pedido","código postal del pedido","modelo de recaudación de impuestos","ventas de productos","impuesto de ventas de productos","créditos de envío","impuesto de abono de envío","créditos por envoltorio de regalo","impuesto de créditos de envoltura","Tarifa reglamentaria","Impuesto sobre tarifa reglamentaria","descuentos promocionales","impuesto de reembolsos promocionales","impuesto de retenciones en la plataforma","tarifas de venta","tarifas fba","tarifas de otra transacción","otro","total" +"1 feb 2024 07:32:42 GMT-8","19625508671","Reembolso","702-1407698-3039454","86-OF5Z-WX9V","Curaprox Swiss SY 2460 Sensitive Young - cepillo para polvo de dientes suave para niños de 4 a 8 años, unisex, colores","1","amazon.com.mx","Vendedor","LA PAZ","BAJA CALIFORNIA SUR","23094","","-490.00","0","-705.00","0","0","0","0","0","0","0","0","143.40","0","0","0","-1,051.60" +"1 feb 2024 23:14:23 GMT-8","19625508671","Pedido","702-6059542-0467468","55-KOH-FR5413","KOH-I-NOOR Polycolor Artist's - Lápices de colores (48 unidades)","1","amazon.com.mx","Vendedor","Mexico D.F","Mexico City","14390","","1,490.00","0","705.00","0","0","0","0","0","0","0","0","-315.60","0","0","0","1,879.40" +"6 feb 2024 04:21:35 GMT-8","19625508671","Ajuste","","","Otro","","","","","","","","0","0","0","0","0","0","0","0","0","0","0","0","0","0","1,015.74","1,015.74" +"6 feb 2024 22:54:33 GMT-8","19625508671","Pedido","702-7039372-8259406","GR-F5HG-MIJB","Dermacol Make-up Cover - Waterproof Hypoallergenic Foundation 30g (207)","1","amazon.com.mx","Vendedor","HEROICA GUAYMAS","SONORA","85430","","490.00","0","705.00","0","0","0","0","0","0","0","0","-179.26","0","0","0","1,015.74" +"6 feb 2024 22:56:32 GMT-8","19625508671","Pedido","701-6390681-9499463","67-ONZV-Q30J","Curaprox 1560 - cepillo para polvo de dientes suave y sensible, 4 cepillos Mejor limpieza y firme, pero suave suavidad, su suya en maravillosos colore","1","amazon.com.mx","Vendedor","SALTILLO","COAHUILA DE ZARAGOZA","25280","","890.00","0","705.00","0","0","0","0","0","0","0","0","-239.25","0","0","0","1,355.75" +"7 feb 2024 01:02:29 GMT-8","19625508671","Tarifa de servicio","","","Suscripción","","Amazon.com.mx","","","","","","0","0","0","0","0","0","0","0","0","0","0","0","0","0","-126.96","-126.96" +"8 feb 2024 23:17:48 GMT-8","19625508671","Pedido","702-1008238-8175469","55-KOH-FR5415","KOH-I-NOOR Polycolor Brown Line Artist's - Lápices de colores (12 unidades)","1","amazon.com.mx","Vendedor","JUCHITAN (JUCHITAN DE ZARAGOZA)","OAXACA","70000","","490.00","0","705.00","0","0","0","0","0","0","0","0","-179.26","0","0","0","1,015.74" +"8 feb 2024 23:25:40 GMT-8","19625508671","Pedido","701-0997051-0131401","1113C","Dermacol Make-up Cover - High Covering Waterproof Foundation SPF30, 213","1","amazon.com.mx","Vendedor","CIUDAD DE MEXICO","CIUDAD DE MEXICO","11200","","490.00","0","460.00","0","0","0","0","0","0","0","0","-142.50","0","0","0","807.50" +"8 feb 2024 23:25:40 GMT-8","19625508671","Pedido","701-0997051-0131401","1115C","Dermacol Make-up Cover - High Covering Waterproof Foundation SPF30, 215","1","amazon.com.mx","Vendedor","CIUDAD DE MEXICO","CIUDAD DE MEXICO","11200","","490.00","0","460.00","0","0","0","0","0","0","0","0","-142.50","0","0","0","807.50" +"11 feb 2024 23:44:06 GMT-8","19741800151","Pedido","702-3416897-6974669","1122B","Dermacol make-up cover maquillaje de alta cobertura (tono 222) 222","1","amazon.com.mx","Vendedor","Tecate","Baja california","21440","","490.00","0","705.00","0","0","0","0","0","0","0","0","-179.26","0","0","0","1,015.74" +"12 feb 2024 21:54:50 GMT-8","19741800151","Trasferir","","","A la cuenta que finaliza en: 907","","","","","","","","0","0","0","0","0","0","0","0","0","0","0","0","0","0","-5,731.90","-5,731.90" +"13 feb 2024 23:22:27 GMT-8","19741800151","Pedido","702-5970173-6014602","4H-BPKH-UW1A","Dermacol Gold Anti-Wrinkle Make Up Base Rejuvenating & Smoothing Make-up Base with Active Gold - 15ml / 0.53 oz","1","amazon.com.mx","Vendedor","CIUDAD DE MEXICO","CIUDAD DE MEXICO","01700","","720.00","0","705.00","0","0","0","0","0","0","0","0","-213.76","0","0","0","1,211.24" +"19 feb 2024 00:01:37 GMT-8","19741800151","Pedido","701-7451497-8634638","55-KOH-FR1021","APLI Circular labels 5 sheets 8 x 8mm Red Rojo 288pieza(s) - Etiqueta autoadhesiva (Rojo, 8 mm, 8 mm, 288 pieza(s), 5 hojas)","2","amazon.com.mx","Vendedor","CIUDAD DE MEXICO","CIUDAD DE MEXICO","04370","","480.00","0","920.00","0","0","0","0","0","0","0","0","-210.01","0","0","0","1,189.99" +"22 feb 2024 23:52:34 GMT-8","19741800151","Pedido","701-5926395-5480264","Y1-2MFF-KOP6","KOH-I-NOOR 6510010001TD - Borrador de piedras naturales","1","amazon.com.mx","Vendedor","MORELIA","MICHOACAN DE OCAMPO","58000","","270.00","0","705.00","0","0","0","0","0","0","0","0","-146.26","0","0","0","828.74" +"25 feb 2024 23:25:00 GMT-8","19829856021","Pedido","702-3541579-5077063","55-KOH-FR1245","Koh-i-noor Cables de grafito 4190 HB de 3,2 mm para dibujo técnico y retoque.","1","amazon.com.mx","Vendedor","huixquilucan","Estado de México","52786","","290.00","0","705.00","0","0","0","0","0","0","0","0","-149.25","0","0","0","845.75" +"25 feb 2024 23:27:15 GMT-8","19829856021","Pedido","701-2609605-2473830","95-4U35-KBRY","Curaprox CPS 06 PRIME PLUS HANDY - Producto de cuidado dental (Turquesa)","3","amazon.com.mx","Vendedor","CIUDAD DE MEXICO","CIUDAD DE MEXICO","07708","","1,710.00","0","1,135.00","0","0","0","0","0","0","0","0","-426.75","0","0","0","2,418.25" +"26 feb 2024 22:29:54 GMT-8","19829856021","Trasferir","","","A la cuenta que finaliza en: 907","","","","","","","","0","0","0","0","0","0","0","0","0","0","0","0","0","0","-9,108.61","-9,108.61" diff --git a/Mapp.BusinessLogic.Transactions.Tests/TestData/AmazonSE.csv b/Mapp.BusinessLogic.Transactions.Tests/TestData/AmazonSE.csv new file mode 100644 index 0000000..5878b07 --- /dev/null +++ b/Mapp.BusinessLogic.Transactions.Tests/TestData/AmazonSE.csv @@ -0,0 +1,11 @@ +"Inkluderar transaktioner på Amazons marknadsplats, Fraktas från Amazon (FBA) och Amazons webbutik" +"Alla belopp i kr, om inte annat anges" +"Definitioner:" +"Inkasserad moms: Inkluderar moms som kasserats in från köpare för produktförsäljning, frakt och presentinslagning." +"Försäljningsavgifter: Inkluderar rörliga avstängningsavgifter och hänvisningsavgifter." +"Övriga transaktionsavgifter: Inkluderar återdebitering av frakt, stoppad frakt, fraktstopp, avgifter per artikel och inkassering av moms." +"Övrigt: Inkluderar belopp för annat än beställningar. Mer information finns i kolumnerna ”Typ” och ”Beskrivning” för varje beställnings-ID." +"datum/tid","reglerings-id","typ","beställnings-id","sku","beskrivning","antal","marknadsplats","leverans","stad för beställning","delstat för beställning","postadress för beställning","försäljning av produkter","fraktkrediter","krediter för presentinslagning","kampanjrabatter","Inkasserad moms","Skatt för marknadsplatsförmedlare","försäljningsavgifter","fba-avgifter","övriga transaktionsavgifter","Övrigt","totalt" +"9 feb. 2024 11:25:30 UTC","21514960562","Order","404-4654840-2609942","55-KOH-FR5368","Koh-I-Noor 3714072001KZ akvarell färgpenna, 72 stycken","1","amazon.se","Säljare","PÅARP","","25351","390,00","130,00","0","0","0","0","−78,00","0","0","0","442,00" +"23 feb. 2024 07:58:16 UTC","21514960562","Order","403-4150601-4889141","DVDCZ1213","Tri Bratri [DVD] [DVD]","1","amazon.se","Säljare","SJÖBO","","27592","149,00","130,00","0","0","0","0","−50,85","0","0","0","228,15" +"27 feb. 2024 05:11:00 UTC","21607040132","Överföring","","","Till konto som slutar med: 907","","","","","","","0","0","0","0","0","0","0","0","0","−442,00","−442,00" diff --git a/Mapp.BusinessLogic.Transactions.Tests/TestData/AmazonSG.csv b/Mapp.BusinessLogic.Transactions.Tests/TestData/AmazonSG.csv new file mode 100644 index 0000000..16675c9 --- /dev/null +++ b/Mapp.BusinessLogic.Transactions.Tests/TestData/AmazonSG.csv @@ -0,0 +1,13 @@ +"Includes Amazon Marketplace, Fulfilment by Amazon (FBA), and Amazon Webstore transactions" +"All amounts in SGD, unless specified" +"Definitions:" +"Sales tax collected: Includes sales tax collected from buyers for product sales, shipping, and gift wrap." +"Selling fees: Includes variable closing fees and referral fees." +"Other transaction fees: Includes delivery chargebacks, delivery holdbacks." +"Other: Includes non-order transaction amounts. For more details, see the ""Type"" and ""Description"" columns for each order ID." +"date/time","settlement id","type","order id","sku","description","quantity","marketplace","fulfilment","order city","order state","order postal","product sales","postage credits","gift wrap credits","promotional rebates","sales tax collected","Marketplace Facilitator Tax","selling fees","fba fees","other transaction fees","other","total" +"6 Feb 2024 1:23:33 pm GMT+9","11619680113","Transfer","","","To account ending in: 907","","","","","","","0","0","0","0","0","0","0","0","0","-64.09","-64.09" +"11 Feb 2024 8:01:28 pm GMT+9","11619680113","Order","249-5935095-7995865","CF-C84H-UJNP","Ultra soft toothbrush 3 pack, Curaprox 5460, better cleaning & softer feeling. by Curaprox","2","amazon.sg","Seller","Singapore","","267951","45.88","18.34","0","0","5.78","-5.78","-7.00","0","0","0","57.22" +"14 Feb 2024 5:41:14 pm GMT+9","11619680113","Order","249-3345804-3613404","650366","Tescoma 650366.00 Sugar Dispenser Glass 7,6 oz","2","amazon.sg","Seller","Singapore","Singapore","387298","55.04","18.34","0","0","6.62","-6.62","-9.20","0","0","0","64.18" +"15 Feb 2024 8:19:45 am GMT+9","11619680113","Order","249-5071565-4227814","420651","Tescoma Poached egg maker PRESTO","1","amazon.sg","Seller","Singapore","","460039","10.09","12.84","0","0","2.07","-2.07","-2.88","0","0","0","20.05" +"20 Feb 2024 1:24:08 pm GMT+9","11631463023","Transfer","","","To account ending in: 907","","","","","","","0","0","0","0","0","0","0","0","0","-141.45","-141.45" diff --git a/Mapp.BusinessLogic.Transactions.Tests/TestData/PayPalCZ.csv b/Mapp.BusinessLogic.Transactions.Tests/TestData/PayPalCZ.csv index 61fdfca..0fb7ddd 100644 --- a/Mapp.BusinessLogic.Transactions.Tests/TestData/PayPalCZ.csv +++ b/Mapp.BusinessLogic.Transactions.Tests/TestData/PayPalCZ.csv @@ -1,2 +1,46 @@ -"Datum","Čas","Časové pásmo","Popis","Měna","Brutto ","Poplatek ","Netto","Zůstatek","ID transakce","E-mailová adresa odesílatele","Název","Název banky","Bankovní účet","Výše poštovného a balného","Daň z prodeje","ID faktury","Referenční ID transakce" -"10/6/2023","11:52:55","Europe/Prague","General Withdrawal - Bank Account","CZK","-89 535,66","0,00","-89 535,66","-89 535,66","0X14071132876594C","","","Fio banka, a.s.","3907","0,00","0,00","","" \ No newline at end of file +"Datum","Čas","Časové pásmo","Popis","Měna","Brutto ","Poplatek ","Netto","Zůstatek","ID transakce","E-mailová adresa odesílatele","Název","Název banky","Bankovní účet","Výše poštovného a balného","Daň z prodeje","ID faktury","Referenční ID transakce" +"2/2/2024","00:15:55","Europe/Prague","Express Checkout Payment","USD","156,76","-8,75","148,01","1 981,71","7NH405139H471830L","tereza73196@gmail.com","Lanabugboutique","","","49,00","0,00","#3398.2","93T11476C36441131" +"2/4/2024","08:15:13","Europe/Prague","Express Checkout Payment","USD","149,91","-8,38","141,53","2 123,24","20P28371PX0872040","steven.jeczala@gmail.com","Steven Jeczala","","","22,00","0,00","#3406.2","8CV47216LL388490G" +"2/4/2024","17:04:43","Europe/Prague","Express Checkout Payment","USD","26,25","-1,71","24,54","2 147,78","7NW60972NM830262H","ferret@planters.net","Mike Mullenix","","","10,00","0,00","#3408.2","34P074102N1704745" +"2/4/2024","19:47:19","Europe/Prague","Express Checkout Payment","USD","45,97","-2,78","43,19","2 190,97","0S005125E51712028","prissizz@hotmail.com","Priscilla Izzo","","","10,00","0,00","#203120.2","5U230485G0173720W" +"2/6/2024","21:36:45","Europe/Prague","Express Checkout Payment","USD","29,99","-1,92","28,07","2 219,04","87P92596RW901400C","Mmsurfergirl905@aol.com","Delfina Morris","","","10,00","0,00","#203121.2","50S93806PM8274532" +"2/8/2024","18:36:08","Europe/Prague","Express Checkout Payment","USD","146,94","-8,22","138,72","2 357,76","2WT57309BY933270H","Jankiraly@aol.com","Jan Kiraly","","","22,00","0,00","#3416.2","76M15835B5110770X" +"2/12/2024","02:56:29","Europe/Prague","Express Checkout Payment","USD","34,99","-2,19","32,80","2 390,56","2VP23490BE9206737","gilbertcivil@gmail.com","Ed Eckert","","","10,00","0,00","#3425.2","0GN2489700545872S" +"2/13/2024","09:45:12","Europe/Prague","General Currency Conversion","USD","-2 200,00","0,00","-2 200,00","190,56","5B163188W0645002F","","","","","0,00","0,00","","3MD261353Y2556528" +"2/14/2024","03:29:39","Europe/Prague","Express Checkout Payment","USD","44,99","-2,72","42,27","232,83","8FT31471BC843652U","jem9240@aol.com","John Mead","","","10,00","0,00","#3431.2","3SW86413R51666436" +"2/14/2024","15:34:21","Europe/Prague","Express Checkout Payment","USD","24,99","-1,65","23,34","256,17","3HJ67317KB3241248","detroyes@hotmail.com","Chris B Olson","","","10,00","0,00","#3432.2","7LX59325KH701950H" +"2/16/2024","21:37:14","Europe/Prague","Express Checkout Payment","USD","133,95","-7,52","126,43","382,60","9VN63171BY275410J","borekh@hotmail.com","Lubor Hlousek","","","22,00","0,00","#3437.2","66872057SX113263B" +"2/18/2024","01:29:45","Europe/Prague","Express Checkout Payment","USD","141,55","-7,93","133,62","516,22","70579172L0451730G","marekskrabana@gmail.com","MJS Remodeling Inc","","","50,00","0,00","#3444.2","1N33091812168173Y" +"2/18/2024","16:49:18","Europe/Prague","Express Checkout Payment","USD","134,96","-7,57","127,39","643,61","6GP35402TH068060C","sepshteyn@gmail.com","aleksandr epshteyn","","","6,00","0,00","#203130.2","0LU619452K329510A" +"2/20/2024","03:07:15","Europe/Prague","Express Checkout Payment","USD","15,99","-1,16","14,83","658,44","66G79553VU661420C","jagolkosky@yahoo.com","Joseph Golkosky","","","10,00","0,00","#3447.2","1GP059351V994390X" +"2/20/2024","22:53:54","Europe/Prague","Express Checkout Payment","USD","86,97","-4,99","81,98","740,42","3XY62246JC933552C","jansimak@hotmail.com","Jan Simak","","","14,00","0,00","#3449.2","40208948EW652551P" +"2/21/2024","05:21:18","Europe/Prague","Express Checkout Payment","USD","48,20","-2,90","45,30","785,72","6XR50753X4939723Y","lukaskacer409@gmail.com","lukas kacer","","","29,00","0,00","#3452.2","268635489G297715L" +"2/21/2024","13:21:03","Europe/Prague","Express Checkout Payment","USD","29,99","-1,92","28,07","813,79","8MC59937DX876132W","culperta23@gmail.com","Amy Culpert","","","10,00","0,00","#3453.2","0VX661251V069543K" +"2/27/2024","03:26:56","Europe/Prague","Express Checkout Payment","USD","81,99","-4,72","77,27","891,06","13S67692814763604","myndtrypp@gmail.com","Brandon Farve","","","39,00","0,00","#3470.2","1W383439PP3025624" +"2/28/2024","00:15:24","Europe/Prague","Express Checkout Payment","USD","100,96","-5,74","95,22","986,28","6SP09330FP693001W","jastewart100@gmail.com","Jacob Stewart","","","14,00","0,00","#3472.2","79J813027E392383U" +"2/28/2024","16:15:37","Europe/Prague","Express Checkout Payment","USD","29,99","-1,71","28,28","1 014,56","7WA83296SY136841V","jtkotil@hotmail.com","Jarmo Kotilaine","","","10,00","0,00","#3474.2","58S750056D853243V" +"2/29/2024","23:40:16","Europe/Prague","Express Checkout Payment","USD","25,99","-1,70","24,29","1 038,85","0VB951992X095223K","mjcampagna@hotmail.com","Matthew Campagna","","","10,00","0,00","#3476.2","6CF9734082104383F" +"2/5/2024","09:04:40","Europe/Prague","Express Checkout Payment","AUD","34,90","-2,18","32,72","898,29","16B96341BV798984H","pkalina@vtown.com.au","Peter Kalina","","","16,00","0,00","rgUotbrAWfLEjY0cBBPMzehmT","" +"2/5/2024","10:16:00","Europe/Prague","Express Checkout Payment","AUD","44,80","-2,71","42,09","940,38","2TR137846H6027351","pkalina@vtown.com.au","Peter Kalina","","","16,00","0,00","rTeQADFRD1Hdj1yjXDExFpJUO","" +"2/12/2024","11:47:23","Europe/Prague","Express Checkout Payment","AUD","56,00","-3,32","52,68","993,06","95P10874V31915332","pkalina@vtown.com.au","Peter Kalina","","","16,00","0,00","rSVnzOjvviyE95Nxwq4CM7432","" +"2/25/2024","07:08:07","Europe/Prague","Express Checkout Payment","AUD","48,00","-2,89","45,11","1 038,17","0XC85450GL610032E","robert_knoth@yahoo.com.au","robert knoth","","","16,00","0,00","rhhfXjfoFd3T8rXHe46WHXRHM","" +"2/28/2024","09:51:03","Europe/Prague","Express Checkout Payment","AUD","45,00","-2,73","42,27","1 080,44","1RS4744099308604G","pkalina@vtown.com.au","Peter Kalina","","","16,00","0,00","rM1RhQeUie3lsRDQUfl6J9e9M","" +"2/13/2024","09:45:12","Europe/Prague","User Initiated Withdrawal","CZK","-49 775,98","0,00","-49 775,98","-49 775,98","3MD261353Y2556528","","","Fio banka, a.s.","3907","0,00","0,00","","" +"2/13/2024","09:45:12","Europe/Prague","General Currency Conversion","CZK","49 775,98","0,00","49 775,98","0,00","3MS461449R5094049","","","","","0,00","0,00","","3MD261353Y2556528" +"2/13/2024","09:46:55","Europe/Prague","User Initiated Withdrawal","CZK","-41 521,82","0,00","-41 521,82","-41 521,82","9JM461597K092060C","","","Fio banka, a.s.","3907","0,00","0,00","","" +"2/13/2024","09:46:55","Europe/Prague","General Currency Conversion","CZK","41 521,82","0,00","41 521,82","0,00","42R86741D5670361L","","","","","0,00","0,00","","9JM461597K092060C" +"2/3/2024","20:39:30","Europe/Prague","Express Checkout Payment","EUR","39,90","-1,71","38,19","1 649,56","2AT300019C402024A","klaus.zottmann@web.de","Klaus Zottmann","","","5,95","0,00","rQfJEAXA2ATQUBMzl8319zIQW","" +"2/5/2024","18:31:17","Europe/Prague","Express Checkout Payment","EUR","18,45","-0,98","17,47","1 667,03","9RV20818BE3143704","cindy41751@web.de","Cindy Schmidbauer","","","8,95","0,00","rejiOMhj94No8S5rDgLsMz2CJ","" +"2/7/2024","13:27:39","Europe/Prague","Express Checkout Payment","EUR","47,40","-1,96","45,44","1 712,47","2W5446069K139113F","tipeka@freenet.de","Peter Kamm","","","11,95","0,00","rFWQsFi3BVCABTFIED8UldPRu","" +"2/8/2024","21:08:09","Europe/Prague","Express Checkout Payment","EUR","27,55","-1,29","26,26","1 738,73","1YA25895AT0169118","davidtichava@hotmail.com","David tichava","","","11,95","0,00","rmBGkDFerpT2mcqP8beXHwKpV","" +"2/12/2024","16:15:36","Europe/Prague","Express Checkout Payment","EUR","65,85","-2,59","63,26","1 801,99","86H31144F6773810U","silvia@piranhazone.com","Silvia Griffi","","","8,95","0,00","rkeKhC5T1iikeReTi5THg9hFd","" +"2/13/2024","09:46:55","Europe/Prague","General Currency Conversion","EUR","-1 700,00","0,00","-1 700,00","101,99","2KK186562D714435K","","","","","0,00","0,00","","9JM461597K092060C" +"2/15/2024","20:29:44","Europe/Prague","Express Checkout Payment","EUR","35,55","-1,56","33,99","135,98","5AX89236DS2696614","Christianschneider2@gmx.de","Christian Schneider","","","11,95","0,00","rUW4iCdJdmHYIpZMW2G69QTAz","" +"2/16/2024","14:50:42","Europe/Prague","Express Checkout Payment","EUR","90,75","-3,44","87,31","223,29","2JM719210S563944C","hedwigscheer@yahoo.de","Hedwig Scheer","","","8,95","0,00","rrGDmsHiw1Qms4ZKJbJ1a5G6C","" +"2/17/2024","16:19:53","Europe/Prague","Express Checkout Payment","EUR","65,75","-2,59","63,16","286,45","4WX1208333984902M","zltn.viragh@gmail.com","Zoltan Viragh","","","8,95","0,00","rboN252TSEZcfVvTdDhDrygcA","" +"2/22/2024","14:09:40","Europe/Prague","Express Checkout Payment","EUR","38,45","-1,66","36,79","323,24","2LC747757E401511B","arianepm@web.de","Ariane Mühle","","","8,95","0,00","r8KlaylbhNdsGjaHstch3KdkN","" +"2/23/2024","19:13:30","Europe/Prague","Express Checkout Payment","EUR","51,85","-2,11","49,74","372,98","57G6575451086150T","sjoerd_klink@hotmail.com","Sjoerd Klinkenberg","","","8,95","0,00","rIJWOa0Qif5W36YKuccKeJwsz","" +"2/28/2024","19:07:26","Europe/Prague","Express Checkout Payment","EUR","22,90","-1,13","21,77","394,75","9TS5920535011390H","dannaan.gifts@gmail.com","Dannaan Gifts","","","5,95","0,00","rvXJCrYG1HineO0hY6e80XE5W","" +"2/17/2024","14:37:07","Europe/Prague","Express Checkout Payment","GBP","50,00","-2,65","47,35","96,32","1VL14858NS855452F","alexandr.steffel@paconsulting.com","Alexandr Steffel","","","10,00","0,00","rIYPhx02CssxA43LLOZk5VWwc","" +"2/19/2024","11:03:53","Europe/Prague","Express Checkout Payment","SEK","481,00","-19,60","461,40","2 153,13","19E90969AM446740N","antonsson_anna@yahoo.se","Anna Antonsson","","","96,00","0,00","rEFguJ0bnQi3sBzOjyLqZb5ct","" +"2/23/2024","22:38:43","Europe/Prague","Express Checkout Payment","SEK","833,00","-31,57","801,43","2 954,56","2XJ15099P43855731","neodoc@telia.com","Neodoc","","","95,00","0,00","rkch5vBz2xoAZEOVCNO17beTi","" diff --git a/Mapp.DataAccess/AutocompleteDataLoader.cs b/Mapp.DataAccess/AutocompleteDataLoader.cs index 2ecc81c..61a3213 100644 --- a/Mapp.DataAccess/AutocompleteDataLoader.cs +++ b/Mapp.DataAccess/AutocompleteDataLoader.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.IO; using System.Reflection; +using System.Threading; using Mapp.Common; namespace Mapp.DataAccess @@ -24,18 +25,17 @@ public interface IAutocompleteData public class AutocompleteData : IAutocompleteData { - public Dictionary ProdWarehouseSectionBySku { get; set; } // TODO fix names + public Dictionary ProdWarehouseSectionBySku { get; set; } = new(); // TODO fix names - public Dictionary PohodaProdCodeBySku { get; set; } // TODO decide - SKU or AmazonProdCode + public Dictionary PohodaProdCodeBySku { get; set; } = new();// TODO decide - SKU or AmazonProdCode - public Dictionary ShippingNameBySku { get; set; } + public Dictionary ShippingNameBySku { get; set; } = new(); - public Dictionary PackQuantitySku { get; set; } + public Dictionary PackQuantitySku { get; set; } = new(); - public Dictionary CustomsDeclarationBySku { get; set; } - - public Dictionary DefaultShippingByPartnerCountry { get; set; } + public Dictionary CustomsDeclarationBySku { get; set; } = new(); + public Dictionary DefaultShippingByPartnerCountry { get; set; } = new(); public void UpdateAutocompleteData(T newParamValue, IDictionary autocompleteData, string productKey) { @@ -72,7 +72,6 @@ public AutocompleteDataLoader(IJsonManager jsonManager, ISettingsWrapper setting { _jsonManager = jsonManager; _settingsWrapper = settingsWrapper; - LoadSettings(); } public IAutocompleteData LoadSettings() diff --git a/Mapp.DataAccess/JsonManager.cs b/Mapp.DataAccess/JsonManager.cs index b179302..a37d9e9 100644 --- a/Mapp.DataAccess/JsonManager.cs +++ b/Mapp.DataAccess/JsonManager.cs @@ -18,7 +18,8 @@ public interface IJsonManager Dictionary DeserializeJsonDictionary(string fileName); void SerializeDictionaryToJson(Dictionary map, string fileName); IEnumerable LoadTransactionsConfigs(); - IEnumerable LoadStockQuantityUpdaterConfigs(); + IReadOnlyList LoadStockQuantityUpdaterConfigs(); + void SaveStockQuantityUpdaterConfigs(IReadOnlyList definitions); } public class JsonManager : IJsonManager @@ -79,7 +80,7 @@ public IEnumerable LoadTransactionsConfigs() return configDtos; } - public IEnumerable LoadStockQuantityUpdaterConfigs() + public IReadOnlyList LoadStockQuantityUpdaterConfigs() { var serializeOptions = new JsonSerializerOptions { @@ -89,5 +90,16 @@ public IEnumerable LoadStockQuantityUpdaterConfigs string json = _fileManager.ReadAllTextFromFile(Path.Join("StockQuantityUpdater", "config.json")); return JsonSerializer.Deserialize(json, serializeOptions); } + + public void SaveStockQuantityUpdaterConfigs(IReadOnlyList definitions) + { + var serializeOptions = new JsonSerializerOptions + { + PropertyNamingPolicy = JsonNamingPolicy.CamelCase, + WriteIndented = true + }; + var json = JsonSerializer.Serialize(definitions, serializeOptions); + _fileManager.WriteAllTextToFile(Path.Join("StockQuantityUpdater", "config.json"), json); + } } } \ No newline at end of file diff --git a/Mapp.Models/StockQuantity/StockDataXmlSourceDefinition.cs b/Mapp.Models/StockQuantity/StockDataXmlSourceDefinition.cs index 2a91c98..e279dc1 100644 --- a/Mapp.Models/StockQuantity/StockDataXmlSourceDefinition.cs +++ b/Mapp.Models/StockQuantity/StockDataXmlSourceDefinition.cs @@ -5,6 +5,7 @@ namespace Mapp.Models.StockQuantity; public record StockDataXmlSourceDefinition() { public string Url { get; init; } + public bool? IsEnabled { get; set; } public string ItemNodeName { get; init; } public IEnumerable SkuNodeParsingOptions { get; init; } public IEnumerable StockQuantityNodeParsingOptions { get; init; } diff --git a/Mapp.Models/Transactions/MarketPlaceTransactionsConfigData.cs b/Mapp.Models/Transactions/MarketPlaceTransactionsConfigData.cs index ac88ca8..fc1e6f3 100644 --- a/Mapp.Models/Transactions/MarketPlaceTransactionsConfigData.cs +++ b/Mapp.Models/Transactions/MarketPlaceTransactionsConfigData.cs @@ -15,6 +15,7 @@ public MarketPlaceTransactionsConfigData() // TODO why cannot be protected ? (ex public string DateSubstring { get; set; } public string TimeSeparatorOverride { get; set; } + public string NumericFormatSourceCultureName { get; set; } public string DateCultureInfoName { get; set; } diff --git a/Mapp.UI/App.xaml b/Mapp.UI/App.xaml index 67244ee..09d79b0 100644 --- a/Mapp.UI/App.xaml +++ b/Mapp.UI/App.xaml @@ -4,6 +4,7 @@ xmlns:system="clr-namespace:System;assembly=System.Runtime" xmlns:views="clr-namespace:Mapp.UI.Views" xmlns:viewModels="clr-namespace:Mapp.UI.ViewModels" + xmlns:extensions="clr-namespace:Mapp.UI.Extensions" xmlns:converters="clr-namespace:Mapp.UI.Views.Converters" Startup="Application_Startup" Exit="Application_OnExit"> @@ -15,6 +16,7 @@ +