Package br.com.visualmidia.business

Examples of br.com.visualmidia.business.Money


            TreeItem treeItem = new TreeItem(courses, SWT.NONE);
            treeItem.setText(course.getDescription());
            treeItem.setImage(new Image(getShell().getDisplay(), "img/course.png"));
            treeItem.setText(0, (countercouses++) + "");
            treeItem.setText(1, course.getDescription());
            treeItem.setText(2, new Money(course.getValue()).getFormatedValue());
            treeItem.setText(3, course.getDuration());
            oldNumberOfParcels += Integer.parseInt(course.getDuration());
//          }
      }
     
      List<Parcel> registrationParcelList = registration.getParcels();
      MergeSortAlgorithm sort = new MergeSortAlgorithm();
      sort.sortParcelByDate(registrationParcelList);
     
      for (int i = 0; i < registrationParcelList.size(); i++) {
        Parcel parcel = registrationParcelList.get(i);
       
              GDDate date = new GDDate(parcel.getDate());
              GDDate today = new GDDate();
              GDDate todayPlusOneWeek = new GDDate();
              todayPlusOneWeek.addDays(7);
       
              GDDate graceDays = new GDDate(parcel.getDate());
          graceDays.addDays(Integer.valueOf(system.getProperty("gracedays")));
         
        TableItem item = new TableItem(parcelTable, SWT.NONE);
       
        if (parcel.isPayed()) {
                item.setImage(new Image(null, "img/icoPay.png"));
              } else if ((date.before(todayPlusOneWeek) && date.after(today)) || date.equals(today)) {
                item.setImage(new Image(null, "img/icoWarningExpiration.png"));
              } else if (date.before(today) && today.beforeOrEquals(graceDays)) {
                item.setImage(new Image(null, "img/icoInGraceDays.png"));               
              } else if (date.before(today) && today.after(graceDays)) {
                item.setImage(new Image(null, "img/icoExpirad.png"));
              } else {
                item.setImage(new Image(null, "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.getIdPersonReceived() != null) {
          Person person = (Person) system.query(new GetPerson(parcel.getIdPersonReceived()));
          item.setText(4, person.getName());
        } else {
          item.setText(4, "");
View Full Code Here


   
  private void generateParcels() {
    int numberOfItensAdd = courses.getItems().length - treeItemsOld.length;
    if(numberOfItensAdd > 0){
      for (int i = 1; i <= numberOfItensAdd; i++) {
        _valueAdd.credit(new Money(courses.getItems()[courses.getItems().length - i].getText(2)));
        _duration += Integer.parseInt(courses.getItems()[courses.getItems().length - i].getText(3));
      }
      MessageBox box = new MessageBox(getShell(), SWT.ICON_QUESTION|SWT.YES|SWT.NO);
      box.setMessage("Deseja recalcular as parcelas de acordo com os cursos adicionados?");
      box.setText("Alerta Gerente Digital");
View Full Code Here

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

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

        return !total.equals(totalPayment);
  }
View Full Code Here

      Map<String, Operation> operationMap = (Map<String, Operation>) system.query(new GetOperation());
      for (Operation operation : operationMap.values()) {
        if(operation.getAccount().isBankAccount() && !operation.isOperationLinked() && (extractBankItem.getAccount() == null ? true : extractBankItem.getAccount().getId().equals(operation.getAccount().getId()))) {
          float operationBeginValue = operation.getValue() - 20;
          float operationEndValue = operation.getValue() + 20;
          float extractBankItemValue = new Money(extractBankItem.getValue()).getFloatValue();
         
            GDDate beginDate = new GDDate(operation.getDateTime());
            beginDate.addDays(-3);
           
            GDDate endDate = new GDDate(operation.getDateTime());
            endDate.addDays(3);
         
          if((extractBankItem.getDate().afterDay(beginDate) && extractBankItem.getDate().beforeDay(endDate))
              && (extractBankItemValue > operationBeginValue && extractBankItemValue < operationEndValue) )
          {
            TableItem item = new TableItem(table, SWT.NONE);
                     
            item.setText(0, operation.getId());
            item.setText(1, new GDDate(operation.getDateTime()).getFormatedDate());
            item.setText(2, "Opera��o, "+ operation.getAccount().getName());
            item.setText(3, operation.getDescription());
            item.setText(4, ((operation.isCredit())? "" : "-") + new Money(operation.getValue()).getFormatedValue());
                  }
        }
      }
     
//      Map<String, Incoming> incomingMap = (Map<String, Incoming>) system.query(new GetIncoming());
View Full Code Here

                 
          item.setText(0, operation.getId());
          item.setText(1, new GDDate(operation.getDateTime()).getFormatedDate());
          item.setText(2, "Opera��o, "+ operation.getAccount().getName());
          item.setText(3, operation.getDescription());
          item.setText(4, ((operation.isCredit())? "" : "-") + new Money(operation.getValue()).getFormatedValue());
        }
      }
      tableOrder.reOrder();
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

             
              item.setText(0, incoming.getId());
              item.setText(1, incoming.getNextPaymentDate().getFormatedDate());
              item.setText(2, system.getBillPlan().get(incoming.getCategoryId()).getDescription());
              item.setText(3, incoming.getDescription());
              item.setText(4, new Money(incoming.getValue()).getFormatedValue());
            }
          }
        } else {
          Map<String, Expenditure> expenditureMap = (Map<String, Expenditure>) system.query(new GetExpenditures());
          for (Expenditure expenditure : expenditureMap.values()) {
            if(expenditure.isActive()){
              TableItem item = new TableItem(table, SWT.NONE);
             
              item.setText(0, expenditure.getId());
              item.setText(1, expenditure.getNextPaymentDate().getFormatedDate());
              item.setText(2, system.getBillPlan().get(expenditure.getCategoryId()).getDescription());
              item.setText(3, expenditure.getDescription());
              item.setText(4, "-" + new Money(expenditure.getValue()).getFormatedValue());
            }
          }
        }
        tableOrder.reOrder();
      } catch (Exception e) {
View Full Code Here

      table.removeAll();
      try {
        if(extractBankItem.isCredit()) {
          Map<String, Incoming> incomingMap = (Map<String, Incoming>) system.query(new GetIncoming());
          for (Incoming incoming : incomingMap.values()) {
            if(incoming.getValue().getValue() == new Money(extractBankItem.getValue()).getValue()) {
              TableItem item = new TableItem(table, SWT.NONE);
             
              item.setText(0, incoming.getId());
              item.setText(1, incoming.getNextPaymentDate().getFormatedDate());
              item.setText(2, system.getBillPlan().get(incoming.getCategoryId()).getDescription());
              item.setText(3, incoming.getDescription());
              item.setText(4, new Money(incoming.getValue()).getFormatedValue());
            }
          }
        } else {
          Map<String, Expenditure> expenditureMap = (Map<String, Expenditure>) system.query(new GetExpenditures());
          for (Expenditure expenditure : expenditureMap.values()) {
            if(expenditure.getValue().getValue() == new Money(extractBankItem.getValue()).getValue()) {
              TableItem item = new TableItem(table, SWT.NONE);
             
              item.setText(0, expenditure.getId());
              item.setText(1, expenditure.getNextPaymentDate().getFormatedDate());
              item.setText(2, system.getBillPlan().get(expenditure.getCategoryId()).getDescription());
              item.setText(3, expenditure.getDescription());
              item.setText(4, "-" + new Money(expenditure.getValue()).getFormatedValue());
            }
          }
        }
        tableOrder.reOrder();
      } catch (Exception e) {
View Full Code Here

    private void addNewOperation() {
      if((extractBankItem.getAccount() == null ? new AccountsDialog(getShell(), this).open() == TitleAreaDialog.OK : true)) {
        BillCategory billCategory = system.getBillPlan().get(billPlanCombo.getText());
          String categoryId = billCategory.getId();
          new MoneyTransaction().accountOperationAndLinkExtractItem(account, categoryId, new GDDate(dateText.getText()), descriptionText.getText(), new Money(valueText.getText()).getFloatValue(), new PaymentMoney(), extractBankItem.getId());
          close();
      }
  }
View Full Code Here

                }                 
                if(registrationList.size() > 0) {
                    sortAlgorithm.sortRegistrationByDateOfLastParcel(registrationList);
                }
               
                Money totalParcel = new Money(0);
                for (Registration registration : registrationList) {
                  if (registration.isActive()) {
                      int parcelsTotal = 0;
                      int parcelsPayed = 0;
                      List<Parcel> parcels = registration.getParcels();
                     
                      sortAlgorithm.sortParcelByDate(parcels);
                     
                      Parcel lastParcel = parcels.get(parcels.size()-1);
                      totalParcel.credit(lastParcel.isPayed()? lastParcel.getPayValue() : new GDDate(lastParcel.getDate()).beforeDay(new GDDate()) ? lastParcel.getValueAfterParcelDateExpiration() : lastParcel.getValueBeforeParcelDateExpiration());
                      for(Parcel parcel : parcels) {
                          parcelsTotal++;
                          if(parcel.isPayed())
                              parcelsPayed++;
                      }
                      page.addElement(drawRectangle(posX, posY, 535, 15, 0));
                      page.addElement(insertText(bodyStyle, registration.getStudent().getName(), posX+5, 215));
                      page.addElement(divLine(posX+220));
                      page.addElement(insertText(bodyStyle, registration.getIdRegistration(), posX+225, 30));
                      page.addElement(divLine(posX+255));
                      page.addElement(insertText(bodyStyle, String.valueOf(parcelsTotal), posX+260, 40));
                      page.addElement(divLine(posX+300));
                      page.addElement(insertText(bodyStyle, String.valueOf(parcelsPayed), posX+305, 40));
                      page.addElement(divLine(posX+345));
                      page.addElement(insertText(bodyStyle, String.valueOf(parcelsTotal-parcelsPayed), posX+350, 55));
                      page.addElement(divLine(posX+405));
                      page.addElement(insertText(bodyStyle, new GDDate(lastParcel.getDate()).getFormatedDate(), posX+410, 70));
                      page.addElement(divLine(posX+480));
                      page.addElement(insertText(bodyStyle, new Money(lastParcel.isPayed()? lastParcel.getPayValue() : new GDDate(lastParcel.getDate()).beforeDay(new GDDate()) ? lastParcel.getValueAfterParcelDateExpiration() : lastParcel.getValueBeforeParcelDateExpiration()).getFormatedValue(), posX+485, 50));
                     
                      posY += 15;
                      totalPerAttendant++;
                     
                      if(posY > (convert(297)-20)){
                          jasperPrint.addPage(page);
                          page = new JRBasePrintPage();
                          posY = convert(10);
                      }
                  }
                }
               
                page.addElement(insertFooter("Total de Alunos: "+totalPerAttendant + "                Total R$: " + totalParcel.getFormatedValue(), posY));
               
                posY += 15;
           jasperPrint.addPage(page);
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

        registrationDuration = String.valueOf(registration.getDuration());
        registrationInitDate = registration.getInitDate() != null ? registration.getInitDate().getFormatedDate() : "N�o cadastrada";
       

        registrationValue = new Money(registration.getRegistrationValue()).getFormatedValue();
       
        float registrationTaxValue = 0;
        float totalParcelsValueWithDiscount = 0;
        Parcel firstParcelRegistration = null;
        firstParcelRegistration = ( registration.getParcel(0).isRegistrationTax() ? registration.getParcel(1) : registration.getParcel(0) );
        int numberParcels= 0;
        for (Parcel parcel : registration.getParcels()) {
          if (parcel.isRegistrationTax()) {
            registrationTaxValue = parcel.getValueAfterParcelDateExpiration();
          } else {
            totalParcelsValueWithDiscount += parcel.getValueBeforeParcelDateExpiration();
            numberParcels++;
          }
        }
        numberOfParcels = String.valueOf(numberParcels);

        registrationTax = new Money(registrationTaxValue).getFormatedValue();
        registrationValueWithTotalDiscount = new Money(totalParcelsValueWithDiscount).getFormatedValue();
        registrationPontualityDiscount = registration.getPontualityDiscount().getFormatedValue();
        registrationDateOfTheFirstParcel = firstParcelRegistration.getDate();
        registrationParcelsValueBeforeDate = new Money(firstParcelRegistration.getValueBeforeParcelDateExpiration()).getFormatedValue();
        registrationParcelsValueAfterDate = new Money(firstParcelRegistration.getValueAfterParcelDateExpiration()).getFormatedValue();
        registrationDateOfTheNextParcels = String.valueOf(firstParcelRegistration.getDate().substring(0, 2));

        attendancaEmployeeName = registration.getEmployee().getName();
        attendancedate = registration.getRegistrationDate();
        attendanceHowDoYouKnow = student.getHowDoYouKnowVisualMidia();
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.