R28953 BGVATDeclaration - Correct VAT Codes Of All Entries

Code R28953
Entity Finance.Vat.BGVATDeclarations Entity
Name CorrectVATCodesOfAllEntries
Attribute -
Layer Back-End
Events Releasing +
Priority Normal
Modify NO
Action Validate that:

if (VATPeriodStart < 2014/01/01)

for each Entries[ApplyDate <=BGVATDeclaration.VATPeriodEnd; ApplyDate >= BGVATDeclaration.VATPeriodStart; Entry.Void = False; Entry.State >= 30; EnterpriseCompany = BGVATDeclaration.EnterpriseCompany; BGVATPeriodStart < 2014/01/01].ReferencedDocumentType:

BGVATDocumentTypeVATCode[DocumentType = ReferencedDocumentType && VATCode != null].Count() == 1

else

for each Entries[ApplyDate <=BGVATDeclaration.VATPeriodEnd; ApplyDate >= BGVATDeclaration.VATPeriodStart; Entry.Void = False; Entry.State >= 30; EnterpriseCompany = BGVATDeclaration.EnterpriseCompany; CashReportingMode = False].ReferencedDocumentType:

BGVATDocumentTypeVATCode[DocumentType = ReferencedDocumentType && VATCode != null ].Count() == 1

&&

for each Entries[ApplyDate <=BGVATDeclaration.VATPeriodEnd; ApplyDate >= BGVATDeclaration.VATPeriodStart; Entry.Void = False; Entry.State >= 30; EnterpriseCompany = BGVATDeclaration.EnterpriseCompany; CashReportingMode = True].ReferencedDocumentType:

BGVATDocumentTypeVATCode[DocumentType = ReferencedDocumentType && CashReportingVATCode != null].Count() == 1
Description

VAT codes are used when creating VAT export files for the specified Document Type. The VAT codes are required by the government and their values are government-regulated. The declarations which are submitted in the National Revenue Agency must contain entries with specified VAT codes and a specified VAT code is as follows:

  • if the start period of the BGVATDeclaration is before 01 Jan 2014 , then the document type (referenced by the VAT entry) must have record in Document Type VAT Codes table with VAT Code attribute specified.
  • if the start period of the BGVATDeclaration is after 01 Jan 2014  and the Cash Reporting Mode of the entry is not checked (false), then the document type (referenced by the VAT entry) must have record in Document Type VAT Codes table with VAT Code attribute specified.
  • if the start period of the BGVATDeclaration is after 01 Jan 2014  and the Cash Reporting Mode of the entry is checked (true), then the document type (referenced by the VAT entry) must have record in Document Type VAT Codes table with Cash Reporting VAT Code attribute specified.
Message VAT codes for document types '{list ot ReferencedDocumentType.TypeName; comma separated}' are not specified.
Introduced In Version
Revocable NO

* For more information about the Business Rules Documentation Template and a short explanation of each column, see topic System Business Rules.