public JFrame createFrame() {
    SQLElement element = Configuration.getInstance().getDirectory().getElement("SAISIE_ACHAT");
    ListeGestCommEltPanel panel = new ListeGestCommEltPanel(element);
    panel.setAddVisible(true);
    IListFrame frame = new IListFrame(panel);
    IListTotalPanel total =
        new IListTotalPanel(
            frame.getPanel().getListe(),
            Arrays.asList(
                element.getTable().getField("MONTANT_HT"),
                element.getTable().getField("MONTANT_TTC")));
    GridBagConstraints c = new DefaultGridBagConstraints();
    c.gridy = 3;
    c.weightx = 0;
    c.fill = GridBagConstraints.NONE;
    c.anchor = GridBagConstraints.EAST;
    frame.getPanel().add(total, c);

    // Date panel
    Map<IListe, SQLField> map = new HashMap<IListe, SQLField>();
    map.put(frame.getPanel().getListe(), element.getTable().getField("DATE"));

    IListFilterDatePanel datePanel =
        new IListFilterDatePanel(map, IListFilterDatePanel.getDefaultMap());
    c.gridy = 4;
    c.anchor = GridBagConstraints.CENTER;
    c.weighty = 0;
    datePanel.setFilterOnDefault();
    frame.getPanel().add(datePanel, c);
    return frame;
  }
  private ListeAddPanel getPanel(
      final SQLElement eltCmd,
      final SQLTableModelSourceOnline tableSource,
      final List<RowAction> allowedActions) {
    final ListeAddPanel panel =
        new ListeAddPanel(eltCmd, new IListe(tableSource)) {
          @Override
          protected void createUI() {
            super.createUI();
            this.btnMngr.setAdditional(
                this.buttonEffacer,
                new ITransformer<JButton, String>() {

                  @Override
                  public String transformChecked(JButton input) {

                    SQLRowAccessor row = getListe().fetchSelectedRow();

                    BigDecimal b = getAvancement(row);

                    if (b.signum() != 0) {
                      return "Vous ne pouvez pas supprimer une commande facturée !";
                    }
                    return null;
                  }
                });
            this.btnMngr.setAdditional(
                this.buttonModifier,
                new ITransformer<JButton, String>() {

                  @Override
                  public String transformChecked(JButton input) {

                    SQLRowAccessor row = getListe().fetchSelectedRow();

                    BigDecimal b = getAvancement(row);

                    if (b.signum() != 0) {
                      return "Vous ne pouvez pas modifier une commande facturée !";
                    }
                    return null;
                  }
                });
          }
        };

    final List<Tuple2<? extends SQLTableModelColumn, IListTotalPanel.Type>> fields =
        new ArrayList<Tuple2<? extends SQLTableModelColumn, IListTotalPanel.Type>>(2);
    fields.add(
        Tuple2.create(
            panel.getListe().getSource().getColumn(eltCmd.getTable().getField("T_HT")),
            IListTotalPanel.Type.SOMME));
    fields.add(Tuple2.create(this.colAvancement, IListTotalPanel.Type.AVANCEMENT_TTC));
    final IListTotalPanel totalPanel =
        new IListTotalPanel(panel.getListe(), fields, null, "Total des commandes de la liste");

    final GridBagConstraints c = new DefaultGridBagConstraints();
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.fill = GridBagConstraints.BOTH;
    c.anchor = GridBagConstraints.EAST;
    c.weightx = 1;
    c.gridy = 4;

    // Date panel
    final IListFilterDatePanel datePanel =
        new IListFilterDatePanel(
            panel.getListe(),
            eltCmd.getTable().getField("DATE"),
            IListFilterDatePanel.getDefaultMap());

    panel
        .getListe()
        .addIListeActions(
            new MouseSheetXmlListeListener(CommandeClientXmlSheet.class) {
              @Override
              public List<RowAction> addToMenu() {
                return allowedActions;
              }
            }.getRowActions());

    datePanel.setFilterOnDefault();

    final JPanel bottomPanel = new JPanel();
    bottomPanel.setLayout(new GridBagLayout());
    bottomPanel.setOpaque(false);
    final GridBagConstraints c2 = new DefaultGridBagConstraints();
    c2.fill = GridBagConstraints.NONE;
    c2.weightx = 1;
    bottomPanel.add(datePanel, c2);

    c2.gridx++;
    c2.weightx = 0;
    c2.anchor = GridBagConstraints.EAST;
    bottomPanel.add(totalPanel, c2);

    panel.add(bottomPanel, c);
    return panel;
  }