LOG0206 Create Excise Administrative Documents

Basic Information

Module Logistics.Inventory
Code LOG0206
Parent Document StoreTransaction
Sub-document ExciseAdministrativeDocument
Full Name Create Excise Administrative Documents
Status NEW
Deterministic NO
Supports Transitional Documents NO
Supports Single Execution YES
Replaces -
Orphan Rows Ignore
Introduced In Version 2022
Date of Suspension -

Business Logic

This Generation is used to create Excise Administrative Documents for the products of the current Store Transactions that have value for the field ExciseProductsType.
It is activated only if the store in the current Store Transaction has a value for the field TaxWarehouse.
The Excise Administrative Document's header is created based on the Store Transaction's header as follows:

ExciseAdministrativeDocument.TaxWarehouse = StoreTransaction.Store.TaxWarehouse

ExciseAdministrativeDocument.OtherParty = StoreTransaction.ToParty

ExciseAdministrativeDocument.CurrencyDirectory = StoreTransaction.CurrencyDirectory
Note

The attributes which are not specified here are filled in as described in Standard Document Attributes

Note

The new Excise Administrative Document is saved then and only when there is at least one line in it.

Fulfillments

Name StoreTransactionLineToExciseAdministrativeDocumentLine
Parent Entity StoreTransactionLine
Child Entity ExciseAdministrativeDocumentLine
Parent / Child Relationship ExciseAdministrativeDocumentLine.ParentDocument = StoreTransaction; ExciseAdministrativeDocumentLineParentLineNo = StoreTransactionLine.LineNo

Metrics

Fulfillment Name Metric Name Measurement Unit Parent Value Child Value New Record
StoreTransactionLineToExciseAdministrativeDocumentLine MQuantityBase StoreTransactionLine.Product.BaseMeasurementUnit StoreTransactionLine.QuantityBase ExciseAdministrativeDocumentLine.QuantityBase YES
StoreTransactionLineToExciseAdministrativeDocumentLine MQuantity StoreTransactionLine.QuantityUnit StoreTransactionLine.Quantity ExciseAdministrativeDocumentLine.Quantity NO

The lines of the new document are created based on the data for the Fulfilled Part of quantities by ExciseAdministrativeDocument that are already created (for more information, see topic Discrepancy System). The new ExciseAdministrativeDocument is created as follows:

ExciseAdministrativeDocumentLine.LineNo = Autonumber

ExciseAdministrativeDocumentLine.ParentLineNo = StoreTransactionLine.LineNo

ExciseAdministrativeDocumentLine.ParentDocument = StoreTransactionLine.TransactionObj

ExciseAdministrativeDocumentLine.Product = StoreTransactionLine.Product

ExciseAdministrativeDocumentLine.Quantity = StoreTransactionLine.REMAINING(MQuantity)

ExciseAdministrativeDocumentLine.QuantityUnit = StoreTransactionLine.QuantityUnit

ExciseAdministrativeDocumentLine.QuantityBase = StoreTransactionLine.REMAINING(MQuantityBase)

ExciseAdministrativeDocumentLine.ExciseQuantityUnit = StoreTransactionLine.Product.ExciseProductType.MeasurementUnit

ExciseAdministrativeDocumentLine.ExciseQuantity = Convert(QuantityBase, ExciseQuantityUnit)

ExciseAdministrativeDocumentLine.MeasuringTransaction = StoreTransactionLine.Lot.ExciseMeasuringTransaction

ExciseAdministrativeDocumentLine.Lot = StoreTransactionLine.Lot


ExciseAdministrativeDocumentLine.ExciseAlcoholicStrength = 
IF MeasuringTransaction is not Null THEN MeasuringTransaction.AlcoholDegree
IF MeasuringTransaction is Null THEN Product.ExciseProductType.AlcoholicStrength

ExciseAdministrativeDocumentLine.ExciseProduct = StoreTransactionLine.Product.ExciseProductsType.ExciseProduct

ExciseAdministrativeDocumentLine.ExcisePurposeCode = DefaultExcisePurposeCode

ExciseAdministrativeDocumentLine.ExciseDutyRate = DetermineExciseDutyRate(ExciseProduct, ExcisePurposeCode, ExciseAdministrativeDocument.EnterpriseCompany.BaseCurrency)

ExciseAdministrativeDocumentLine.ExciseDutyRateValue = ExciseDutyRate.ExciseDutyRateField

ExciseAdministrativeDocumentLine.ExciseAmountBase = CalculateExciseAmountBase(ExciseProduct, ExciseQuantity, ExciseAlcoholicStrength)

ExciseAdministrativeDocumentLine.ExciseAmount = ExciseAmountBase * ExciseDutyRateValue
Functions:

DefaultExcisePurposeCode - return this ExcisePurposeCode which has check "Is Default" in ExcisePurposeCodes table.

https://docs.erp.net/model/entities/Finance.Excise.ExcisePurposeCodes.html

DetermineExciseDutyRate (ExciseProduct, ExcisePurposeCode, Currency) - return this ExciseDutyRate which has match with the two parameters ExciseProduct and ExcisePurposeCode in ExciseDutyRates table.

https://docs.erp.net/model/entities/Finance.Excise.ExciseDutyRates.html

CalculateExciseAmountBase(ExciseProduct, QuantityBase, ExciseAlcoholicStrength) - calculate ExciseAmountBase with ExciseProduct.ExciseProductCategory.CalculationAlgorithm and parameters Quantity и ExciseAlcoholicStrength.

https://docs.erp.net/model/entities/Finance.Excise.ExciseProductCategories.html#calculationalgorithm