OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 144 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 144 Rev 156
Line 11... Line 11...
11
 * When distributing the software, include this License Header Notice in each file.
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.erp.core.sales.order.action;
14
 package org.openconcerto.erp.core.sales.order.action;
15
 
15
 
16
import org.openconcerto.erp.action.CreateFrameAbstractAction;
16
import org.openconcerto.erp.action.CreateListFrameAbstractAction;
-
 
17
import org.openconcerto.erp.config.ComptaPropsConfiguration;
17
import org.openconcerto.erp.core.common.ui.ListeViewPanel;
18
import org.openconcerto.erp.core.common.ui.ListeViewPanel;
18
import org.openconcerto.erp.core.sales.order.element.FacturationCommandeClientSQLElement;
19
import org.openconcerto.erp.core.sales.order.element.FacturationCommandeClientSQLElement;
19
import org.openconcerto.sql.Configuration;
-
 
20
import org.openconcerto.sql.element.SQLElement;
20
import org.openconcerto.sql.element.SQLElement;
21
import org.openconcerto.sql.model.SQLField;
21
import org.openconcerto.sql.model.SQLField;
22
import org.openconcerto.sql.model.Where;
22
import org.openconcerto.sql.model.Where;
23
import org.openconcerto.sql.view.list.IListe;
23
import org.openconcerto.sql.view.list.IListe;
24
import org.openconcerto.sql.view.list.SQLTableModelSourceOnline;
24
import org.openconcerto.sql.view.list.SQLTableModelSourceOnline;
25
 
25
 
26
import javax.swing.Action;
-
 
27
import javax.swing.JFrame;
26
import javax.swing.JFrame;
28
import javax.swing.JTabbedPane;
27
import javax.swing.JTabbedPane;
29
 
28
 
30
public class ListeDesFacturationCommandesClientAction extends CreateFrameAbstractAction {
29
public class ListeDesFacturationCommandesClientAction extends CreateListFrameAbstractAction<FacturationCommandeClientSQLElement, JFrame> {
31
 
30
 
32
    public ListeDesFacturationCommandesClientAction() {
31
    public ListeDesFacturationCommandesClientAction(final ComptaPropsConfiguration conf) {
33
        super();
-
 
34
        this.putValue(Action.NAME, "Echéancier de commandes clients");
32
        super(conf, FacturationCommandeClientSQLElement.class);
35
    }
33
    }
36
 
34
 
-
 
35
    @Override
37
    public JFrame createFrame() {
36
    protected JFrame instantiateFrame() {
38
        final JFrame frame = new JFrame("Echéancier de commandes clients");
37
        final JFrame frame = new JFrame(String.valueOf(getValue(NAME)));
39
        final JTabbedPane pane = new JTabbedPane();
38
        final JTabbedPane pane = new JTabbedPane();
40
 
39
 
41
        final String tableName = FacturationCommandeClientSQLElement.TABLENAME;
-
 
42
        final SQLElement eltCmd = Configuration.getInstance().getDirectory().getElement(tableName);
-
 
43
        if (eltCmd == null) {
40
        final SQLElement eltCmd = getElem();
44
            throw new IllegalStateException("No elements for table " + tableName);
-
 
45
        }
41
 
46
        final SQLField fieldFacture = eltCmd.getTable().getField("ID_SAISIE_VENTE_FACTURE");
42
        final SQLField fieldFacture = eltCmd.getTable().getField("ID_SAISIE_VENTE_FACTURE");
47
        // Elements à facturer
43
        // Elements à facturer
48
        final Where wToInvoice = new Where(fieldFacture, "=", 1).or(new Where(fieldFacture, "=", (Object) null));
44
        final Where wToInvoice = new Where(fieldFacture, "=", 1).or(new Where(fieldFacture, "=", (Object) null));
49
        final SQLTableModelSourceOnline tableSourceToInvoice = eltCmd.createTableSource(wToInvoice);
45
        final SQLTableModelSourceOnline tableSourceToInvoice = eltCmd.createTableSource(wToInvoice);
50
        final ListeViewPanel toInvoicePanel = new ListeViewPanel(eltCmd, new IListe(tableSourceToInvoice));
46
        final ListeViewPanel toInvoicePanel = new ListeViewPanel(eltCmd, new IListe(tableSourceToInvoice));