Export amazon settlement report fix

This commit is contained in:
2020-02-06 21:20:15 +00:00
committed by GitHub
parent bed529e1c8
commit 7e50da21e7
52 changed files with 4827 additions and 819 deletions

View File

@@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bnhtrade.Core.Model.Account
{
public class AccountCode
{
private int? accountCodeId;
public int AccountCodeId
{
get { return (int)accountCodeId; }
set { accountCodeId = value; }
}
public string Title
{
get;
set;
}
public string Description
{
get;
set;
}
public string Type
{
get;
set;
}
public string BasicType
{
get;
set;
}
public bool IsSetAccountCodeId
{
get { return accountCodeId != null; }
}
public bool IsSetTitle
{
get { return Title != null; }
}
public bool IsSetDescription
{
get { return Description != null; }
}
public bool IsSetType
{
get { return Type != null; }
}
public bool IsSetBasicType
{
get { return BasicType != null; }
}
}
}

View File

@@ -0,0 +1,179 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bnhtrade.Core.Model.Account
{
public interface IInvoice : IInvoiceHeader
{
List<Invoice.InvoiceLine> InvoiceLineList { get; set; }
bool InvoiceLineListIsSet { get; }
}
public interface IInvoiceLine
{
string ItemCode { get; set; }
bool ItemCodeIsSet { get; }
bool DescriptionIsSet { get; }
string Description { get; set; }
int Quantity { get; set; }
bool QuantityIsSet { get; }
decimal TotalNetAmount { get; set; }
bool TotalNetAmountIsSet { get; }
bool AccountCodeIsSet { get; }
int AccountCode { get; set; }
bool TaxCodeIsSet { get; }
string TaxCode { get; set; }
decimal TaxAmountAdjust { get; set; }
bool TaxAmountAdjustIsSet { get; }
decimal TaxAmount { get; }
bool TaxAmountIsSet { get; }
decimal GrossTotalAmount { get; }
bool GrossTotalAmountIsSet { get; }
}
public abstract class Invoice : InvoiceHeader, IInvoice
{
public List<InvoiceLine> InvoiceLineList { get; set; } = new List<InvoiceLine>();
public bool InvoiceLineListIsSet
{
get
{
if (InvoiceLineList == null || !InvoiceLineList.Any())
{ return false; }
else
{ return true; }
}
}
public class InvoiceLine : IInvoiceLine
{
private int? accountCode;
private decimal? netAmount;
private decimal? taxAmount;
private decimal? taxAmountAdjust;
private int? quantity;
private decimal? discount;
public string ItemCode
{
get;
set;
}
public bool ItemCodeIsSet
{
get { return ItemCode != null; }
}
public string Description
{
get;
set;
}
public bool DescriptionIsSet
{
get { return Description != null; }
}
public int Quantity
{
get { return (int)quantity.GetValueOrDefault(); }
set { quantity = value; }
}
public bool QuantityIsSet
{
get { return quantity != null; }
}
public decimal TotalNetAmount
{
get { return (decimal)netAmount.GetValueOrDefault(); }
set { netAmount = value; }
}
public bool TotalNetAmountIsSet
{
get { return netAmount != null; }
}
public int AccountCode
{
get { return (int)accountCode.GetValueOrDefault(); }
set { accountCode = value; }
}
public bool AccountCodeIsSet
{
get { return accountCode != null; }
}
public string TaxCode
{
get;
set;
}
public bool TaxCodeIsSet
{
get { return TaxCode != null; }
}
public decimal TaxAmount
{
get { return (decimal)taxAmount.GetValueOrDefault(); }
set { taxAmount = decimal.Round(value, 2); }
}
public bool TaxAmountIsSet
{
get { return taxAmount != null; }
}
public decimal TaxAmountAdjust
{
get { return (decimal)taxAmountAdjust.GetValueOrDefault(); }
set { taxAmountAdjust = decimal.Round(value, 2); }
}
public bool TaxAmountAdjustIsSet
{
get { return taxAmountAdjust != null; }
}
public decimal GrossTotalAmount
{
get { return (decimal)netAmount.GetValueOrDefault() + TaxAmount; }
}
public bool GrossTotalAmountIsSet
{
get { return (TotalNetAmountIsSet && TaxAmountIsSet); }
}
}
}
}

