Package br.com.visualmidia.business

Examples of br.com.visualmidia.business.Money


    private void createPayTotalFields() {
        Label totalLabel = new Label(mainPanel, SWT.LEFT);
        totalLabel.setText("Total do curso:");

        Text totalText = new Text(mainPanel, SWT.SINGLE | SWT.BORDER);
        totalText.setText(new Money(registration.getRegistrationValue()).getFormatedValue());
        totalText.setEditable(false);

        GridData data = new GridData();
        data.widthHint = 80;
        data.horizontalSpan = 2;
View Full Code Here


                } else {
                    item.setImage(new Image(null, (parcel.isRegistrationTax() ? "img/icoNotPayRegistrationTax.png" : "img/icoNotPay.png")));
                }
                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());
               
                if (parcel.getTicket() != Float.parseFloat("0"))
                    item.setText(4, MoneyMask.format(String.valueOf(parcel.getTicket()).replace(".", ",")));
                if (parcel.getMora() != Float.parseFloat("0"))
                    item.setText(5, MoneyMask.format(String.valueOf(parcel.getMora()).replace(".", ",")));
                if (parcel.getDiscount() != Float.parseFloat("0"))
                    item.setText(6, MoneyMask.format(String.valueOf(parcel.getDiscount()).replace(".", ",")));
//                if (parcel.getPayValue() != Float.parseFloat("0"))
                    item.setText(7, MoneyMask.format(String.valueOf(parcel.getPayValue()).replace(".", ",")));
//                if(parcel.getValueReceived().getFloatValue() != Float.parseFloat("0")){
                  item.setText(8, parcel.getValueReceived().getFormatedValue());
//                }
                  item.setText(9, String.valueOf(new Money(parcel.getValueReceived().getFloatValue() - parcel.getPayValue()).getFormatedValue()));
                if (parcel.getPayDate() != null)
                    item.setText(10, parcel.getPayDate().getFormatedDate());
                if (parcel.getPayment() instanceof PaymentCheck) {
                    PaymentCheck check = (PaymentCheck) parcel.getPayment();
                   
View Full Code Here

      Parcel parcel = registration.getParcels().get(
          parcelsSelectedItens[i]);
      totalToPay += parcel.getValueAfterParcelDateExpiration();
    }

    totalToPayMoney = new Money(totalToPay);
    totalText.setText(totalToPayMoney.getFormatedValue());

    GridData data = new GridData();
    data.widthHint = 80;
    data.horizontalSpan = 2;
View Full Code Here

          paymentTable.removeAll();
          parcelList = getNewParcelList();
          int numberOfParcels = Integer.parseInt(numberOfParcelsText
              .getText());

          Money money = new Money(totalText.getText());
          List<Money> moneyParcel = money.parcel(numberOfParcels);

          Money subTotal = new Money(0);
          for (int i = 1; i <= moneyParcel.size(); i++) {
            Money parcelValue = moneyParcel.get(i - 1);

            TableItem item = new TableItem(paymentTable, SWT.NULL);
            item.setText(0, i + "");

            item.setText(1, parcelDate.getFormatedDate());
            parcelDate.addMonth(1);

            item.setText(2, parcelValue.getFormatedValue());

            subTotal.credit(parcelValue);
            item.setText(3, subTotal.getFormatedValue());

            parcelList.add(new Parcel(item.getText(1), new Money(
                item.getText(2)).getFloatValue(), new Money(
                item.getText(2)).getFloatValue()
                - pontualityDiscount, 0, 0, 0, 0));
          }

        }
View Full Code Here

    generateParcelsButton.setLayoutData(new GridData(
        GridData.VERTICAL_ALIGN_BEGINNING));
  }

  protected boolean totalsAreDifferent() {
    Money total = new Money(totalText.getText());
    Money totalPayment = new Money(0);

    for (int i = 0; i < paymentTable.getItemCount(); i++) {
      totalPayment.credit(new Money(paymentTable.getItem(i).getText(2)));
    }

    return (total.equals(totalPayment)) ? false : true;
  }
View Full Code Here

    return (total.equals(totalPayment)) ? false : true;
  }

  private void calculateValue() {
    Money calculation = new Money(totalToPayMoney);

    if (!additionText.getText().equals(""))
      calculation.credit(new Money(additionText.getText()));
    if ((!discountingText.getText().equals(""))
        && (getDiscounting() <= totalToPayMoney.getFloatValue())) {
      calculation.debit(new Money(discountingText.getText()));
    } else if (discountingText.getText().equals(""))
      setMessage("", IMessageProvider.NONE);
    else
      setMessage("Valor do desconto superior ao valor da Parcela",
          IMessageProvider.ERROR);

    totalText.setText(calculation.getFormatedValue());
  }
View Full Code Here

                if(bill != null){
               
                    Expenditure expenditure = new Expenditure(bill.getId(), bill.getDescription(), bill.getNextPaymentDate(), bill.getFrequency(),bill.getNumberOfOcurrencies(), bill.getValue(), bill.isFixedValue(), bill.getCategoryId(), bill.getObservation());
                    expenditure.setActive(false);
                   
                    Money money = new Money(linkedOperation.getOperation().getValue());
                    GDDate date = new GDDate(linkedOperation.getOperation().getDateTime());
                   
                    Account account = system.accounts.get(accountId);
                   
                    Operation operation = new Operation(id, account, expenditure.getCategoryId(), date, expenditure. getDescription(), money.getFloatValue());
                    system.operations.put(id, operation);
                   
                    bill.skip();
                   
                    if (bill.getFrequency() == 0 || (bill.getLastPaymentDate() == null ? true : bill.getNextPaymentDate().after(bill.getLastPaymentDate()))) {
                        bill.setActive(false);
                    } else {
                        if (!bill.isFixedValue()) {
                            Map<String, PaidExpenditure> tempMap = new HashMap<String, PaidExpenditure>();
                            for (PaidExpenditure bill2 : system.paidExpenditures.values()) {
                                if (bill2.getEnpenditure() == bill) {
                                    tempMap.put(bill2.getId(), bill2);
                                }
                            }
   
                            Money total = new Money(0);
   
                            for (PaidExpenditure bills : tempMap.values()) {
                                total.credit(bills.getValue());
                            }
   
                            bill.setValue(new Money(total.getValue() / tempMap.size()));
                        }
                    }
                }
            }
View Full Code Here

    }

    @Override
    protected void execute(PrevalentSystem system) throws BusinessException {
        int count = 0;
        Money total = new Money(0);
       
        String idOperation = "0";
        for (String string : system.operations.keySet()) {
            if (Integer.parseInt(idOperation) <= Integer.parseInt(string))
                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.bankName = bankName;
        this.agencyName = agencyName;
        this.agencyAddress = agencyAddress;
        this.agencyphone = agencyphone;
        this.agencyManager = agencyManager;
        this.initialAmount = new Money(0);
        this.id = "-1";
    }
View Full Code Here

   
    public AddAccount(String name, GDDate openDate, Person person) {
        this.name = name;
        this.openDate = openDate;
        this.personId = person.getId();
        this.initialAmount = new Money(0);
        this.limit = new Money(0);
        this.id = "-1";
    }
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.