mirror of
https://github.com/stokebob/bnhtrade.git
synced 2026-03-19 06:27:15 +00:00
wip
This commit is contained in:
@@ -354,8 +354,8 @@ namespace bnhtrade.Core.Data.Database.Import
|
||||
item.Asin = reader.GetString(8);
|
||||
item.Condition = reader.GetString(9);
|
||||
item.CurrencyUnit = reader.GetString(10);
|
||||
item.AmountPerUnit = reader.GetInt32(11);
|
||||
item.AmountTotal = reader.GetInt32(12);
|
||||
item.AmountPerUnit = reader.GetDecimal(11);
|
||||
item.AmountTotal = reader.GetDecimal(12);
|
||||
item.QuantityReimbursedCash = reader.GetInt32(13);
|
||||
item.QuantityReimbursedInventory = reader.GetInt32(14);
|
||||
item.QuantityReimbursedTotal = reader.GetInt32(15);
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace bnhtrade.Core.Logic.Import
|
||||
dateLog.SetDateTimeUtc(reportName, utcEndDate);
|
||||
scope.Complete();
|
||||
}
|
||||
log.LogInformation("Amazon report '" + reportName + "' sync with database comlpete.");
|
||||
log.LogInformation("Amazon report '" + reportName + "' sync with database complete.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,10 +39,10 @@ namespace bnhtrade.Core.Logic.Stock
|
||||
|
||||
private string ConstructTransactionTypeCode(Model.Import.AmazonFbaInventoryLedgerDetail record)
|
||||
{
|
||||
if (string.IsNullOrEmpty(record.Reason))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
//if (string.IsNullOrEmpty(record.Reason))
|
||||
//{
|
||||
// return null;
|
||||
//}
|
||||
|
||||
string transactionCode = "<AmazonReport><GET_LEDGER_DETAIL_VIEW_DATA><" + record.EventType + ">";
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace bnhtrade.Core.Logic.Stock
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
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.
|
||||
@@ -255,8 +255,8 @@ namespace bnhtrade.Core.Logic.Stock
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public void ImportAmazonFbaLedgerDetail()
|
||||
{
|
||||
// Done but needs testing!!
|
||||
throw new NotImplementedException("Done but needs testing!!");
|
||||
//// Done but needs testing!!
|
||||
//throw new NotImplementedException("Done but needs testing!!");
|
||||
|
||||
log.LogInformation("Starting TransposeFbaAdustmentReport()");
|
||||
int transposeCount = 0;
|
||||
|
||||
@@ -15,7 +15,10 @@ namespace bnhtrade.Core.Logic.Validate
|
||||
/// <returns></returns>
|
||||
public static bool SkuNumber(string skuNumber)
|
||||
{
|
||||
if (string.IsNullOrEmpty(skuNumber)) { return false;}
|
||||
if (string.IsNullOrEmpty(skuNumber))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
foreach (char c in skuNumber)
|
||||
@@ -50,11 +53,17 @@ namespace bnhtrade.Core.Logic.Validate
|
||||
public static bool DateTime(DateTime dateTime)
|
||||
{
|
||||
if (dateTime == default(DateTime))
|
||||
{ return false; }
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (dateTime.Kind != DateTimeKind.Utc)
|
||||
{ return false; }
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{ return true; }
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace bnhtrade.Core.Model.Stock
|
||||
{
|
||||
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"));
|
||||
}
|
||||
@@ -62,7 +62,7 @@ namespace bnhtrade.Core.Model.Stock
|
||||
{
|
||||
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"));
|
||||
}
|
||||
|
||||
@@ -50,12 +50,12 @@ namespace bnhtradeScheduledTasks
|
||||
Console.WriteLine("<1> Start nightly tasks");
|
||||
Console.WriteLine();
|
||||
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("<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("<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();
|
||||
Console.WriteLine("<0> Back");
|
||||
@@ -84,7 +84,7 @@ namespace bnhtradeScheduledTasks
|
||||
else if (input == "3")
|
||||
{
|
||||
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.ReadKey();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user