Package com.zesped.model

Examples of com.zesped.model.AccountingAccount


    final String sFormerId = getParam("accountingAccount.id","");
    try {
      connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
      TaxPayer oTxpr = new TaxPayer(getSession().getDms(), getParam("taxPayer"));
      try {
        AccountingAccount oAaac = oTxpr.accounts(getSession()).seek(getSession(), getParam("accountingAccount.code"));
        if (!sFormerId.equals(oAaac.id()))
          addError(new LocalizableError("com.zesped.action.SaveAccountingAccount.code.valueDuplicated"));
      } catch (ElementNotFoundException enfe) { }
      disconnect();
    } catch (Exception xcpt) {
      Log.out.error(xcpt.getMessage(), xcpt);
View Full Code Here


  @DefaultHandler
  public Resolution save() {
    if (getErrorsCount()==0) {
      final String sFormerId = getParam("accountingAccount.id");
      try {
        AccountingAccount oAacc;
        connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
        if (sFormerId.length()>0) {
            oAacc = new AccountingAccount();
            oAacc.load(getSession(), sFormerId);
            oAacc.setCode(getParam("accountingAccount.code"));
            oAacc.setDescription(getParam("accountingAccount.description"));
            oAacc.setActive(getParam("accountingAccount.active","1").equals("1"));
        } else {
            Dms oDms = getSession().getDms();
            TaxPayer oTxpr = new TaxPayer(getSession().getDms(), getParam("taxPayer"));
            Document oDoca = oDms.newDocument(oDms.getDocumentType("AccountingAccount"), oTxpr.accounts(getSession()).getDocument());
            oDoca.save("");           
            oAacc = new AccountingAccount(oDoca);
            oAacc.setCode(getParam("accountingAccount.code"));
            oAacc.setDescription(getParam("accountingAccount.description"));
            oAacc.setActive(getParam("accountingAccount.active","1").equals("1"));
        }
        oAacc.save(getSession());
        disconnect();
          addDataLine("taxpayer",getParam("taxPayer"));
          addDataLine("id",oAacc.id());
          addDataLine("uuid",oAacc.getUuid());
          addDataLine("code",oAacc.getCode());
          addDataLine("description",oAacc.getDescription());
      } catch (Exception xcpt) {
        Log.out.error(xcpt.getMessage(), xcpt);
        addError(new SimpleError(xcpt.getMessage()));
      } finally {
        close();
View Full Code Here

        oDzb.start();
        Log.out.debug("Done attaching sides");
      } else {
        TaxPayer txpy = new TaxPayer(getSession().getDms(), sTaxPayerId);
        BillNote bill = txpy.billnotes(getSession()).forConcept(getSession(), sConcept, sEmployee);
        Ticket tckt = bill.createTicket(getSession(), new AccountingAccount(getSession(), sAccount));
        disconnect();
        DepositToZespedBridge oDzb = new DepositToZespedBridge(CaptureService.BILLNOTES, lDepositId, Long.parseLong(tckt.getId()));
        oDzb.start();
        Log.out.debug("Done attaching sides");
        FlashScope oFscope = FlashScope.getCurrent(getContext().getRequest(), true);
View Full Code Here

        if (getAccounts().get(t).length()==0) {
          oTck.remove("accounting_uuid");
          oTck.remove("accounting_code");
          oTck.remove("accounting_desc");
        } else {
          AccountingAccount oAcc = new AccountingAccount(oDms,getAccounts().get(t));
          oTck.put("accounting_uuid", oAcc.getUuid());
          oTck.put("accounting_code", oAcc.getCode());
          oTck.put("accounting_desc", oAcc.getDescription());
        }
        if (getBillers().size()>t) {
          Log.out.debug("Ticket biller is "+getBillers().get(t));
          if (getBillers().get(t)!=null)
            if (getBillers().get(t).id()!=null)
View Full Code Here

  }
 
  @DefaultHandler
  public Resolution form() {
    if (getParam("id")==null) {
      account = new AccountingAccount();
      account.setActive(true);
    } else {
      try {
            connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
            setId(getParam("id"));
            setAccountingAccount(new AccountingAccount(getSession().getDms(), getId()));
            disconnect();
          } catch (Exception xcpt) {
            Log.out.error(xcpt.getMessage(), xcpt);
          } finally {
            close();
View Full Code Here

    final String id = getParam("id","");

    try {
          connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
          Dms oDms = getSession().getDms();
          AccountingAccount oAacc = new AccountingAccount(oDms, id);
          SortableList<Document> oTcks = oDms.query("Ticket$accounting_uuid='"+oAacc.getUuid()+"'");
      if (!oTcks.isEmpty()) {
        addError(new LocalizableError("com.zesped.action.CheckCanDeleteAccountingAccount.hasTickets"));       
      }
      disconnect();
      } catch (Exception xcpt) {
View Full Code Here

TOP

Related Classes of com.zesped.model.AccountingAccount

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.