/** * Converts the instance of SuretaxResponse object into tax lines. * * @param suretaxResponse * @param order * @return */ private List<InvoiceLineDTO> getTaxLines(SuretaxResponse suretaxResponse, OrderDTO order) { List<InvoiceLineDTO> taxLines = new ArrayList<InvoiceLineDTO>(); if (suretaxResponse.successful.equals("Y")) { for (Group group : suretaxResponse.groupList) { for (TaxItem taxItem : group.taxList) { InvoiceLineDTO invoiceLineDTO = new InvoiceLineDTO(); invoiceLineDTO.setAmount(new BigDecimal(taxItem.taxAmount)); invoiceLineDTO.setDescription(taxItem.taxTypeCode + ":" + taxItem.taxTypeDesc); invoiceLineDTO.setInvoiceLineType( new InvoiceLineTypeDTO(ServerConstants.INVOICE_LINE_TYPE_TAX)); invoiceLineDTO.setIsPercentage(null); invoiceLineDTO.setOrder(order); invoiceLineDTO.setPrice(new BigDecimal(taxItem.taxAmount)); invoiceLineDTO.setQuantity(1); taxLines.add(invoiceLineDTO); } } } return taxLines; }