Package br.com.visualmidia.business

Examples of br.com.visualmidia.business.MoneyTransaction


                   
                  
                    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


                            String agencyManager = (bankAgencyManagerText.getText() == null)
                                    ? ""
                                    : bankAgencyManagerText.getText();

                            newAccount = (Account) system.executeAndQuery(new AddAccount(accountNameText.getText(), new GDDate(), numberofAccount, responsableName, limitAccount, dateOfOpen, bankId, bankName, agencyName, agencyAddress, agencyphone, agencyManager));
                            new MoneyTransaction().addAccountInicialAmount(newAccount, new Money(amountText.getText()));
                        } else {
                            newAccount = (Account) system.executeAndQuery(new AddAccount(accountNameText.getText(), new GDDate(), (Person) system.query(new GetPersonByName(personCombo.getText()))));
                            new MoneyTransaction().addAccountInicialAmount(newAccount, new Money(amountText.getText()));
                        }
                        accountCotrolCenter.updateTable();
                        close();
                    } else {
                        setMessage("Voc� n�o pode deixar nenhuma informa��o em branco.", IMessageProvider.ERROR);
View Full Code Here

                      break;
                    }
                  }
                }
                if(accountSelected.equals(accountNameLogged)){
                  new MoneyTransaction().incomingPayment(getIncomingId(), accountId, paidDate.getCalendar(), paidTotal.getValue(), paymentTypeCombo.getPaymentType(), extractBankItem);
                } else {
                  Account accountDestiny = (Account) system.query(new GetAccountByName(accountSelected));
                  accountId = accountDestiny.getId();
                  if(!accountDestiny.isBankAccount()) {
                    User user = ((User)accountDestiny.getPerson().getPersonType("user"));
                    ConfirmUserAndPasswordDialog dialog = new ConfirmUserAndPasswordDialog(getShell(), user);
                    dialog.open();
                    if(dialog.isCheckPassword()) {
                      new MoneyTransaction().incomingPayment(getIncomingId(), accountId, paidDate.getCalendar(), paidTotal.getValue(), paymentTypeCombo.getPaymentType(), extractBankItem);
                    }
                  } else {
                    new MoneyTransaction().incomingPayment(getIncomingId(), accountId, paidDate.getCalendar(), paidTotal.getValue(), paymentTypeCombo.getPaymentType(), extractBankItem);
                  }
                }
                close();
                GDWindowControl.getInstance().updateControlCenter();
              } else {
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

        mora = new Money(moraText.getText()).getFloatValue();//Float.parseFloat(clearString(moraText.getText()));
     
      if (!discountText.getText().equals(""))
        discount = new Money(discountText.getText()).getFloatValue();//Float.parseFloat(clearString(discountText.getText()));
     
      new MoneyTransaction().parcelPayment(registration, accountId, parcelId, ticket, mora, discount, payTotal, new GDDate(), paymentTypeCombo.getPaymentType(), new Money(receivedValueText.getText()));
     
      if (registrationParentScreen != null) {
        registrationParentScreen.updateTable();
      }
      if (dayleParentScreen != null) {
View Full Code Here

                          if(!accountDestiny.getPerson().getId().equals(personLogged.getId())){
                            ConfirmUserAndPasswordDialog dialogConfirmAccountDestiny = new ConfirmUserAndPasswordDialog(getShell(), ((User)accountDestiny.getPerson().getPersonType("user")));
                              dialogConfirmAccountDestiny.open();
                             
                              if(dialogConfirmAccountDestiny.isCheckPassword()) {
                                new MoneyTransaction().transferMoneyBetweenAccounts(paymentAccountCombo.getText(), moneyFromAccount, transferValue);
                              }
                              close();
                          }else{
                            new MoneyTransaction().transferMoneyBetweenAccounts(paymentAccountCombo.getText(), moneyFromAccount, transferValue);
                            close();
                          }
                        }else{
                          Group groupAdmin = (Group) system.query(new GetGroup("Administrador"));
                          ConfirmUserAndPasswordDialog dialogConfirmAccountSource = new ConfirmUserAndPasswordDialog(getShell(), groupAdmin.getPeopleInThisGroup());
                          dialogConfirmAccountSource.open();
                         
                          if(dialogConfirmAccountSource.isCheckPassword()) {
                            new MoneyTransaction().transferMoneyBetweenAccounts(paymentAccountCombo.getText(), moneyFromAccount, transferValue);
                          }
                          close();
                        }
                       
                      }else if(!moneyFromAccount.isBankAccount() && accountDestiny.isBankAccount()){
                        if(moneyFromAccount.getPerson().getId().equals(personLogged.getId())){
                          new MoneyTransaction().transferMoneyBetweenAccounts(paymentAccountCombo.getText(), moneyFromAccount, transferValue);
                        }else{
                          boolean isOk = false;
                              boolean passwordIsOk = false;
                          if(moneyFromAccount.getId().equals(personLogged.getId())){
                                isOk = true;
                              }else{
                                User userAccountSource = ((User)moneyFromAccount.getPerson().getPersonType("user"));
                                ConfirmUserAndPasswordDialog dialogConfirmAccountSource = new ConfirmUserAndPasswordDialog(getShell(), userAccountSource);
                                dialogConfirmAccountSource.open();
                                passwordIsOk = dialogConfirmAccountSource.isCheckPassword();
                              }
                             
                              if(passwordIsOk || isOk) {
                                new MoneyTransaction().transferMoneyBetweenAccounts(paymentAccountCombo.getText(), moneyFromAccount, transferValue);
                              }
                        }
                        close();
                        }else if(moneyFromAccount.isBankAccount() && accountDestiny.isBankAccount()){//Conta Banco para Conta Banco
                           if(isAdmin(personLogged)){
                             new MoneyTransaction().transferMoneyBetweenAccounts(paymentAccountCombo.getText(), moneyFromAccount, transferValue);
                        }else{
                          Group groupAdmin = (Group) system.query(new GetGroup("Administrador"));
                          ConfirmUserAndPasswordDialog dialogConfirmAccountSource = new ConfirmUserAndPasswordDialog(getShell(), groupAdmin.getPeopleInThisGroup());
                          dialogConfirmAccountSource.open();
                         
                          if(dialogConfirmAccountSource.isCheckPassword()) {
                            new MoneyTransaction().transferMoneyBetweenAccounts(paymentAccountCombo.getText(), moneyFromAccount, transferValue);
                          }
                        }
                           close();
                        }else {//Conta caixa para conta caixa
                          boolean isOk = false;
                          boolean passwordIsOk = false;
                          User userAccountSource = ((User)moneyFromAccount.getPerson().getPersonType("user"));
                          if(moneyFromAccount.getPerson().getId().equals(personLogged.getId())){
                            isOk = true;
                          }else{
                            ConfirmUserAndPasswordDialog dialogConfirmAccountSource = new ConfirmUserAndPasswordDialog(getShell(), userAccountSource);
                            dialogConfirmAccountSource.open();
                            passwordIsOk = dialogConfirmAccountSource.isCheckPassword();
                          }
                         
                          if(isOk || passwordIsOk) {
                if(accountDestiny.getPerson().getId().equals(personLogged.getId())){
                               new MoneyTransaction().transferMoneyBetweenAccounts(paymentAccountCombo.getText(), moneyFromAccount, transferValue);
                             }else{
                               User userAccountDestiny = ((User)accountDestiny.getPerson().getPersonType("user"));
                               ConfirmUserAndPasswordDialog dialogConfirmDestiny = new ConfirmUserAndPasswordDialog(getShell(), userAccountDestiny);
                               dialogConfirmDestiny.open();
                              
                               if(dialogConfirmDestiny.isCheckPassword()) {
                                 new MoneyTransaction().transferMoneyBetweenAccounts(paymentAccountCombo.getText(), moneyFromAccount, transferValue);
                               }
                             }
                              close();
                          }
                        }
