Package br.com.visualmidia.business

Examples of br.com.visualmidia.business.Incoming


        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());
        nextPaymentDateText.setValue(incoming.getNextPaymentDate().getDate());
        billPlanCombo.select(billPlan.get(incoming.getCategoryId()).getDescription());
        frequencyCombo.select(incoming.getFrequency());
        numberOfOcurrenciesText.setText("" + incoming.getNumberOfOcurrencies());
        fixedValue.select((incoming.isFixedValue()) ? 0 : 1);
        fixedValue.notifyListeners(SWT.Selection, new Event());
        valueText.setText(incoming.getValue().getValue() + "");
        observation.setText(incoming.getObservation());
      }
    } catch (Exception e) {
      logger.error("GetExpeditures exception: ", e);
    }
  }
View Full Code Here


        TableItem[] item = incomingTable.getAccountTableTree().getSelection();
        String idBill = item[0].getText(0);
        GDDate paymentDayBill = new GDDate(item[0].getText(1));
        if (incomingTable.getAccountTableTree().getSelectionCount() > 0) {
          try {
            Incoming incoming = (Incoming) system.query(new GetIncoming(idBill));
            if (incoming.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 recebimento da parcela vencida?");
              messageBox.setText("Alerta Gerente Digital!");
              int result = messageBox.open();
              if (result == SWT.YES) {
View Full Code Here

                    if(operation != null) {
                      if(!operation.isOperationLinked()) {
                        system.execute(new AddExtractBankItem(bankOperationNumber, description, value, date, operation, accountId));
                      }
                    } 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){
View Full Code Here

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

                Operation relatedOperation = extractBankItem.getRelatedOperation();
        if(relatedOperation != null) {
                  item.setText(4, "Opera��o efetuada na conta "+ relatedOperation.getAccount().getName() +": "+ relatedOperation.getDescription());
                }
       
        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());
View Full Code Here

                idOperation = string;
        }
        idOperation = String.valueOf(Integer.parseInt(idOperation) + 1);
       
        Account account = system.getAccounts().get(accountId);
        Incoming incoming = system.getIncoming().get(incomingId);
       
//        Incoming myIncoming = new Incoming(incoming.getId(), incoming.getDescription(), incoming.getNextPaymentDate(), incoming.getFrequency(),incoming.getNumberOfOcurrencies(), incoming.getValue(), incoming.isFixedValue(), incoming.getCategoryId(), incoming.getObservation());
//        myIncoming.setActive(false);

        Operation operation;
       
        if(typeOfPayment == null){
          typeOfPayment = system.getPaymentMoney();
        }else{
          if (typeOfPayment.getType().equals("Dinheiro")) {
            typeOfPayment = system.getPaymentMoney();
      } else if (typeOfPayment.getType().equals("D�bito autom�tico")) {
        typeOfPayment = system.getPaymentAutomaticDebit();
      } else if (typeOfPayment.getType().equals("Pagamento eletr�nico")) {
        typeOfPayment = system.getPaymentEletronic();
      } else if (typeOfPayment.getType().equals("Transfer�ncia eletr�nica")) {
        typeOfPayment = system.getPaymentEletronicTransfer();
      } else if (typeOfPayment.getType().equals("TED")) {
        typeOfPayment = system.getPaymentTED();
      } else if (typeOfPayment.getType().equals("DOC")) {
        typeOfPayment = system.getPaymentDOC();
      } else if (typeOfPayment.getType().equals("Saque cart�o")) {
        typeOfPayment = system.getPaymentGetMoney();
      }
        }
       
        if(idExtractItem == null){
            operation = new Operation(idOperation,account, incoming.getCategoryId(), gdDate, incoming.getDescription(), new Money(value).getFloatValue(),typeOfPayment, false, incoming.getId());
        } else {
            operation = new Operation(idOperation,account,incoming.getCategoryId(),gdDate, incoming.getDescription(),new Money(value).getFloatValue(),typeOfPayment, false, incoming.getId(), idExtractItem);
            operation.setOperationLinked(true);
            system.getExtractItemMap().remove(idExtractItem);
        }
        system.getOperations().put(idOperation, operation);

        incoming.skip();
       
        if (incoming.getLastPaymentDate() != null && (incoming.getFrequency() == 0 || incoming.getNextPaymentDate().after(incoming.getLastPaymentDate()))) {
            incoming.setActive(false);
        } else if(incoming.getLastPaymentDate() == null && incoming.getFrequency() == 0){
          incoming.setActive(false);
        }else {
            if (!incoming.isFixedValue()) {
                for (Operation operationTemp : system.getOperations().values()) {
                    if(!operationTemp.isExpenditure()) {
                      if(operationTemp.getBillId() != null)
                          if (operationTemp.getBillId().equals(incoming.getId())) {
                              total.credit(operationTemp.getValue());
                              count++;
                          }
                    }
                }
                incoming.setValue(new Money(total.getValue() / count));
            }
        }
    }
View Full Code Here

        this.gdDateNextPaymentDate = nextPaymentDate;
    }

    @Override
    protected void execute(PrevalentSystem system) throws BusinessException {
        Incoming incoming = system.incoming.get(id);
        if (gdDateNextPaymentDate == null || gdDateNextPaymentDate.afterDay(incoming.getLastPaymentDate()) || incoming.getFrequency() == 0) {
            incoming.setActive(false);
        } else {
            incoming.setNextPaymentDate(gdDateNextPaymentDate);
        }
    }
