Package br.com.visualmidia.business

Examples of br.com.visualmidia.business.Parcel


    }

  @Override
  protected Object executeAndQuery(PrevalentSystem system) {
     Registration registration = system.registrations.get(idRegistration);
       Parcel parcel = registration.getParcel(idParcel);
         
          if(parcel != null){
            parcel.setTicket(ticket);
            parcel.setMora(mora);
            parcel.setDiscount(discount);
            parcel.setPayValue(payValue);
            parcel.setPayDate(gdDatePayDate);
            parcel.setPayed(true);
            parcel.setPersonReceivedId(personId);
            parcel.setValueReceived(_valueReceived);
           
           
              if(paymentType == null){
                parcel.setPaymenType(system.getPaymentMoney());
              }else{
                if (paymentType.getType().equals("Dinheiro")) {
                  parcel.setPaymenType(system.getPaymentMoney());
            } else if (paymentType.getType().equals("D�bito autom�tico")) {
              parcel.setPaymenType(system.getPaymentAutomaticDebit());
            } else if (paymentType.getType().equals("Pagamento eletr�nico")) {
              parcel.setPaymenType(system.getPaymentEletronic());
            } else if (paymentType.getType().equals("Transfer�ncia eletr�nica")) {
              parcel.setPaymenType(system.getPaymentEletronicTransfer());
            } else if (paymentType.getType().equals("TED")) {
              parcel.setPaymenType(system.getPaymentTED());
            } else if (paymentType.getType().equals("DOC")) {
              parcel.setPaymenType(system.getPaymentDOC());
            } else if (paymentType.getType().equals("Saque cart�o")) {
              parcel.setPaymenType(system.getPaymentGetMoney());
            }else if(paymentType instanceof PaymentBankAccountPayed){
                  boolean paymentTypeBankAccountExists = false;
                  for (int i = 0; i< system.getPaymentTypeBankAccount().size(); i++) {
                    if(system.getPaymentTypeBankAccount().get(i).getAccountId().equals(this.accountId)){
                      parcel.setPaymenType(system.getPaymentTypeBankAccount().get(i));
                      paymentTypeBankAccountExists = true;
                      break;
                    }
                  }
                 
                  if(!paymentTypeBankAccountExists){
                    PaymentBankAccountPayed paymentTypeBankAccount = new PaymentBankAccountPayed(this.accountId);
                    system.getPaymentTypeBankAccount().add(paymentTypeBankAccount);
                    for (int j=0; j < system.getPaymentTypeBankAccount().size(); j++){
                      if(system.getPaymentTypeBankAccount().get(j).getAccountId().equals(this.accountId)){
                        parcel.setPaymenType(system.getPaymentTypeBankAccount().get(j));
                        break;
                      }
                    }
                  }
                } else if (paymentType.getType().equals("Cheque")) {
                  parcel.setPaymenType(paymentType);
                }
             
              }
           
           
View Full Code Here


    sort.sortParcelByDate(parcelList);

    this.parcelList = new ArrayList<Parcel>();

    for (int j = 0; j < parcelList.size(); j++) {
      Parcel parcel = parcelList.get(j);
      pontualityDiscount = parcel.getValueAfterParcelDateExpiration()
          - parcel.getValueBeforeParcelDateExpiration();

      boolean theParcelHasBeinFounded = false;
      for (int i = 0; i < parcelsSelectedItens.length; i++) {
        if (parcelsSelectedItens[i] == j) {
          theParcelHasBeinFounded = true;
View Full Code Here

    totalText = new Text(composite, SWT.SINGLE | SWT.BORDER);
    totalText.setEditable(false);

    float totalToPay = 0;
    for (int i = 0; i < parcelsSelectedItens.length; i++) {
      Parcel parcel = registration.getParcels().get(
          parcelsSelectedItens[i]);
      totalToPay += parcel.getValueAfterParcelDateExpiration();
    }

    totalToPayMoney = new Money(totalToPay);
    totalText.setText(totalToPayMoney.getFormatedValue());
View Full Code Here

            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

    }

    protected Object executeQuery(PrevalentSystem system){
            Registration registration = system.registrations.get(idRegistration);

            Parcel parcel = registration.getParcel(Integer.valueOf(idParcel)-1);
            if(parcel != null){
              if ((parcel.getPaymentType() == "Cheque")) {
                if (parcel.getPayment() instanceof PaymentCheck) {
                  check = (PaymentCheck) parcel.getPayment();
                }
              }
            }
        return check;
    }
View Full Code Here

        this.printed = printed;
    }

  protected void execute(PrevalentSystem system) throws BusinessException {
      Registration registration = system.registrations.get(idRegistration);
      Parcel parcel = registration.getParcel(idParcel);
     
      if(parcel != null){
        float pontualityDiscount = parcel.getValueAfterParcelDateExpiration() - parcel.getValueBeforeParcelDateExpiration();
       
        parcel.setValueBeforeParcelDateExpiration(total - pontualityDiscount);
        parcel.setValueAfterParcelDateExpiration(total);
        parcel.setDate(date);
        parcel.setPayed(false);
        parcel.setPrinted(printed);
      }
    }
View Full Code Here

    protected void execute(PrevalentSystem system) throws BusinessException {
        Registration localRegistrations = system.registrations.get(registrationId);
        List<Parcel> parcels = localRegistrations.getParcels();
        if(parcels.size() > 0){
          Parcel parcel = parcels.get(parcelPosition);
          parcel.setPrinted(true);
        }
    }
View Full Code Here

        GDDate dateLastParcel = new GDDate();
        int i = 0;
      while (parcels.get(i).isPayed()) {
        i++;
      }
      Parcel lastParcel = parcels.get(i);
             
      dateLastParcel.setDayOfMonth((int) new GDDate(lastParcel.getDate()).getDayOfMonth());
      dateLastParcel.setMonthOfYear((int) new GDDate().getMonth());
        // Foi adicionado pois verifica se o usuario clicou em SIM ou NAO para remover parcelas existentes
        if (option){
          registration.setParcels(removeParcelsWhenRegistrationIsEnded(gdDateEndDate.getCalendar(), registration.getParcels(), system));
          //if (registration.getParcels().size()>0){
            dateLastParcel = new GDDate(registration.getParcel(registration.getParcels().size()-1).getDate());
            dateLastParcel.addMonth(1);
        //  }
         
        }
        if(status.getCategory().equals("Desistiu")) {
//          GDDate date;
//          if (registration.getParcels().size()==0){
//            date = new GDDate();
//          }else{
//            date = new GDDate(registration.getParcels().get(i).getDate());
//          }
//          dateLastParcel.setDayOfMonth(date.getDayOfMonth());
          //Adicionado um m�s para gerar as parcelas da recis�o para o m�s seguinte
//          dateLastParcel.setMonthOfYear(date.getMonth()==12 ? 1 : date.getMonth()+1);

          //Adiciona as parcelas de acordo com a multa recis�ria
            for (i = 0; i < fine; i++) {
              Parcel parcel = new Parcel(dateLastParcel.getFormatedDate(), lastParcel.getValueAfterParcelDateExpiration(), lastParcel.getValueBeforeParcelDateExpiration(), lastParcel.getTicket(), lastParcel.getMora(), 0, 0);
              registration.getParcels().add(parcel);
              dateLastParcel.addMonth(1);
            }
       
        }
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

  }

    @Override
    protected void execute(PrevalentSystem system) throws BusinessException {
      Registration registration = system.registrations.get(_idRegistration);
      Parcel parcel = registration.getParcel(_idParcel);
      if(parcel != null){
        parcel.setValueAfterParcelDateExpiration(new Money(_value).getFloatValue());
        parcel.setValueBeforeParcelDateExpiration(new Money(_value).getFloatValue()-new Money(_discount).getFloatValue());
        parcel.setDiscount(new Money(_discount).getFloatValue());
        parcel.setDate(new GDDate(_date));
      }
  }
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.