Asset Categories
This commit is contained in:
@@ -5,6 +5,7 @@ using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
|
||||
{
|
||||
@@ -80,6 +81,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
|
||||
public String RefExt { get; set; } = "";
|
||||
public String DescBrief { get; set; } = "";
|
||||
public ItemId ItemId { get; set; } = new ItemId();
|
||||
// Purchase.
|
||||
public DateTime PurchaseOn { get; set; } = DateTime.MinValue;
|
||||
public SysId AssocIdSupplier { get; set; } = new SysId();
|
||||
public String PurchaseInvoiceRef { get; set; } = "";
|
||||
@@ -89,6 +91,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
|
||||
public decimal AmountPurchaseGross { get; set; } = 0.0m;
|
||||
public decimal AmountSettlementGross { get; set; } = 0.0m;
|
||||
public decimal AmountEnhancementGross { get; set; } = 0.0m;
|
||||
// Sale.
|
||||
public SysId AssocIdCustomer { get; set; } = new SysId();
|
||||
public String SellCategoryCode { get; set; } = "";
|
||||
public decimal AmountSell { get; set; } = 0.0m;
|
||||
@@ -98,15 +101,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
|
||||
public DateTime SoldOn { get; set; } = DateTime.MinValue;
|
||||
public decimal AmountSold { get; set; } = 0.0m;
|
||||
public decimal AmountSoldGross { get; set; } = 0.0m;
|
||||
// Disposal.
|
||||
public String DisposeCode { get; set; } = "";
|
||||
public DateTime DisposeOn { get; set; } = DateTime.MinValue;
|
||||
public DateTime DueBackOn { get; set; } = DateTime.MinValue;
|
||||
// Rental.
|
||||
public decimal AmountRentalCost { get; set; } = 0.0m;
|
||||
public SysId UomIdRentalCost { get; set; } = new SysId();
|
||||
public SysId TaxCodeIdRentalCost { get; set; } = new SysId();
|
||||
public decimal AmountRentalPrice { get; set; } = 0.0m;
|
||||
public SysId UomIdRentalPrice { get; set; } = new SysId();
|
||||
public SysId TaxCodeIdRentalPrice { get; set; } = new SysId();
|
||||
// Processes.
|
||||
public SysId ProcessIdNext { get; set; } = new SysId();
|
||||
}
|
||||
|
||||
@@ -633,8 +639,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
|
||||
public new class Params : SacsHierarchyItem.Params
|
||||
{
|
||||
// List filtering.
|
||||
public List<SysId> IdsIncluded { get; } = new List<SysId>();
|
||||
public List<SysId> IdsExcluded { get; } = new List<SysId>();
|
||||
public HashSet<SysId> IdsIncluded { get; } = new HashSet<SysId>();
|
||||
public HashSet<SysId> IdsExcluded { get; } = new HashSet<SysId>();
|
||||
// Asset.
|
||||
public SysId AssetCatId { get; set; }
|
||||
public String Search { get; set; }
|
||||
@@ -648,25 +654,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
|
||||
public bool RestrictToActive { get; set; }
|
||||
/// <summary>Asset status.</summary>
|
||||
public StatusCat StatusCat { get; set; } = StatusCat.NotDeleted;
|
||||
// Utilities.
|
||||
public List<StringPair> GetDisplayValues()
|
||||
{
|
||||
List<StringPair> value = new List<StringPair>();
|
||||
|
||||
if (IdsIncluded.Count > 0) value.Add("Assets included", IdsIncluded.ToString());
|
||||
if (IdsExcluded.Count > 0) value.Add("Assets excluded", IdsExcluded.ToString());
|
||||
if (SysId.IsValid(AssetCatId)) value.Add("Asset category Id", AssetCatId.ToString());
|
||||
if (ItemType > 0) value.Add("Item type", ItemType.ToString());
|
||||
if (ItemId.IsValid(ItemId)) value.Add("Item Id", ItemId.ToString());
|
||||
if (!StringUtil.IsEmpty(SerialNumber)) value.Add("SerialNumber", SerialNumber);
|
||||
if (!StringUtil.IsEmpty(SerialNumberPartial)) value.Add("SerialNumber starts", SerialNumberPartial);
|
||||
if (!StringUtil.IsEmpty(DescBriefPartial)) value.Add("Description starts", DescBriefPartial);
|
||||
if (SysId.IsValid(ProcessIdNext)) value.Add("Next process #", ProcessIdNext.ToString());
|
||||
if (SysId.IsValid(ProcessIdActive)) value.Add("Active process #", ProcessIdActive.ToString());
|
||||
if (!RestrictToActive) value.Add("Status", "Active");
|
||||
|
||||
return value;
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
@@ -675,16 +662,16 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
|
||||
//=======================================================================
|
||||
public static class SbmAssetList
|
||||
{
|
||||
/// <summary>Check whether currency exists/locate in list with specified Id.</summary>
|
||||
/// <summary>Check whether item exists/locate in list with specified Id.</summary>
|
||||
public static bool Find(this List<SbmAddress> values, SbmAddress address)
|
||||
{
|
||||
if (address == null) return false;
|
||||
return (values.Find(item => item == address) != null);
|
||||
return values.Any(item => item == address);
|
||||
}
|
||||
public static bool FindById(this List<SbmAddress> values, SysId addressId)
|
||||
{
|
||||
if (!SysId.IsValid(addressId)) return false;
|
||||
return values.Exists(item => item.Id.Equals(addressId));
|
||||
return values.Any(item => item.Id.Equals(addressId));
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
|
||||
Reference in New Issue
Block a user