View Full Code Here

        this.isActive = isActive;
    }

    @Override
    protected void execute(PrevalentSystem system) {
      Incoming incoming = system.getIncoming().get(incomingId);
      incoming.setActive(isActive);
    }
View Full Code Here

      this.observation = observation;
    }

    @Override
    protected void execute(PrevalentSystem system) throws BusinessException {
        Incoming incoming = new Incoming(id, description, gdDatenextIncomingDate, frequency, numberOfOcurrencies, value, fixedValue, categoryId, observation);
        incoming.setFirstPaymentDate(gdDatenextIncomingDate);
        incoming.setLastPaymentDate();
       
        system.getIncoming().put(id, incoming);
    }
View Full Code Here

                  if(incoming.getNumberOfOcurrencies() > 0){
                    int i = 1;
                    while (i <= incoming.getNumberOfOcurrencies()) {
                      if ( date.afterOrEqualsDay(fromDate) && date.beforeOrEqualsDay(toDate) ){
//                        Incoming myBill = new Incoming(incoming.getId(), incoming.getDescription(), new GDDate(date), incoming.getFrequency(), incoming.getNumberOfOcurrencies(), incoming.getValue(), incoming.isFixedValue(), incoming.getCategoryId(), incoming.getObservation());
                        Incoming myBill = new Incoming(incoming.getId(), incoming.getDescription(), new GDDate(date), incoming.getFrequency(), incoming.getNumberOfOcurrencies(), incoming.getValue(), incoming.isFixedValue(), incoming.getCategoryId(), incoming.getObservation(),incoming.getFirstPaymentDate(),incoming.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) ){
                        Incoming myBill = new Incoming(incoming.getId(), incoming.getDescription(), new GDDate(date), incoming.getFrequency(), incoming.getNumberOfOcurrencies(), incoming.getValue(), incoming.isFixedValue(), incoming.getCategoryId(), incoming.getObservation(),incoming.getFirstPaymentDate(),incoming.getLastPaymentDate());
                        list.add(myBill);
                      }
                      date = skip(date, frequency);
                      if (date == null) {
                        break;
                      }
                    }
                  }
                }
            }
            SortComparator comparator = new SortComparator();
            Collections.sort(list, comparator);
         
         
            int bgColorControl = 0;

            for (Incoming incoming : list) {
                    if (incoming.isActive()) {
                        TableItem item = new TableItem(incomingTable, 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 nextIncomingDate = incoming.getNextPaymentDate();
                        GDDate today = new GDDate();
                       
                      Incoming incomingToCompare = (Incoming) system.query(new GetIncoming(incoming.getId()));
                        GDDate paymentDayBill = incomingToCompare.getNextPaymentDate();
             
              if (paymentDayBill.beforeDay(nextIncomingDate) && paymentDayBill.beforeDay(today)) {
                item.setImage(new Image(null, "img/icoExpiradNotPayed.png"));
              } else if (nextIncomingDate.beforeOrEqualsDay(todayPlusOneWeek) && nextIncomingDate.afterOrEqualsDay(today)) {
                            item.setImage(new Image(null, "img/icoWarningExpiration.png"));
View Full Code Here

TOP

Related Classes of br.com.visualmidia.business.Incoming

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.