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

eForms support #42

Closed
jonatanprins opened this issue Sep 27, 2021 · 9 comments
Closed

eForms support #42

jonatanprins opened this issue Sep 27, 2021 · 9 comments
Assignees
Labels

Comments

@jonatanprins
Copy link

We are working on a preliminary implementation for handling invoices based on (TED) https://github.com/OP-TED/eForms-SDK. They've built their documents on the UBL23 standard. We'd like to use ph-ubl for reading and creating of the documents.

Are there any plans to support eForms? Maybe an extra package like you have for DIAN or PE?

Regards,

@phax phax self-assigned this Sep 27, 2021
@phax phax added the question label Sep 27, 2021
@phax
Copy link
Owner

phax commented Sep 27, 2021

Hi @jonatanprins no plans so far, but that seems to be a quick win...

@jonatanprins
Copy link
Author

Hi @phax, that would definately benefit us. If it were to be added, how would this go?

@phax
Copy link
Owner

phax commented Sep 28, 2021

Well what I would do, from the top of my head, is something like this:

  • Create a new submodule
  • Integrate the custom XSDs in the pom.xml
  • Create Marshaller Wrappers like in UBL21Writer etc. based on the Jaxb created classes
  • Find test files and test
  • Document and release....

@jonatanprins
Copy link
Author

jonatanprins commented Dec 14, 2021

Alright, so we had a go at it. Ran into a some issues.

EForms has custom versions for:

  • UBL-ContractAwardNotice-2.3.xsd
  • UBL-ContractNotice-2.3.xsd
  • UBL-PriorInformationNotice-2.3.xsd

It would not generate the classes for them when it depends on ph-ubl23, so I omitted it for now and used the XSDs supplied by TED (https://github.com/OP-TED/eForms-SDK/tree/main/schemas). Browsing stackoverflow got me here: https://stackoverflow.com/questions/50176111/maven-jaxb2-plugin-reusing-commons-xsd-within-same-project.

Not sure what the way to go is here.

The other issue I ran into when running mvn clean install:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project ph-ubl23: Compilation failure [ERROR] /home/jonatan/projects/ph-ubl/ph-ubl23/target/generated-sources/ubl23/oasis/names/specification/ubl/schema/xsd/commonaggregatecomponents_23/DocumentDis tributionType.java:[800,42] incompatible types: oasis.names.specification.ubl.schema.xsd.commonaggregatecomponents_23.CommunicationType cannot be converted to oasis.names.specification.ubl.schema.xsd.commonbasiccomponents_23.ValueType

Looks like the generated code uses a CommunicationType getter where, to make it compile, it should probably use the CommunicationTypeValue getter.
When building on a Windows it does not happen for ph-ubl23, but does for ph-ubl-eforms.

I opened a PR. If you have time maybe you can have a look.

@phax
Copy link
Owner

phax commented Dec 23, 2021

@jonatanprins well, it was a bit of pain in the a but I think I finally managed to get it working.

Please see the https://github.com/phax/ph-ubl/tree/eforms branch for details.

What I did: depend on the ph-ubl23 project - that gives the most synergies and avoids "double code" generation.
The only problem: the specifically modified file https://github.com/OP-TED/eForms-SDK/blob/main/schemas/common/UBL-ExtensionContentDataType-2.3.xsd cannot be used. I found no way of "replacing" the ph-ubl23 type with this type.

What I did instead is to create a helper class EformsUBLHelper to get and set from a UBL 2.3 ExtensionContentType - I hope that works for you as well.

Merry christmas

@DKamerbeek
Copy link

Hello @phax,

First of all: thank you for your answer/fix. Hope you've had a nice christmas!

In @jonatanprins his absence.. i'm giving it a whirl (co-worker). Looks like all is compiling and running fine. The helper class will suffice for now 👍. Having some troubles with running EformsUBLFuncTest#testUpdateInstanceAndAddExtension() in intellij, but command line isn't complaining.

What to do next? how can we promote to master? which hurdles to take :)

@phax
Copy link
Owner

phax commented Dec 28, 2021

@DKamerbeek thanks for your feedback. The problem with IntelliJ is, that the base directory differs from the Eclipse one. If the base directory is set to the project directory and not src it should work.

If this suffices, I will just merge it :)

@DKamerbeek
Copy link

Yes this is fine, thanks in advance

@phax
Copy link
Owner

phax commented Dec 29, 2021

Part of the 6.7.0 release. Thanks for your contribution!

@phax phax closed this as completed Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants