Package com.zesped.model

Examples of com.zesped.model.BillNote


  }

  public Resolution upload() throws Exception {
    String sFwd;
    Ticket tckt = null;
    BillNote bill = null;
    setCapturedCount(0);
    final int nItems = (getItems()==null ? 0 : getItems().size());
    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) {
              if (tckt==null) {
                tckt = bill.createTicket(getSession(), getAccount());
                setId(tckt.id());
                FlashScope oFscope = FlashScope.getCurrent(getContext().getRequest(), true);
                oFscope.put("ticket_docid", tckt.id());
              }
              TicketNote note = tckt.createNote(getSession(), attachment.getInputStream(), incCapturedCount(), attachment.getFileName());
View Full Code Here


          } else {
            setBillDay(oTck.getTicketDate().getDate());
            setBillMonth(oTck.getTicketDate().getMonth()+1);
            setBillYear(oTck.getTicketDate().getYear()+1900);
          }
          BillNote oBln = oTck.billNote(getSession());
          setBillNoteId(oBln.id());
          setConcept(oBln.getConcept());
          setEmployee(oBln.getEmployeeUuid());
          ArrayList<TicketNote> oPgs = oTck.pages(getSession());
          setCapturedCount(oPgs.size());
          if (oPgs.size()>0) setCapturedPage1(oPgs.get(0).id());
          for (TicketNote n : oPgs)
            pages.add(n.id());