View Full Code Here

                if(paidDate.isToday()) {
                  Account accountDestiny = (Account) system.query(new GetAccountByName(paymentExpenditureAccountCombo.getText()));
                  if((system.getRegisterMachine() != null ? paymentExpenditureAccountCombo.getText().equals(system.getRegisterMachine().getName()) : false) || accountDestiny.isBankAccount()){
                    if(accountDestiny.isBankAccount()) {
                      if((accountDestiny.getLimit().getFloatValue() + accountDestiny.getAmount().getFloatValue()) >= paidTotal.getFloatValue()) {
                        new MoneyTransaction().expendituresPayment(getExpenditureId(), getAccountId(), paidDate, paidTotal.getValue(), paymentTypeCombo.getPaymentType(), extractBankItem);
                        GDWindowControl.getInstance().updateControlCenter();
                        close();
                      } else {
                        setErrorMessage("N�o existe saldo suficiente para efetuar a transa��o.");
                      }
                    } else {
                      new MoneyTransaction().expendituresPayment(getExpenditureId(), getAccountId(), paidDate, paidTotal.getValue(), paymentTypeCombo.getPaymentType(), extractBankItem);
                      GDWindowControl.getInstance().updateControlCenter();
                      close();
                    }
                  } else {
                    ConfirmUserAndPasswordDialog dialog = new ConfirmUserAndPasswordDialog(getShell(), ((User)accountDestiny.getPerson().getPersonType("user")));
                        dialog.open();
                       
                        if(dialog.isCheckPassword()) {
                          new MoneyTransaction().expendituresPayment(getExpenditureId(), getAccountId(), paidDate, paidTotal.getValue(), paymentTypeCombo.getPaymentType(), extractBankItem);
                          GDWindowControl.getInstance().updateControlCenter();
                            close();
                        }
                  }
                } else {
                  if(MessageDialog.openQuestion(getShell(), "Data invalida!", "A data '"+ paymentExpenditureDateText.getText() +"' � uma data diferente da atual, deseja efetuar a opera��o mesmo assim?")){
                    Account accountDestiny = (Account) system.query(new GetAccountByName(paymentExpenditureAccountCombo.getText()));
                    if((system.getRegisterMachine() != null ? paymentExpenditureAccountCombo.getText().equals(system.getRegisterMachine().getName()) : false) || accountDestiny.isBankAccount()){
                      new MoneyTransaction().expendituresPayment(getExpenditureId(), getAccountId(), paidDate, paidTotal.getValue(), paymentTypeCombo.getPaymentType(), extractBankItem);
                      close();
                    } else {
                      ConfirmUserAndPasswordDialog dialog = new ConfirmUserAndPasswordDialog(getShell(), ((User)accountDestiny.getPerson().getPersonType("user")));
                          dialog.open();
                         
                          if(dialog.isCheckPassword()) {
                            new MoneyTransaction().expendituresPayment(getExpenditureId(), getAccountId(), paidDate, paidTotal.getValue(), paymentTypeCombo.getPaymentType(), extractBankItem);
                              close();
                          }
                    }
                      GDWindowControl.getInstance().updateControlCenter();
                  }
View Full Code Here

    private void doTheTransfer() {
        Money transferValue = new Money(amountText.getText());
        Money amountValue = new Money(registerMachineControlCenter.getBalanceValue());
                                      
        if(transferValue.getFloatValue() <= amountValue.getFloatValue()){
            new MoneyTransaction().transferMoneyBetweenAccounts(paymentAccountCombo.getText(), system.getRegisterMachine(), transferValue);
            GDWindowControl.getInstance().updateControlCenter();
            close();
        }else{
            setMessage("N�o existe saldo suficiente para efetuar a transfer�ncia.", IMessageProvider.ERROR);
        }
View Full Code Here

                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.MoneyTransaction

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.