Package br.com.visualmidia.business

Examples of br.com.visualmidia.business.TypeOfPayment


  protected void execute(PrevalentSystem system) throws BusinessException {
      for (Registration registration : system.getRegistrations().values()) {
        List<Parcel> parcels = registration.getParcels();
        for (Parcel parcel : parcels) {
          if(parcel.getPayment() != null){
            TypeOfPayment paymentType = parcel.getPayment();
            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){
              PaymentBankAccountPayed type = (PaymentBankAccountPayed) paymentType;
              boolean paymentTypeBankAccountExists = false;
              for (int i = 0; i< system.getPaymentTypeBankAccount().size(); i++) {
                if(system.getPaymentTypeBankAccount().get(i).getAccountId().equals(type.getAccountId())){
                  parcel.setPaymenType(system.getPaymentTypeBankAccount().get(i));
                  paymentTypeBankAccountExists = true;
                  break;
                }
              }
             
              if(!paymentTypeBankAccountExists){
                PaymentBankAccountPayed paymentTypeBankAccount = new PaymentBankAccountPayed(type.getAccountId());
                system.getPaymentTypeBankAccount().add(paymentTypeBankAccount);
                for (int j=0; j < system.getPaymentTypeBankAccount().size(); j++){
                  if(system.getPaymentTypeBankAccount().get(j).getAccountId().equals(type.getAccountId())){
                    parcel.setPaymenType(system.getPaymentTypeBankAccount().get(j));
                    break;
                  }
                }
              }
            } else if (paymentType.getType().equals("Cheque")) {
                    parcel.setPaymenType(paymentType);
                  }
          }
        }
      }
View Full Code Here


            public void handleEvent(Event arg0) {
                BillCategory billCategory = system.getBillPlan().get(billPlanCombo.getText());
                String categoryId = billCategory.getId();
                if(buttonPressed.equals("add")){
                    if((account.getLimit().getFloatValue() + account.getAmount().getFloatValue()) >= new Money(valueText.getText()).getFloatValue() || categoryId.charAt(0) == '1') {
                      TypeOfPayment paymentType = typeOfPaymentCombo.getPaymentType();
                      new MoneyTransaction().accountOperation(account, categoryId, new GDDate(dateText.getText()), descriptionText.getText(), new Money(valueText.getText()).getFloatValue(), paymentType);
                      clearTextFields();
                      setErrorMessage("");
                    } else {
                      setErrorMessage("N�o existe saldo suficiente para efetuar a transa��o.");
                    }
                }else{
                  categoryIdReversal = (categoryId.charAt(0) == '1')? "2.3.14" : "1.3.1";
                  TypeOfPayment paymentType = typeOfPaymentCombo.getPaymentType();
                  new MoneyTransaction().accountOperation(account, categoryIdReversal, new GDDate(dateText.getText()), descriptionText.getText(), new Money(valueText.getText()).getFloatValue(), paymentType);
                  clearTextFields();
                }
                updateFlowBankAccountTable();
            }
View Full Code Here

TOP

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

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.