public void viewDocument(AccountsLine line) {

    Window w = SwingUtilities.getWindowAncestor(this);
    Frame owner = w instanceof Frame ? (Frame) w : null;

    if (line.getDocType().equals(Enums.AcDocType.INVOICE.toString())) {

      SalesInvoiceDlg dlg = new SalesInvoiceDlg(owner);
      dlg.showDialog(line.getId());
    } else if (line.getDocType().equals(Enums.AcDocType.DEBITMEMO.toString())
        || line.getDocType().equals(Enums.AcDocType.CREDITMEMO.toString())) {

      SalesAcDocumentDlg dlg = new SalesAcDocumentDlg(owner);
      dlg.showDialog(line.getId());
    }
  }
  private void populateTable() {

    DefaultTableModel tableModel = (DefaultTableModel) tblAccounts.getModel();
    tableModel.getDataVector().removeAllElements();

    if (lines.size() > 0) {
      int i = 0;
      for (; i < lines.size(); i++) {
        AccountsLine l = lines.get(i);
        tableModel.insertRow(
            i,
            new Object[] {
              l.getDate(),
              l.getDocType(),
              l.getLine_desc(),
              l.getDebit_amount(),
              l.getCredit_amount(),
              l.getLine_balance()
            });
      }
    } else {
      tableModel.insertRow(0, new Object[] {"", "", "", "", "", ""});
    }
    populateSummery(report);
  }