Package br.com.visualmidia.business

Examples of br.com.visualmidia.business.Money


  private void updateAmountAccount() {
      try {
        Map<String, Account> accounts = (Map<String, Account>) system.query(new GetAccounts());
        for (Account account : accounts.values()) {
          Money money = new Money(0);
          Map<String, Operation> operations = (Map<String, Operation>) system.query(new GetOperationByAccountId(account.getId()));
          for (Operation operation : operations.values()) {
            if(operation.isCredit()){
              money.credit(operation.getValue());
            }else{
              money.debit(operation.getValue());
            }
          }
          system.execute(new SetAmountOfAccount(money, account.getId()));
        }
      } catch (Exception e) {
View Full Code Here


        }
        return finantialInfoList;
    }

    public void calculatePayCheck() {
        Money payCheck = new Money(0);
        TableItem[] itens = finantialTable.getItems();
       
        for (TableItem item : itens) {
            Money value = new Money(item.getText(4));
            if (item.getText(0).equals("Acr�scimo")){
                payCheck.credit(value);
            } else {
                payCheck.debit(value);
            }
View Full Code Here

                    page.addElement(divLine(posX+240));
                    page.addElement(insertText(parcel.getParcel().getDate(), posX+245, 65));
                    page.addElement(divLine(posX+310));
                    page.addElement(insertText(parcel.getNumberOfParcel(), posX+315, 40));
                    page.addElement(divLine(posX+355));
                    page.addElement(insertRightText(new Money(parcel.getParcel().getTicket()).getFormatedValue(), posX+360, 35));
                    page.addElement(divLine(posX+400));
                    page.addElement(insertRightText(new Money(parcel.getParcel().getMora()).getFormatedValue(), posX+405, 35));
                    page.addElement(divLine(posX+445));
                    page.addElement(insertRightText(new Money(parcel.getParcel().getDiscount()).getFormatedValue(), posX+450, 35));
                    page.addElement(divLine(posX+490));
                    page.addElement(insertRightText(new Money(parcel.getParcel().getPayValue()).getFormatedValue(), posX+495, 35));
                   
                    posY += 15;
                   
                    totalOfParcels++;
                    valueTotalOfParcels += parcel.getParcelValue();
                    allTotalOfParcels ++;
                    allValueTotalOfParcels += parcel.getParcelValue();
                   
                    if(posY > (convert(290)-25)){
                        jasperPrint.addPage(page);
                        page = new JRBasePrintPage();
                        posY = convert(10);
                    }
                }

               
                page.addElement(insertFooterLeft("Total de Parcelas: "+totalOfParcels));
                page.addElement(insertFooterRight("Valor Total: "+new Money(valueTotalOfParcels).getFormatedValue()));
               
                posY += 25;
               
                page.addElement(drawGrayRectangle(posX, posY, 535, 20, 3));
                page.addElement(insertTitleBox("Alunos Finalizados" + obs));
               
                posY += 25;
               
                totalOfParcels = 0;
                valueTotalOfParcels = 0;
               
                page.addElement(drawRectangle(posX, posY, 535, 15, 0));
                page.addElement(insertCenterBoldText("Nome", posX, 170));
                page.addElement(divLine(posX+170));
                page.addElement(insertCenterBoldText("Data de Pgto", posX+170, 70));
                page.addElement(divLine(posX+240));
                page.addElement(insertCenterBoldText("Data de Vcto", posX+240, 70));
                page.addElement(divLine(posX+310));
                page.addElement(insertCenterBoldText("Parcela", posX+310, 45));
                page.addElement(divLine(posX+355));
                page.addElement(insertCenterBoldText("Multa", posX+355, 45));
                page.addElement(divLine(posX+400));
                page.addElement(insertCenterBoldText("Mora", posX+400, 45));
                page.addElement(divLine(posX+445));
                page.addElement(insertCenterBoldText("Desc.", posX+445, 45));
                page.addElement(divLine(posX+490));
                page.addElement(insertCenterBoldText("Valor", posX+490, 40));
               
                posY += 15;
               
                for(ParcelData parcel : parcelDataListFinalization){
                    page.addElement(drawRectangle(posX, posY, 535, 15, 0));
                    page.addElement(insertText((parcel.isRegistrationTax() ? "(*) " : "") + parcel.getStudentName(), posX+5, 165));
                    page.addElement(divLine(posX+170));
                    page.addElement(insertText(parcel.getParcel().getPayDate().getFormatedDate(), posX+175, 65));
                    page.addElement(divLine(posX+240));
                    page.addElement(insertText(parcel.getParcel().getDate(), posX+245, 65));
                    page.addElement(divLine(posX+310));
                    page.addElement(insertText(parcel.getNumberOfParcel(), posX+315, 40));
                    page.addElement(divLine(posX+355));
                    page.addElement(insertRightText(new Money(parcel.getParcel().getTicket()).getFormatedValue(), posX+360, 35));
                    page.addElement(divLine(posX+400));
                    page.addElement(insertRightText(new Money(parcel.getParcel().getMora()).getFormatedValue(), posX+405, 35));
                    page.addElement(divLine(posX+445));
                    page.addElement(insertRightText(new Money(parcel.getParcel().getDiscount()).getFormatedValue(), posX+450, 35));
                    page.addElement(divLine(posX+490));
                    page.addElement(insertRightText(new Money(parcel.getParcel().getPayValue()).getFormatedValue(), posX+495, 35));
                   
                   
                    posY += 15;
                   
                    totalOfParcels++;
                    valueTotalOfParcels += parcel.getParcelValue();
                    allTotalOfParcels ++;
                    allValueTotalOfParcels += parcel.getParcelValue();
                   
                    if(posY > (convert(290)-25)){
                        jasperPrint.addPage(page);
                        page = new JRBasePrintPage();
                        posY = convert(10);
                    }
                }
               
                page.addElement(insertFooterLeft("Total de Parcelas: "+totalOfParcels));
                page.addElement(insertFooterRight("Valor Total: "+new Money(valueTotalOfParcels).getFormatedValue()));
               
                posY += 15;
               
                page.addElement(insertFooterLeft("Total Geral de Parcelas: "+allTotalOfParcels));
                page.addElement(insertFooterRight("TOTAL GERAL: "+new Money(allValueTotalOfParcels).getFormatedValue()));
               
                posY += 15;
               
                jasperPrint.addPage(page);
           
View Full Code Here

   
    private void createParcelsMap(Person person, Parcel parcel, int index, int numberOfParcel, boolean isActive, String idRegistration) {
        float value;
        String numberOfParcelStr = "";

        value = new Money(parcel.getPayValue()).getFloatValue();


        try {
            numberOfParcelStr = idRegistration + "/" + numberOfParcel;
        } catch (Exception e) {
View Full Code Here

        try {
          String id = (editAccountId == null) ? (String) system.query(new GetExpenditureId()) : editAccountId;

          String categoryId = billPlan.get(billPlanCombo.getText()).getId();
          system.execute(new AddExpenditures(id, descriptionText.getText(), nextPaymentDateText.getText(), frequencyCombo
              .getSelectionIndex(), Integer.parseInt(numberOfOcurrenciesText.getText()), new Money(
                  (valueText.getText().equals("") ? VALUE_0_00 : valueText.getText())), (fixedValue.getSelectionIndex() == 0) ? true
                      : false, categoryId, observation.getText()));
        } catch (TransactionDateException e) {
          MessageBox box = new MessageBox(parent.getShell(), IMessageProvider.INFORMATION);
          box.setText("Data Inv�lida");
          box.setMessage(MessageConstants.TRANSACTION_DATE_EXCEPTION);
          box.open();
        } catch (Exception e) {
          logger.error("Get Expenditure Exception: ", e);
        }
      } else {
        try {
          String id = (editAccountId == null) ? (String) system.query(new GetIncomingId()) : editAccountId;
          String categoryId = billPlan.get(billPlanCombo.getText()).getId();
          system.execute(new AddIncoming(id, descriptionText.getText(), new GDDate(nextPaymentDateText.getText()), frequencyCombo
              .getSelectionIndex(), Integer.parseInt(numberOfOcurrenciesText.getText()), new Money(
                  (valueText.getText().equals("") ? VALUE_0_00 : valueText.getText())), (fixedValue.getSelectionIndex() == 0) ? true
                      : false, categoryId, observation.getText()));
        } catch (TransactionDateException e) {
          MessageBox box = new MessageBox(parent.getShell(), IMessageProvider.INFORMATION);
          box.setText("Data Inv�lida");
View Full Code Here

                    BillCategory billCategory = system.getBillPlan().get(billPlanComboTree.getText());
                    String categoryId = billCategory.getId();
                   
                  
                    if(categoryId.charAt(0) == '2'){
                        Money valueComp = new Money(valueText.getText());
                        if(balanceValue.getFloatValue() >= valueComp.getFloatValue()){
                            Operation operation = new MoneyTransaction().accountOperation(system.getRegisterMachine(), categoryId, new GDDate(), descriptionText.getText(), new Money(valueText.getText()).getFloatValue(), paymentTypeCombo.getPaymentType());
                            addOperationToTable(operation);
                           
                            clearForNewTransaction();
                        }else{
                            setErrorMessage("Saldo Insuficiente.");
                        }
                    }else{
                        Operation operation = new MoneyTransaction().accountOperation(system.getRegisterMachine(), categoryId, new GDDate(), descriptionText.getText(), new Money(valueText.getText()).getFloatValue(), paymentTypeCombo.getPaymentType());
                        addOperationToTable(operation);

                        clearForNewTransaction();
                    }
                } catch (Exception e) {
View Full Code Here

                gc.drawLine(0, 1, footer.getClientArea().width, 1);
                gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));
                gc.drawLine(0, 2, footer.getClientArea().width, 2);
                gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));

                String balanceValueFormated = new Money(balanceValue).getFormatedValue();
               
                Point endBalance = gc.textExtent("Balan�o final: R$ " + balanceValueFormated);
                gc.drawText("Balan�o final: R$ " + balanceValueFormated, footer.getClientArea().width - 10 - endBalance.x, 10, SWT.DRAW_TRANSPARENT);
                gc.dispose();
            }
