closes #788
This commit is contained in:
@@ -7,6 +7,7 @@ import java.math.RoundingMode;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@@ -65,6 +66,24 @@ public class TransactionCalculator implements IAbsoluteValueProvider {
|
||||
return sumAllowanceCharge(percent, charges);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns information about every tax that is involved in the current transaction.
|
||||
*
|
||||
* @return transaction taxes.
|
||||
*/
|
||||
public Set<VATAmount> getTaxDetails() {
|
||||
return getVATPercentAmountMap().entrySet().stream()
|
||||
.map(entry ->
|
||||
new VATAmount(
|
||||
entry.getValue().getBasis(),
|
||||
entry.getValue().getCalculated(),
|
||||
entry.getValue().getCategoryCode()
|
||||
).setCalculated(entry.getKey())
|
||||
)
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
private BigDecimal sumAllowanceCharge(BigDecimal percent, IZUGFeRDAllowanceCharge[] charges) {
|
||||
BigDecimal res = BigDecimal.ZERO;
|
||||
if ((charges != null) && (charges.length > 0)) {
|
||||
|
||||
Reference in New Issue
Block a user