@@ -975,20 +975,20 @@ public Ebi41InvoiceType convertToEbInterface (@NonNull final CreditNoteType aUBL
975975 final Ebi41ReductionAndSurchargeBaseType aEbiRSItem = new Ebi41ReductionAndSurchargeBaseType ();
976976 // Amount is mandatory
977977 final BigDecimal aAmount = aUBLAllowanceCharge .getAmountValue ();
978- aEbiRSItem .setAmount (bSwapSigns ? aAmount .negate () : aAmount );
978+ aEbiRSItem .setAmount (( bSwapSigns ? aAmount .negate () : aAmount ). setScale ( SCALE_PRICE2 , ROUNDING_MODE ) );
979979
980980 // Base amount is optional
981981 if (aUBLAllowanceCharge .getBaseAmount () != null )
982- aEbiRSItem .setBaseAmount (aUBLAllowanceCharge .getBaseAmountValue ());
982+ aEbiRSItem .setBaseAmount (aUBLAllowanceCharge .getBaseAmountValue (). setScale ( SCALE_PRICE2 , ROUNDING_MODE ) );
983983 if (aEbiRSItem .getBaseAmount () == null )
984- aEbiRSItem .setBaseAmount (aEbiBaseAmount );
984+ aEbiRSItem .setBaseAmount (aEbiBaseAmount . setScale ( SCALE_PRICE2 , ROUNDING_MODE ) );
985985
986986 if (aUBLAllowanceCharge .getMultiplierFactorNumeric () != null )
987987 {
988988 // Percentage is optional
989989 final BigDecimal aPerc = aUBLAllowanceCharge .getMultiplierFactorNumericValue ()
990990 .multiply (CGlobal .BIGDEC_100 );
991- aEbiRSItem .setPercentage (aPerc );
991+ aEbiRSItem .setPercentage (aPerc . setScale ( SCALE_PERC , ROUNDING_MODE ) );
992992 }
993993
994994 if (eSurcharge .isTrue ())
@@ -1086,19 +1086,19 @@ public Ebi41InvoiceType convertToEbInterface (@NonNull final CreditNoteType aUBL
10861086 final Ebi41ReductionAndSurchargeType aEbiRSItem = new Ebi41ReductionAndSurchargeType ();
10871087 // Amount is mandatory
10881088 final BigDecimal aAmount = aUBLAllowanceCharge .getAmountValue ();
1089- aEbiRSItem .setAmount (aAmount );
1089+ aEbiRSItem .setAmount (aAmount . setScale ( SCALE_PRICE2 , ROUNDING_MODE ) );
10901090
10911091 // Base amount is optional
10921092 if (aUBLAllowanceCharge .getBaseAmount () != null )
1093- aEbiRSItem .setBaseAmount (aUBLAllowanceCharge .getBaseAmountValue ());
1093+ aEbiRSItem .setBaseAmount (aUBLAllowanceCharge .getBaseAmountValue (). setScale ( SCALE_PRICE2 , ROUNDING_MODE ) );
10941094 if (aEbiRSItem .getBaseAmount () == null )
1095- aEbiRSItem .setBaseAmount (aEbiBaseAmount );
1095+ aEbiRSItem .setBaseAmount (aEbiBaseAmount . setScale ( SCALE_PRICE2 , ROUNDING_MODE ) );
10961096
10971097 if (aUBLAllowanceCharge .getMultiplierFactorNumeric () != null )
10981098 {
10991099 // Percentage is optional
11001100 final BigDecimal aPerc = aUBLAllowanceCharge .getMultiplierFactorNumericValue ().multiply (CGlobal .BIGDEC_100 );
1101- aEbiRSItem .setPercentage (aPerc );
1101+ aEbiRSItem .setPercentage (aPerc . setScale ( SCALE_PERC , ROUNDING_MODE ) );
11021102 }
11031103
11041104 aEbiRSItem .setComment (getAllowanceChargeComment (aUBLAllowanceCharge ));
0 commit comments