Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CII Example with Allowances is hard to parse in Mustang-Server #619

Open
PhilippGoetje opened this issue Dec 19, 2024 · 0 comments
Open

Comments

@PhilippGoetje
Copy link

Hey,

when reading the following example CII file in Ninox (Mustang-Server), I get a JSON that is hard to process afterwards.
https://github.com/ConnectingEurope/eInvoicing-EN16931/blob/master/cii/examples/CII_example2.xml

The lines with ram:AppliedTradeAllowanceCharge is seemingly not parsed, yet I do not know if it is even valid syntax.
The lines with ram:SpecifiedTradeAllowanceCharge are parsed, but sent back on the document level "zfallowances" and "zfcharges". While this would be okish from a mapping point of view, the arrays only have two items each and there is no indication, which item of the returned arrays is corresponding to which zfitems item. A correct parsing in the downstream process is simply not possible, as far as I can tell.

Here is the returned JSON, as recieved from the mustang server:

{
	"documentCode": "380",
	"number": "TOSL108",
	"buyerOrderReferencedDocumentID": "123",
	"ownOrganisationName": "Salescompany ltd.",
	"currency": "NOK",
	"issueDate": "2013-06-30T00:00:00.000+00:00",
	"dueDate": "2013-07-20T00:00:00.000+00:00",
	"deliveryDate": "2013-06-15T00:00:00.000+00:00",
	"sender": {
		"name": "Salescompany ltd.",
		"zip": "303",
		"street": "Main street 34",
		"location": "Big city",
		"country": "NO",
		"vatID": "NO123456789MVA",
		"additionalAddress": "Suite 123",
		"bankDetails": [
			{
				"bic": "DNBANOKK",
				"iban": "NO9386011117947"
			},
			{
				"iban": "NO9386011117947"
			}
		],
		"contact": {
			"name": "Antonio Salesmacher",
			"phone": "46211230",
			"email": "antonio@salescompany.no"
		},
		"vatid": "NO123456789MVA",
		"legalOrganisation": {},
		"globalID": "1238764941386",
		"globalIDScheme": "0088"
	},
	"recipient": {
		"name": "The Buyercompany",
		"zip": "101",
		"street": "Anystreet 8",
		"location": "Anytown",
		"country": "NO",
		"vatID": "NO987654321MVA",
		"additionalAddress": "Back door",
		"contact": {
			"name": "John Doe",
			"phone": "5121230",
			"email": "john@buyercompany.no"
		},
		"vatid": "NO987654321MVA",
		"legalOrganisation": {},
		"globalID": "3456789012098",
		"globalIDScheme": "0088"
	},
	"deliveryAddress": {
		"zip": "523427",
		"street": "Deliverystreet 2",
		"location": "DeliveryCity",
		"country": "NO",
		"additionalAddress": "Side door",
		"globalID": "6754238987643",
		"globalIDScheme": "0088"
	},
	"payee": {
		"name": "Ebeneser Scrooge AS",
		"id": "2298740918237",
		"legalOrganisation": {}
	},
	"totalPrepaidAmount": 1000,
	"lineTotalAmount": 1436.5,
	"duePayable": 801.78,
	"grandTotal": 1801.78,
	"taxBasis": 1436.5,
	"valid": false,
	"detailedDeliveryPeriodTo": "2013-06-30T00:00:00.000+00:00",
	"detailedDeliveryPeriodFrom": "2013-06-01T00:00:00.000+00:00",
	"zfallowances": [
		{
			"totalAmount": 12,
			"reason": "Damage",
			"categoryCode": "S"
		},
		{
			"totalAmount": 100,
			"taxPercent": 25,
			"reason": "Promotion discount",
			"reasonCode": "95",
			"categoryCode": "S"
		}
	],
	"zfcharges": [
		{
			"totalAmount": 12,
			"reason": "Testing",
			"categoryCode": "S"
		},
		{
			"totalAmount": 100,
			"taxPercent": 25,
			"reason": "Freight",
			"categoryCode": "S"
		}
	],
	"zfitems": [
		{
			"price": 1273,
			"quantity": 1,
			"basisQuantity": 1273,
			"id": "1",
			"product": {
				"unit": "NAR",
				"name": "Laptop computer",
				"sellerAssignedID": "JB007",
				"description": "Processor: Intel Core 2 Duo SU9400 LV (1.4GHz). RAM: 3MB. Screen 1440x900",
				"taxCategoryCode": "S",
				"attributes": {
					"Color": "Black"
				},
				"classifications": [
					{
						"classCode": {
							"listID": "STI",
							"code": "65434568"
						}
					}
				],
				"vatpercent": 25,
				"reverseCharge": false,
				"intraCommunitySupply": false,
				"globalID": "1234567890128",
				"globalIDScheme": "0088"
			},
			"buyerOrderReferencedDocumentLineID": "1",
			"value": 1273
		},
		{
			"price": 3.96,
			"quantity": -1,
			"basisQuantity": 3.96,
			"id": "2",
			"product": {
				"unit": "NAR",
				"name": "Returned \"Advanced computing\" book",
				"sellerAssignedID": "JB008",
				"taxCategoryCode": "S",
				"classifications": [
					{
						"classCode": {
							"listID": "STI",
							"code": "65434567"
						}
					}
				],
				"vatpercent": 15,
				"reverseCharge": false,
				"intraCommunitySupply": false,
				"globalID": "1234567890135",
				"globalIDScheme": "0088"
			},
			"buyerOrderReferencedDocumentLineID": "5",
			"value": 3.96
		},
		{
			"price": 2.48,
			"quantity": 2,
			"basisQuantity": 2.48,
			"id": "3",
			"product": {
				"unit": "NAR",
				"name": "\"Computing for dummies\" book",
				"sellerAssignedID": "JB009",
				"taxCategoryCode": "S",
				"classifications": [
					{
						"classCode": {
							"listID": "STI",
							"code": "65434566"
						}
					}
				],
				"vatpercent": 15,
				"reverseCharge": false,
				"intraCommunitySupply": false,
				"globalID": "1234567890142",
				"globalIDScheme": "0088"
			},
			"buyerOrderReferencedDocumentLineID": "3",
			"value": 2.48
		},
		{
			"price": 25,
			"quantity": -1,
			"basisQuantity": 25,
			"id": "4",
			"product": {
				"unit": "NAR",
				"name": "Returned IBM 5150 desktop",
				"sellerAssignedID": "JB010",
				"taxCategoryCode": "Z",
				"classifications": [
					{
						"classCode": {
							"listID": "STI",
							"code": "65434565"
						}
					}
				],
				"vatpercent": 0,
				"reverseCharge": false,
				"intraCommunitySupply": false,
				"globalID": "1234567890159",
				"globalIDScheme": "0088"
			},
			"buyerOrderReferencedDocumentLineID": "2",
			"value": 25
		},
		{
			"price": 0.75,
			"quantity": 250,
			"basisQuantity": 0.75,
			"id": "5",
			"product": {
				"unit": "MTR",
				"name": "Network cable",
				"sellerAssignedID": "JB011",
				"taxCategoryCode": "S",
				"attributes": {
					"Type": "Cat5"
				},
				"classifications": [
					{
						"classCode": {
							"listID": "STI",
							"code": "12344325"
						}
					}
				],
				"vatpercent": 25,
				"reverseCharge": false,
				"intraCommunitySupply": false,
				"globalID": "1234567890166",
				"globalIDScheme": "0088"
			},
			"buyerOrderReferencedDocumentLineID": "4",
			"value": 0.75
		}
	],
	"tradeSettlement": [
		{
			"bic": "DNBANOKK",
			"iban": "NO9386011117947"
		},
		{
			"iban": "NO9386011117947"
		}
	],
	"ownVATID": "NO123456789MVA",
	"ownStreet": "Main street 34",
	"ownZIP": "303",
	"ownLocation": "Big city",
	"ownCountry": "NO",
	"notesWithSubjectCode": [
		{
			"content": "Ordered in our booth at the convention"
		}
	]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant