Expenses Classification (whole Invoice)
This case scenario is for Sending cases that the user does not and/or is
not able to find the exact lines of the invoice.
This scenario also applies to users that insert the invoice lines into their
accountant books differently than the way the invoice has been sent to
myDATA.
For this sample, we will use this case scenario.
We have an invoice that the issuer has sent it to myDATA as following:
myDATA Invoice
Line Number | VAT% | Net Value | VAT Amount |
---|---|---|---|
1 | 24% | 100,00€ | 24,00€ |
2 | 24% | 120,00€ | 28,80€ |
3 | 24% | 80,00€ | 19,20€ |
So, the issuer has sent to myDATA the invoice without merging the Amount
and VAT Amount according to VAT%.
However, the end user inserted the following data into his application:
User's Insert
VAT% | Net Value | VAT Amount |
---|---|---|
24% | 300,00 | 72,00€ |
Knowing only the user's insert, it's imposible to send classifications line by line, because:
- You don't know how many lines have been sent to myDATA
- Even if you know how many lines have been sent to myDATA, it's impossible to know the exact values of each line.
CODE SAMPLE 1 - For multiple Invoices:
var cls = new SendClassifications("AADEUserID", "OcpApimSubscriptionKey", "ExecuteEntityVatNumber", "Arbitrans User", "Arbitrans Key", false); var classif = new Dictionary<string, List<SendClassifications.classifications>>(); // initialize a new dictionary for invoice classifications var clsList = new List<classifications>(); // Create a new List(Of classifications) classifications clsLine = cls.newClassification; // create a new classification clsLine.lineNumber = 1; // In this scenario, the line number is demanding but it is not used by AADE. clsLine.classificationType = ""; // This field refers to the E3 code clsLine.classificationCategory = "category2_95"; clsLine.amount = 300; clsLine.VatCategory = "VAT_361"; clsLine.VatCategoryShort = 1; // The VAT Rate (1, 2, 3, 4, 5, 6) clsLine.VatAmount = 72; // the VAT amount corresponding to the VAT category clsList.Add(clsLine); // add the ivnoice classification into the list classif.Add("400000000000001", clsList); // add the invoice classification list into the list. Replace the 'invoiceMark' with the mark of your invoice // Add more classifications into the classif List to send multiple invoice classifications // Sending Classifications. If everything's fine, you'll get back the Classification MARK. // Otherwise, you'll get back the errors so you can handle them properly. SortedDictionary<string, object> result = cls.Send(classif, false, true);
This language is not supported or no code example is available.
Dim cls As SendClassifications = New SendClassifications("AADEUserID", "OcpApimSubscriptionKey", "ExecuteEntityVatNumber", "Arbitrans User", "Arbitrans Key", False) Dim classif As New Dictionary(Of String, List(Of SendClassifications.classifications)) 'initialize a new dictionary for invoice classifications Dim clsList As New List(Of classifications) 'Create a new List(Of classifications) Dim clsLine As classifications = cls.newClassification 'create a new classification clsLine.lineNumber = 1 'In this scenario, the line number is demanding but it is not used by AADE. clsLine.classificationType = "" ' This field refers to the E3 code clsLine.classificationCategory = "category2_95" clsLine.amount = 300 clsLine.VatCategory = "VAT_361" clsLine.VatCategoryShort = 1 'The VAT Rate (1, 2, 3, 4, 5, 6) clsLine.VatAmount = 72 'the VAT amount corresponding to the VAT category clsList.Add(clsLine) 'add the ivnoice classification into the list classif.Add("400000000000001", clsList) 'add the invoice classification list into the list. Replace the 'invoiceMark' with the mark of your invoice ' Add more classifications into the classif List to send multiple invoice classifications ' Sending Classifications. If everything's fine, you'll get back the Classification MARK. ' Otherwise, you'll get back the errors so you can handle them properly. Dim result As SortedDictionary(Of String, Object) = cls.Send(classif, False, True)
This language is not supported or no code example is available.
CODE SAMPLE 2 - For one invoice:
var cls = new SendClassifications("AADEUserID", "OcpApimSubscriptionKey", "ExecuteEntityVatNumber", "Arbitrans User", "Arbitrans Key", false); var clsList = new List<classifications>(); // Create a new List(Of classifications) classifications clsLine = cls.newClassification; // create a new classification clsLine.lineNumber = 1; // In this scenario, the line number is demanding but it is not used by AADE. clsLine.classificationType = ""; // This field refers to the E3 code clsLine.classificationCategory = "category2_95"; clsLine.amount = 300; clsLine.VatCategory = "VAT_361"; clsLine.VatCategoryShort = 1; // The VAT Rate (1, 2, 3, 4, 5, 6) clsLine.VatAmount = 72; // the VAT amount corresponding to the VAT category clsList.Add(clsLine); // add the ivnoice classification into the list // Sending Classifications. If everything's fine, you'll get back the Classification MARK. // Otherwise, you'll get back the errors so you can handle them properly. string result = cls.Send("400000000000001", clsList, false, true);
This language is not supported or no code example is available.
Dim cls As SendClassifications = New SendClassifications("AADEUserID", "OcpApimSubscriptionKey", "ExecuteEntityVatNumber", "Arbitrans User", "Arbitrans Key", False) Dim clsList As New List(Of classifications) 'Create a new List(Of classifications) Dim clsLine As classifications = cls.newClassification 'create a new classification clsLine.lineNumber = 1 'In this scenario, the line number is demanding but it is not used by AADE. clsLine.classificationType = "" ' This field refers to the E3 code clsLine.classificationCategory = "category2_95" clsLine.amount = 300 clsLine.VatCategory = "VAT_361" clsLine.VatCategoryShort = 1 'The VAT Rate (1, 2, 3, 4, 5, 6) clsLine.VatAmount = 72 'the VAT amount corresponding to the VAT category clsList.Add(clsLine) 'add the ivnoice classification into the list ' Sending Classifications. If everything's fine, you'll get back the Classification MARK. ' Otherwise, you'll get back the errors so you can handle them properly. Dim result As String = cls.Send("400000000000001", clsList, False, True)
This language is not supported or no code example is available.
Important: When the classificationCategory is category2_5, you must use the Gross Value as an amount and leave the classifications.VatCategory blank.
See the SendClassification class