Examples of TaxPayer


Examples of com.zesped.model.TaxPayer

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

    try {
      connect();
      TaxPayer taxpr = new TaxPayer(getSession().getDms(), txpr);
      taxpr.refreshCounters(getSession());
      taxpr.save(getSession());
      bizname = taxpr.getBusinessName();
      pending = taxpr.getPendingTicketsCount();
      processed = taxpr.getProcessedTicketsCount();
      settled = taxpr.getSettledTicketsCount();
      total = taxpr.getTotalTicketsCount();
      disconnect();
      } catch (Exception xcpt) {
        Log.out.error("CountTickets.form() "+xcpt.getClass().getName()+" "+xcpt.getMessage(), xcpt);
      } finally {
        close();
View Full Code Here

Examples of com.zesped.model.TaxPayer

      addError(new LocalizableError("com.zesped.action.SaveClient.businessName.valueNotPresent"));
    } else {
      try {
        connect();
        CustomerAccount oAcc = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
        TaxPayer oFoundTaxPayer = oAcc.taxpayers(getSession()).seek(getSession(), sBusinessName);
        if (!oFoundTaxPayer.id().equals(sFormerId))
          addError(new LocalizableError("com.zesped.action.SaveClient.businessNameAlreadyExists"));
        oFoundTaxPayer = oAcc.taxpayers(getSession()).seek(getSession(), sTaxId);
        if (!oFoundTaxPayer.id().equals(sFormerId))
          addError(new LocalizableError("com.zesped.action.SaveClient.taxIdAlreadyExists"));
      } catch (ElementNotFoundException clientnotfound) {
      } catch (Exception e) {
        Log.out.error("SaveTaxPayer.validateBusinessName("+sBusinessName+") "+e.getClass().getName()+" "+e.getMessage(), e);
      } finally {
View Full Code Here

Examples of com.zesped.model.TaxPayer

  public Resolution save() {
    final String sFormerId = getParam("taxPayer.id");
    Log.out.debug("Saving TaxPayer "+sFormerId);
    if (getErrorsCount()==0) {
      try {
        TaxPayer oTxpr;
        connect();
        if (sFormerId.length()>0) {
            oTxpr = new TaxPayer();
            oTxpr.load(getSession(), sFormerId);
        } else {
            CustomerAccount oCacc = new CustomerAccount(getSession().getDms(), getSessionAttribute("customer_account_docid"));
            oTxpr = TaxPayer.create(getSession(), oCacc, getParam("taxPayer.businessName"), getParam("taxPayer.contactPerson"), getParam("taxPayer.email"), DAO.getVolumesMountBase());
        }
        saveRequest(oTxpr);
        disconnect();
          addDataLine("id",oTxpr.id());
          if (getSessionAttribute("taxpayer_docid").equals(oTxpr.getId()))
            setSessionAttribute("businessname", oTxpr.getBusinessName());
      } catch (Exception xcpt) {
        Log.out.error(xcpt.getMessage(), xcpt);
        addError(new SimpleError(xcpt.getMessage()));
      } finally {
        close();
View Full Code Here

Examples of com.zesped.model.TaxPayer

        connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
        if (sFormerId.length()>0) {
            oEmpl = new Employee();
            oEmpl.load(getSession(), sFormerId);
        } else {
            TaxPayer oTxpr = new TaxPayer(getSession().getDms(), getParam("taxPayer"));
            oEmpl = new Employee(getSession(), oTxpr.employees(getSession()));
        }
        saveRequest(oEmpl);
        disconnect();
          addDataLine("uuid",oEmpl.getUuid());
          addDataLine("id",oEmpl.id());
View Full Code Here

Examples of com.zesped.model.TaxPayer

    if (nItems>0) {
      Log.out.debug("UploadBillNote "+String.valueOf(nItems)+" items found");
      try {
        connect(getSessionAttribute("nickname"), getSessionAttribute("password"));

        TaxPayer txpy = new TaxPayer(getSession().getDms(), getRecipientTaxPayer());

        bill = txpy.billnotes(getSession()).forConcept(getSession(), getConcept(), getEmployee());
        setCapturedPage1("");

        for (FileBean attachment : getItems()) {
          if (attachment != null) {
            if (attachment.getSize() > 0) {
View Full Code Here

Examples of com.zesped.model.TaxPayer

      if (sBeanEmployeeUUID.length()==0)
        errors.add("empleado", new LocalizableError("com.zesped.action.EditBillNote.employee.valueNotPresent"));       
      if (sConcept.length()>0 && sBeanEmployeeUUID.length()>0) {
        connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
        Dms oDms = getSession().getDms();       
        TaxPayer txpy = new TaxPayer(oDms, getRecipientTaxPayer());
        BillNote bill = txpy.billnotes(getSession()).forConcept(getSession(), sConcept, sBeanEmployeeUUID);
        Log.out.debug("BillNote with Id "+bill.id()+" found for concept "+sConcept+" and employee "+sBeanEmployeeUUID);
        if (bill.isOpen()) {
          final String sBillEmployeeUUID = (bill.getEmployeeUuid()==null ? "" : bill.getEmployeeUuid());
          if (sBillEmployeeUUID.length()==0) {
            Log.out.debug("Assigning BillNote "+bill.id()+" to employee "+sBeanEmployeeUUID);
            bill.setEmployee(txpy.employees(getSession()).seek(getSession(), sBeanEmployeeUUID));
            bill.save(getSession());
            setBillNoteId(bill.id());
          } else if (sBillEmployeeUUID.equals(sBeanEmployeeUUID)) {
            setBillNoteId(bill.id());
          } else {
View Full Code Here

Examples of com.zesped.model.TaxPayer

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

    try {
      connect();
      taxpr = new TaxPayer(getSession().getDms(), txpr);
      accounts = taxpr.accounts(getSession()).list(getSession());
      disconnect();
      } catch (Exception xcpt) {
        Log.out.error(xcpt.getMessage(), xcpt);
      } finally {
View Full Code Here

Examples of com.zesped.model.TaxPayer

          bizname = "";
          biznames = "";       
      } else {
        String[] ids = getParam("taxpayer").split(",");
        connect(getSessionAttribute("nickname"), getSessionAttribute("password"));
        TaxPayer txpr = new TaxPayer(getSession().getDms(), ids[0]);
          bizname = Gadgets.HTMLEncode(txpr.getBusinessName());
          biznames = "";
          if (ids.length>1) {
            for (int t=1; t<ids.length; t++)
              biznames += (biznames.length()==0 ? "" : ", ")+new TaxPayer(getSession().getDms(), ids[t]).getBusinessName();
            bizname += " y <a href=\"#\" class=\"anchorhighlight\" title=\""+biznames.replace('"', ' ')+"\">"+String.valueOf(ids.length-1)+" m&aacute;s</a>";
          }
          biznames += (biznames.length()==0 ? "" : ", ")+txpr.getBusinessName();
        disconnect();       
      }
      } catch (Exception xcpt) {
        Log.out.error(xcpt.getMessage(), xcpt);
      } finally {
View Full Code Here

Examples of com.zesped.model.TaxPayer

  @ValidationMethod(on="save")
  public void validateNoDuplicatedCodes(ValidationErrors ignore) {
    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) {
View Full Code Here

Examples of com.zesped.model.TaxPayer

            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"));
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.