Пример #1
0
  private void viewTypeCombo() {
    if (activeInActiveSelect == null) {
      activeInActiveSelect = new SelectCombo(messages.show());

      List<String> activetypeList = new ArrayList<String>();
      activetypeList.add(messages.active());
      activetypeList.add(messages.inActive());
      activeInActiveSelect.initCombo(activetypeList);
      activeInActiveSelect.setComboItem(messages.active());
      activeInActiveSelect.addSelectionChangeHandler(
          new IAccounterComboSelectionChangeHandler<String>() {

            @Override
            public void selectedComboBoxItem(String selectItem) {
              if (activeInActiveSelect.getSelectedValue() != null) {
                if (activeInActiveSelect
                    .getSelectedValue()
                    .toString()
                    .equalsIgnoreCase(messages.active())) {
                  refreshActiveinActiveList(true);
                } else {
                  refreshActiveinActiveList(false);
                }
              }
            }
          });
    }
  }
  protected void transactionDateRangeSelector() {
    dateRangeSelector = new SelectCombo(messages.date());

    ArrayList<String> dateRangeList = new ArrayList<String>();
    String[] dateRangeArray = {
      messages.all(),
      messages.thisWeek(),
      messages.thisMonth(),
      messages.lastWeek(),
      messages.lastMonth(),
      messages.thisFinancialYear(),
      messages.lastFinancialYear(),
      messages.thisFinancialQuarter(),
      messages.lastFinancialQuarter(),
      messages.financialYearToDate()
    };
    for (int i = 0; i < dateRangeArray.length; i++) {
      dateRangeList.add(dateRangeArray[i]);
    }
    dateRangeSelector.initCombo(dateRangeList);

    dateRangeSelector.setComboItem(messages.all());
    dateRangeSelector.addSelectionChangeHandler(
        new IAccounterComboSelectionChangeHandler<String>() {
          @Override
          public void selectedComboBoxItem(String selectItem) {
            dateRangeSelector.setComboItem(selectItem);
            if (dateRangeSelector.getValue() != null) {
              dateRangeChanged(selectItem);
              callRPC(0, getPageSize());
            }
          }
        });
  }
  private void transactionViewSelectCombo() {
    if (trasactionViewSelect == null) {
      trasactionViewSelect = new SelectCombo(messages.currentView());

      ArrayList<String> transactionTypeList = new ArrayList<String>();
      transactionTypeList.add(messages.allTransactions());
      for (String type : transactionTypes) {
        if (type.equalsIgnoreCase(messages.Charges())
            || type.equalsIgnoreCase(messages.credits())) {
          if (getPreferences().isDelayedchargesEnabled()) {
            transactionTypeList.add(type);
          } else {
            continue;
          }
        } else if (type.equalsIgnoreCase(messages.salesOrders())) {
          if (getPreferences().isSalesOrderEnabled()) {
            transactionTypeList.add(type);
          } else {
            continue;
          }
        } else if (type.equalsIgnoreCase(messages.purchaseOrders())) {
          if (getPreferences().isPurchaseOrderEnabled()) {
            transactionTypeList.add(type);
          } else {
            continue;
          }
        } else {
          transactionTypeList.add(type);
        }
      }
      trasactionViewSelect.initCombo(transactionTypeList);
      trasactionViewSelect.setComboItem(messages.allTransactions());
      trasactionViewSelect.addSelectionChangeHandler(
          new IAccounterComboSelectionChangeHandler<String>() {

            @Override
            public void selectedComboBoxItem(String selectItem) {
              if (trasactionViewSelect.getSelectedValue() != null) {
                getMessagesList();
                callRPC(0, 25);
              }
            }
          });
    }
  }
Пример #4
0
  private void transactionViewSelectCombo() {
    if (trasactionViewSelect == null) {
      trasactionViewSelect = new SelectCombo(messages.currentView());

      List<String> transactionTypeList = new ArrayList<String>();
      transactionTypeList.add(messages.allTransactions());
      transactionTypeList.add(messages.invoices());
      if (getPreferences().isDoyouwantEstimates()) {
        transactionTypeList.add(messages.quotes());
      }
      if (getCompany().getPreferences().isDelayedchargesEnabled()) {
        transactionTypeList.add(messages.Charges());
        transactionTypeList.add(messages.credits());
      }
      transactionTypeList.add(messages.cashSales());
      transactionTypeList.add(messages.receivedPayments());
      transactionTypeList.add(messages.CustomerCreditNotes());
      transactionTypeList.add(messages.customerRefunds(Global.get().Customer()));
      transactionTypeList.add(messages.cheques());
      if (getPreferences().isSalesOrderEnabled()) {
        transactionTypeList.add(messages.salesOrders());
      }
      trasactionViewSelect.initCombo(transactionTypeList);
      trasactionViewSelect.setComboItem(messages.allTransactions());
      trasactionViewSelect.addSelectionChangeHandler(
          new IAccounterComboSelectionChangeHandler<String>() {

            @Override
            public void selectedComboBoxItem(String selectItem) {
              if (trasactionViewSelect.getSelectedValue() != null) {
                getMessagesList();
                callRPC(0, getPageSize());
              }
            }
          });
    }
  }
