OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 94 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 94 Rev 142
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.product.element;
14
 package org.openconcerto.erp.core.sales.product.element;
15
 
15
 
16
import java.awt.GridBagConstraints;
-
 
17
import java.awt.GridBagLayout;
-
 
18
import java.awt.event.ActionEvent;
-
 
19
import java.sql.SQLException;
-
 
20
import java.util.ArrayList;
-
 
21
import java.util.List;
-
 
22
 
-
 
23
import javax.swing.AbstractAction;
-
 
24
import javax.swing.JLabel;
-
 
25
 
-
 
26
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
16
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
27
import org.openconcerto.erp.core.sales.invoice.ui.FactureAffacturerTable;
17
import org.openconcerto.erp.core.sales.invoice.ui.FactureAffacturerTable;
28
import org.openconcerto.erp.core.supplychain.receipt.component.BonReceptionSQLComponent;
18
import org.openconcerto.erp.core.supplychain.receipt.component.BonReceptionSQLComponent;
29
import org.openconcerto.sql.element.BaseSQLComponent;
19
import org.openconcerto.sql.element.BaseSQLComponent;
30
import org.openconcerto.sql.element.SQLComponent;
20
import org.openconcerto.sql.element.SQLComponent;
Line 35... Line 25...
35
import org.openconcerto.sql.view.list.IListe;
25
import org.openconcerto.sql.view.list.IListe;
36
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
26
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
37
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
27
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
38
import org.openconcerto.ui.DefaultGridBagConstraints;
28
import org.openconcerto.ui.DefaultGridBagConstraints;
39
 
29
 
-
 
30
import java.awt.GridBagConstraints;
-
 
31
import java.awt.GridBagLayout;
-
 
32
import java.awt.event.ActionEvent;
-
 
33
import java.sql.SQLException;
-
 
34
import java.util.ArrayList;
-
 
35
import java.util.List;
-
 
36
 
-
 
37
import javax.swing.AbstractAction;
-
 
38
import javax.swing.JLabel;
-
 
39
 
40
public class ReliquatSQLElement extends ComptaSQLConfElement {
40
public class ReliquatSQLElement extends ComptaSQLConfElement {
41
 
41
 
42
    private final String tableBonName;
42
    private final String tableBonName;
43
 
43
 
44
    static public class ReliquatBRSQLElement extends ReliquatSQLElement {
44
    static public class ReliquatBRSQLElement extends ReliquatSQLElement {
Line 71... Line 71...
71
                    @Override
71
                    @Override
72
                    public void inserted(int id) {
72
                    public void inserted(int id) {
73
                        for (SQLRowValues rowVals : rows) {
73
                        for (SQLRowValues rowVals : rows) {
74
                            try {
74
                            try {
75
                                SQLRowValues upRowVals = rowVals.createEmptyUpdateRow();
75
                                SQLRowValues upRowVals = rowVals.createEmptyUpdateRow();
76
                                upRowVals.put("ID_BON_RECEPTION", id);
76
                                upRowVals.put("ID_" + tableBonName, id);
77
                                upRowVals.update();
77
                                upRowVals.update();
78
                            } catch (SQLException exn) {
78
                            } catch (SQLException exn) {
79
                                exn.printStackTrace();
79
                                exn.printStackTrace();
80
                            }
80
                            }
81
                        }
81
                        }
Line 89... Line 89...
89
                    @Override
89
                    @Override
90
                    public void cancelled() {
90
                    public void cancelled() {
91
                    }
91
                    }
92
                });
92
                });
93
 
93
 
94
                BonReceptionSQLComponent comp = (BonReceptionSQLComponent) frame.getSQLComponent();
94
                SQLComponent comp = (SQLComponent) frame.getSQLComponent();
-
 
95
                if (comp instanceof BonReceptionSQLComponent) {
95
                comp.loadFromReliquat(rows);
96
                    ((BonReceptionSQLComponent) comp).loadFromReliquat(rows);
-
 
97
                } else {
-
 
98
                    // ((BonDeLivraisonSQLComponent) comp).loadFromReliquat(rows);
-
 
99
 
-
 
100
                }
96
                frame.setVisible(true);
101
                frame.setVisible(true);
97
 
102
 
98
            }
103
            }
99
        }, true);
104
        }, true);
100
        actionTR.setPredicate(IListeEvent.getNonEmptySelectionPredicate());
105
        actionTR.setPredicate(IListeEvent.getNonEmptySelectionPredicate());
Line 105... Line 110...
105
        this("RELIQUAT_BL", "un reliquat de BL", "reliquats de BL", "BON_DE_LIVRAISON");
110
        this("RELIQUAT_BL", "un reliquat de BL", "reliquats de BL", "BON_DE_LIVRAISON");
106
    }
111
    }
107
 
112
 
108
    @Override
113
    @Override
109
    protected String getParentFFName() {
114
    protected String getParentFFName() {
110
 
-
 
111
        return "ID_" + this.tableBonName;
115
        return "ID_" + this.tableBonName;
112
    }
116
    }
113
 
117
 
114
    protected List<String> getListFields() {
118
    protected List<String> getListFields() {
115
        final List<String> l = new ArrayList<String>();
119
        final List<String> l = new ArrayList<String>();