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

ExtendedQuantityCode to use Codes which are not definded in default Q… #493

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vissers-dev
Copy link
Contributor

Hi Stefan,

First of all, thank you for your awesome solution! We’ve been using it and are very happy with how it works.

One of our customers, however, requires some units that aren’t defined in QuantityUnitCodes. Extending the existing codes doesn’t seem practical, as it could turn into a never-ending story.

To address this, I’ve introduced the ExtendedQuantityCode property. This property can store either a default code or a custom code, giving us the flexibility to handle unique cases without modifying the predefined list.

How It Works
Now, LineItem includes both UnitCode and ExtendedUnitCode. The writer will prioritize ExtendedUnitCode and fall back to the default UnitCode if no custom value is provided.

Here’s how you can use it:

tradeLineItem.UnitCode = quantityCode;
// or
// Override with a Custom Unit
tradeLineItem.ExtendedUnitCode = new ExtendedQuantityCode("INH");
// or us default code from enum
tradeLineItem.ExtendedUnitCode = new ExtendedQuantityCode(tradeLineItem.UnitCode);

To retrieve the code:
var code = tradeLineItem.ExtendedUnitCode?.ToString();

I hope everything is correct...

@stephanstapel
Copy link
Owner

thanks @vissers-dev ,
thanks for the idea. I will consider it.

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

Successfully merging this pull request may close these issues.

2 participants