use of org.folio.rest.jaxrs.model.jaxb.AdjustmentLineType in project mod-invoice by folio-org.
the class BatchedVoucherModelConverter method convertAdjustmentsLines.
private BatchedVoucherType.Adjustments convertAdjustmentsLines(BatchedVoucher batchedVoucher) {
BatchedVoucherType.Adjustments adjustments = new BatchedVoucherType.Adjustments();
List<AdjustmentLineType> adjustmentsList = new ArrayList<>();
for (Adjustment adjustment : batchedVoucher.getAdjustments()) {
AdjustmentLineType normalizedAdjustment = new AdjustmentLineType();
normalizedAdjustment.setDescription(adjustment.getDescription());
normalizedAdjustment.setRelationToTotal(adjustment.getRelationToTotal().value());
normalizedAdjustment.setProrate(adjustment.getProrate().value());
normalizedAdjustment.setType(adjustment.getType().value());
normalizedAdjustment.setValue(adjustment.getValue());
normalizedAdjustment.setTotalAmount(adjustment.getTotalAmount());
adjustmentsList.add(normalizedAdjustment);
}
adjustments.withAdjustment(adjustmentsList);
return adjustments;
}
Aggregations