mirror of
https://github.com/stokebob/bnhtrade.git
synced 2026-03-19 14:37:16 +00:00
Export amazon settlement report fix
This commit is contained in:
34
src/bnhtrade.Core/Logic/Account/ValidateSalesInvoice.cs
Normal file
34
src/bnhtrade.Core/Logic/Account/ValidateSalesInvoice.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace bnhtrade.Core.Logic.Account
|
||||
{
|
||||
public class ValidateSalesInvoice : ValidateInvoice
|
||||
{
|
||||
public ValidateSalesInvoice()
|
||||
{
|
||||
int propertyCount = new Model.Account.SalesInvoice().GetType().GetProperties().Count();
|
||||
if (propertyCount != 20)
|
||||
{ throw new Exception("Model.Account.SalesInvoice property count has altered. Validate class requires an update."); }
|
||||
|
||||
propertyCount = new Model.Account.SalesInvoice.InvoiceLine().GetType().GetProperties().Count();
|
||||
if (propertyCount != 18)
|
||||
{ throw new Exception("Model.Account.SalesInvoice property count has altered. Validate class requires an update."); }
|
||||
}
|
||||
|
||||
public bool IsValidInvoice(Model.Account.SalesInvoice invoice)
|
||||
{
|
||||
return IsValidInvoice(new List<Model.Account.SalesInvoice> { invoice });
|
||||
}
|
||||
|
||||
public bool IsValidInvoice(List<Model.Account.SalesInvoice> invoiceList)
|
||||
{
|
||||
var interfaceList = invoiceList.Cast<Model.Account.IInvoice>().ToList();
|
||||
|
||||
return IsValidInvoice(interfaceList);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user