Class TransactionViewHelper
A helper class for an implementation of a ILayoutGenerator that has child transactions
This includes view visibility formulas to make sure the allocations sub views are only visible when the
transaction is configured that way
Inheritance
TransactionViewHelper
Assembly: LemonEdge.ClientCore.dll
Syntax
public class TransactionViewHelper
Constructors
TransactionViewHelper(EntityDescriptor, IEntityDescriptorFactory, IViewDescriptorInstanceFactory)
Creates a new transaction view helper for the specified entity type with child transactions
Declaration
public TransactionViewHelper(EntityDescriptor desc, IEntityDescriptorFactory entityDescriptorFactory, IViewDescriptorInstanceFactory viewDescriptorInstanceFactory)
Parameters
Fields
Declaration
public const string DOES_TRANSACTION_HAVE_PARAMS_FORMULA = "\r\nvar head = View.Controller.CurrentDisplayedItem as LemonEdge.API.Entities.FinancialServices.Transactions.ITransaction; \r\nif(head == null) return false;\r\nvar code = head != null ? await Cache.GetItem<LemonEdge.API.Entities.FinancialServices.Transactions.ITransactionCode>(head.TransactionCodeID) : null; \r\nif(code == null) return false;\r\nreturn code.TransactionSettingLayoutID.HasValue;"
Field Value
Declaration
public const string DOES_TRANSACTION_HAVE_TRANSACTIONSANDGL_FORMULA = "\r\nvar head = View.Controller.CurrentDisplayedItem as LemonEdge.API.Entities.FinancialServices.Transactions.ITransaction; \r\nif(head == null) return true;\r\nvar code = head != null ? await Cache.GetItem<LemonEdge.API.Entities.FinancialServices.Transactions.ITransactionCode>(head.TransactionCodeID) : null; \r\nif(code == null) return true;\r\nreturn code.ShowTransactionsAndGL;"
Field Value
HAS_TRANSACTION_ASSOCIATIONS
Declaration
public const string HAS_TRANSACTION_ASSOCIATIONS = "\r\nvar code = Item is LemonEdge.API.Entities.FinancialServices.Transactions.ITransaction trn ? await Cache.GetItem<LemonEdge.API.Entities.FinancialServices.Transactions.ITransactionCode>(trn.TransactionCodeID) : null; \r\nreturn code != null && code.AllowAssociations;"
Field Value
Declaration
public const string IS_GL_ALLOCATED_FORMULA = "\r\nvar head = View.Controller.CurrentDisplayedItem as LemonEdge.API.Entities.FinancialServices.Accounting.IGLPosting; \r\nLemonEdge.API.Entities.FinancialServices.Transactions.ITransactionCode code = null;\r\nvar hasAllocations = false;\r\nif(head != null) \r\n{\r\n var cn = View.Displayer.Controller.MainDisplayedItem.Context;\r\n var processor = cn.GetProcessor<LemonEdge.API.Entities.FinancialServices.Processors.Transactional.ITransactionProcessor>(head); \r\n var trn = processor.GetTransaction(head.ParentTransactionID);\r\n code = await Cache.GetItem<LemonEdge.API.Entities.FinancialServices.Transactions.ITransactionCode>(trn.TransactionCodeID); \r\n hasAllocations = processor.GetGLValuesAllocated(head).Any();\r\n}\r\nelse\r\n{\r\n code = Item is LemonEdge.API.Entities.FinancialServices.Transactions.ITransaction trn ? await Cache.GetItem<LemonEdge.API.Entities.FinancialServices.Transactions.ITransactionCode>(trn.TransactionCodeID) : null; \r\n}\r\nreturn code != null && (code.Allocation >= LemonEdge.API.Entities.FinancialServices.Transactions.TransactionCodeAllocation.Automatic || hasAllocations);"
Field Value
Declaration
public const string IS_TRANSACTION_ALLOCATED_FORMULA = "\r\nvar head = MyItem as LemonEdge.API.Entities.FinancialServices.Transactions.ITransaction; \r\nvar code = head != null ? await Cache.GetItem<LemonEdge.API.Entities.FinancialServices.Transactions.ITransactionCode>(head.TransactionCodeID) : null; \r\nif(head == null || code == null) return false;\r\nvar cn = View.Displayer.Controller.MainDisplayedItem.Context;\r\nvar processor = cn.GetProcessor<LemonEdge.API.Entities.FinancialServices.Processors.Transactional.ITransactionProcessor>(head); \r\nvar hasAllocations = processor.GetTransactionValuesAllocated(head).Any();\r\nreturn code != null && (code.Allocation >= LemonEdge.API.Entities.FinancialServices.Transactions.TransactionCodeAllocation.Automatic || hasAllocations);"
Field Value
Properties
The name of the controller that holds header transactions only
Declaration
public string HeaderTransactionsControllerName { get; set; }
Property Value
Parent
Declaration
public ViewDescriptorInstance Parent { get; set; }
Property Value
Methods
AddDefaultTransactionViews(LayoutDescriptorGroup, LayoutDescriptorGroup)
Declaration
public void AddDefaultTransactionViews(LayoutDescriptorGroup topGroup, LayoutDescriptorGroup bottomGroup)
Parameters
AddDefaultTransactionViews(LayoutDescriptorGroup, LayoutDescriptorGroup, bool)
Adds the transaction view, values view, allocations, gl posting, and gl posting allocations views to the specified
group within a layout
The parent transaction view is related to the parent entity descriptor these transactions all have as a parent
Declaration
public void AddDefaultTransactionViews(LayoutDescriptorGroup topGroup, LayoutDescriptorGroup bottomGroup, bool addHeader)
Parameters
Type |
Name |
Description |
LayoutDescriptorGroup |
topGroup |
The top group within the owning layout the header transactions should be added to
|
LayoutDescriptorGroup |
bottomGroup |
The larger bottom group that holds the values, allocations, gl postings and gl posting
allocations views within the owning layout
|
bool |
addHeader |
|
Extension Methods