Skip to content

Commit 4516aa2

Browse files
committed
Fixed MultiplierFactorNumeric; #17
1 parent edcebbc commit 4516aa2

File tree

6 files changed

+18
-21
lines changed

6 files changed

+18
-21
lines changed

en16931-cii2ubl/src/main/java/com/helger/en16931/cii2ubl/CIIToUBL21Converter.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import javax.annotation.Nonnull;
2626
import javax.annotation.Nullable;
2727

28-
import com.helger.commons.CGlobal;
2928
import com.helger.commons.ValueEnforcer;
3029
import com.helger.commons.collection.CollectionHelper;
3130
import com.helger.commons.equals.EqualsHelper;
@@ -360,8 +359,8 @@ private void _copyAllowanceCharge (@Nonnull final TradeAllowanceChargeType aAllo
360359
}
361360
if (aAllowanceCharge.getCalculationPercent () != null)
362361
{
363-
// TODO calc is correct?
364-
aUBLAllowanceCharge.setMultiplierFactorNumeric (aAllowanceCharge.getCalculationPercentValue ().divide (CGlobal.BIGDEC_100));
362+
// UBL requires values between 0 and 100
363+
aUBLAllowanceCharge.setMultiplierFactorNumeric (aAllowanceCharge.getCalculationPercentValue ());
365364
}
366365
if (aAllowanceCharge.hasActualAmountEntries ())
367366
{

en16931-cii2ubl/src/main/java/com/helger/en16931/cii2ubl/CIIToUBL22Converter.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import javax.annotation.Nonnull;
2626
import javax.annotation.Nullable;
2727

28-
import com.helger.commons.CGlobal;
2928
import com.helger.commons.ValueEnforcer;
3029
import com.helger.commons.collection.CollectionHelper;
3130
import com.helger.commons.equals.EqualsHelper;
@@ -360,8 +359,8 @@ private void _copyAllowanceCharge (@Nonnull final TradeAllowanceChargeType aAllo
360359
}
361360
if (aAllowanceCharge.getCalculationPercent () != null)
362361
{
363-
// TODO calc is correct?
364-
aUBLAllowanceCharge.setMultiplierFactorNumeric (aAllowanceCharge.getCalculationPercentValue ().divide (CGlobal.BIGDEC_100));
362+
// UBL requires values between 0 and 100
363+
aUBLAllowanceCharge.setMultiplierFactorNumeric (aAllowanceCharge.getCalculationPercentValue ());
365364
}
366365
if (aAllowanceCharge.hasActualAmountEntries ())
367366
{

en16931-cii2ubl/src/main/java/com/helger/en16931/cii2ubl/CIIToUBL23Converter.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import javax.annotation.Nonnull;
2626
import javax.annotation.Nullable;
2727

28-
import com.helger.commons.CGlobal;
2928
import com.helger.commons.ValueEnforcer;
3029
import com.helger.commons.collection.CollectionHelper;
3130
import com.helger.commons.equals.EqualsHelper;
@@ -358,8 +357,8 @@ private void _copyAllowanceCharge (@Nonnull final TradeAllowanceChargeType aAllo
358357
}
359358
if (aAllowanceCharge.getCalculationPercent () != null)
360359
{
361-
// TODO calc is correct?
362-
aUBLAllowanceCharge.setMultiplierFactorNumeric (aAllowanceCharge.getCalculationPercentValue ().divide (CGlobal.BIGDEC_100));
360+
// UBL requires values between 0 and 100
361+
aUBLAllowanceCharge.setMultiplierFactorNumeric (aAllowanceCharge.getCalculationPercentValue ());
363362
}
364363
if (aAllowanceCharge.hasActualAmountEntries ())
365364
{

en16931-cii2ubl/toubl21/CII_example5-ubl.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
202202
<cbc:AllowanceChargeReasonCode>95</cbc:AllowanceChargeReasonCode>
203203
<cbc:AllowanceChargeReason>Loyal customer</cbc:AllowanceChargeReason>
204-
<cbc:MultiplierFactorNumeric>0.1</cbc:MultiplierFactorNumeric>
204+
<cbc:MultiplierFactorNumeric>10</cbc:MultiplierFactorNumeric>
205205
<cbc:Amount currencyID="DKK">150</cbc:Amount>
206206
<cbc:BaseAmount currencyID="DKK">1500</cbc:BaseAmount>
207207
<cac:TaxCategory>
@@ -216,7 +216,7 @@
216216
<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
217217
<cbc:AllowanceChargeReasonCode>ABL</cbc:AllowanceChargeReasonCode>
218218
<cbc:AllowanceChargeReason>Packaging</cbc:AllowanceChargeReason>
219-
<cbc:MultiplierFactorNumeric>0.1</cbc:MultiplierFactorNumeric>
219+
<cbc:MultiplierFactorNumeric>10</cbc:MultiplierFactorNumeric>
220220
<cbc:Amount currencyID="DKK">150</cbc:Amount>
221221
<cbc:BaseAmount currencyID="DKK">1500</cbc:BaseAmount>
222222
<cac:TaxCategory>
@@ -284,15 +284,15 @@
284284
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
285285
<cbc:AllowanceChargeReasonCode>95</cbc:AllowanceChargeReasonCode>
286286
<cbc:AllowanceChargeReason>Loyal customer</cbc:AllowanceChargeReason>
287-
<cbc:MultiplierFactorNumeric>0.1</cbc:MultiplierFactorNumeric>
287+
<cbc:MultiplierFactorNumeric>10</cbc:MultiplierFactorNumeric>
288288
<cbc:Amount currencyID="DKK">100</cbc:Amount>
289289
<cbc:BaseAmount currencyID="DKK">1000</cbc:BaseAmount>
290290
</cac:AllowanceCharge>
291291
<cac:AllowanceCharge>
292292
<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
293293
<cbc:AllowanceChargeReasonCode>ABL</cbc:AllowanceChargeReasonCode>
294294
<cbc:AllowanceChargeReason>Packaging</cbc:AllowanceChargeReason>
295-
<cbc:MultiplierFactorNumeric>0.1</cbc:MultiplierFactorNumeric>
295+
<cbc:MultiplierFactorNumeric>10</cbc:MultiplierFactorNumeric>
296296
<cbc:Amount currencyID="DKK">100</cbc:Amount>
297297
<cbc:BaseAmount currencyID="DKK">1000</cbc:BaseAmount>
298298
</cac:AllowanceCharge>

en16931-cii2ubl/toubl22/CII_example5-ubl.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
202202
<cbc:AllowanceChargeReasonCode>95</cbc:AllowanceChargeReasonCode>
203203
<cbc:AllowanceChargeReason>Loyal customer</cbc:AllowanceChargeReason>
204-
<cbc:MultiplierFactorNumeric>0.1</cbc:MultiplierFactorNumeric>
204+
<cbc:MultiplierFactorNumeric>10</cbc:MultiplierFactorNumeric>
205205
<cbc:Amount currencyID="DKK">150</cbc:Amount>
206206
<cbc:BaseAmount currencyID="DKK">1500</cbc:BaseAmount>
207207
<cac:TaxCategory>
@@ -216,7 +216,7 @@
216216
<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
217217
<cbc:AllowanceChargeReasonCode>ABL</cbc:AllowanceChargeReasonCode>
218218
<cbc:AllowanceChargeReason>Packaging</cbc:AllowanceChargeReason>
219-
<cbc:MultiplierFactorNumeric>0.1</cbc:MultiplierFactorNumeric>
219+
<cbc:MultiplierFactorNumeric>10</cbc:MultiplierFactorNumeric>
220220
<cbc:Amount currencyID="DKK">150</cbc:Amount>
221221
<cbc:BaseAmount currencyID="DKK">1500</cbc:BaseAmount>
222222
<cac:TaxCategory>
@@ -284,15 +284,15 @@
284284
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
285285
<cbc:AllowanceChargeReasonCode>95</cbc:AllowanceChargeReasonCode>
286286
<cbc:AllowanceChargeReason>Loyal customer</cbc:AllowanceChargeReason>
287-
<cbc:MultiplierFactorNumeric>0.1</cbc:MultiplierFactorNumeric>
287+
<cbc:MultiplierFactorNumeric>10</cbc:MultiplierFactorNumeric>
288288
<cbc:Amount currencyID="DKK">100</cbc:Amount>
289289
<cbc:BaseAmount currencyID="DKK">1000</cbc:BaseAmount>
290290
</cac:AllowanceCharge>
291291
<cac:AllowanceCharge>
292292
<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
293293
<cbc:AllowanceChargeReasonCode>ABL</cbc:AllowanceChargeReasonCode>
294294
<cbc:AllowanceChargeReason>Packaging</cbc:AllowanceChargeReason>
295-
<cbc:MultiplierFactorNumeric>0.1</cbc:MultiplierFactorNumeric>
295+
<cbc:MultiplierFactorNumeric>10</cbc:MultiplierFactorNumeric>
296296
<cbc:Amount currencyID="DKK">100</cbc:Amount>
297297
<cbc:BaseAmount currencyID="DKK">1000</cbc:BaseAmount>
298298
</cac:AllowanceCharge>

en16931-cii2ubl/toubl23/CII_example5-ubl.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
202202
<cbc:AllowanceChargeReasonCode>95</cbc:AllowanceChargeReasonCode>
203203
<cbc:AllowanceChargeReason>Loyal customer</cbc:AllowanceChargeReason>
204-
<cbc:MultiplierFactorNumeric>0.1</cbc:MultiplierFactorNumeric>
204+
<cbc:MultiplierFactorNumeric>10</cbc:MultiplierFactorNumeric>
205205
<cbc:Amount currencyID="DKK">150</cbc:Amount>
206206
<cbc:BaseAmount currencyID="DKK">1500</cbc:BaseAmount>
207207
<cac:TaxCategory>
@@ -216,7 +216,7 @@
216216
<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
217217
<cbc:AllowanceChargeReasonCode>ABL</cbc:AllowanceChargeReasonCode>
218218
<cbc:AllowanceChargeReason>Packaging</cbc:AllowanceChargeReason>
219-
<cbc:MultiplierFactorNumeric>0.1</cbc:MultiplierFactorNumeric>
219+
<cbc:MultiplierFactorNumeric>10</cbc:MultiplierFactorNumeric>
220220
<cbc:Amount currencyID="DKK">150</cbc:Amount>
221221
<cbc:BaseAmount currencyID="DKK">1500</cbc:BaseAmount>
222222
<cac:TaxCategory>
@@ -284,15 +284,15 @@
284284
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
285285
<cbc:AllowanceChargeReasonCode>95</cbc:AllowanceChargeReasonCode>
286286
<cbc:AllowanceChargeReason>Loyal customer</cbc:AllowanceChargeReason>
287-
<cbc:MultiplierFactorNumeric>0.1</cbc:MultiplierFactorNumeric>
287+
<cbc:MultiplierFactorNumeric>10</cbc:MultiplierFactorNumeric>
288288
<cbc:Amount currencyID="DKK">100</cbc:Amount>
289289
<cbc:BaseAmount currencyID="DKK">1000</cbc:BaseAmount>
290290
</cac:AllowanceCharge>
291291
<cac:AllowanceCharge>
292292
<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
293293
<cbc:AllowanceChargeReasonCode>ABL</cbc:AllowanceChargeReasonCode>
294294
<cbc:AllowanceChargeReason>Packaging</cbc:AllowanceChargeReason>
295-
<cbc:MultiplierFactorNumeric>0.1</cbc:MultiplierFactorNumeric>
295+
<cbc:MultiplierFactorNumeric>10</cbc:MultiplierFactorNumeric>
296296
<cbc:Amount currencyID="DKK">100</cbc:Amount>
297297
<cbc:BaseAmount currencyID="DKK">1000</cbc:BaseAmount>
298298
</cac:AllowanceCharge>

0 commit comments

Comments
 (0)