mirror of
https://github.com/stokebob/bnhtrade.git
synced 2026-03-19 14:37:16 +00:00
Fix amazon settlement period and other updates
This commit is contained in:
@@ -8,21 +8,27 @@ using System.Transactions;
|
||||
|
||||
namespace bnhtrade.Core.Logic.Export
|
||||
{
|
||||
public class AmazonSettlementData
|
||||
public class AmazonSettlement
|
||||
{
|
||||
private string sqlConnectionString;
|
||||
private Dictionary<string, Model.Account.TaxCode> taxCodeBySkuNumer;
|
||||
|
||||
public AmazonSettlementData(string sqlConnectionString)
|
||||
public AmazonSettlement(string sqlConnectionString)
|
||||
{
|
||||
this.sqlConnectionString = sqlConnectionString;
|
||||
}
|
||||
|
||||
public void ToInvoice()
|
||||
{
|
||||
var console = new UI.Console.Update();
|
||||
var log = new Logic.Log.LogEvent();
|
||||
log.LogInformation("Starting processing of Amazon settlement data into export invoice table...");
|
||||
|
||||
// check settlement reports consistancy
|
||||
var consistencyCheck = new Data.Database.Consistency.ImportAmazonSettlement(sqlConnectionString).PeriodDateGaps();
|
||||
if (consistencyCheck == false )
|
||||
{ return; }
|
||||
|
||||
// get list of unprocssed settlement reports to export
|
||||
var settlementData = new Data.Database.Import.ReadAmazonSettlement(sqlConnectionString);
|
||||
var settlementList = settlementData.AllUnprocessed();
|
||||
@@ -234,12 +240,13 @@ namespace bnhtrade.Core.Logic.Export
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
scope.Dispose();
|
||||
log.LogError(ex.Message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
Console.Write("\r");
|
||||
log.LogInformation("Finished processing of Amazon settlement data. " + invoiceList.Count() + " invoices created from "+ settlementIdList.Count() + " Amazon settlement reports.");
|
||||
log.LogInformation("\rFinished processing of Amazon settlement data. " + invoiceList.Count() + " invoices created from "+ settlementIdList.Count() + " Amazon settlement reports.");
|
||||
}
|
||||
|
||||
private string BuildLineItemCode(string skuNumber, string transactionType, string amountType, string amountDescription)
|
||||
Reference in New Issue
Block a user