OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 61 | Rev 132 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
18 ilm 1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
10
 *
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
13
 
14
 package org.openconcerto.erp.core.finance.payment.action;
15
 
16
import org.openconcerto.erp.action.CreateFrameAbstractAction;
19 ilm 17
import org.openconcerto.erp.core.common.ui.IListFilterDatePanel;
18
import org.openconcerto.erp.core.common.ui.IListTotalPanel;
18 ilm 19
import org.openconcerto.erp.core.common.ui.ListeViewPanel;
20
import org.openconcerto.sql.Configuration;
21
import org.openconcerto.sql.element.SQLElement;
19 ilm 22
import org.openconcerto.sql.model.SQLField;
18 ilm 23
import org.openconcerto.sql.view.IListFrame;
73 ilm 24
import org.openconcerto.sql.view.list.IListe;
19 ilm 25
import org.openconcerto.ui.DefaultGridBagConstraints;
18 ilm 26
 
73 ilm 27
import java.awt.GridBagConstraints;
28
import java.util.ArrayList;
29
import java.util.List;
30
 
18 ilm 31
import javax.swing.Action;
32
import javax.swing.JFrame;
33
 
34
public class ListeDesEncaissementsAction extends CreateFrameAbstractAction {
35
 
36
    public ListeDesEncaissementsAction() {
37
        super();
38
        this.putValue(Action.NAME, "Liste des encaissements");
39
    }
40
 
41
    public JFrame createFrame() {
42
 
43
        final SQLElement elementEchClient = Configuration.getInstance().getDirectory().getElement("ENCAISSER_MONTANT");
44
 
73 ilm 45
        // FIXME Cacher les encaissements de reports (créer à partir d'une échéance pour la reporter
46
        // ????)
47
 
48
        IListFrame frame = new IListFrame(new ListeViewPanel(elementEchClient, new IListe(elementEchClient.getTableSource(true))));
49
 
19 ilm 50
        List<SQLField> fields = new ArrayList<SQLField>(2);
51
        fields.add(elementEchClient.getTable().getField("MONTANT"));
52
 
61 ilm 53
        IListTotalPanel totalPanel = new IListTotalPanel(frame.getPanel().getListe(), fields, "Total Global");
19 ilm 54
 
55
        GridBagConstraints c = new DefaultGridBagConstraints();
56
        c.gridwidth = GridBagConstraints.REMAINDER;
57
        c.fill = GridBagConstraints.NONE;
58
        c.weightx = 0;
59
 
60
        // Total panel
61
        c.gridwidth = GridBagConstraints.REMAINDER;
62
        c.fill = GridBagConstraints.NONE;
63
        c.anchor = GridBagConstraints.EAST;
64
        c.weightx = 1;
65
        c.gridy = 4;
66
 
67
        frame.getPanel().add(totalPanel, c);
68
 
69
        // Date panel
70
        IListFilterDatePanel datePanel = new IListFilterDatePanel(frame.getPanel().getListe(), elementEchClient.getTable().getField("DATE"), IListFilterDatePanel.getDefaultMap());
71
        c.gridy++;
72
        c.anchor = GridBagConstraints.CENTER;
73
        frame.getPanel().add(datePanel, c);
74
 
18 ilm 75
        return frame;
76
    }
77
}