Package br.com.visualmidia.business

Examples of br.com.visualmidia.business.Money


         discountPontuallityText .setLayoutData(data);
  }

  protected void buttonPressed(int buttonId) {
        if (buttonId == OK) {
            float total = (float) new Money(totalText.getText()).getValue();
            GDDate date = new GDDate(paymentDateText.getText());
            if ( ( system.hasAccess("Editar Parcelas de Matricula") ? true : new GDDate().beforeOrEquals(date))) {
              if ( total > registration.getPontualityDiscount().getFloatValue()){
                try {
                  system.execute(new ParcelEdition(registration.getIdRegistration(), parcelId, total, date, false));
View Full Code Here


        totalText = new Text(dialog, SWT.RIGHT | SWT.SINGLE | SWT.BORDER);
        Validator.validateNumbers(totalText);
        Validator.validateTextOfMoneyValuesToAvoidEmptyStrings(totalText);
       
        totalText.setText(new Money(parcel.getValueAfterParcelDateExpiration()).getFormatedValue());
        new MoneyMask(totalText);
       
        GridData data = new GridData(GridData.FILL);
        data.widthHint = 80;
        totalText.setLayoutData(data);
View Full Code Here

          date.addDays(-1*limitOverDueCredit);
        }
        GDDate end = cashFlowControlCenter.getEndDate();
        int bgColorControl = 0;
       
        Money total = new Money("0");
       
        while (date.beforeOrEqualsDay(end)) {
          if (!cashFlow.isEmpty(date)) {
                TableItem item = new TableItem(cashFlowTable, SWT.NULL);
                if (bgColorControl == 1) {
                    item.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));
                    bgColorControl = 0;
                } else {
                    bgColorControl = 1;
                }
               
                total.credit(cashFlow.getTotal(date));

                String valueToReceiveStr = (cashFlow.getToReceive(date).toString().equals(VALUE_0_00)) ? "" : cashFlow.getToReceive(date).getFormatedValue();
                String valueToPayStr = (cashFlow.getToPay(date).toString().equals(VALUE_0_00)) ? "" : cashFlow.getToPay(date).getFormatedValue();
                String totalStr = (total.toString().equals(VALUE_0_00)) ? "" : total.getFormatedValue();

                item.setText(0, date.getFormatedDate());
                item.setText(1, valueToReceiveStr);
                item.setText(2, valueToPayStr);
                item.setText(3, new Money(new Money((valueToReceiveStr.equals("") ? "0" : valueToReceiveStr)).getFloatValue() + new Money((valueToPayStr.equals("") ? "0" : valueToPayStr)).getFloatValue()).getFormatedValue());
                item.setText(5, totalStr);
            }
            date.addDays(1);
        }

       
        Money amountAccountsSelected = new Money(0);
        for(Account account : getSelectedAccounts().values()){
          amountAccountsSelected.credit(account.getAmount());
        }
        total.credit(amountAccountsSelected);
       
        endCashLabelValue.setText(total.getFormatedValue());
        cashFlowTable.setRedraw(true);
View Full Code Here

       
        GDDate date = startDate;
        GDDate end = endDate;
        cashFlow.assembly(date, end, unconsiderToReceive, unconsiderToPay);
       
        Money total = new Money("0");
        String totalStr = "";
       
        Money amountAccountsSelected = new Money(0);
        for(Account account : accountMap.values()){
          amountAccountsSelected.credit(account.getAmount());
        }
        total.credit(amountAccountsSelected);
       
        if (!withDetail){
          page.addElement(insertBoldText("Data: ", posX+5, posY+5, 170));
View Full Code Here

    @SuppressWarnings("unchecked")
  protected void buttonPressed(int buttonId) {
        if (buttonId == OK) {
          setConfirmed(true);
            GDDate paidDate = getPaidDate();
            Money paidTotal = getPaidTotal();

            try {
              String accountSelected = incomingAccountCombo.getText();
              String accountId = "";
        if(!accountSelected.equals("Selecione uma conta...")) {
                String accountNameLogged = "";
                Map<String, Account> accountMap = (Map<String, Account>) system.query(new GetAccounts());
                for (Account account : accountMap.values()) {
                  if(!account.isBankAccount()){
                    if(account.getPerson().getId().equals(system.getLogged().getId())){
                      accountNameLogged = account.getName();
                      accountId = account.getId();
                      break;
                    }
                  }
                }
                if(accountSelected.equals(accountNameLogged)){
                  new MoneyTransaction().incomingPayment(getIncomingId(), accountId, paidDate.getCalendar(), paidTotal.getValue(), paymentTypeCombo.getPaymentType(), extractBankItem);
                } else {
                  Account accountDestiny = (Account) system.query(new GetAccountByName(accountSelected));
                  accountId = accountDestiny.getId();
                  if(!accountDestiny.isBankAccount()) {
                    User user = ((User)accountDestiny.getPerson().getPersonType("user"));
                    ConfirmUserAndPasswordDialog dialog = new ConfirmUserAndPasswordDialog(getShell(), user);
                    dialog.open();
                    if(dialog.isCheckPassword()) {
                      new MoneyTransaction().incomingPayment(getIncomingId(), accountId, paidDate.getCalendar(), paidTotal.getValue(), paymentTypeCombo.getPaymentType(), extractBankItem);
                    }
                  } else {
                    new MoneyTransaction().incomingPayment(getIncomingId(), accountId, paidDate.getCalendar(), paidTotal.getValue(), paymentTypeCombo.getPaymentType(), extractBankItem);
                  }
                }
                close();
                GDWindowControl.getInstance().updateControlCenter();
              } else {
View Full Code Here

    public GDDate getPaidDate(){
        return new GDDate(incomingDateText.getText());
    }
   
    public Money getPaidTotal() {
        return new Money(incomingTotalText.getText());
    }
View Full Code Here

        return accountList;
    }

    @Override
  public Money getPayTotal() {
    return new Money(incomingTotalText.getText());
  }
View Full Code Here

                    item.setChecked(true);
                }
               
                item.setText(0, (i + 1) + "");
                item.setText(1, parcel.getDate());
                item.setText(2, new Money(parcel.getValueBeforeParcelDateExpiration()).getFormatedValue());
                item.setText(3, new Money(parcel.getValueAfterParcelDateExpiration()).getFormatedValue());
            }
        }
    }
View Full Code Here

            } else {
              id = course.getId();
            }
            system.execute(new AddCourse(id, descriptionText
                .getText(), numberOfLessonsText.getText(),
                durationText.getText(), new Money(valueText
                    .getText()).getFloatValue(),
                extraMaterialCheck.getSelection()));
            coursesCotrolCenter.updateCoursesTable();
            close();
          } catch (TransactionDateException e) {
View Full Code Here

    valueText = new Text(dialog, SWT.SINGLE | SWT.BORDER);
    valueText.setText("0,00");
    Validator.validateNumbers(valueText);
    Validator.validateTextOfMoneyValuesToAvoidEmptyStrings(valueText);
    if (course != null) {
      valueText.setText(new Money(course.getValue()).getFormatedValue());
    }
    valueText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    new MoneyMask(valueText);
  }
View Full Code Here

TOP

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

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.