Exemplo n.º 1
0
  private void creatControls() {

    StyledPanel mainPanel = new StyledPanel("customerCenter");

    StyledPanel leftVpPanel = new StyledPanel("leftPanel");

    viewTypeCombo();
    DynamicForm viewform = new DynamicForm("viewform");
    viewform.setStyleName("filterPanel");
    viewform.add(activeInActiveSelect);
    leftVpPanel.add(viewform);
    custGrid = new CustomersListGrid();
    custGrid.init();
    initCustomersListGrid();
    leftVpPanel.add(custGrid);

    custGrid.setStyleName("cusotmerCentrGrid");

    rightVpPanel = new StyledPanel("rightPanel");
    dummyPanel = new StyledPanel("dummyPanel");

    detailsPanel = new CustomerDetailsPanel(selectedCustomer);
    rightVpPanel.add(detailsPanel);
    custGrid.setCustomerSelectionListener(
        new CustomerSelectionListener() {
          @Override
          public void cusotmerSelected() {
            OncusotmerSelected();
          }
        });
    transactionViewSelectCombo();
    transactionViewTypeSelectCombo();
    transactionDateRangeSelector();
    DynamicForm transactionViewform = new DynamicForm("transactionViewform");

    transactionViewform.add(trasactionViewSelect, trasactionViewTypeSelect, dateRangeSelector);

    transactionGridpanel = new StyledPanel("transactionGridpanel");
    transactionGridpanel.add(transactionViewform);
    custHistoryGrid =
        new CustomerTransactionsHistoryGrid() {
          @Override
          public void initListData() {
            OncusotmerSelected();
          }
        };
    custHistoryGrid.init();
    custHistoryGrid.addEmptyMessage(messages.pleaseSelectAnyPayee(Global.get().Customer()));
    int pageSize = getPageSize();
    custHistoryGrid.addRangeChangeHandler2(
        new Handler() {

          @Override
          public void onRangeChange(RangeChangeEvent event) {
            onPageChange(event.getNewRange().getStart(), event.getNewRange().getLength());
          }
        });
    SimplePager pager =
        new SimplePager(
            TextLocation.CENTER,
            (Resources) GWT.create(Resources.class),
            false,
            pageSize * 2,
            true);
    pager.setDisplay(custHistoryGrid);
    updateRecordsCount(0, 0, 0);

    if (Accounter.isIpadApp()) {

      transactionButton = new Button(messages.transaction());
      transactionButton.addClickHandler(
          new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
              ActionFactory.getCustomerTransactionListHistory(selectedCustomer).run();
            }
          });

    } else {
      dummyPanel.add(transactionGridpanel);
      dummyPanel.add(custHistoryGrid);
      dummyPanel.add(pager);
    }
    rightVpPanel.add(dummyPanel);
    Label labelTitle = new Label(messages.customerCentre(Global.get().Customer()));
    labelTitle.setStyleName("label-title");

    mainPanel.add(leftVpPanel);
    mainPanel.add(rightVpPanel);
    deleteButtonPanel = new StyledPanel("deleteButtonPanel");
    add(labelTitle);
    add(deleteButtonPanel);
    add(mainPanel);
  }