View Full Code Here

  private void addOperationToTable(Operation operation) {
    TableItem item = new TableItem(accountTable, SWT.NONE);

    int bgColorControl = 0;
    Money operationValue = new Money(operation.getValue());

    if (bgColorControl == 1) {
        item.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));
        bgColorControl = 0;
    } else {
        bgColorControl = 1;
    }
    if (operation.isCredit())
        item.setImage(new Image(null, "img/entrada.png"));
    else
        item.setImage(new Image(null, "img/saida.png"));
    item.setText(0, operation.getId());
    item.setText(1, new SimpleDateFormat("EEE, dd/MM/yyyy HH:mm:ss").format(operation.getDateTime().getDate()));
    item.setText(2, system.getBillPlan().get(operation.getCategoryId()).getDescription());
    item.setText(3, operation.getDescription());
    String text = "";
    if(operation.getPaymentType() == null){
      text = new PaymentMoney().getType();
    }else{
      if(operation.getPaymentType().getType().equals("Dep�sito em Conta")){
        try {
          PaymentBankAccountPayed paymentBank = (PaymentBankAccountPayed) operation.getPaymentType();
          Account account = (Account) system.query(new GetAccounts(paymentBank.getAccountId()));
          text = "Dep�sito na conta "+account.getName();
        } catch (Exception e) {
          logger.error("GetAccounts Exception: ",e);
        }
      }else{
        text = operation.getPaymentType().getType();
      }
    }
   
    item.setText(4, text);
   
    if (operation.isCredit()) {
        item.setText(5, operationValue.getFormatedValue());
        balanceValue.credit(operationValue);
    } else {
        item.setText(6, operationValue.getFormatedValue());
        balanceValue.debit(operationValue);
    }
    if (balanceValue.getFloatValue() < 0)
        item.setForeground(7, Display.getCurrent().getSystemColor(SWT.COLOR_RED));
   
View Full Code Here

                    float inMoney = (!operation.isCredit()) ? 0f : operation.getValue();
                    float outMoney = (operation.isCredit()) ? 0f : operation.getValue()* -1;
                    balanceUntilLastDay += inMoney + outMoney;
                }
            }
            return new Money(balanceUntilLastDay);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
View Full Code Here

            return null;
        }
    }
   
  public Money getPayTotal() {
    return new Money(valueText.getText());
  }
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.