Examples of CustomerAccount


Examples of com.zesped.model.CustomerAccount

        }else{          
            try {
                connect();
                AtrilSession oSes = getSession();
                Dms oDms = oSes.getDms();
                CustomerAccount cacc = new CustomerAccount(oDms, getSessionAttribute("customer_account_docid"));
                setName(cacc.getString("name_billing"));
                setCif(cacc.getString("cif_billing"));
                setPhone(cacc.getString("phone_billing"));
                setMail(cacc.getString("mail_billing"));
                setAddress(cacc.getString("address_billing"));
                setPostcode(cacc.getString("postcode_billing"));
                setCountry(cacc.getString("country_billing"));
                setState(cacc.getString("state_billing"));
                setCity(cacc.getString("city_billing"));
                disconnect();
                return new ForwardResolution(FORM);
            } catch (StorageException ex) {
                 Log.out.error("EngageCredit.form() "+ex.getClass().getName()+" "+ex.getMessage(), ex);
            }
View Full Code Here

Examples of com.zesped.model.CustomerAccount

        try {

            connect();
            AtrilSession oSes = getSession();
            Dms oDms = oSes.getDms();
            CustomerAccount cacc = new CustomerAccount(oDms, getSessionAttribute("customer_account_docid"));
      oSes.commit();
     
            cacc.put("name_billing",getName());
            cacc.put("cif_billing",getCif());
            cacc.put("phone_billing",getPhone());
            cacc.put("mail_billing",getMail());
            cacc.put("address_billing",getAddress());
            cacc.put("postcode_billing",getPostcode());
            cacc.put("city_billing",getCity());
            cacc.put("state_billing",getState());
            cacc.put("country_billing",getCountry());
            cacc.save(oSes);
            oSes.commit();
     
            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"));

            order.put("promo_code",promo_code);
            order.put("name",name);
            order.put("cif",cif);
            order.put("phone",phone);
            order.put("mail",mail);
            order.put("address",address);
            order.put("city",city);
            order.put("state",state);
            order.put("country",country);
            order.put("postcode",postcode);
            order.put("cardnumber",cardnumber);
            order.put("cardholder",cardholder);
            order.put("expiration_month_card",expiration_month_card);
            order.put("expiration_year_card",expiration_year_card);
            order.put("cvv2",cvv2);

            order.save(oSes);
            commit();
           
            OrderLine line = order.addLine(oSes, selectedProduct);
      commit();
     
            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"));

            if (selectedProduct.getPrice().compareTo(BigDecimal.ZERO)==0) {
                order.put("status_number", Tpv.PAGADO);
                Long oCreditsLeft = new Long(cacc.getBigDecimal("credits_left").longValue());
                if (null == oCreditsLeft) {
                    oCreditsLeft = new Long(0l);
                }
                cacc.put("credits_left", new Long(oCreditsLeft.longValue() + selectedProduct.getCredits().longValue()));
                cacc.save(oSes);
        commit();
       
                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"));

            } else {
                order.put("status_number",Tpv.PENDIENTE_PAGO);
            }
           
View Full Code Here

Examples of com.zesped.model.CustomerAccount

        try {
            connect();
            AtrilSession oSes = getSession();
            if(oSes!=null){
            Dms oDms = oSes.getDms();
            CustomerAccount cacc = new CustomerAccount(oDms, getSessionAttribute("customer_account_docid"));
            disconnect();
            return cacc.getCreditsLeft().toString().substring(0, cacc.getCreditsLeft().toString().indexOf("."));
            }
        } catch (StorageException ex) {
            Log.out.error("BaseActionBean.getCreditsleft() "+ex.getClass().getName()+" "+ex.getMessage(), ex);
        }
        return null;
View Full Code Here

Examples of com.zesped.model.CustomerAccount

        try {
            connect();
            AtrilSession oSes = getSession();
            if(oSes!=null){
            Dms oDms = oSes.getDms();
            CustomerAccount cacc = new CustomerAccount(oDms, getSessionAttribute("customer_account_docid"));
            disconnect();
            return cacc.getCreditsUsed().toString().substring(0, cacc.getCreditsUsed().toString().indexOf("."));
            }
        } catch (StorageException ex) {
            Log.out.error("BaseActionBean.getCreditsused() "+ex.getClass().getName()+" "+ex.getMessage(), ex);
        }
        return null;
View Full Code Here

Examples of com.zesped.model.CustomerAccount

    return null;
  }

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

Examples of com.zesped.model.CustomerAccount

  @DefaultHandler
  public Resolution form() {
    try {     
        connect();
        CustomerAccount oAcc = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
        cused = oAcc.getCreditsUsed().intValue();
        cleft = oAcc.getCreditsLeft().intValue();
        ordrs = oAcc.orders(getSession()).list(getSession());
        if (ordrs.size()>0) {
        cbought = ordrs.get(0).getCreditsBought().intValue();
        } else {
        cbought = 0;
        }
        ArrayList<TaxPayer> oTxps = oAcc.taxpayers(getSession()).list(getSession());
        for (TaxPayer p : oTxps) {
        cbasic   += p.basicInvoices(getSession()).size();
          cpremium += p.premiumInvoices(getSession()).size();
          ctickets += p.allTickets(getSession()).size();
        }       
View Full Code Here

Examples of com.zesped.model.CustomerAccount

    } catch (Exception e) {
      Log.out.error("EditConfig.getClients() Cache.getObject("+getSessionAttribute("customer_account_docid")+"clients) "+e.getClass().getName()+" "+e.getMessage(), e);
    }
    if (null==clients) {
      AtrilSession oSes = DAO.getAdminSession("CaptureInvoice");
      CustomerAccount oAcc = new CustomerAccount(oSes.getDms().getDocument(getSessionAttribute("customer_account_docid")));
      clients = oAcc.clients(oSes).list(oSes);
      for (Client oCli : clients)
        if (oCli.getTaxId().length()>0)
          oCli.setBusinessName(oCli.getBusinessName()+" ("+oCli.getTaxId()+")");
      oSes.disconnect();
      oSes.close();
View Full Code Here

Examples of com.zesped.model.CustomerAccount

    } catch (Exception e) {
      Log.out.error("CaptureInvoice.getClients() Cache.getObject("+getSessionAttribute("customer_account_docid")+"clients) "+e.getClass().getName()+" "+e.getMessage(), e);
    }
    if (null==clients) {
      AtrilSession oSes = DAO.getAdminSession("CaptureInvoice");
      CustomerAccount oAcc = new CustomerAccount(oSes.getDms().getDocument(getSessionAttribute("customer_account_docid")));
      clients = oAcc.clients(oSes).list(oSes);
      for (Client oCli : clients)
        if (oCli.getTaxId().length()>0)
          oCli.setBusinessName(oCli.getBusinessName()+" ("+oCli.getTaxId()+")");
      oSes.disconnect();
      oSes.close();
View Full Code Here

Examples of com.zesped.model.CustomerAccount

 
  @DefaultHandler
  public Resolution form() {
    try {
        connect();
        TaxPayers txprs = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid")).taxpayers(getSession());
        for (TaxPayer t : txprs.list(getSession())) {
        totalInvoices.add(new Integer((int) t.getTotalInvoicesCount()));
        totalTickets.add(new Integer((int) t.getTotalTicketsCount()));
        allowed.add(new Integer(t.allowedUsers(getSession()).size()));
        employees.add(new Integer(t.employees(getSession()).count()));
View Full Code Here

Examples of com.zesped.model.CustomerAccount

    return null;
  }

  public Collection<TaxPayer> getTaxPayers() throws ElementNotFoundException, NotEnoughRightsException, DmsException, InstantiationException, IllegalAccessException {
    AtrilSession oSes = DAO.getAdminSession("EditUser");
    CustomerAccount oAcc = new CustomerAccount(oSes.getDms().getDocument(getSessionAttribute("customer_account_docid")));
    Collection<TaxPayer> taxpayers = oAcc.taxpayers(oSes).list(oSes);
    oSes.disconnect();
    oSes.close();
    return taxpayers;
  }
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.