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

[BUG] ZugferdSettings::addSpecialDecimalPlacesMap doesn't work for BasisPeriodMeasure #169

Closed
stiefelsalat opened this issue Nov 15, 2024 · 2 comments · Fixed by #170
Closed
Assignees

Comments

@stiefelsalat
Copy link

stiefelsalat commented Nov 15, 2024

By setting ZugferdSettings::addSpecialDecimalPlacesMap('/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:ApplicableTradePaymentDiscountTerms/ram:BasisPeriodMeasure',0);
I still get an result like <ram:BasisPeriodMeasure unitCode="DAY">14.0</ram:BasisPeriodMeasure>

I can't validate my invoices with an BasisPeriodMeasure having decimals.
The function ZugferdSettings::addSpecialDecimalPlacesMap() works fine on different fields, but somehow not on the BasisPeriodMeasure

Sample code:
ZugferdSettings::addSpecialDecimalPlacesMap('/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:ApplicableTradePaymentDiscountTerms/ram:BasisPeriodMeasure',0);
$document = ZugferdDocumentBuilder::CreateNew(ZugferdProfiles::PROFILE_EXTENDED);
$document->addDocumentPaymentTerm("Fälligkeitsdatum: 05.12.24 ; Skonto 3% bis zum 19.11.24",\DateTime::createFromFormat("d.m.y", "19.11.24"))
->addDiscountTermsToPaymentTerms(3,\DateTime::createFromFormat("d.m.y", "05.11.24"), 14, "DAY",2123.53,63.71)

@stiefelsalat stiefelsalat added the bug Something isn't working label Nov 15, 2024
@horstoeko
Copy link
Owner

Good evening @stiefelsalat,

First of all: I'm used to opening an issue with a friendly “hello” or “good afternoon” or “good evening”.

Next: Please formulate your request with sufficient information and don't just blurt out your “problem”.

I am more than happy to deal with your request, but I am not in a position to help you in the form you have presented it.

Kind regards

Repository owner locked and limited conversation to collaborators Nov 15, 2024
@horstoeko horstoeko removed the bug Something isn't working label Nov 15, 2024
Repository owner unlocked this conversation Nov 16, 2024
@horstoeko horstoeko reopened this Nov 16, 2024
horstoeko pushed a commit that referenced this issue Nov 16, 2024
horstoeko added a commit that referenced this issue Nov 16, 2024
#169 Handle Decimals of the measure type
@horstoeko
Copy link
Owner

Good morning @stiefelsalat,

The problem has been solved. The measure type must be considered and dealt with separately. I had to implement a separate handler for this type with a separate decimal place property in the ZugferdSettings. You can do the following (with the next release):

ZugferdSettings::setMeasureDecimals(0);

or (for example):

ZugferdSettings::addSpecialDecimalPlacesMap('/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradePaymentTerms/ram:ApplicableTradePaymentDiscountTerms/ram:BasisPeriodMeasure', 0);

I hope this helps you.

Kind regards

Repository owner locked as resolved and limited conversation to collaborators Nov 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants