Пример #1
0
  public TicketTaxInfo getTaxLine(TaxInfo tax) {

    for (TicketTaxInfo taxline : taxes) {
      if (tax.getId().equals(taxline.getTaxInfo().getId())) {
        return taxline;
      }
    }

    return new TicketTaxInfo(tax);
  }
Пример #2
0
  public TicketTaxInfo[] getTaxLines() {

    Map<String, TicketTaxInfo> m = new HashMap<String, TicketTaxInfo>();

    TicketLineInfo oLine;
    for (Iterator<TicketLineInfo> i = m_aLines.iterator(); i.hasNext(); ) {
      oLine = i.next();

      TicketTaxInfo t = m.get(oLine.getTaxInfo().getId());
      if (t == null) {
        t = new TicketTaxInfo(oLine.getTaxInfo());
        m.put(t.getTaxInfo().getId(), t);
      }
      t.add(oLine.getSubValue());
    }

    // return dSuma;
    Collection<TicketTaxInfo> avalues = m.values();
    return avalues.toArray(new TicketTaxInfo[avalues.size()]);
  }