Package no.sws.invoice.line

Examples of no.sws.invoice.line.InvoiceLine


      final List<InvoiceLine> invoiceLines = new LinkedList<InvoiceLine>();

      for(final Element currentLineElement : lineElements) {

        // create invoice line
        final InvoiceLine invoiceLine = InvoiceLineFactory.getInstance();

        // get elements value
        final String qty = getElementValue(currentLineElement, "qty", false);
        final String unitPrice = getElementValue(currentLineElement, "unitPrice", false);
        final String discount = getElementValue(currentLineElement, "discount", false);
        final String tax = getElementValue(currentLineElement, "tax", false);
        final String lineTaxAmount = getElementValue(currentLineElement, "lineTaxAmount", false);
        final String lineTotal = getElementValue(currentLineElement, "lineTotal", false);

        // itemNo (required)
        invoiceLine.setItemNo(Integer.parseInt(getElementValue(currentLineElement, "itemNo", true)));

        // qty
        if(qty != null && qty.trim().length() > 0) {
          invoiceLine.setQty(new BigDecimal(qty));
        }

        // prodCode
        invoiceLine.setProdCode(getElementValue(currentLineElement, "prodCode", false));

        // desc
        invoiceLine.setDesc(getElementValue(currentLineElement, "desc", false));

        // unitPrice
        if(unitPrice != null && unitPrice.trim().length() > 0) {
          invoiceLine.setUnitPrice(new BigDecimal(unitPrice));
        }

        // discount
        if(discount != null && discount.trim().length() > 0) {
          invoiceLine.setDiscount(new BigDecimal(discount));
        }

        // tax
        if(tax != null && tax.trim().length() > 0) {
          invoiceLine.setTax(Integer.parseInt(tax));
        }

        // lineTaxAmount
        if(lineTaxAmount != null && lineTaxAmount.trim().length() > 0) {
          invoiceLine.setLineTaxAmount(new BigDecimal(lineTaxAmount));
        }

        // lineTotal
        if(lineTotal != null && lineTotal.trim().length() > 0) {
          invoiceLine.setLineTotal(new BigDecimal(lineTotal));
        }

        invoiceLines.add(invoiceLine);
      }
View Full Code Here


    if(this.invoiceLines.size() >= SwsClient.MAX_NO_OF_INVOICE_LINES) {
      throw new SwsTooManyInvoiceLinesException(this);
    }

    final InvoiceLine invoiceLine = InvoiceLineFactory.getInstance();
    invoiceLine.setQty(qty);
    invoiceLine.setDesc(desc);
    invoiceLine.setUnitPrice(unitPrice);

    this.invoiceLines.add(invoiceLine);
  }
View Full Code Here

TOP

Related Classes of no.sws.invoice.line.InvoiceLine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.