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

ZUGFeRDInvoiceImporter: Item-Allowances not imported #651

Open
danl-devp opened this issue Jan 8, 2025 · 0 comments
Open

ZUGFeRDInvoiceImporter: Item-Allowances not imported #651

danl-devp opened this issue Jan 8, 2025 · 0 comments

Comments

@danl-devp
Copy link

Allowances for Items are not available after Import.

Steps:

1. Export Invoice

                Invoice invoiceOut = new Invoice();

                [...]

		Item itemOut = new Item();
                [...]
		itemOut.addAllowance(new Allowance(BigDecimal.valueOf(123)));

		var zf2p = new ZUGFeRD2PullProvider();
		zf2p.setProfile(Profiles.getByName("XRechnung"));
		zf2p.generateXML(invoiceOut);
		byte[] xml = zf2p.getXML();

2. Import from xml

                ZUGFeRDInvoiceImporter importer = new ZUGFeRDInvoiceImporter();
		importer.fromXML(new String(xml));

		Invoice invoiceIn = importer.extractInvoice();

		for (var itemIn : invoiceIn.getZFItems())
		{
			IZUGFeRDAllowanceCharge[] itemAllowances = itemIn.getItemAllowances();
			assert itemAllowances.length > 0;
		}
  • The data for Allowances is stored in Xml-Element GrossPriceProductTradePrice.
  • The class responsible for importing an item is org.mustangproject.Item.
  • During the import process this Xml-Element is not considered.
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