phax / en16931-cii2ubl

Converter for EN16931 invoices from CII to UBL
Apache License 2.0
20 stars 6 forks source link

Bad convertion CalculationPercent to SpecifiedTradeAllowanceCharge #17

Closed L3Mars closed 2 years ago

L3Mars commented 2 years ago

Hello Philip,

I'm using your CIIToUBL converter and it looks like there is a problem converting the CalculationPercent to MultiplierFactorNumeric.

    if (aAllowanceCharge.getCalculationPercent () != null)
    {
      // TODO calc is correct?
      aUBLAllowanceCharge.setMultiplierFactorNumeric (aAllowanceCharge.getCalculationPercentValue ().divide (CGlobal.BIGDEC_100));
    }

I think CalculationPercent should not be divided by 100

You can see the documentation of MultiplierFactorNumeric here

MultiplierFactorNumeric Line level allowance or charge percentage The percentage that may be used, in conjunction with the line level allowance base amount, to calculate the line level allowance or charge amount. Example value: 20

PS: Thank you very much for all your work :)

phax commented 2 years ago

Hi @L3Mars thanks for pointing that out. I can confirm that the value range for MultiplierFactorNumeric is between 0 and 100.

phax commented 2 years ago

Will be part of the 1.4.9 release

L3Mars commented 2 years ago

@phax thank you for your promt response, it works perfectly.