This commit is contained in:
Bobbie Hodgetts
2024-11-21 09:36:16 +00:00
parent 7a12b49b44
commit f9b38a98b1
6 changed files with 29 additions and 20 deletions

View File

@@ -354,8 +354,8 @@ namespace bnhtrade.Core.Data.Database.Import
item.Asin = reader.GetString(8); item.Asin = reader.GetString(8);
item.Condition = reader.GetString(9); item.Condition = reader.GetString(9);
item.CurrencyUnit = reader.GetString(10); item.CurrencyUnit = reader.GetString(10);
item.AmountPerUnit = reader.GetInt32(11); item.AmountPerUnit = reader.GetDecimal(11);
item.AmountTotal = reader.GetInt32(12); item.AmountTotal = reader.GetDecimal(12);
item.QuantityReimbursedCash = reader.GetInt32(13); item.QuantityReimbursedCash = reader.GetInt32(13);
item.QuantityReimbursedInventory = reader.GetInt32(14); item.QuantityReimbursedInventory = reader.GetInt32(14);
item.QuantityReimbursedTotal = reader.GetInt32(15); item.QuantityReimbursedTotal = reader.GetInt32(15);

View File

@@ -45,7 +45,7 @@ namespace bnhtrade.Core.Logic.Import
dateLog.SetDateTimeUtc(reportName, utcEndDate); dateLog.SetDateTimeUtc(reportName, utcEndDate);
scope.Complete(); scope.Complete();
} }
log.LogInformation("Amazon report '" + reportName + "' sync with database comlpete."); log.LogInformation("Amazon report '" + reportName + "' sync with database complete.");
} }
} }
} }

View File

@@ -39,10 +39,10 @@ namespace bnhtrade.Core.Logic.Stock
private string ConstructTransactionTypeCode(Model.Import.AmazonFbaInventoryLedgerDetail record) private string ConstructTransactionTypeCode(Model.Import.AmazonFbaInventoryLedgerDetail record)
{ {
if (string.IsNullOrEmpty(record.Reason)) //if (string.IsNullOrEmpty(record.Reason))
{ //{
return null; // return null;
} //}
string transactionCode = "<AmazonReport><GET_LEDGER_DETAIL_VIEW_DATA><" + record.EventType + ">"; string transactionCode = "<AmazonReport><GET_LEDGER_DETAIL_VIEW_DATA><" + record.EventType + ">";
@@ -101,7 +101,7 @@ namespace bnhtrade.Core.Logic.Stock
/// <exception cref="NotImplementedException"></exception> /// <exception cref="NotImplementedException"></exception>
public void ImportAmazonFbaReimbursement() public void ImportAmazonFbaReimbursement()
{ {
throw new NotImplementedException("Needs testing"); //throw new NotImplementedException("Needs testing");
/* /*
* Not to be used for stock reconciliation! A single stock item can have multiple reimburesements aginst it. * Not to be used for stock reconciliation! A single stock item can have multiple reimburesements aginst it.
@@ -255,8 +255,8 @@ namespace bnhtrade.Core.Logic.Stock
/// <exception cref="NotImplementedException"></exception> /// <exception cref="NotImplementedException"></exception>
public void ImportAmazonFbaLedgerDetail() public void ImportAmazonFbaLedgerDetail()
{ {
// Done but needs testing!! //// Done but needs testing!!
throw new NotImplementedException("Done but needs testing!!"); //throw new NotImplementedException("Done but needs testing!!");
log.LogInformation("Starting TransposeFbaAdustmentReport()"); log.LogInformation("Starting TransposeFbaAdustmentReport()");
int transposeCount = 0; int transposeCount = 0;

View File

@@ -15,7 +15,10 @@ namespace bnhtrade.Core.Logic.Validate
/// <returns></returns> /// <returns></returns>
public static bool SkuNumber(string skuNumber) public static bool SkuNumber(string skuNumber)
{ {
if (string.IsNullOrEmpty(skuNumber)) { return false;} if (string.IsNullOrEmpty(skuNumber))
{
return false;
}
int count = 0; int count = 0;
foreach (char c in skuNumber) foreach (char c in skuNumber)
@@ -50,11 +53,17 @@ namespace bnhtrade.Core.Logic.Validate
public static bool DateTime(DateTime dateTime) public static bool DateTime(DateTime dateTime)
{ {
if (dateTime == default(DateTime)) if (dateTime == default(DateTime))
{ return false; } {
return false;
}
else if (dateTime.Kind != DateTimeKind.Utc) else if (dateTime.Kind != DateTimeKind.Utc)
{ return false; } {
return false;
}
else else
{ return true; } {
return true;
}
} }
} }
} }

View File

@@ -54,7 +54,7 @@ namespace bnhtrade.Core.Model.Stock
{ {
var result = new List<ValidationResult>(); var result = new List<ValidationResult>();
if (Logic.Validate.Format.DateTime(TransactionDate)) if (Logic.Validate.Format.DateTime(TransactionDate) == false)
{ {
result.Add(new ValidationResult("Invalid transaction date")); result.Add(new ValidationResult("Invalid transaction date"));
} }
@@ -62,7 +62,7 @@ namespace bnhtrade.Core.Model.Stock
{ {
result.Add(new ValidationResult("Invalid transaction type code")); result.Add(new ValidationResult("Invalid transaction type code"));
} }
if (Logic.Validate.Format.SkuNumber(SkuNumber)) if (Logic.Validate.Format.SkuNumber(SkuNumber) == false)
{ {
result.Add(new ValidationResult("Invalid SKU number")); result.Add(new ValidationResult("Invalid SKU number"));
} }

View File

@@ -50,12 +50,12 @@ namespace bnhtradeScheduledTasks
Console.WriteLine("<1> Start nightly tasks"); Console.WriteLine("<1> Start nightly tasks");
Console.WriteLine(); Console.WriteLine();
Console.WriteLine("<2> Update FBA Inventory Data"); Console.WriteLine("<2> Update FBA Inventory Data");
Console.WriteLine("<3> Update FBA Inventory Age Data"); Console.WriteLine("<3> Update FBA Inventory Ledger Data (new)");
Console.WriteLine("<4> Update Amazon Settlement Data"); Console.WriteLine("<4> Update Amazon Settlement Data");
Console.WriteLine("<5> Update Fba Inventory Receipt Data"); Console.WriteLine("<5> (depreciated) Update Fba Inventory Receipt Data");
Console.WriteLine("<6> Update Fba Sale Shipment Data"); Console.WriteLine("<6> Update Fba Sale Shipment Data");
Console.WriteLine("<7> Update Fba Return Data"); Console.WriteLine("<7> Update Fba Return Data");
Console.WriteLine("<8> Update Fba Adustment Data"); Console.WriteLine("<8> (depreciated) Update Fba Adustment Data");
Console.WriteLine("<9> Update Fba Removal Order Data"); Console.WriteLine("<9> Update Fba Removal Order Data");
Console.WriteLine(); Console.WriteLine();
Console.WriteLine("<0> Back"); Console.WriteLine("<0> Back");
@@ -84,7 +84,7 @@ namespace bnhtradeScheduledTasks
else if (input == "3") else if (input == "3")
{ {
Console.Clear(); Console.Clear();
new bnhtrade.Core.Logic.Import.AmazonFbaInventoryAge().SyncDatabaseWithAmazon(); new bnhtrade.Core.Logic.Import.AmazonFbaInventoryLedgerDetail().SyncDatabaseWithAmazon();
Console.WriteLine("Complete, press any key to continue..."); Console.WriteLine("Complete, press any key to continue...");
Console.ReadKey(); Console.ReadKey();
} }