Search in sources :

Example 1 with AdjustmentLineType

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;
}
Also used : Adjustment(org.folio.rest.jaxrs.model.Adjustment) ArrayList(java.util.ArrayList) BatchedVoucherType(org.folio.rest.jaxrs.model.jaxb.BatchedVoucherType) AdjustmentLineType(org.folio.rest.jaxrs.model.jaxb.AdjustmentLineType)

Aggregations

ArrayList (java.util.ArrayList)1 Adjustment (org.folio.rest.jaxrs.model.Adjustment)1 AdjustmentLineType (org.folio.rest.jaxrs.model.jaxb.AdjustmentLineType)1 BatchedVoucherType (org.folio.rest.jaxrs.model.jaxb.BatchedVoucherType)1