View Full Code Here

        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 {
            errors.add("empleado", new LocalizableError("com.zesped.action.EditBillNote.employeeConceptMismatch"));         
          }         
        } else {
          errors.add("billnote", new LocalizableError("com.zesped.action.EditBillNote.billNoteIsClosed"));
View Full Code Here

        DepositToZespedBridge oDzb = new DepositToZespedBridge(CaptureService.INVOICES, lDepositId, getSessionAttribute("user_uuid"), sFlavor, sTaxPayerId, sBiller, sRecipient);
        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

    final String sPassw = getSessionAttribute("password");
    final String sBillNoteId = getParam("id");
    try {
      connect(sNickN, sPassw);
      Dms oDms = getSession().getDms();
      BillNote oBln = new BillNote(oDms, sBillNoteId);
      setId(sBillNoteId);
      oBln.computeSettling(getSession());
      setIsOpen(oBln.isOpen());
      base = oBln.getBaseAmount();
      total = oBln.getTotalAmount();
      vat = oBln.getVat();
      concept = oBln.getConcept();
      ArrayList<Ticket> oTcs = oBln.tickets(getSession());
      int nTcs = oTcs.size();
      Log.out.debug("FastEditBillNote "+String.valueOf(nTcs)+" tickets found");
      TaxPayer oTxp = oBln.taxPayer(oDms);
      employees = oTxp.employees(getSession()).list(getSession());
      accaccounts = oTxp.accounts(getSession()).list(getSession());
      employeeName = oBln.getEmployeeName();
      employeeUuid = oBln.getEmployeeUuid();
      for (Ticket oTck : oTcs) {
        Log.out.debug("Reading ticket "+oTck.id());
        ticketIds.add(oTck.id());
        thumbnails.add(oTck.thumbnail(getSession()).id());
        if (oTck.isNull("biller_taxpayer")) {
View Full Code Here

          oTck.isProcessed(true);
        }
        oTck.save(getSession());
      }
      Log.out.debug("Updating Bill Note");
      BillNote oBln = new BillNote(oDms, getId());
      oBln.setProcessDate(new Date());
      if (bSettle) {
        oBln.settle(getSession(), getSessionAttribute("user_uuid"));
      } else {
        oBln.computeSettling(getSession());
        oBln.save(getSession());
      }
      disconnect();
    } catch (StorageException xcpt) {
      Log.out.error("FastEditBillNote.write() "+sNickN+" "+xcpt.getClass()+" "+xcpt.getMessage());
    } finally {
View Full Code Here

    final String sPassw = getSessionAttribute("password");

    try {
      connect(sNickN, sPassw);
      Dms oDms = getSession().getDms();
      BillNote oBln = new BillNote(oDms, getId());
      oBln.isOpen(true);
      oBln.save(getSession());
      DAO.log(getSession(), oBln.getDocument(), BillNote.class, "REOPEN BILLNOTE", AtrilEvent.Level.INFO, oBln.id()+";"+oBln.getTaxPayer());
      disconnect();
    } catch (Exception xcpt) {
      Log.out.error("FastEditBillNote.write() "+sNickN+" "+xcpt.getClass()+" "+xcpt.getMessage());
    } finally {
      close();
View Full Code Here

        DocumentIndexer oIdx = getSession().getDocumentIndexer();
        oIdx.setMaximumNumberOfDocumentReturned(iMaxRows);

        if (sBillNote.length()>0) {
          aLst = new QueryResultSet<Ticket>();
          aLst.addAll(new BillNote(oDms, sBillNote).tickets(getSession()));
        } else if (sEmployee.length()>0) {
          Employee oEmpl = new TaxPayer(oDms, sTaxPayer).employees(getSession()).seek(getSession(), sEmployee);
          if (null!=oEmpl
            aLst = oEmpl.queryTickets(getSession(), bProcessed, bHasMistakes, bOnlyOpen, aAmountRange, aMonthsRange, aYearsRange, sBiller, sSearchStr, iMaxRows, iOffset);
          else
            aLst = new QueryResultSet<Ticket>();
        } else {     
          aLst = new TaxPayer(oDms, sTaxPayer).queryTickets(getSession(), bProcessed, bHasMistakes, bOnlyOpen, aAmountRange, aMonthsRange, aYearsRange, sBiller, sConcept, sSearchStr, iMaxRows, iOffset);
        }
        for (Ticket i : aLst) {
          if (!i.isNull("biller_taxpayer")) {
            if (!oCompanies.containsKey(i.getString("biller_taxpayer")))
              oCompanies.put(i.getBillerTaxPayer(), i.biller(getSession()));
          }
          if (!i.isNull("taxpayer")) {
            if (!oCompanies.containsKey(i.getString("taxpayer")))
              oCompanies.put(i.getTaxPayer(), i.taxPayer(oDms));
          }
          if (i.getStringNull("employee_uuid","").length()>0) {
            if (!oEmployees.containsKey(i.getString("employee_uuid")))
              oEmployees.put(i.getString("employee_uuid"), i.employee(getSession()));
          }
          if (!oBillNotes.containsKey(i.parentId())) {
            oBillNotes.put(i.parentId(), new BillNote(oDms,i.parentId()));
          }         
        }
        disconnect();
      } catch (Exception xcpt) {
        Log.out.error("QueryTickets "+sNickN+" "+xcpt.getClass()+" "+xcpt.getMessage());
View Full Code Here

      User oUsr = new User(oSes, USRID);
      CustomerAccount oAcc = new CustomerAccount(oSes.getDms(), ACCID);
      Iterator<TaxPayer> oItr = oAcc.taxpayers(oSes).list(oSes).iterator();
    TaxPayer oTpr = oItr.next();
    String sEmployeeUuid = "";
    BillNote oBln = oTpr.billnotes(oSes).create(oSes, oUsr.getNickName(), CaptureServiceFlavor.BASIC, oTpr.id(), "Test Concept", sEmployeeUuid);
    oBln.createTicket(oSes);
      closeTestSession(oSes);
  }
View Full Code Here

      User oUsr = new User(oSes, sUsrId);
      CustomerAccount oAcc = new CustomerAccount(oSes.getDms(), sAccId);
      Iterator<TaxPayer> oItr = oAcc.taxpayers(oSes).list(oSes).iterator();
    TaxPayer oTpr = oItr.next();
    String sEmployeeUuid = "";
    BillNote oBln = oTpr.billnotes(oSes).create(oSes, oUsr.getNickName(), CaptureServiceFlavor.BASIC, oTpr.id(), "Test Concept", sEmployeeUuid);
    Ticket oTck = oBln.createTicket(oSes);
    oTck.createNote(oSes, getClass().getResourceAsStream("OutbackSteakhouse.jpg"), 1, "OutbackSteakhouse.jpg");
    closeTestSession(oSes);
  }
View Full Code Here

TOP

Related Classes of com.zesped.model.BillNote

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.