Пример #5
0
  private void getMessagesList() {
    transactiontypebyStatusMap = new HashMap<Integer, String>();
    String selectedValue = trasactionViewSelect.getSelectedValue();
    if (selectedValue.equalsIgnoreCase(messages.allTransactions())) {
      transactiontypebyStatusMap.put(
          TransactionHistory.ALL_TRANSACTIONS, messages.allTransactions());
    } else if (selectedValue.equalsIgnoreCase(messages.invoices())) {
      transactiontypebyStatusMap.put(TransactionHistory.ALL_INVOICES, messages.getallInvoices());
      transactiontypebyStatusMap.put(
          TransactionHistory.OPENED_INVOICES, messages.getOpendInvoices());
      transactiontypebyStatusMap.put(
          TransactionHistory.OVER_DUE_INVOICES, messages.overDueInvoices());
      if (Accounter.hasPermission(Features.DRAFTS)) {
        transactiontypebyStatusMap.put(
            TransactionHistory.DRAFT_INVOICES, messages.draftTransaction(messages.invoices()));
      }
    } else if (selectedValue.equalsIgnoreCase(messages.cashSales())) {
      transactiontypebyStatusMap.put(
          TransactionHistory.ALL_CASHSALES, messages.all() + " " + messages.cashSales());
      if (Accounter.hasPermission(Features.DRAFTS)) {
        transactiontypebyStatusMap.put(
            TransactionHistory.DRAFT_CASHSALES, messages.draftTransaction(messages.cashSales()));
      }

    } else if (selectedValue.equalsIgnoreCase(messages.quotes())) {

      transactiontypebyStatusMap.put(TransactionHistory.ALL_QUOTES, messages.allQuotes());
      if (Accounter.hasPermission(Features.DRAFTS)) {
        transactiontypebyStatusMap.put(
            TransactionHistory.DRAFT_QUOTES, messages.draftTransaction(messages.quotes()));
      }
    } else if (selectedValue.equalsIgnoreCase(messages.credits())) {
      transactiontypebyStatusMap.put(TransactionHistory.ALL_CREDITS, messages.allCredits());
      if (Accounter.hasPermission(Features.DRAFTS)) {
        transactiontypebyStatusMap.put(
            TransactionHistory.DRAFT_CREDITS, messages.draftTransaction(messages.credits()));
      }

    } else if (selectedValue.equalsIgnoreCase(messages.Charges())) {

      transactiontypebyStatusMap.put(TransactionHistory.ALL_CHARGES, messages.allCahrges());
      if (Accounter.hasPermission(Features.DRAFTS)) {
        transactiontypebyStatusMap.put(
            TransactionHistory.DRAFT_CHARGES, messages.draftTransaction(messages.Charges()));
      }

    } else if (selectedValue.equalsIgnoreCase(messages.receivedPayments())) {
      transactiontypebyStatusMap.put(
          TransactionHistory.ALL_RECEIVEDPAYMENTS,
          messages.all() + " " + messages.receivedPayments());
      transactiontypebyStatusMap.put(
          TransactionHistory.RECEV_PAY_BY_CASH, messages.receivedPaymentsbyCash());
      transactiontypebyStatusMap.put(
          TransactionHistory.RECEV_PAY_BY_CHEQUE, messages.receivedPaymentsbyCheque());
      transactiontypebyStatusMap.put(
          TransactionHistory.RECEV_PAY_BY_CREDITCARD, messages.receivedPaymentsbyCreditCard());
      transactiontypebyStatusMap.put(
          TransactionHistory.RECEV_PAY_BY_DIRECT_DEBIT, messages.receivedPaymentsbyDirectDebit());
      transactiontypebyStatusMap.put(
          TransactionHistory.RECEV_PAY_BY_MASTERCARD, messages.receivedPaymentsbyMastercard());
      transactiontypebyStatusMap.put(
          TransactionHistory.RECEV_PAY_BY_ONLINE, messages.receivedPaymentsbyOnlineBanking());
      transactiontypebyStatusMap.put(
          TransactionHistory.RECEV_PAY_BY_STANDING_ORDER,
          messages.receivedPaymentsbyStandingOrder());
      transactiontypebyStatusMap.put(
          TransactionHistory.RECEV_PAY_BY_MAESTRO, messages.receivedPaymentsbySwitchMaestro());

    } else if (selectedValue.equalsIgnoreCase(messages.CustomerCreditNotes())) {
      transactiontypebyStatusMap.put(TransactionHistory.ALL_CREDITMEMOS, messages.allCreditMemos());
      if (Accounter.hasPermission(Features.DRAFTS)) {
        transactiontypebyStatusMap.put(
            TransactionHistory.DRAFT_CREDITMEMOS, messages.draftTransaction(messages.creditNote()));
      }
      // transactiontypebyStatusMap.put(
      // TransactionHistory.OPEND_CREDITMEMOS,
      // messages.openCreditMemos());

    } else if (selectedValue.equalsIgnoreCase(messages.customerRefunds(Global.get().Customer()))) {
      transactiontypebyStatusMap.put(
          TransactionHistory.REFUNDS_BY_CREDITCARD, messages.refundsByCreditCard());
      transactiontypebyStatusMap.put(TransactionHistory.REFUNDS_BYCASH, messages.refundsByCash());
      transactiontypebyStatusMap.put(
          TransactionHistory.REFUNDS_BYCHEQUE, messages.refundsByCheck());

      transactiontypebyStatusMap.put(
          TransactionHistory.ALL_CUSTOMER_REFUNDS, messages.allCustomerRefunds());
      if (Accounter.hasPermission(Features.DRAFTS)) {
        transactiontypebyStatusMap.put(
            TransactionHistory.DRAFT_CUSTOMER_REFUNDS,
            messages.draftTransaction(messages.customerRefunds(Global.get().Customer())));
      }
    } else if (trasactionViewSelect.getSelectedValue().equalsIgnoreCase(messages.cheques())) {
      transactiontypebyStatusMap.put(TransactionHistory.ALL_CHEQUES, messages.allcheques());
      if (Accounter.hasPermission(Features.DRAFTS)) {
        transactiontypebyStatusMap.put(
            TransactionHistory.DRAFT_CHEQUES, messages.draftTransaction(messages.cheques()));
      }
    } else if (trasactionViewSelect.getSelectedValue().equalsIgnoreCase(messages.salesOrders())) {
      transactiontypebyStatusMap.put(TransactionHistory.ALL_SALES_ORDERS, messages.all());
      transactiontypebyStatusMap.put(
          TransactionHistory.COMPLETED_SALES_ORDERS, messages.completed());
      transactiontypebyStatusMap.put(TransactionHistory.OPEN_SALES_ORDERS, messages.open());
    }
    List<String> typeList = new ArrayList<String>(transactiontypebyStatusMap.values());
    Collections.sort(
        typeList,
        new Comparator<String>() {

          @Override
          public int compare(String entry1, String entry2) {
            return entry1.compareTo(entry2);
          }
        });
    trasactionViewTypeSelect.initCombo(typeList);
    trasactionViewTypeSelect.setComboItem(typeList.get(0));
  }
  private void getMessagesList() {
    String selectedValue = trasactionViewSelect.getSelectedValue();
    transactiontypebyStatusMap = new HashMap<Integer, String>();
    if (trasactionViewSelect.getSelectedValue().equalsIgnoreCase(messages.allTransactions())) {
      transactiontypebyStatusMap.put(
          TransactionHistory.ALL_TRANSACTIONS, messages.allTransactions());
    } else if (selectedValue.equalsIgnoreCase(messages.quotes())) {

      transactiontypebyStatusMap.put(TransactionHistory.ALL_QUOTES, messages.allQuotes());
      transactiontypebyStatusMap.put(
          TransactionHistory.DRAFT_QUOTES, messages.draftTransaction(messages.quotes()));

    } else if (selectedValue.equalsIgnoreCase(messages.Charges())) {

      transactiontypebyStatusMap.put(TransactionHistory.ALL_CHARGES, messages.allCahrges());
      transactiontypebyStatusMap.put(
          TransactionHistory.DRAFT_CHARGES, messages.draftTransaction(messages.Charges()));

    } else if (selectedValue.equalsIgnoreCase(messages.credits())) {
      transactiontypebyStatusMap.put(TransactionHistory.ALL_CREDITS, messages.allCredits());
      transactiontypebyStatusMap.put(
          TransactionHistory.DRAFT_CREDITS, messages.draftTransaction(messages.credits()));

    } else if (selectedValue.equalsIgnoreCase(messages.invoices())) {
      transactiontypebyStatusMap.put(TransactionHistory.ALL_INVOICES, messages.getallInvoices());
      transactiontypebyStatusMap.put(
          TransactionHistory.OPENED_INVOICES, messages.getOpendInvoices());
      transactiontypebyStatusMap.put(
          TransactionHistory.OVER_DUE_INVOICES, messages.overDueInvoices());
      transactiontypebyStatusMap.put(
          TransactionHistory.DRAFT_INVOICES, messages.draftTransaction(messages.invoices()));
    } else if (selectedValue.equalsIgnoreCase(messages.cashSales())) {
      transactiontypebyStatusMap.put(
          TransactionHistory.ALL_CASHSALES, messages.all() + " " + messages.cashSales());
      transactiontypebyStatusMap.put(
          TransactionHistory.DRAFT_CASHSALES, messages.draftTransaction(messages.cashSales()));

    } else if (selectedValue.equalsIgnoreCase(messages.payeeCreditNotes(Global.get().Customer()))) {
      transactiontypebyStatusMap.put(TransactionHistory.ALL_CREDITMEMOS, messages.allCreditMemos());
      transactiontypebyStatusMap.put(
          TransactionHistory.DRAFT_CREDITMEMOS, messages.draftTransaction(messages.creditNote()));
      // transactiontypebyStatusMap.put(
      // TransactionHistory.OPEND_CREDITMEMOS,
      // messages.openCreditMemos());

    } else if (trasactionViewSelect.getSelectedValue().equalsIgnoreCase(messages.cashPurchases())) {
      transactiontypebyStatusMap.put(
          TransactionHistory.ALL_CASH_PURCHASES, messages.allCashPurchases());
      transactiontypebyStatusMap.put(
          TransactionHistory.DRAFT_CASH_PURCHASES,
          messages.draftTransaction(messages.cashPurchases()));

    } else if (trasactionViewSelect.getSelectedValue().equalsIgnoreCase(messages.bills())) {
      transactiontypebyStatusMap.put(TransactionHistory.ALL_BILLS, messages.allBills());
      transactiontypebyStatusMap.put(
          TransactionHistory.OPEND_BILLS, messages.all() + " " + messages.openedBills());
      transactiontypebyStatusMap.put(
          TransactionHistory.OVERDUE_BILLS, messages.all() + " " + messages.overDueBills());
      transactiontypebyStatusMap.put(
          TransactionHistory.DRAFT_BILLS, messages.draftTransaction(messages.bills()));

    } else if (trasactionViewSelect
        .getSelectedValue()
        .equalsIgnoreCase(messages.payeeCreditNotes(Global.get().Vendor()))) {
      transactiontypebyStatusMap.put(
          TransactionHistory.ALL_VENDOR_CREDITNOTES,
          messages.all() + " " + messages.payeeCreditNotes(Global.get().Vendor()));
      transactiontypebyStatusMap.put(
          TransactionHistory.DRAFT_VENDOR_CREDITNOTES,
          messages.draftTransaction(messages.payeeCreditNotes(Global.get().Vendor())));

    } else if (trasactionViewSelect.getSelectedValue().equalsIgnoreCase(messages.expenses())) {
      transactiontypebyStatusMap.put(TransactionHistory.ALL_EXPENSES, messages.allExpenses());
      transactiontypebyStatusMap.put(
          TransactionHistory.CREDIT_CARD_EXPENSES, messages.creditCardExpenses());
      transactiontypebyStatusMap.put(TransactionHistory.CASH_EXPENSES, messages.cashExpenses());
      transactiontypebyStatusMap.put(
          TransactionHistory.DRAFT_CREDIT_CARD_EXPENSES,
          messages.draftTransaction(messages.creditCardExpenses()));
      transactiontypebyStatusMap.put(
          TransactionHistory.DRAFT_CASH_EXPENSES,
          messages.draftTransaction(messages.cashExpenses()));

    } else if (trasactionViewSelect.getSelectedValue().equalsIgnoreCase(messages.salesOrders())) {

      transactiontypebyStatusMap.put(TransactionHistory.ALL_SALES_ORDERS, messages.all());
      transactiontypebyStatusMap.put(TransactionHistory.DRAFT_SALES_ORDERS, messages.drafts());

    } else if (trasactionViewSelect
        .getSelectedValue()
        .equalsIgnoreCase(messages.purchaseOrders())) {

      transactiontypebyStatusMap.put(TransactionHistory.ALL_PURCHASE_ORDERS, messages.all());
      transactiontypebyStatusMap.put(TransactionHistory.DRAFT_PURCHASE_ORDERS, messages.drafts());
    }
    List<String> typeList = new ArrayList<String>(transactiontypebyStatusMap.values());
    Collections.sort(
        typeList,
        new Comparator<String>() {

          @Override
          public int compare(String entry1, String entry2) {
            return entry1.compareTo(entry2);
          }
        });
    trasactionViewTypeSelect.initCombo(typeList);
    trasactionViewTypeSelect.setComboItem(typeList.get(0));
  }