View File

@@ -0,0 +1,135 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bnhtrade.Core.Model.Account
{
public interface IInvoiceHeader
{
string ContactName { get; set; }
bool ContactNameIsSet { get; }
decimal InvoiceAmount { get; set; }
bool InvoiceAmountIsSet { get; }
string InvoiceCurrencyCode { get; set; }
bool InvoiceCurrencyCodeIsSet { get; }
DateTime InvoiceDate { get; set; }
bool InvoiceDateIsSet { get; }
DateTime InvoiceDueDate { get; set; }
bool InvoiceDueDateIsSet { get; }
DateTimeKind InvoiceDateKind { get; set; }
bool InvoiceDateKindIsSet { get; }
string InvoiceNumber { get; set; }
bool InvoiceNumberIsSet { get; }
string InvoiceReference { get; set; }
bool InvoiceReferenceIsSet { get; }
bool IsCreditNote { get; set; }
bool IsCreditNoteIsSet { get; }
}
public abstract class InvoiceHeader : IInvoiceHeader
{
private string invoiceCurrencyCode;
private DateTime? invoiceDate;
private DateTime? invoiceDueDate;
private DateTimeKind? invoiceDateKind = DateTimeKind.Utc;
private decimal? invoiceAmount;
public InvoiceHeader()
{
IsCreditNote = false;
}
public string ContactName { get; set; }
public bool ContactNameIsSet
{
get { return ContactName != null; }
}
public DateTime InvoiceDate
{
get { return (DateTime)invoiceDate.GetValueOrDefault(); }
set { invoiceDate = value; }
}
public bool InvoiceDateIsSet
{
get { return invoiceDate != null; }
}
public DateTime InvoiceDueDate
{
get { return (DateTime)invoiceDueDate.GetValueOrDefault(); }
set { invoiceDueDate = value; }
}
public bool InvoiceDueDateIsSet
{
get { return invoiceDueDate != null; }
}
public DateTimeKind InvoiceDateKind
{
get { return (DateTimeKind)invoiceDateKind; }
set { invoiceDateKind = value; }
}
public bool InvoiceDateKindIsSet
{
get { return invoiceDateKind != null; }
}
public string InvoiceCurrencyCode
{
get { return invoiceCurrencyCode; }
set
{
if (!string.IsNullOrWhiteSpace(value))
{
invoiceCurrencyCode = value.ToUpper();
}
}
}
public bool InvoiceCurrencyCodeIsSet
{
get { return InvoiceCurrencyCode != null; }
}
public string InvoiceNumber { get; set; }
public bool InvoiceNumberIsSet
{
get { return InvoiceNumber != null; }
}
public string InvoiceReference { get; set; }
public bool InvoiceReferenceIsSet
{
get { return InvoiceReference != null; }
}
public decimal InvoiceAmount
{
get { return (decimal)invoiceAmount; }
set { invoiceAmount = value; }
}
public bool InvoiceAmountIsSet
{
get { return invoiceAmount != null; }
}
public bool IsCreditNote
{
get;
set;
}
public bool IsCreditNoteIsSet
{
get { return true; }
}
}
}

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bnhtrade.Core.Model.Account
{
public class InvoiceLineItem
{
public string ItemCode
{
get;
set;
}
public string Title
{
get;
set;
}
public string Description
{
get;
set;
}
public bool IsNewReviewRequired
{
get;
set;
}
public bool InvoiceLineEntryEnabled
{
get;
set;
}
public int DefaultAccountCode
{
get;
set;
}
public string DefaultTaxCode
{
get;
set;
}
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bnhtrade.Core.Model.Account
{
public class SalesInvoice : Invoice
{
}
}

View File

@@ -0,0 +1,102 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bnhtrade.Core.Model.Account
{
public class TaxCode
{
private decimal? netAmountMultiplier = null;
private decimal? grossAmountMultiplier = null;
private bool? isActive = null;
private bool? isValidOnExpense = null;
private bool? isValidOnIncome = null;
public string TaxCodeId { get; set; }
public string TaxRateDescription { get; set; }
public string TaxRateTitle { get; set; }
public string TaxType { get; set; }
public decimal NetAmountMultiplier
{
get { return (decimal)netAmountMultiplier; }
set { netAmountMultiplier = value; }
}
public decimal GrossAmountMultiplier
{
get { return (decimal)grossAmountMultiplier; }
set { grossAmountMultiplier = value; }
}
public bool IsActive
{
get { return (bool)isActive; }
set { isActive = value; }
}
public bool IsSetAll
{
get
{
if (IsSetGrossAmountMultiplier
&& IsSetIsActive
&& IsSetIsValidOnExpense
&& IsSetIsValidOnIncome
&& IsSetNetAmountMultiplier
&& IsSetTaxCodeId
&& IsSetTaxRateTitle
&& IsSetTaxRateDescription
)
{
return true;
}
else { return false; }
}
}
public bool IsSetGrossAmountMultiplier
{
get { return grossAmountMultiplier != null; }
}
public bool IsSetIsActive
{
get { return isActive != null; }
}
public bool IsSetIsValidOnExpense
{
get { return isValidOnExpense != null; }
}
public bool IsSetIsValidOnIncome
{
get { return isValidOnIncome != null; }
}
public bool IsSetNetAmountMultiplier
{
get { return netAmountMultiplier != null; }
}
public bool IsSetTaxCodeId
{
get { return TaxCodeId != null; }
}
public bool IsSetTaxRateTitle
{
get { return TaxRateTitle != null; }
}
public bool IsSetTaxRateDescription
{
get { return TaxRateDescription != null; }
}
public bool IsSetTaxType
{
get { return TaxType != null; }
}
public bool IsValidOnExpense
{
get { return (bool)isValidOnExpense; }
set { isValidOnExpense = value; }
}
public bool IsValidOnIncome
{
get { return (bool)isValidOnIncome; }
set { isValidOnIncome = value; }
}
}
}

View File

@@ -0,0 +1,193 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bnhtrade.Core.Model.Import
{
public class AmazonSettlement : AmazonSettlementHeader
{
public List<SettlementLine> SettlementLineList { get; set; } = new List<SettlementLine>();
public bool SettlementLineListIsSet
{
get
{
if (SettlementLineList == null || !SettlementLineList.Any())
{ return false; }
else
{ return true; }
}
}
public class SettlementLine
{
private decimal? amount = null;
private DateTime? postDateTime = null;
private int? quantityPurchased = null;
private bool? isProcessed = null;
private int? exportAccountInvoiceLineId = null;
public string TransactionType { get; set; }
public bool TransactionTypeIsSet
{
get { return TransactionType != null; }
}
public string OrderId { get; set; }
public bool OrderIdIsSet
{
get { return OrderId != null; }
}
public string MerchantOrderId { get; set; }
public bool MerchantOrderIdIsSet
{
get { return MerchantOrderId != null; }
}
public string AdjustmentId { get; set; }
public bool AdjustmentIdIsSet
{
get { return AdjustmentId != null; }
}
public string ShipmentId { get; set; }
public bool ShipmentIdIsSet
{
get { return ShipmentId != null; }
}
public string MarketPlaceName { get; set; }
public bool MarketPlaceNameIsSet
{
get { return MarketPlaceName != null; }
}
public string AmountType { get; set; }
public bool AmountTypeIsSet
{
get { return AmountType != null; }
}
public string AmountDescription { get; set; }
public bool AmountDescriptionIsSet
{
get { return AmountDescription != null; }
}
public decimal Amount
{
get { return (decimal)amount.GetValueOrDefault(); }
set { amount = value; }
}
public bool AmountIsSet
{
get { return amount != null; }
}
public string CurrenyCode { get; set; }
public bool CurrenyCodeIsSet
{
get { return CurrenyCode != null; }
}
public string FulfillmentId { get; set; }
public bool FulfillmentIdIsSet
{
get { return FulfillmentId != null; }
}
public DateTime PostDateTime
{
get { return (DateTime)postDateTime.GetValueOrDefault(); }
set { postDateTime = value; }
}
public bool PostDateTimeIsSet
{
get { return PostDateTime != null; }
}
public string OrderItemCode { get; set; }
public bool OrderItemCodeIsSet
{
get { return OrderItemCode != null; }
}
public string MerchantOrderItemId { get; set; }
public bool MerchantOrderItemIdIsSet
{
get { return MerchantOrderItemId != null; }
}
public string MerchantAdjustmentItemId { get; set; }
public bool MerchantAdjustmentItemIdIsSet
{
get { return MerchantAdjustmentItemId != null; }
}
public string Sku { get; set; }
public bool SkuIsSet
{
get { return Sku != null; }
}
public int QuantityPurchased
{
get { return (int)quantityPurchased.GetValueOrDefault(); }
set { quantityPurchased = value; }
}
public bool QuantityPurchasedIsSet
{
get { return quantityPurchased != null; }
}
public string PromotionId { get; set; }
public bool PromotionIdIsSet
{
get { return PromotionId != null; }
}
public bool IsProcessed
{
get { return (bool)isProcessed.GetValueOrDefault(); }
set { isProcessed = value; }
}
public bool IsProcessedIsSet
{
get { return isProcessed != null; }
}
public int ExportAccountInvoiceLineId
{
get { return exportAccountInvoiceLineId.GetValueOrDefault(); }
set { exportAccountInvoiceLineId = value; }
}
public bool ExportAccountInvoiceLineIdIsSet
{
get { return exportAccountInvoiceLineId != null; }
}
}
}
}

View File

@@ -0,0 +1,107 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bnhtrade.Core.Model.Import
{
public class AmazonSettlementHeader
{
private DateTime? startDate = null;
private DateTime? endDate = null;
private DateTime? depositDate = null;
private decimal? totalAmount = null;
private bool? isProcessed = null;
public string MarketPlaceName
{
get;
set;
}
public bool MarketPlaceNameIsSet
{
get { return MarketPlaceName != null; }
}
public string SettlementId
{
get;
set;
}
public bool SettlementIdIsSet
{
get { return SettlementId != null; }
}
public DateTime StartDate
{
get { return (DateTime)startDate.GetValueOrDefault(); }
set { startDate = value; }
}
public bool StartDateIsSet
{
get { return startDate != null; }
}
public DateTime EndDate
{
get { return (DateTime)endDate.GetValueOrDefault(); }
set { endDate = value; }
}
public bool EndDateIsSet
{
get { return endDate != null; }
}
public DateTime DepositDate
{
get { return (DateTime)depositDate.GetValueOrDefault(); }
set { depositDate = value; }
}
public bool DepositDateIsSet
{
get { return depositDate != null; }
}
public decimal TotalAmount
{
get { return (decimal)totalAmount.GetValueOrDefault(); }
set { totalAmount = value; }
}
public bool TotalAmountIsSet
{
get { return totalAmount != null; }
}
public string CurrencyCode
{
get;
set;
}
public bool CurrencyCodeIsSet
{
get { return CurrencyCode != null; }
}
public bool IsProcessed
{
get { return (bool)isProcessed.GetValueOrDefault(); }
set { isProcessed = value; }
}
public bool IsProcessedIsSet
{
get { return isProcessed != null; }
}
}
}

View File

@@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bnhtrade.Core.Model.SKU
{
class SKUInfo
{
public string SkuNumber { get; set; }
public string AmazonFNSKU { get; set; }
public bool IsActive { get; set; }
}
}

View File

@@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace bnhtrade.Core.Model.Sku
{
public class Sku
{
private bool? isActive;
public string ConditionModelPlaceholder
{
get;
set;
}
public string ProductModelPlaceholder
{
get;
set;
}
public string SkuNumber
{
get;
set;
}
public Account.TaxCode TaxCode
{
get;
set;
}
public string AmazonFNSKU
{
get;
set;
}
public bool IsActive
{
get { return (bool)isActive; }
set { isActive = value; }
}
public bool IsSetConditionModelPlaceholder
{
get { return ConditionModelPlaceholder != null; }
}
public bool IsSetProductModelPlaceholder
{
get { return ProductModelPlaceholder != null; }
}
public bool IsSetSkuNumber
{
get { return SkuNumber != null; }
}
public bool IsSetTaxCode
{
get { return TaxCode != null; }
}
public bool IsSetAmazonFNSKU
{
get { return AmazonFNSKU != null; }
}
public bool IsSetIsActive
{
get { return isActive != null; }
}
}
}