Class TransactionConverter
Converts and transforms transactions
Inheritance
Inherited Members
Namespace: Simplic.ERP.Core
Assembly: Simplic.ERP.Core.dll
Syntax
public class TransactionConverter
Methods
| Improve this Doc View SourceConvert(Transaction, TransactionType, TransactionSubtype, Boolean)
Convert a complete transaction into a new transaction. This should only be used for complete converting.
Declaration
public ConvertResult Convert(Transaction source, TransactionType targetType, TransactionSubtype targetSubtype = null, bool copyMode = false)
Parameters
Type | Name | Description |
---|---|---|
Transaction | source | Source transaction, items and header information will be taken from this |
TransactionType | targetType | Target transaction type |
TransactionSubtype | targetSubtype | Target subtype |
System.Boolean | copyMode | If set to true, operation items will just be copied and not converted from AllAbove to Children |
Returns
Type | Description |
---|---|
ConvertResult | Convert result with the new transaction type |
Convert(Transaction, IReadOnlyList<TransactionItem>, TransactionType, TransactionSubtype, Boolean)
Convert a list of transactions to a new, single trunsaction. This should only be used for complete converting.
Declaration
public ConvertResult Convert(Transaction source, IReadOnlyList<TransactionItem> items, TransactionType targetType, TransactionSubtype targetSubtype = null, bool copyMode = false)
Parameters
Type | Name | Description |
---|---|---|
Transaction | source | Main transaction. Only some header data will be used from here |
System.Collections.Generic.IReadOnlyList<TransactionItem> | items | |
TransactionType | targetType | Target transaction type |
TransactionSubtype | targetSubtype | target subtype. If null is passed, the default subtype will be passed |
System.Boolean | copyMode | If set to true, operation items will just be copied and not converted from AllAbove to Children. Is only enabled if one transaction is passed |
Returns
Type | Description |
---|---|
ConvertResult | New transaction |
Convert(Transaction, IReadOnlyList<TransactionItem>, IDictionary<TransactionItem, PreciseDecimal>, TransactionType, TransactionSubtype, Boolean)
Convert a list of transactions to a new, single trunsaction. This should only be used for complete converting.
Declaration
public ConvertResult Convert(Transaction source, IReadOnlyList<TransactionItem> items, IDictionary<TransactionItem, PreciseDecimal> quantities, TransactionType targetType, TransactionSubtype targetSubtype = null, bool copyMode = false)
Parameters
Type | Name | Description |
---|---|---|
Transaction | source | Main transaction. Only some header data will be used from here |
System.Collections.Generic.IReadOnlyList<TransactionItem> | items | |
System.Collections.Generic.IDictionary<TransactionItem, PreciseDecimal> | quantities | |
TransactionType | targetType | Target transaction type |
TransactionSubtype | targetSubtype | target subtype. If null is passed, the default subtype will be passed |
System.Boolean | copyMode | If set to true, operation items will just be copied and not converted from AllAbove to Children. Is only enabled if one transaction is passed |
Returns
Type | Description |
---|---|
ConvertResult | New transaction |
Convert(IList<Transaction>, TransactionType, TransactionSubtype, Boolean)
Convert a list of transactions into a new transaction. This should only be used for complete converting.
Declaration
public ConvertResult Convert(IList<Transaction> sources, TransactionType targetType, TransactionSubtype targetSubtype = null, bool copyMode = false)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<Transaction> | sources | Source transactions, items and header information will be taken from this |
TransactionType | targetType | Target transaction type |
TransactionSubtype | targetSubtype | Target subtype |
System.Boolean | copyMode | If set to true, operation items will just be copied and not converted from AllAbove to Children. Is only enabled if one transaction is passed |
Returns
Type | Description |
---|---|
ConvertResult | Convert result with the new transaction type |