Examples of CustomerAccount


Examples of com.zesped.model.CustomerAccount

    }
   
    public Collection<Order> getOrders() throws StorageException, InstantiationException, IllegalStateException, IllegalStateException, IllegalAccessException  {
            connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
            Dms oDms = getSession().getDms();
            CustomerAccount oCacc = new CustomerAccount(oDms, getSessionAttribute("customer_account_docid"));
            return (Collection<Order>) oCacc.orders(getSession()).list(getSession());

    }
View Full Code Here

Examples of com.zesped.model.CustomerAccount

  private AccountingAccount account;

  public Collection<Client> getClients() throws ElementNotFoundException, NotEnoughRightsException, DmsException, InstantiationException, IllegalAccessException {
    AtrilSession oSes = DAO.getAdminSession("CaptureInvoice");
    CustomerAccount oAcc = new CustomerAccount(oSes.getDms().getDocument(getSessionAttribute("customer_account_docid")));
    Collection<Client> clients = oAcc.clients(oSes).list(oSes);
    oSes.disconnect();
    oSes.close();
    return clients;
  }
View Full Code Here

Examples of com.zesped.model.CustomerAccount

        if (!changepassw) {
          oUser.activate();
          oUser.save(getSession());
          DAO.log(User.class, "ACTIVATE USER", AtrilEvent.Level.INFO, email+";"+id+";"+uid);
        }
        CustomerAccount oCacc = new CustomerAccount(getSession(), oUser);
        Employee oEmpl = new Employee();
        String sEmpl = null;
        if (oEmpl.exists(getSession(), "employee_uuid", oUser.getNickName())!=null)
          sEmpl = oUser.getNickName();
        setSessionAttributes(oUser, oCacc, oCacc.taxpayers(getSession()).byDefault(getSession(),oUser),sEmpl);
        hasorders = (oCacc.orders(getSession()).count()>0);
        disconnect();       
        } catch (AuthenticationException acpt) {
          DAO.log(User.class, "ACTIVATE USER", AtrilEvent.Level.WARNING, email+";"+id+";"+uid);
          Log.out.warn("ActivateUser.form() "+acpt.getClass().getName()+" "+acpt.getMessage(), acpt);
          return new RedirectResolution("/error.jsp?e=systemsecurity");
View Full Code Here

Examples of com.zesped.model.CustomerAccount

      connect();
      if (txpr.length()>0) {
        taxpr = new TaxPayer(getSession().getDms(), txpr);
        employees = taxpr.employees(getSession()).list(getSession());
      } else {
        CustomerAccount cacc = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
        employees = new ArrayList<Employee>();
        bnames = new HashMap<String,String>();
        for (TaxPayer t : cacc.taxpayers(getSession()).list(getSession())) {
          ArrayList<Employee> emps = t.employees(getSession()).list(getSession());
          employees.addAll(emps);
          for (Employee e : emps)
            bnames.put(e.id(), t.getBusinessName());
        }
View Full Code Here

Examples of com.zesped.model.CustomerAccount

    }
   
    try {
      connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
      Dms oDms = getSession().getDms();
      cacc = new CustomerAccount(oDms, getSessionAttribute("customer_account_docid"));
      if (cnts==null) {
        cnts = cacc.clients(getSession()).list(getSession());
        try {
          Cache.putEntry(getSessionAttribute("customer_account_docid")+"clients", cnts);
        } catch (Exception e) { }
View Full Code Here

Examples of com.zesped.model.CustomerAccount

    return accaccounts;
  }

  public Collection<Client> getClients() throws ElementNotFoundException, NotEnoughRightsException, DmsException, InstantiationException, IllegalAccessException {
    AtrilSession oSes = DAO.getAdminSession("BaseEditBean");
    CustomerAccount oAcc = new CustomerAccount(oSes.getDms().getDocument(getSessionAttribute("customer_account_docid")));
    Collection<Client> clients = oAcc.clients(oSes).list(oSes);
    oSes.disconnect();
    oSes.close();
    return clients;
  }
View Full Code Here

Examples of com.zesped.model.CustomerAccount

    final String role = getParam("role","");
    final String txpr = getParam("taxpayer","");

    try {
      connect();
      CustomerAccount cacc = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
      if (role.length()==0 || role.equalsIgnoreCase("admin")) setAdmins(cacc.getAdmins(getSession()));
      if (role.length()==0 || role.equalsIgnoreCase("user" )) setUsers(cacc.getUsers(getSession()));
      if (role.length()==0 || role.equalsIgnoreCase("guest")) setGuests(cacc.getGuests(getSession()));
      if (txpr.length()>0) {
        taxpr = new TaxPayer(getSession().getDms(), txpr);
        filterMembersByTaxPayer(getAdmins());
        filterMembersByTaxPayer(getUsers());
        filterMembersByTaxPayer(getGuests());
View Full Code Here

Examples of com.zesped.model.CustomerAccount

    } catch (Exception e) {
      Log.out.error("BaseEditBean.getTaxPayers() Cache.getObject("+ckey+") "+e.getClass().getName()+" "+e.getMessage(), e);
    }
    if (null==taxpayers) {
        connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
      CustomerAccount oAcc = new CustomerAccount(getSession().getDms().getDocument(getSessionAttribute("customer_account_docid")));
      taxpayers = oAcc.taxpayers(getSession()).list(getSession());
      for (TaxPayer oTxp : taxpayers)
        if (oTxp.getTaxId().length()>0)
          oTxp.setBusinessName(oTxp.getBusinessName()+" ("+oTxp.getTaxId()+")");
      disconnect();
      try {
View Full Code Here

Examples of com.zesped.model.CustomerAccount

    id = getParam("id");
    action = getParam("a","r").equals("f") ? "forward" : "reply";
    try {
      connect();
      setMessage(new Message(getSession().getDms(), id));
      CustomerAccount cac = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
      recipients = cac.getUsers(getSession());
      disconnect();
      } catch (Exception xcpt) {
        Log.out.error(xcpt.getMessage(), xcpt);
      } finally {
        close();
View Full Code Here

Examples of com.zesped.model.CustomerAccount

      Order order = new Order();
      try {
        connect();
        AtrilSession oSes = getSession();
        Dms oDms = oSes.getDms();
        CustomerAccount cacc = new CustomerAccount(oDms, getSessionAttribute("customer_account_docid"));
        order = cacc.createOrder(oSes);
        order.put("user_id", getSessionAttribute("user_docid"));
        order.put("credits_bought", selectedProduct.getCredits());
        order.save(oSes);

        Log.out.info("Created order "+order.getString("order_id")+" for customer "+getSessionAttribute("customer_acount"));
       
        OrderLine line = order.addLine(oSes, selectedProduct);

        Log.out.info("Added order line for product "+selectedProduct.getString("product_name"));

        order.put("base_price", line.getString("base_price"));
        order.put("taxes", line.getString("taxes"));
        order.put("taxespct", line.getString("taxespct"));
        order.put("total_price", line.getString("subtotal_price"));
        order.put("currency", line.getString("currency"));
        order.save(oSes);
       
        DAO.log(oSes, order.getDocument(), Order.class, "CREATE ORDER", AtrilEvent.Level.INFO, order.getDocument().id()+";"+getSessionAttribute("customer_acount")+";"+selectedProduct.getString("product_name"));

        cacc.restoreCredits(oSes, new BigDecimal(selectedProduct.getCredits().longValue()));

        Log.out.info("Added "+selectedProduct.getCredits().toString()+" credits to customer "+getSessionAttribute("customer_acount"));
        DAO.log(oSes, cacc.getDocument(), CustomerAccount.class, "UPDATE CREDITS", AtrilEvent.Level.INFO, cacc.getDocument().id()+";"+cacc.get("credits_left"));
       
        disconnect();
        LoginInterceptor.expire(getSessionAttribute("nickname"), getSessionAttribute("password"));
        return new RedirectResolution(CaptureInvoice.class);
      } catch (Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.