mirror of
https://github.com/stokebob/bnhtrade.git
synced 2026-03-19 22:47:15 +00:00
Feature repricing min max (#10)
amazon settlement import/export improvements
This commit is contained in:
@@ -1,12 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
</configSections>
|
||||
<connectionStrings>
|
||||
<add name="bnhtradeDbConnString"
|
||||
connectionString="Data Source=SQL-Server;Initial Catalog=e2A;Persist Security Info=TRUE;User ID=e2A Client;Password=eSYH4EYoK6Guc5KIclhgFDlGc4;MultipleActiveResultSets=TRUE" />
|
||||
<add name="bnhtradeDbConnString" connectionString="Data Source=SQL-Server;Initial Catalog=e2A;Persist Security Info=TRUE;User ID=e2A Client;Password=eSYH4EYoK6Guc5KIclhgFDlGc4;MultipleActiveResultSets=TRUE" />
|
||||
</connectionStrings>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -9,6 +9,7 @@ using System.Configuration;
|
||||
using System.Transactions;
|
||||
using bnhtrade.Core;
|
||||
using bnhtrade.Core.Stock;
|
||||
using bnhtrade.Core.Model;
|
||||
|
||||
namespace bnhtradeScheduledTasks
|
||||
{
|
||||
@@ -214,20 +215,19 @@ namespace bnhtradeScheduledTasks
|
||||
else if (input == "3")
|
||||
{
|
||||
Console.Clear();
|
||||
var task = new StockReconciliation();
|
||||
var result = new StockReconciliation.ReconcileStockTransactionsResult();
|
||||
try
|
||||
{
|
||||
result = task.ReconcileStockTransactions(sqlConnectionString, false);
|
||||
Console.WriteLine(result.ItemsCompleted + " of " + (result.ItemsCompleted + result.ItemsRemaining) + " items completed.");
|
||||
Console.WriteLine("Current transaction ID=" + result.StockTransactionId);
|
||||
Console.WriteLine(result.ProgressMessage);
|
||||
//try
|
||||
//{
|
||||
var recon = new bnhtrade.Core.Logic.Stock.SkuTransactionReconcile(sqlConnectionString);
|
||||
recon.ReconcileStockTransactions(false);
|
||||
Console.WriteLine(recon.ItemsCompleted + " of " + (recon.ItemsCompleted + recon.ItemsRemaining) + " items completed.");
|
||||
Console.WriteLine("Current transaction ID=" + recon.CurrentSkuTransaction.SkuTransactionId);
|
||||
Console.WriteLine(recon.ProgressMessage);
|
||||
Console.WriteLine("");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message.ToString());
|
||||
}
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
//Console.WriteLine(ex.Message.ToString());
|
||||
//}
|
||||
Console.WriteLine("Complete, press any key to continue...");
|
||||
Console.ReadKey();
|
||||
}
|
||||
@@ -239,7 +239,7 @@ namespace bnhtradeScheduledTasks
|
||||
{
|
||||
task.UpdateFbaStockImportData(sqlConnectionString);
|
||||
task.ProcessFbaStockImportData(sqlConnectionString);
|
||||
task.ReconcileStockTransactions(sqlConnectionString, false);
|
||||
new bnhtrade.Core.Logic.Stock.SkuTransactionReconcile(sqlConnectionString).ReconcileStockTransactions(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -253,7 +253,8 @@ namespace bnhtradeScheduledTasks
|
||||
Console.Clear();
|
||||
//try
|
||||
//{
|
||||
bnhtrade.Core.Inventory.InventoryPricing.AmazonMinMaxTemp(sqlConnectionString);
|
||||
Console.WriteLine("Currently disabled");
|
||||
//bnhtrade.Core.Inventory.InventoryPricing.AmazonMinMaxTemp(sqlConnectionString);
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
@@ -283,14 +284,14 @@ namespace bnhtradeScheduledTasks
|
||||
Console.WriteLine("Main Menu > Dev Funcions");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("<1> Get Amazon UTC time");
|
||||
Console.WriteLine("<2> Test Stock Journal Reallocate");
|
||||
Console.WriteLine("<3> test Product Update Amazon Estimate Fee");
|
||||
Console.WriteLine("<4> Process Amazon Reimbursement Report (into transactiontable)");
|
||||
Console.WriteLine("<5> Test Stock Table Delete");
|
||||
Console.WriteLine("<6> Test Owner intro insert");
|
||||
Console.WriteLine("<7> Currency exchange rate insert");
|
||||
Console.WriteLine("<8> SQL Loop function");
|
||||
Console.WriteLine("<9> AUTOEXEC TEST");
|
||||
Console.WriteLine("<2> Test Account");
|
||||
Console.WriteLine("<3> Test Export");
|
||||
Console.WriteLine("<4> Test Import");
|
||||
Console.WriteLine("<5> Test Logic");
|
||||
Console.WriteLine("<6> Test SKU");
|
||||
Console.WriteLine("<7> Test xxxxxxx");
|
||||
Console.WriteLine("<8> Test xxxxxxx");
|
||||
Console.WriteLine("<9> Detele Sku Transaction");
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("<0> Back");
|
||||
Console.WriteLine("");
|
||||
@@ -314,23 +315,19 @@ namespace bnhtradeScheduledTasks
|
||||
else if (input == "2")
|
||||
{
|
||||
Console.Clear();
|
||||
int result = new int();
|
||||
try
|
||||
{
|
||||
result = TempStuff.TempTasks.testStockReallocate();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
Console.WriteLine(result);
|
||||
|
||||
new bnhtrade.Core.Test.Account.Account(sqlConnectionString);
|
||||
|
||||
Console.WriteLine("Done");
|
||||
Console.WriteLine("Complete, press any key to continue...");
|
||||
Console.ReadKey();
|
||||
}
|
||||
else if (input == "3")
|
||||
{
|
||||
Console.Clear();
|
||||
TempStuff.TempTasks.test_ProductUpdateAmazonEstimateFee();
|
||||
|
||||
new bnhtrade.Core.Test.Export.Export(sqlConnectionString);
|
||||
|
||||
Console.WriteLine("Done");
|
||||
Console.WriteLine("Complete, press any key to continue...");
|
||||
Console.ReadKey();
|
||||
@@ -338,57 +335,40 @@ namespace bnhtradeScheduledTasks
|
||||
else if (input == "4")
|
||||
{
|
||||
Console.Clear();
|
||||
var task = new StockReconciliation();
|
||||
task.WIP_ProcessFbaReimbursementData(sqlConnectionString);
|
||||
|
||||
new bnhtrade.Core.Test.Import.Import(sqlConnectionString);
|
||||
|
||||
Console.WriteLine("Done");
|
||||
Console.WriteLine("Complete, press any key to continue...");
|
||||
Console.ReadKey();
|
||||
}
|
||||
else if (input == "5")
|
||||
{
|
||||
Console.Clear();
|
||||
int result = new int();
|
||||
try
|
||||
{
|
||||
TempStuff.TempTasks.testStockJournalDelete();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
Console.WriteLine(result);
|
||||
|
||||
new bnhtrade.Core.Test.Logic.Logic(sqlConnectionString);
|
||||
|
||||
Console.WriteLine("Done");
|
||||
Console.WriteLine("Complete, press any key to continue...");
|
||||
Console.ReadKey();
|
||||
}
|
||||
else if (input == "6")
|
||||
{
|
||||
Console.Clear();
|
||||
int result = 0;
|
||||
try
|
||||
{
|
||||
result = TempStuff.TempTasks.input6();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
Console.WriteLine(result.ToString());
|
||||
|
||||
new bnhtrade.Core.Logic.Sku.Price.FbaPricing(sqlConnectionString).Update();
|
||||
|
||||
Console.WriteLine("Done");
|
||||
Console.WriteLine("Complete, press any key to continue...");
|
||||
Console.ReadKey();
|
||||
}
|
||||
else if (input == "7")
|
||||
{
|
||||
Console.Clear();
|
||||
//bool result = false;
|
||||
int result = 0;
|
||||
try
|
||||
{
|
||||
result = TempStuff.TempTasks.CurrencyExchangeInsert();
|
||||
Console.WriteLine("Result: " + result.ToString());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
|
||||
Console.WriteLine("Nothing......");
|
||||
|
||||
Console.WriteLine("Done");
|
||||
Console.WriteLine("Complete, press any key to continue...");
|
||||
Console.ReadKey();
|
||||
}
|
||||
@@ -396,10 +376,9 @@ namespace bnhtradeScheduledTasks
|
||||
{
|
||||
Console.Clear();
|
||||
|
||||
var jjjj = new bnhtrade.Core.Test.InboundShipmentInfo(sqlConnectionString);
|
||||
jjjj.GetMWSInfo();
|
||||
Console.WriteLine("Nothing......");
|
||||
|
||||
//Console.WriteLine(result.ToString());
|
||||
Console.WriteLine("Done");
|
||||
Console.WriteLine("Complete, press any key to continue...");
|
||||
Console.ReadKey();
|
||||
}
|
||||
@@ -407,14 +386,12 @@ namespace bnhtradeScheduledTasks
|
||||
{
|
||||
Console.Clear();
|
||||
|
||||
var inst = new bnhtrade.Core.Test.AutoExec(sqlConnectionString);
|
||||
new bnhtrade.Core.Logic.Stock.SkuTransactionPersistance(sqlConnectionString).DeleteJournalEntry(80774);
|
||||
|
||||
Console.WriteLine("Done");
|
||||
Console.WriteLine("Complete, press any key to continue...");
|
||||
Console.ReadKey();
|
||||
}
|
||||
|
||||
|
||||
|
||||
} while (true);
|
||||
}
|
||||
} while (true);
|
||||
@@ -442,15 +419,15 @@ namespace bnhtradeScheduledTasks
|
||||
Console.WriteLine("Starting (unsafe) stock reconciliation...");
|
||||
Console.Clear();
|
||||
StockReconciliation task = new StockReconciliation();
|
||||
StockReconciliation.ReconcileStockTransactionsResult result = new StockReconciliation.ReconcileStockTransactionsResult();
|
||||
result = task.ReconcileStockTransactions(sqlConnectionString, false);
|
||||
Console.WriteLine("Progress: " + result.ProgressMessage);
|
||||
Console.WriteLine("Reconciled date: " + result.LastItemDateTime.ToString());
|
||||
Console.WriteLine("Transactions completed: " + result.ItemsCompleted);
|
||||
Console.WriteLine("Transactions remaining: " + result.ItemsRemaining);
|
||||
if (!result.ReconciliationComplete)
|
||||
var recon = new bnhtrade.Core.Logic.Stock.SkuTransactionReconcile(sqlConnectionString);
|
||||
recon.ReconcileStockTransactions(false);
|
||||
Console.WriteLine("Progress: " + recon.ProgressMessage);
|
||||
Console.WriteLine("Reconciled date: " + recon.LastItemDateTime.ToString());
|
||||
Console.WriteLine("Transactions completed: " + recon.ItemsCompleted);
|
||||
Console.WriteLine("Transactions remaining: " + recon.ItemsRemaining);
|
||||
if (!recon.ReconciliationComplete)
|
||||
{
|
||||
Console.WriteLine("Halted at Stock Transaction ID: " + result.StockTransactionId);
|
||||
Console.WriteLine("Halted at Stock Transaction ID: " + recon.CurrentSkuTransaction.SkuTransactionId);
|
||||
}
|
||||
Console.WriteLine("Exiting application...");
|
||||
}
|
||||
@@ -503,76 +480,4 @@ namespace bnhtradeScheduledTasks
|
||||
MiscFunction.EventLogInsert("Nightly scheduled tasks finished.");
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace TempStuff
|
||||
{
|
||||
public class TempTasks
|
||||
{
|
||||
static string sqlConnectionString = ConfigurationManager.ConnectionStrings["bnhtradeDbConnString"].ConnectionString;
|
||||
|
||||
public static void testStockTableDelete()
|
||||
{
|
||||
//bnhtradeDatabaseClient.Stock.StockQuery.WIP_StockTableDelete(sqlConnectionString, 15776);
|
||||
}
|
||||
|
||||
public static bool testStockConsistCheck()
|
||||
{
|
||||
//return bnhtradeDatabaseClient.Stock.StockQuery.WIP_StockJournalConsistencyCheck(sqlConnectionString, 22677);
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void testStockDelete()
|
||||
{
|
||||
//bnhtradeDatabaseClient.Stock.StockQuery.WIP_StockDelete(sqlConnectionString, 15798);
|
||||
}
|
||||
|
||||
public static void testStockJournalDelete()
|
||||
{
|
||||
//bnhtradeDatabaseClient.Stock.StockQuery.StockJournalDelete(sqlConnectionString, 33763);
|
||||
}
|
||||
|
||||
|
||||
public static int testStockReallocate()
|
||||
{
|
||||
int creditStatusId = 4;
|
||||
int debitStatusId = 21;
|
||||
DateTime entryDate = new DateTime(2099, 06, 15);
|
||||
|
||||
//return bnhtradeDatabaseClient.Stock.StockQuery.StockReallocateByStockId(sqlConnectionString, 4, 15776, 1, debitStatusId, creditStatusId, entryDate);
|
||||
|
||||
return 0;
|
||||
}
|
||||
public static void testPurchaseLineInsert()
|
||||
{
|
||||
DateTime entrdate = DateTime.Parse("07/09/2016 08:13:54");
|
||||
|
||||
//return bnhtradeDatabaseClient.Purchase.PurchaseQuery.WIP_PurchaseLineNetTransactionInsert(sqlConnectionString, 10164, "GBP", 138, 9.98m, entrdate);
|
||||
bnhtrade.Core.Purchase.PurchaseQuery.WIP_PurchaseLineTransactionNetUpdate(sqlConnectionString, 10164, "GBP", 138, 100000);
|
||||
}
|
||||
public static void test_ProductUpdateAmazonEstimateFee()
|
||||
{
|
||||
var list = new List<(string asin, decimal price)>();
|
||||
|
||||
list.Add(("B000MGVBG4", 1.99m));
|
||||
|
||||
bnhtrade.Core.Product.ProductQuery.ProductUpdateAmazonEstimateFee(sqlConnectionString, list);
|
||||
}
|
||||
public static void test_AmazonInventoryTableUpdate()
|
||||
{
|
||||
//bnhtradeDatabaseClient.Inventory.InventoryPricing.AmazonInventoryTableUpdate(sqlConnectionString);
|
||||
}
|
||||
public static int input6()
|
||||
{
|
||||
DateTime entrdate = DateTime.Parse("28/11/2018 08:13:54");
|
||||
|
||||
return bnhtrade.Core.Stock.StockCreate.WIP_StockInsertOwnerIntroduced(sqlConnectionString, 0.01m, 7, 15374, 51, 16, entrdate, 51);
|
||||
}
|
||||
public static int CurrencyExchangeInsert()
|
||||
{
|
||||
DateTime start = new DateTime(2019, 03, 01);
|
||||
DateTime finish = new DateTime(2019, 04, 01);
|
||||
|
||||
return bnhtrade.Core.Account.AccountQuery.CurrencyExchangeRateInsert(sqlConnectionString, 1, "USD", 222m, start, finish, true );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\packages\ILMerge.3.0.29\build\ILMerge.props" Condition="Exists('..\..\packages\ILMerge.3.0.29\build\ILMerge.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -26,6 +27,8 @@
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
@@ -39,7 +42,7 @@
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\artifiacts\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
@@ -72,6 +75,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
@@ -96,4 +100,10 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\packages\ILMerge.3.0.29\build\ILMerge.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\ILMerge.3.0.29\build\ILMerge.props'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
4
src/bnhtrade.ScheduledTasks/packages.config
Normal file
4
src/bnhtrade.ScheduledTasks/packages.config
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="ILMerge" version="3.0.29" targetFramework="net471" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user