mirror of
https://github.com/stokebob/bnhtrade.git
synced 2026-05-18 19:48:23 +00:00
Migrated projects to dotnet8
migrated all projects over to .net8 incomplete feature for gui shipments
This commit is contained in:
@@ -4,7 +4,6 @@ using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace bnhtrade.Core.Model.Account
|
||||
{
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace bnhtrade.Core.Model.Account
|
||||
{
|
||||
public class Contact
|
||||
{
|
||||
public int ContactId { get; set; }
|
||||
|
||||
public string ContantName { get; set; }
|
||||
|
||||
public string ContactEbayName { get; set; }
|
||||
|
||||
public string ContactEbayEmail { get; set; }
|
||||
|
||||
public string ContactPaypalName { get; set; }
|
||||
|
||||
public string ContactPaypalEmail { get; set; }
|
||||
|
||||
public DateTime Created { get; set; }
|
||||
|
||||
public DateTime? Modified { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
using Microsoft.VisualBasic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace bnhtrade.Core.Model.Account
|
||||
{
|
||||
public class Journal : IValidatableObject
|
||||
{
|
||||
internal Journal(uint journalId, Core.Model.Account.JournalType type, List<Post> posts, DateTime entryDate, DateTime postDate, DateTime lastModifed, bool isLocked)
|
||||
{
|
||||
JournalId = journalId;
|
||||
Type = type;
|
||||
Posts = posts;
|
||||
EntryDate = entryDate;
|
||||
PostDate = postDate;
|
||||
LastModified = lastModifed;
|
||||
IsLocked = isLocked;
|
||||
}
|
||||
|
||||
public uint JournalId { get; private set; }
|
||||
public Core.Model.Account.JournalType Type { get; private set; }
|
||||
public List<Post> Posts { get; private set; } = new List<Post>();
|
||||
public DateTime EntryDate { get; private set; }
|
||||
public DateTime PostDate { get; private set; }
|
||||
public DateTime LastModified { get;private set; }
|
||||
public bool IsLocked { get; private set; }
|
||||
|
||||
public class Post
|
||||
{
|
||||
internal Post(uint postId, Core.Model.Account.Account account, decimal amountGbp)
|
||||
{
|
||||
PostId = postId;
|
||||
Account = account;
|
||||
AmountGbp = amountGbp;
|
||||
}
|
||||
|
||||
public uint PostId { get; private set; }
|
||||
public Core.Model.Account.Account Account { get; private set; }
|
||||
public decimal AmountGbp { get; private set; }
|
||||
}
|
||||
|
||||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
var result = new List<ValidationResult>();
|
||||
|
||||
// get total of posts
|
||||
decimal postTotal = 0;
|
||||
foreach (var post in Posts)
|
||||
{
|
||||
postTotal = postTotal + post.AmountGbp;
|
||||
}
|
||||
if (postTotal != 0)
|
||||
{
|
||||
result.Add(new ValidationResult("Account journal posts do not equal zero"));
|
||||
}
|
||||
|
||||
throw new NotImplementedException();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace bnhtrade.Core.Model.Account
|
||||
{
|
||||
public class JournalType
|
||||
{
|
||||
internal JournalType(uint journalTypeId, string title, Model.Account.Account defaultCreditAccount = null, Model.Account.Account defaultDebitAccount = null)
|
||||
{
|
||||
JournalTypeId = journalTypeId;
|
||||
Title = title;
|
||||
DefaultCreditAccount = defaultCreditAccount;
|
||||
DefaultDebitAccount = defaultDebitAccount;
|
||||
}
|
||||
|
||||
internal void AddDefaultAccounts(Model.Account.Account defaultCreditAccount = null, Model.Account.Account defaultDebitAccount = null)
|
||||
{
|
||||
DefaultCreditAccount = defaultCreditAccount;
|
||||
DefaultDebitAccount = defaultDebitAccount;
|
||||
}
|
||||
|
||||
public uint JournalTypeId { get ; private set; }
|
||||
|
||||
public string Title { get; private set; }
|
||||
|
||||
public Model.Account.Account DefaultDebitAccount { get; private set; }
|
||||
|
||||
public bool IsSetDefaultDebitAccount
|
||||
{
|
||||
get { return DefaultDebitAccount != null; }
|
||||
}
|
||||
|
||||
public Model.Account.Account DefaultCreditAccount { get; private set; }
|
||||
|
||||
public bool IsSetDefaultCreditAccount
|
||||
{
|
||||
get { return DefaultCreditAccount != null; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace bnhtrade.Core.Model.Account
|
||||
{
|
||||
public class PurchaseInvoice
|
||||
{
|
||||
public int PurchaseID { get; set; }
|
||||
|
||||
public int PurchaseNumber { get; set; }
|
||||
|
||||
public int? RecordID { get; set; }
|
||||
|
||||
public DateTime PurchaseDate { get; set; }
|
||||
|
||||
public Model.Account.Contact Contact { get; set; }
|
||||
|
||||
public string SupplierRef { get; set; }
|
||||
|
||||
public string AccountCurrency { get; set; }
|
||||
|
||||
public string PurchaseChannel { get; set; }
|
||||
|
||||
public string CurrencyCode { get; set; }
|
||||
|
||||
public decimal InvoiceNetAmount
|
||||
{
|
||||
get
|
||||
{
|
||||
return InvoiceGrossAmount - InvoiceTaxAmount;
|
||||
}
|
||||
}
|
||||
|
||||
public decimal InvoiceTaxAmount
|
||||
{
|
||||
get
|
||||
{
|
||||
decimal amount = 0;
|
||||
foreach (var item in InvoiceLines)
|
||||
{
|
||||
amount = amount + item.LineTotalTax;
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
}
|
||||
|
||||
public decimal InvoiceGrossAmount
|
||||
{
|
||||
get
|
||||
{
|
||||
decimal amount = 0;
|
||||
foreach (var item in InvoiceLines)
|
||||
{
|
||||
amount = amount + item.LineTotalGross;
|
||||
}
|
||||
return amount;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Value stored in database to check invoice lines against
|
||||
/// </summary>
|
||||
public decimal InvoiceGrossAmountCheck { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Don't know what this is for, all the amounts in the db are gross, so this is always true
|
||||
/// </summary>
|
||||
public bool VatInclusiveAmounts { get; set; }
|
||||
|
||||
public DateTime RecordCreated { get; set; }
|
||||
|
||||
public DateTime RecordModified { get; set; }
|
||||
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
public List<Model.Account.PurchaseInvoice.Line> InvoiceLines { get; set; }
|
||||
|
||||
public class Line
|
||||
{
|
||||
public int PurchaseLineId { get; set; }
|
||||
|
||||
public int PurchaseId { get; set; }
|
||||
|
||||
public string Status { get; set; }
|
||||
|
||||
public string SupplierRef { get; set; }
|
||||
|
||||
public DateTime? CheckedIn { get; set; }
|
||||
|
||||
public string ItemDescription { get; set; }
|
||||
|
||||
public int ItemQuantity { get; set; }
|
||||
|
||||
public decimal ItemNet
|
||||
{
|
||||
get
|
||||
{
|
||||
return ItemGross - ItemTax;
|
||||
}
|
||||
}
|
||||
|
||||
public decimal ItemGross { get; set; }
|
||||
|
||||
public decimal ItemTax { get; set; }
|
||||
|
||||
public decimal ShippingNet
|
||||
{
|
||||
get
|
||||
{
|
||||
return ShippingGross - ShippingTax;
|
||||
}
|
||||
}
|
||||
|
||||
public decimal ShippingGross { get; set; }
|
||||
|
||||
public decimal ShippingTax { get; set; }
|
||||
|
||||
public decimal OtherNet
|
||||
{
|
||||
get
|
||||
{
|
||||
return OtherGross - OtherTax;
|
||||
}
|
||||
}
|
||||
|
||||
public decimal OtherGross { get; set; }
|
||||
|
||||
public decimal OtherTax { get; set; }
|
||||
|
||||
public decimal LineTotalNet
|
||||
{
|
||||
get
|
||||
{
|
||||
return (ItemGross + ShippingGross + OtherGross) - (ItemTax + ShippingTax + OtherTax);
|
||||
}
|
||||
}
|
||||
|
||||
public decimal LineTotalTax
|
||||
{
|
||||
get
|
||||
{
|
||||
return ItemTax + ShippingTax + OtherTax;
|
||||
}
|
||||
}
|
||||
|
||||
public decimal LineTotalGross
|
||||
{
|
||||
get
|
||||
{
|
||||
return ItemGross + ShippingGross + OtherGross;
|
||||
}
|
||||
}
|
||||
|
||||
public bnhtrade.Core.Model.Account.TaxCodeInfo AccountTaxCode { get; set; }
|
||||
|
||||
public int? Tax_AccountTransactionId { get; set; }
|
||||
|
||||
public int Net_AccountChartOfId { get; set; }
|
||||
|
||||
public int? Net_AccountTransactionId { get; set; }
|
||||
|
||||
public DateTime RecordCreated { get; set; }
|
||||
|
||||
public DateTime RecordModified { get; set; }
|
||||
|
||||
public bool IsActive { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace bnhtrade.Core.Model.Account
|
||||
{
|
||||
public class PurchaseInvoiceLineStatus
|
||||
{
|
||||
public PurchaseInvoiceLineStatus(int statusId, string statusName, int listSort)
|
||||
{
|
||||
PurchaseLineStatusId = statusId;
|
||||
PurchaseLineStatusName = statusName;
|
||||
ListSort = listSort;
|
||||
}
|
||||
|
||||
public int PurchaseLineStatusId { get; private set; }
|
||||
|
||||
public string PurchaseLineStatusName { get; private set; }
|
||||
|
||||
public int ListSort { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace bnhtrade.Core.Model.Account
|
||||
{
|
||||
public class PurchaseInvoiceLineSummary
|
||||
{
|
||||
public int PurchaseId { get; set; }
|
||||
public int PurchaseNumber { get; set; }
|
||||
public int PurchaseLineId { get; set; }
|
||||
public DateTime PurchaseDate { get; set; }
|
||||
public string ItemDescription { get; set; }
|
||||
public string LineStatus { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ namespace bnhtrade.Core.Model.Account
|
||||
{
|
||||
public class TaxCodeInfo : IValidatableObject
|
||||
{
|
||||
public TaxCodeInfo(string taxCodeId, string title, string description, decimal taxRatePercent, bool isMarginSchemeRate,
|
||||
public TaxCodeInfo(string taxCode, string title, string description, decimal taxRatePercent, bool isMarginSchemeRate,
|
||||
bool isValidOnExpense, bool isValidOnIncome, string taxType, bool isActive)
|
||||
{
|
||||
if (TaxRate < 0)
|
||||
@@ -24,7 +24,7 @@ namespace bnhtrade.Core.Model.Account
|
||||
throw new Exception("Tax rate is >= 100%");
|
||||
}
|
||||
|
||||
TaxCode = taxCodeId;
|
||||
TaxCode = taxCode;
|
||||
TaxCodeDescription = description;
|
||||
TaxRate = taxRatePercent;
|
||||
IsMarginScheme = isMarginSchemeRate;
|
||||
|
||||
@@ -9,24 +9,35 @@ namespace bnhtrade.Core.Model.Credentials
|
||||
public class bnhtradeDB
|
||||
{
|
||||
public string DataSource { get; private set; }
|
||||
|
||||
public string UserId { get; private set; }
|
||||
|
||||
public string UserPassword { get; private set; }
|
||||
|
||||
public string InitialCatalog { get; private set; } = "e2A";
|
||||
|
||||
public bool PersistSecurityInfo { get; private set; } = true;
|
||||
|
||||
public bool MultipleActiveResultSets { get; private set; } = true;
|
||||
|
||||
public uint ConnectionTimeout { get; private set; }
|
||||
|
||||
public string ConnectionString
|
||||
{ get
|
||||
{
|
||||
get
|
||||
{
|
||||
return "Data Source=" + DataSource + ";Initial Catalog=" + InitialCatalog + ";Persist Security Info=" + PersistSecurityInfo.ToString()
|
||||
+ ";User ID=" + UserId + ";Password=" + UserPassword + ";MultipleActiveResultSets=" + MultipleActiveResultSets.ToString();
|
||||
+ ";User ID=" + UserId + ";Password=" + UserPassword + ";MultipleActiveResultSets=" + MultipleActiveResultSets.ToString()
|
||||
+ ";Connect Timeout=" + ConnectionTimeout;
|
||||
}
|
||||
}
|
||||
|
||||
public bnhtradeDB (string source, string userId, string userPassword)
|
||||
public bnhtradeDB (string source, string userId, string userPassword, uint connectionTimeout = 30)
|
||||
{
|
||||
this.DataSource = source;
|
||||
this.UserId = userId;
|
||||
this.UserPassword = userPassword;
|
||||
this.ConnectionTimeout = connectionTimeout;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using CsvHelper.Configuration.Attributes;
|
||||
using NUnit.Framework.Interfaces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
@@ -7,7 +7,6 @@ using System.Runtime.ConstrainedExecution;
|
||||
using System.Security.Policy;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace bnhtrade.Core.Model.Import
|
||||
{
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace bnhtrade.Core.Model.Purchase
|
||||
{
|
||||
public class PurchaseLineStatus
|
||||
{
|
||||
public PurchaseLineStatus(int statusId, string statusName, int listSort)
|
||||
{
|
||||
PurchaseLineStatusId = statusId;
|
||||
PurchaseLineStatusName = statusName;
|
||||
ListSort = listSort;
|
||||
}
|
||||
|
||||
public int PurchaseLineStatusId {get; private set;}
|
||||
|
||||
public string PurchaseLineStatusName { get; private set;}
|
||||
|
||||
public int ListSort { get; private set;}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user