From 738f87f988e24c59cb46f142273d894361398335 Mon Sep 17 00:00:00 2001 From: Bobbie Hodgetts Date: Fri, 5 Jun 2020 12:19:46 +0100 Subject: [PATCH] wip --- src/bnhtrade.Core/Data/Database/Constants.cs | 10 ++++++++++ src/bnhtrade.Core/Logic/Sku/Price/FbaPricing.cs | 6 ++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/bnhtrade.Core/Data/Database/Constants.cs b/src/bnhtrade.Core/Data/Database/Constants.cs index 4b989b5..637a0bc 100644 --- a/src/bnhtrade.Core/Data/Database/Constants.cs +++ b/src/bnhtrade.Core/Data/Database/Constants.cs @@ -8,6 +8,16 @@ namespace bnhtrade.Core.Data.Database { public static class Constants { + public static string GetMarginSchemeTaxCode() + { + return "T190"; + } + + public static string GetOrderChannelAmazonUk() + { + return "Amazon.co.uk"; + } + public static int GetProductConditionIdNew() { return 10; diff --git a/src/bnhtrade.Core/Logic/Sku/Price/FbaPricing.cs b/src/bnhtrade.Core/Logic/Sku/Price/FbaPricing.cs index f3de5e1..c8e8ede 100644 --- a/src/bnhtrade.Core/Logic/Sku/Price/FbaPricing.cs +++ b/src/bnhtrade.Core/Logic/Sku/Price/FbaPricing.cs @@ -16,7 +16,7 @@ namespace bnhtrade.Core.Logic.Sku.Price private string sqlConnectionString; private bnhtrade.Core.Logic.Log.LogEvent log = new Log.LogEvent(); string err = "FbaPricing Error: "; - private string marginSchemeTaxCode = "T190"; + private string marginSchemeTaxCode = Data.Database.Constants.GetMarginSchemeTaxCode(); int repriceHoldOnSalePeriod = 14; // days private int newConditionId = Data.Database.Constants.GetProductConditionIdNew(); private List skuInfo; @@ -41,7 +41,7 @@ namespace bnhtrade.Core.Logic.Sku.Price using (var scope = new TransactionScope()) { - string orderChannel = "Amazon.co.uk"; // may in future enable other order channels + string orderChannel = Data.Database.Constants.GetOrderChannelAmazonUk(); ; // may in future enable other order channels // get current sku base pricing details (stock quantity, competative price, VAT info, etc.) skuInfo = new Data.Database.Sku.Price.ReadParameter(sqlConnectionString).Execute(); @@ -70,6 +70,8 @@ namespace bnhtrade.Core.Logic.Sku.Price // loop through skus returnd from stock query for (int i = 0; i < skuInfo.Count(); i++) { + var existing = skuInfo[i]; + string skuNumber = skuInfo[i].SkuNumber; var cr = new Model.Sku.Price.PriceInfo();