Package com.centraview.account.invoice

Examples of com.centraview.account.invoice.InvoiceList


   */
  public InvoiceList getInvoiceList(int individualID, int startATparam, int EndAtparam,
      String searchString, String sortColumn, long entityID, long orderID)
  {
    if ((searchString != null) && ((searchString.trim()).length() > 0)) {
      InvoiceList dl = new InvoiceList();
      dl.setStartAT(startATparam);
      dl.setEndAT(EndAtparam);
      dl.setSortMember(sortColumn);
      dl.setSortType('A');
      dl.setSearchString(searchString);
      dl.setListType("InvoiceHistory");
      dl.setEntityID(entityID);
      dl.setOrderID(orderID);

      long currentListID = this.getNextListID();
      dl.setListID(currentListID);

      displayLists.put(new Long(currentListID), dl);

      return this.getInvoiceList(individualID, dl);

    } else {
      InvoiceList returnDL = null;
      try {
        HashMap hm = new HashMap();
        hm.put("startATparam", new Integer(startATparam));
        hm.put("EndAtparam", new Integer(EndAtparam));
        hm.put("searchString", searchString);
        hm.put("sortmem", sortColumn);
        hm.put("sortType", new Character('A'));
        hm.put("EntityID", new Long(entityID));
        hm.put("OrderID", new Long(orderID));

        try {
          AccountListHome aa = (AccountListHome)CVUtility.getHomeObject(
              "com.centraview.account.accountlist.AccountListHome", "AccountList");
          AccountList remote = (AccountList)aa.create();
          remote.setDataSource(this.dataSource);
          returnDL = remote.getInvoiceList(individualID, hm);
        } catch (Exception e) {
          System.out.println("[Exception] ListGenerator.getInvoiceList: " + e.toString());
          // e.printStackTrace();
        }

        returnDL.setListType("InvoiceHistory");
        returnDL.setTotalNoOfRecords(returnDL.size());

        long currentListID = this.getNextListID();
        returnDL.setListID(currentListID);
        returnDL.setStartAT(startATparam);
        returnDL.setEndAT(EndAtparam);
        returnDL.setEntityID(entityID);
        returnDL.setOrderID(orderID);

        InvoiceList emptyDL = createEmptyObject(returnDL);
        emptyDL.setTotalNoOfRecords(returnDL.getTotalNoOfRecords());
        emptyDL.setListID(currentListID);
        emptyDL.setListType("InvoiceHistory");
        emptyDL.setStartAT(returnDL.getStartAT());
        emptyDL.setEndAT(returnDL.getEndAT());
        emptyDL.setEntityID(returnDL.getEntityID());
        emptyDL.setOrderID(returnDL.getOrderID());

        displayLists.put(new Long(currentListID), emptyDL);

      } catch (Exception e) {
        e.printStackTrace();
View Full Code Here


   * @return
   */
  public InvoiceList getInvoiceList(int individualID, DisplayList DLparam)
  {

    InvoiceList returnDL = null;
    InvoiceList paramDL = (InvoiceList)DLparam;
    int listSize = paramDL.getTotalNoOfRecords();
    int startAT = paramDL.getStartAT();
    int EndAt = paramDL.getEndAT();

    long entityID = paramDL.getEntityID();
    long orderID = paramDL.getOrderID();

    String powerString = paramDL.getPowerString();
    String searchString = paramDL.getSearchString();
    String sortColumn = paramDL.getSortMember();

    HashMap hm = new HashMap();
    hm.put("startATparam", new Integer(startAT));
    hm.put("EndAtparam", new Integer(EndAt));
    hm.put("searchString", searchString);
    hm.put("sortmem", DLparam.getSortMember());
    hm.put("sortType", new Character(DLparam.getSortType()));
    hm.put("EntityID", new Long(entityID));
    hm.put("OrderID", new Long(orderID));

    try {
      AccountListHome aa = (AccountListHome)CVUtility.getHomeObject(
          "com.centraview.account.accountlist.AccountListHome", "AccountList");
      AccountList remote = (AccountList)aa.create();
      remote.setDataSource(this.dataSource);
      returnDL = remote.getInvoiceList(individualID, hm);
    } catch (Exception e) {
      System.out.println("[Exception] ListGenerator.getInvoiceList: " + e.toString());
      // e.printStackTrace();
    }

    returnDL.setListType("InvoiceHistory");
    returnDL.setListID(paramDL.getListID());
    returnDL.setStartAT(paramDL.getStartAT());
    returnDL.setEndAT(paramDL.getEndAT());
    returnDL.setSortType(paramDL.getSortType());
    returnDL.setSearchString(searchString);
    returnDL.setPowerString(powerString);
    returnDL.setEntityID(entityID);
    returnDL.setOrderID(orderID);

View Full Code Here

   * @param list
   * @return
   */
  public InvoiceList createEmptyObject(InvoiceList list)
  {
    InvoiceList dummy = new InvoiceList();
    dummy.setListType(list.getListType());
    dummy.setPrimaryMemberType(list.getPrimaryMemberType());
    dummy.setPrimaryTable(list.getPrimaryTable());
    dummy.setSortMember(list.getSortMember());
    dummy.setSortType(list.getSortType());
    dummy.setPrimaryMember(list.getPrimaryMember());
    dummy.setStartAT(list.getStartAT());
    dummy.setEndAT(list.getEndAT());
    dummy.setBeginIndex(0);
    dummy.setEndIndex(0);
    dummy.setEntityID(list.getEntityID());
    dummy.setOrderID(list.getOrderID());

    return dummy;
  }// end of createEmptyObject
View Full Code Here

    cvdl.executeUpdate();
    cvdl.clearParameters();

    cvdl.destroy();

    InvoiceList invList = new InvoiceList();

    invList.setSortMember(strSortMem);

    if (colList != null)
    {
      Iterator it = colList.iterator();

      int i = 0;

      while (it.hasNext())
      {
        i++;

        HashMap hm = (HashMap) it.next();

        int invID = Integer.parseInt(hm.get("InvoiceID").toString());

        Double amount = null;

        if (hm.get("Total") != null)
        {
          amount = new Double(Double.parseDouble(hm.get("Total").toString()));
        }

        Double amountPaid = null;

        if (hm.get("AmountPaid") != null)
        {
          amountPaid =
            new Double(Double.parseDouble(hm.get("AmountPaid").toString()));
        }

        try
        {
          IntMember intInvID =
            new IntMember("InvoiceID", invID, 10, null, 'T', true, 10);

          IntMember intOrderID = null;

          if (hm.get("OrderID") != null)
          {
            int oID = Integer.parseInt(hm.get("OrderID").toString());
            intOrderID = new IntMember("Order", oID, 10, null, 'T', true, 10);
          }

          StringMember strCustID = null;

          if (hm.get("CustomerID") != null)
          {
            strCustID =
              new StringMember("CustomerID", (String) hm.get("CustomerID"), 10,
                null, 'T', true);
          }
          else
          {
            strCustID =
              new StringMember("CustomerID", null, 10, null, 'T', true);
          }

          DateMember date = null;

          if (hm.get("InvoiceDate") != null)
          {
            date =
              new DateMember("InvoiceDate", (Date) hm.get("InvoiceDate"), 10,
                null, 'T', false, 10, "EST");
          }
          else
          {
            date =
              new DateMember("InvoiceDate", null, 10, null, 'T', false, 10,
                "EST");
          }

          DoubleMember dblAmount =
            new DoubleMember("Total", amount, 10, null, 'T', false, 10);

          StringMember strPaid = null;

          double amt = 0;

          if (amount != null)
          {
            amt = amount.doubleValue();
          }

          double amtPaid = 0;

          if (amountPaid != null)
          {
            amtPaid = amountPaid.doubleValue();
          }

          int result = 0;

          if ((amount != null) && (amountPaid != null))
          {
            result = amount.compareTo(amountPaid);
          }

          if (result == 0)
          {
            strPaid = new StringMember("Paid", "Yes", 10, null, 'T', false);
          }
          else if ((result > 0) && (amtPaid > 0))
          {
            strPaid = new StringMember("Paid", "Partial", 10, null, 'T', false);
          }
          else
          {
            strPaid = new StringMember("Paid", "No", 10, null, 'T', false);
          }

          StringMember strCreator = null;

          if (hm.get("Creator") != null)
          {
            strCreator =
              new StringMember("Creator", (String) hm.get("Creator"), 10, null,
                'T', true);
          }
          else
          {
            strCreator = new StringMember("Creator", null, 10, null, 'T', true);
          }

          int creatorID = 0;

          if (hm.get("CreatorID") != null)
          {
            creatorID = ((Long) hm.get("CreatorID")).intValue();
          }

          int custID = 0;

          if (hm.get("CustID") != null)
          {
            custID = ((Long) hm.get("CustID")).intValue();
          }

          InvoiceListElement invListElement = new InvoiceListElement(invID);

          invListElement.put("InvoiceID", intInvID);
          invListElement.put("Order", intOrderID);
          invListElement.put("CustomerID", strCustID);
          invListElement.put("CustID",
            new IntMember("CustID", custID, 10, null, 'T', true, 10));
          invListElement.put("InvoiceDate", date);
          invListElement.put("Total", dblAmount);
          invListElement.put("Paid", strPaid);
          invListElement.put("Creator", strCreator);
          invListElement.put("CreatorID",
            new IntMember("CreatorID", creatorID, 10, null, 'T', true, 10));

          StringBuffer stringbuffer = new StringBuffer("00000000000");
          stringbuffer.setLength(11);

          String s3 = (new Integer(i)).toString();
          stringbuffer.replace(stringbuffer.length() - s3.length(),
            stringbuffer.length(), s3);

          String s4 = stringbuffer.toString();

          invList.put(s4, invListElement);
        }
        catch (Exception e)
        {
          System.out.println(" Exception in packing data " + e);

          //e.printStackTrace();
        }
      }
    }

    invList.setTotalNoOfRecords(invList.size());
    invList.setListType("InvoiceHistory");
    invList.setBeginIndex(beginIndex);

    //invList.setEndIndex(endIndex);
    invList.setEndIndex(invList.size());

    return invList;
  }
View Full Code Here

TOP

Related Classes of com.centraview.account.invoice.InvoiceList

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.