2024-05-05 22:08:27 +02:00
|
|
|
|
using FirmTracker_Server.nHibernate.Products;
|
2024-05-06 21:25:10 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2024-05-05 22:08:27 +02:00
|
|
|
|
|
|
|
|
|
namespace FirmTracker_Server.nHibernate.Transactions
|
|
|
|
|
{
|
|
|
|
|
public class Transaction
|
|
|
|
|
{
|
|
|
|
|
public virtual int Id { get; set; }
|
2024-05-06 21:25:10 +02:00
|
|
|
|
public virtual DateTime Date { get; set; }
|
2024-05-05 22:08:27 +02:00
|
|
|
|
public virtual int EmployeeId { get; set; }
|
2024-05-06 21:25:10 +02:00
|
|
|
|
public virtual IList<TransactionProduct> TransactionProducts { get; set; } = new List<TransactionProduct>();
|
2024-05-05 22:08:27 +02:00
|
|
|
|
public virtual string PaymentType { get; set; }
|
2024-05-06 21:25:10 +02:00
|
|
|
|
public virtual decimal Discount { get; set; }
|
2024-05-05 22:08:27 +02:00
|
|
|
|
public virtual string Description { get; set; }
|
2024-05-16 00:42:06 +02:00
|
|
|
|
public virtual decimal TotalPrice { get; set; }//=> TransactionProducts.Sum(tp => ((tp.Quantity * tp.UnitPrice)* ((1 - (Discount / 100)))));// (1 - (Discount / 100)));
|
2024-05-05 22:08:27 +02:00
|
|
|
|
|
|
|
|
|
public Transaction()
|
|
|
|
|
{
|
2024-05-06 21:25:10 +02:00
|
|
|
|
TransactionProducts = new List<TransactionProduct>();
|
2024-05-05 22:08:27 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|