Examples of Expenditure


Examples of beans.expenditure.entity.Expenditure

       
        List list = findEntityList(Expenditure.class, "serviceRender", entity);
        List<ExpenditureDetails> res = new ArrayList<ExpenditureDetails>();
        Iterator i = list.iterator();
        while (i.hasNext()) {
            Expenditure j = (Expenditure) i.next();
            res.add(j.getDetails((RightChecker) this));
        }
        return res;
    }
View Full Code Here

Examples of beans.expenditure.entity.Expenditure

    @Override
    public ModificationInfo setExpenditure(ExpenditureDetails details) throws ClipsServerException {
        checkCommandAccessibility(COMMAND_MODIFY);
        ServiceRender entity = getExistentEntity();

        Expenditure exp = null;
        if (details.id != 0) {
            exp = findEntity(Expenditure.class, details.id);
            checkTheSame(exp.getServiceRender());
        } else {
            exp = new Expenditure();
            exp.setServiceRender(entity);
        }
        AuditDoc<Expenditure> auditExp = new AuditDoc<Expenditure>(exp, getCollaborator());
        exp.setQuantity(details.quantity);
        exp.setType(findEntity(ExpenditureType.class, details.expenTypeID));
        int id = saveEntity(exp);
        auditExp.check(exp);
        return new ModificationInfo(id, persistAudit(auditExp));
    }
View Full Code Here

Examples of beans.expenditure.entity.Expenditure

     */
    @Override
    public ModificationInfo removeExpenditure(int id) throws ClipsServerException {
        checkCommandAccessibility(COMMAND_MODIFY);
        checkEntityExist();
        Expenditure exp = findEntity(Expenditure.class, id);
        checkTheSame(exp.getServiceRender());
        AuditDoc<Expenditure> auditExp = new AuditDoc<Expenditure>(exp, getCollaborator());
        manager.remove(exp);
        auditExp.check(null);
        return new ModificationInfo(persistAudit(auditExp));
    }
View Full Code Here

