Package br.com.visualmidia.business

Examples of br.com.visualmidia.business.Parcel


    sort.sortParcelByDate(parcels);
    parcelTable.removeAll();

    float payTotal = 0;
    for (int i = 0; i < parcels.size(); i++) {
      Parcel parcel = (Parcel) parcels.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);
      try {
        if (parcel.isPayed()) {
          item.setImage(new Image(null, (parcel.isRegistrationTax() ? "img/icoRegistrationTaxPay.png" : "img/icoPay.png")));
          payTotal += parcel.getPayValue();
        } else if ((date.before(todayPlusOneWeek) && date.after(today)) || date.equals(today)) {
          item.setImage(new Image(null, (parcel.isRegistrationTax() ? "img/icoWarningExpirationRegistrationTax.png" : "img/icoWarningExpiration.png")));
        } else if (date.before(today) && today.beforeOrEquals(graceDays)) {
          item.setImage(new Image(null, (parcel.isRegistrationTax() ? "img/icoExpiredRegistrationTax.png" : "img/icoInGraceDays.png")));
        } else if (date.before(today) && today.after(graceDays)) {
          item.setImage(new Image(null, (parcel.isRegistrationTax() ? "img/icoExpiredRegistrationTax.png" : "img/icoExpirad.png")));
        } 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.getIdPersonReceived() != null) {
          Person person = (Person) system.query(new GetPerson(parcel.getIdPersonReceived()));
          item.setText(4, person.getName());
        } else {
          item.setText(4, "");
        }
      } catch (Exception e) {
View Full Code Here


      List<Parcel> list = registration.getParcels();
      MergeSortAlgorithm sort = new MergeSortAlgorithm();
      sort.sortParcelByDate(list);
     
      Parcel parcel = list.get(Integer.parseInt(idRegistration[1]) - 1);
     
      if (!parcel.isPayed() && !isParcelOpen(list, parcel)) {new ParcelPaymentDialog(getShell(), registration, Integer.parseInt(idRegistration[1]) - 1, true).open();
        getRegistration();
        updateParcelTable();
      }
    } catch (Exception e) {
      logger.error("GetRegistration Exception: ",e);
View Full Code Here

        item.setBackground(new Color(null,255,255,255));
        item.setText(0, "Matr�cula: " + registration.getIdRegistration());
      }

      for (int i = 0; i < parcels.size(); i++) {
        Parcel parcel = (Parcel) parcels.get(i);

        GDDate date = new GDDate(parcel.getDate());
        GDDate today = new GDDate();
        GDDate todayPlusOneWeek = new GDDate();
        todayPlusOneWeek.addDays(7);//(Calendar.DAY_OF_MONTH, 7);
        GDDate graceDays = new GDDate(parcel.getDate());
        graceDays.addDays(Integer.valueOf(system.getProperty("gracedays")));
       
        TableItem item2 = new TableItem(parcelTable, SWT.NONE);
        if (parcel.isPayed()) {
          item2.setImage(new Image(null, "img/icoPay.png"));
          payTotal += parcel.getPayValue();
        } else if ((date.before(todayPlusOneWeek) && date.after(today))  || date.equals(today)) {
          item2.setImage(new Image(null,"img/icoWarningExpiration.png"));
        } else if (date.before(today) && today.beforeOrEquals(graceDays)) {
          item2.setImage(new Image(null, "img/icoInGraceDays.png"));
        } else if (date.before(today) && today.after(graceDays)) {
          item2.setImage(new Image(null, "img/icoExpirad.png"));
        } else {
          item2.setImage(new Image(null, "img/icoNotPay.png"));
        }
        item2.setText(0, registration.getIdRegistration() + "/"  + (i + 1));
        item2.setText(1, parcel.getDate());
        item2.setText(2, new Money(parcel.getValueBeforeParcelDateExpiration()).getFormatedValue());
        item2.setText(3, new Money(parcel.getValueAfterParcelDateExpiration()).getFormatedValue());
       
      }
     
       
    }
View Full Code Here

        MergeSortAlgorithm sort = new MergeSortAlgorithm();
    sort.sortParcelByDate(parcels);

        Image printerImage = new Image(getDisplay(), "img/printer.png");
        for (int i = 0; i < parcels.size(); i++) {
            Parcel parcel = (Parcel) parcels.get(i);
            if(!parcel.isPayed()) {
                GDDate todayPlusOneWeek = new GDDate();
                todayPlusOneWeek.addDays(7);
               
                TableItem item = new TableItem(parcelTable, SWT.NONE);
                if (parcel.isPrinted()) {
                    item.setImage(printerImage);
                } else {
                    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

      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 boolean isAnyParcelPayed() {
        int[] selectedIndices = parcelTable.getSelectionIndices();
       
        for (int i = 0; i < selectedIndices.length; i++) {
            Parcel parcel = registration.getParcels().get(selectedIndices[i]);
            if(parcel.isPayed()) {
                return true;
            }
        }
       
        return false;
View Full Code Here

                      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)){
View Full Code Here

        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

                setMessage("Data para gera��o de taxa de matr�cula inferior a data atual", IMessageProvider.ERROR);
            } else {
              Money value = new Money(registrationTaxText.getText());
                if(value.getFloatValue() > 0) {
                  GDDate date = new GDDate(registrationTaxDateText.getText());
                  Parcel parcelTax = new Parcel(date.getFormatedDate(), value.getFloatValue(), value.getFloatValue(), Float.parseFloat("0"), Float.parseFloat("0"), Float.parseFloat("0"), Float.parseFloat("0"), true);
                  parcelList.add(parcelTax);
                }

                List <String> courseIdList = new ArrayList <String>();
                TreeItem[] items = courses.getItems();
View Full Code Here

      registrationParcelList = registration.getParcels();
            MergeSortAlgorithm sort = new MergeSortAlgorithm();
      sort.sortParcelByDate(registrationParcelList);
     
      for (int i = 0; i < registrationParcelList.size(); i++) {
        Parcel parcel = registrationParcelList.get(i);
       
        TableItem item = new TableItem(paymentTable, SWT.NONE);
        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());
      }
     
      numberOfLessonsText.setText(registrationParcelList.size() +"");
     
      calculateCourseValue();
View Full Code Here

TOP

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

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.