OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 142 Rev 156
Line 49... Line 49...
49
import org.apache.commons.dbutils.handlers.ArrayListHandler;
49
import org.apache.commons.dbutils.handlers.ArrayListHandler;
50
 
50
 
51
public class BonReceptionSQLElement extends ComptaSQLConfElement {
51
public class BonReceptionSQLElement extends ComptaSQLConfElement {
52
 
52
 
53
    public BonReceptionSQLElement() {
53
    public BonReceptionSQLElement() {
54
        super("BON_RECEPTION", "un bon de réception", "Bons de réception");
54
        super("BON_RECEPTION", "un bon de réception", "bons de réception");
55
 
55
 
56
        PredicateRowAction actionsTRFA = new PredicateRowAction(new AbstractAction("Transfert vers facture fournisseur") {
56
        PredicateRowAction actionsTRFA = new PredicateRowAction(new AbstractAction("Transfert vers facture fournisseur") {
57
            public void actionPerformed(ActionEvent e) {
57
            public void actionPerformed(ActionEvent e) {
58
                TransfertBaseSQLComponent.openTransfertFrame(IListe.get(e).getSelectedRows(), "FACTURE_FOURNISSEUR");
58
                TransfertBaseSQLComponent.openTransfertFrame(IListe.get(e).getSelectedRows(), "FACTURE_FOURNISSEUR");
59
            }
59
            }
Line 79... Line 79...
79
    @Override
79
    @Override
80
    public ListMap<String, String> getShowAs() {
80
    public ListMap<String, String> getShowAs() {
81
        return ListMap.singleton(null, "NUMERO", "DATE");
81
        return ListMap.singleton(null, "NUMERO", "DATE");
82
    }
82
    }
83
 
83
 
-
 
84
    @Override
84
    protected List<String> getListFields() {
85
    protected List<String> getListFields() {
85
        final List<String> l = new ArrayList<String>();
86
        final List<String> l = new ArrayList<>(5);
86
        l.add("NUMERO");
87
        l.add("NUMERO");
87
        l.add("DATE");
88
        l.add("DATE");
88
        l.add("ID_FOURNISSEUR");
89
        l.add("ID_FOURNISSEUR");
89
        l.add("TOTAL_HT");
90
        l.add("TOTAL_HT");
90
        l.add("INFOS");
91
        l.add("INFOS");
91
        return l;
92
        return l;
92
    }
93
    }
93
 
94
 
-
 
95
    @Override
94
    protected List<String> getComboFields() {
96
    protected List<String> getComboFields() {
95
        final List<String> l = new ArrayList<String>();
97
        final List<String> l = new ArrayList<>(2);
96
        l.add("NUMERO");
98
        l.add("NUMERO");
97
        l.add("DATE");
99
        l.add("DATE");
98
        return l;
100
        return l;
99
    }
101
    }
100
 
102
 
Line 117... Line 119...
117
        SQLElement elt = Configuration.getInstance().getDirectory().getElement("SAISIE_ACHAT");
119
        SQLElement elt = Configuration.getInstance().getDirectory().getElement("SAISIE_ACHAT");
118
        EditFrame editFactureFrame = new EditFrame(elt);
120
        EditFrame editFactureFrame = new EditFrame(elt);
119
        editFactureFrame.setIconImage(new ImageIcon(Gestion.class.getResource("frameicon.png")).getImage());
121
        editFactureFrame.setIconImage(new ImageIcon(Gestion.class.getResource("frameicon.png")).getImage());
120
 
122
 
121
        SaisieAchatSQLComponent comp = (SaisieAchatSQLComponent) editFactureFrame.getSQLComponent();
123
        SaisieAchatSQLComponent comp = (SaisieAchatSQLComponent) editFactureFrame.getSQLComponent();
122
 
-
 
123
        // comp.setDefaults();
-
 
124
        comp.loadBonReception(brID);
124
        comp.loadBonReception(brID);
125
        editFactureFrame.pack();
125
        editFactureFrame.pack();
126
        editFactureFrame.setState(JFrame.NORMAL);
126
        editFactureFrame.setState(JFrame.NORMAL);
127
        editFactureFrame.setVisible(true);
127
        editFactureFrame.setVisible(true);
128
    }
128
    }
Line 149... Line 149...
149
    }
149
    }
150
 
150
 
151
    @Override
151
    @Override
152
    protected void archive(TreesOfSQLRows trees, boolean cutLinks) throws SQLException {
152
    protected void archive(TreesOfSQLRows trees, boolean cutLinks) throws SQLException {
153
        List<Object> cmds = null;
153
        List<Object> cmds = null;
154
        List<Integer> ids = new ArrayList<Integer>();
154
        List<Integer> ids = new ArrayList<>();
155
        for (SQLRow row : trees.getRows()) {
155
        for (SQLRow row : trees.getRows()) {
156
            cmds = getCmdFrom(row.getID());
156
            cmds = getCmdFrom(row.getID());
157
            ids.add(row.getID());
157
            ids.add(row.getID());
158
 
158
 
159
            // Mise à jour des stocks
159
            // Mise à jour des stocks
Line 176... Line 176...
176
        for (Integer id : ids) {
176
        for (Integer id : ids) {
177
 
177
 
178
            updateCmdElement(cmds, id);
178
            updateCmdElement(cmds, id);
179
        }
179
        }
180
    }
180
    }
-
 
181
 
-
 
182
    @Override
-
 
183
    protected String createCodeSuffix() {
-
 
184
        return ".note";
-
 
185
    }
181
}
186
}