Exemplo n.º 2
0
  public void createControls() {
    // Creating Title for View
    Label label = new Label();
    label.removeStyleName("gwt-Label");
    label.addStyleName("label-title");
    label.setText(messages.Reconciliation());

    bankaccountLabel = new LabelItem(messages.Account(), "bankaccountLabel");
    bankaccountLabel.setValue(data.getAccount().getName());

    closebalanceLable = new AmountLabel(messages.ClosingBalance());
    closebalanceLable.setTitle(messages.ClosingBalance());
    closebalanceLable.setAmount(data.getClosingBalance());

    startdateLable = new LabelItem(messages.startDate(), "startdateLable");
    startdateLable.setValue(DateUtills.getDateAsString(data.getStartDate().getDateAsObject()));

    enddateLable = new LabelItem(messages.endDate(), "enddateLable");
    enddateLable.setValue(DateUtills.getDateAsString(data.getEndDate().getDateAsObject()));

    // // Creating Input Fields to Start Reconciliation of an Account
    // bankAccountsField = new SelectCombo(messages.bankAccount(Global.get()
    // .Account()));
    //
    // bankAccountsField
    // .addSelectionChangeHandler(new
    // IAccounterComboSelectionChangeHandler<String>() {
    //
    // @Override
    // public void selectedComboBoxItem(String selectItem) {
    // // TODO Auto-generated method stub
    //
    // }
    // });
    //
    // startDate = new DateField(constants.startDate());
    // endDate = new DateField(constants.endDate());
    // closingBalance = new TextItem(constants.ClosingBalance());

    DynamicForm form = new DynamicForm("form");
    form.add(bankaccountLabel, closebalanceLable);
    form.setStyleName("recouncilation_value");

    DynamicForm datesForm = new DynamicForm("datesForm");
    datesForm.add(startdateLable, enddateLable);

    StyledPanel hPanel = new StyledPanel("hPanel");
    // hPanel.setWidth("100%");
    hPanel.add(form);
    hPanel.add(datesForm);
    // hPanel.setCellWidth(form, "40%");
    Button changeBtn = new Button(messages.change());
    changeBtn.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            ReconciliationDialog dialog =
                new ReconciliationDialog(
                    Global.get().messages().Reconciliation(),
                    data,
                    new ValueCallBack<ClientReconciliation>() {

                      @Override
                      public void execute(ClientReconciliation value) {
                        updateData(value);
                      }
                    });
            ViewManager.getInstance().showDialog(dialog);
          }
        });

    StyledPanel btnPanel = new StyledPanel("btnPanel");
    // btnPanel.setWidth("100%");
    btnPanel.add(changeBtn);
    btnPanel.setStyleName("recoucilation_change");
    // btnPanel.setCellHorizontalAlignment(changeBtn,
    // HasHorizontalAlignment.ALIGN_RIGHT);

    // Creating Amount Fields
    StyledPanel amountsPanel = new StyledPanel("amountsPanel");

    openingBalance = new AmountLabel(messages.openingBalance());
    openingBalance.setEnabled(false);
    openingBalance.setAmount(data.getOpeningBalance());

    closingBalance = new AmountLabel(messages.ClosingBalance());
    closingBalance.setEnabled(true);
    closingBalance.setAmount(data.getClosingBalance());

    clearedAmount = new AmountLabel(messages.ClearedAmount());
    clearedAmount.setEnabled(true);

    difference = new AmountLabel(messages.Difference());
    difference.setEnabled(false);
    DynamicForm amountsForm = new DynamicForm("amountsForm");
    // amountsForm.setWidth("50%");
    amountsForm.add(openingBalance, closingBalance, clearedAmount, difference);
    amountsPanel.add(amountsForm);
    amountsPanel.setStyleName("bottom_total_view");

    this.grid =
        new ReconciliationTransactionsGrid(
            this,
            new SelectionChangedHandler<ClientReconciliationItem>() {

              @Override
              public void selectionChanged(ClientReconciliationItem obj, boolean isSelected) {
                if (isCreating()) {
                  clearTransaction(obj, isSelected);
                }
              }
            });
    // grid.setWidth("100%");
    // grid.setHeight("200px");

    this.mainPanel = new StyledPanel("mainPanel");
    StyledPanel gridPanel = new StyledPanel("reconcillation_grid_panel");
    mainPanel.add(label);
    mainPanel.add(hPanel);
    if (isCreating()) {
      mainPanel.add(btnPanel);
    }
    gridPanel.add(grid);
    mainPanel.add(gridPanel);
    // mainPanel.setCellHeight(grid, "200px");
    grid.getElement().getParentElement().addClassName("recounciliation_grid");
    mainPanel.add(amountsPanel);
    this.add(mainPanel);
  }