Examples of br.com.visualmidia.business.Expenditure

        if (expendituresTable.getAccountTableTree().getSelectionCount() > 0) {
          TableItem[] item = expendituresTable.getAccountTableTree().getSelection();
          String idBill = item[0].getText(0);
          GDDate paymentDayBill = new GDDate(item[0].getText(1));
          try {
            Expenditure expenditure = (Expenditure) system.query(new GetExpenditures(idBill));
            if (expenditure.getNextPaymentDate().beforeDay(paymentDayBill)) {
              MessageBox messageBox = new MessageBox(mainScreen.getShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
              messageBox.setMessage("Existem Parcelas anteriores em aberto.\nDeseja efetuar o pagamento da parcela vencida?");
              messageBox.setText("Alerta Gerente Digital!");
              int result = messageBox.open();
              if (result == SWT.YES) {
View Full Code Here

Examples of br.com.visualmidia.business.Expenditure

  public void loadScreen(String id) {
    try {
      editMode = true;
      if (levelBillPlan == 1) {
        Expenditure expenditure = (Expenditure) system.query(new GetExpenditures(id));
        setOpenAccount(expenditure.getId());

        descriptionText.setText(expenditure.getDescription());
        nextPaymentDateText.setValue(expenditure.getNextPaymentDate().getDate());
        billPlanCombo.select(billPlan.get(expenditure.getCategoryId()).getDescription());
        frequencyCombo.select(expenditure.getFrequency());
        numberOfOcurrenciesText.setText("" + expenditure.getNumberOfOcurrencies());
        fixedValue.select((expenditure.isFixedValue()) ? 0 : 1);
        fixedValue.notifyListeners(SWT.Selection, new Event());
        valueText.setText(expenditure.getValue().getValue() + "");
        observation.setText(expenditure.getObservation());
      } else {
        Incoming incoming = (Incoming) system.query(new GetIncoming(id));
        setOpenAccount(incoming.getId());

        descriptionText.setText(incoming.getDescription());
View Full Code Here

Examples of br.com.visualmidia.business.Expenditure

                    } else {
                      Incoming incoming = getRelatedIncoming(bankOperationNumber, description, value, date);
                      if(incoming != null) {
                        system.execute(new AddExtractBankItem(bankOperationNumber, description, value, date, incoming, accountId));
                      } else {
                        Expenditure expenditure = getRelatedExpenditure(bankOperationNumber, description, value, date);
                        if(expenditure != null){
                          system.execute(new AddExtractBankItem(bankOperationNumber, description, value, date, expenditure, accountId));
                        } else {
                          system.execute(new AddExtractBankItem(bankOperationNumber, description, value, date, accountId));
                        }
View Full Code Here

Examples of br.com.visualmidia.business.Expenditure

          if (expenditure.getNumberOfOcurrencies() > 0) {
            int i = 1;
            while (i <= expenditure.getNumberOfOcurrencies()) {
              if ( date.afterOrEqualsDay(fromDate) && date.beforeOrEqualsDay(toDate) ){
//                Expenditure myBill = new Expenditure(expenditure.getId(), expenditure.getDescription(), new GDDate(date), expenditure.getFrequency(), expenditure.getNumberOfOcurrencies(), expenditure.getValue(), expenditure.isFixedValue(), expenditure.getCategoryId(), expenditure.getObservation());
                Expenditure myBill = new Expenditure(expenditure.getId(), expenditure.getDescription(), new GDDate(date), expenditure.getFrequency(), expenditure.getNumberOfOcurrencies(), expenditure.getValue(), expenditure.isFixedValue(), expenditure.getCategoryId(), expenditure.getObservation(),expenditure.getFirstPaymentDate(),expenditure.getLastPaymentDate());
                list.add(myBill);
              }
              date = skip(date, frequency);
              if (date == null) {
                break;
              }
              i++;
            }
          }else{
            while (date.beforeOrEqualsDay(toDate)){
              if ( date.afterOrEqualsDay(fromDate) && date.beforeOrEqualsDay(toDate) ){
                Expenditure myBill = new Expenditure(expenditure.getId(), expenditure.getDescription(), new GDDate(date), expenditure.getFrequency(), expenditure.getNumberOfOcurrencies(), expenditure.getValue(), expenditure.isFixedValue(), expenditure.getCategoryId(), expenditure.getObservation(),expenditure.getFirstPaymentDate(),expenditure.getLastPaymentDate());
                list.add(myBill);
              }
              date = skip(date, frequency);
              if (date == null) {
                break;
              }
            }
          }
        }
      }
      SortComparator comparator = new SortComparator();
      Collections.sort(list, comparator);

      int bgColorControl = 0;

      for (Expenditure expenditure : list) {
        if (expenditure.isActive()) {
          TableItem item = new TableItem(expenditureTable, SWT.NONE | SWT.MULTI | SWT.WRAP);
          if (bgColorControl == 1) {
            item.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));
            bgColorControl = 0;
          } else {
            bgColorControl = 1;
          }
         
          GDDate todayPlusOneWeek = new GDDate();
          todayPlusOneWeek.addDays(7);
          GDDate nextPaymentDate = expenditure.getNextPaymentDate();
          GDDate today = new GDDate();
         
          Expenditure expenditureToCompare = (Expenditure) system.query(new GetExpenditures(expenditure.getId()));
          GDDate paymentDayBill = expenditureToCompare.getNextPaymentDate();
         
          if (paymentDayBill.beforeDay(nextPaymentDate) && paymentDayBill.beforeDay(today)) {
            item.setImage(new Image(null, "img/icoExpiradNotPayed.png"));
          } else if (nextPaymentDate.beforeOrEqualsDay(todayPlusOneWeek) && nextPaymentDate.afterOrEqualsDay(today)) {
            item.setImage(new Image(null, "img/icoWarningExpiration.png"));
View Full Code Here

Examples of br.com.visualmidia.business.Expenditure

                      GDDate date = new GDDate(expenditure.getNextPaymentDate());
                        int frequency = expenditure.getFrequency();
           
                        while (date.beforeOrEqualsDay(endDate)) {
                            if (date.afterOrEqualsDay(beginDate)) {
                              Expenditure myBill = new Expenditure(expenditure.getId(), expenditure.getDescription(), new GDDate(date), expenditure.getFrequency(), expenditure.getNumberOfOcurrencies(), expenditure.getValue(), expenditure.isFixedValue(), expenditure.getCategoryId(), expenditure.getObservation());
                              listExpenditure.add(myBill);
                            }
                            date = skip(date, frequency);
           
                            if (date == null) {
View Full Code Here

Examples of br.com.visualmidia.business.Expenditure

        Incoming relatedIncoming = extractBankItem.getRelatedIncoming();
        if(relatedIncoming != null) {
          item.setText(4, "Receita: "+ relatedIncoming.getDescription());
        }
       
        Expenditure relatedExpenditure = extractBankItem.getRelatedExpenditure();
        if(relatedExpenditure != null) {
          item.setText(4, "Despesa: "+ relatedExpenditure.getDescription());
        }
       
                item.setText(5, ((extractBankItem.isCredit())?"":"-")+ extractBankItem.getValue());
            }
        } catch (Exception e) {
View Full Code Here

Examples of br.com.visualmidia.business.Expenditure

        this.gdDateNextPaymentDate = nextPaymentDate;
    }

    @Override
    protected void execute(PrevalentSystem system) throws BusinessException {
        Expenditure expenditure = system.expenditure.get(id);
        if (gdDateNextPaymentDate == null || (expenditure.getLastPaymentDate() == null ? false : gdDateNextPaymentDate.afterDay(expenditure.getLastPaymentDate())) || expenditure.getFrequency() == 0) {
          expenditure.setActive(false);
        } else {
            expenditure.setNextPaymentDate(gdDateNextPaymentDate);
        }
    }
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.