OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 182 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 182 Rev 185
Line 24... Line 24...
24
import org.openconcerto.erp.core.finance.tax.model.TaxeCache;
24
import org.openconcerto.erp.core.finance.tax.model.TaxeCache;
25
import org.openconcerto.erp.core.sales.product.element.ReferenceArticleSQLElement;
25
import org.openconcerto.erp.core.sales.product.element.ReferenceArticleSQLElement;
26
import org.openconcerto.erp.core.supplychain.order.element.CommandeSQLElement;
26
import org.openconcerto.erp.core.supplychain.order.element.CommandeSQLElement;
27
import org.openconcerto.erp.core.supplychain.order.element.DemandeAchatItemSQLElement;
27
import org.openconcerto.erp.core.supplychain.order.element.DemandeAchatItemSQLElement;
28
import org.openconcerto.erp.core.supplychain.order.ui.CommandeItemTable;
28
import org.openconcerto.erp.core.supplychain.order.ui.CommandeItemTable;
-
 
29
import org.openconcerto.erp.core.supplychain.order.ui.EtatCommandeFournisseur;
-
 
30
import org.openconcerto.erp.core.supplychain.order.ui.EtatCommandeFournisseurComboBox;
-
 
31
import org.openconcerto.erp.core.supplychain.order.ui.EtatCommandeFournisseurRowItemView;
29
import org.openconcerto.erp.core.supplychain.stock.element.StockItemsUpdater;
32
import org.openconcerto.erp.core.supplychain.stock.element.StockItemsUpdater;
30
import org.openconcerto.erp.core.supplychain.stock.element.StockItemsUpdater.TypeStockUpdate;
33
import org.openconcerto.erp.core.supplychain.stock.element.StockItemsUpdater.TypeStockUpdate;
31
import org.openconcerto.erp.core.supplychain.stock.element.StockLabel;
34
import org.openconcerto.erp.core.supplychain.stock.element.StockLabel;
32
import org.openconcerto.erp.generationDoc.gestcomm.CommandeXmlSheet;
35
import org.openconcerto.erp.generationDoc.gestcomm.CommandeXmlSheet;
33
import org.openconcerto.erp.panel.PanelOOSQLComponent;
36
import org.openconcerto.erp.panel.PanelOOSQLComponent;
Line 44... Line 47...
44
import org.openconcerto.sql.model.SQLRowAccessor;
47
import org.openconcerto.sql.model.SQLRowAccessor;
45
import org.openconcerto.sql.model.SQLRowValues;
48
import org.openconcerto.sql.model.SQLRowValues;
46
import org.openconcerto.sql.model.SQLTable;
49
import org.openconcerto.sql.model.SQLTable;
47
import org.openconcerto.sql.model.Where;
50
import org.openconcerto.sql.model.Where;
48
import org.openconcerto.sql.preferences.SQLPreferences;
51
import org.openconcerto.sql.preferences.SQLPreferences;
-
 
52
import org.openconcerto.sql.request.SQLRowItemView;
49
import org.openconcerto.sql.sqlobject.ElementComboBox;
53
import org.openconcerto.sql.sqlobject.ElementComboBox;
50
import org.openconcerto.sql.sqlobject.JUniqueTextField;
54
import org.openconcerto.sql.sqlobject.JUniqueTextField;
51
import org.openconcerto.sql.sqlobject.SQLRequestComboBox;
55
import org.openconcerto.sql.sqlobject.SQLRequestComboBox;
52
import org.openconcerto.sql.sqlobject.SQLTextCombo;
56
import org.openconcerto.sql.sqlobject.SQLTextCombo;
53
import org.openconcerto.sql.users.UserManager;
57
import org.openconcerto.sql.users.UserManager;
Line 203... Line 207...
203
                        table.setRowCatComptable(rowF.getForeign("ID_CATEGORIE_COMPTABLE"));
207
                        table.setRowCatComptable(rowF.getForeign("ID_CATEGORIE_COMPTABLE"));
204
                    } else {
208
                    } else {
205
                        table.setRowCatComptable(null);
209
                        table.setRowCatComptable(null);
206
                    }
210
                    }
207
                    if (getTable().contains("OFFRE_COM")) {
211
                    if (getTable().contains("OFFRE_COM")) {
-
 
212
                        final SQLRowItemView view = getView("OFFRE_COM");
-
 
213
                        if (view != null) {
208
                        ((SQLTextCombo) getView("OFFRE_COM").getComp()).setValue(rowF.getString("RESPONSABLE"));
214
                            ((SQLTextCombo) view.getComp()).setValue(rowF.getString("RESPONSABLE"));
-
 
215
                        }
209
                    }
216
                    }
210
                } else {
217
                } else {
211
                    table.setRowCatComptable(null);
218
                    table.setRowCatComptable(null);
212
                }
219
                }
213
            }
220
            }
Line 592... Line 599...
592
        c.fill = GridBagConstraints.NONE;
599
        c.fill = GridBagConstraints.NONE;
593
        c.anchor = GridBagConstraints.WEST;
600
        c.anchor = GridBagConstraints.WEST;
594
        this.add(commSel, c);
601
        this.add(commSel, c);
595
        addRequiredSQLObject(commSel, field);
602
        addRequiredSQLObject(commSel, field);
596
 
603
 
-
 
604
        // Etat
-
 
605
        final JLabel labelEtat = new JLabel(getLabelFor("ETAT_COMMANDE"), SwingConstants.RIGHT);
-
 
606
        c.gridy++;
-
 
607
        c.gridx = 0;
-
 
608
        c.weightx = 0;
-
 
609
        c.fill = GridBagConstraints.HORIZONTAL;
-
 
610
        this.add(labelEtat, c);
-
 
611
        final EtatCommandeFournisseurComboBox comboEtat = new EtatCommandeFournisseurComboBox();
-
 
612
        c.gridx++;
-
 
613
        c.fill = GridBagConstraints.NONE;
-
 
614
        c.weightx = 1;
-
 
615
        this.add(comboEtat, c);
-
 
616
        addView(new EtatCommandeFournisseurRowItemView(comboEtat), "ETAT_COMMANDE", REQ);
-
 
617
 
597
        // Table d'élément
618
        // Table d'élément
598
        c.fill = GridBagConstraints.BOTH;
619
        c.fill = GridBagConstraints.BOTH;
599
        c.gridy++;
620
        c.gridy++;
600
        c.gridx = 0;
621
        c.gridx = 0;
601
        c.weightx = 0;
622
        c.weightx = 0;
Line 1097... Line 1118...
1097
    @Override
1118
    @Override
1098
    protected SQLRowValues createDefaults() {
1119
    protected SQLRowValues createDefaults() {
1099
        SQLRowValues rowVals = new SQLRowValues(getTable());
1120
        SQLRowValues rowVals = new SQLRowValues(getTable());
1100
        rowVals.put("T_POIDS", 0.0F);
1121
        rowVals.put("T_POIDS", 0.0F);
1101
        rowVals.put("EN_COURS", Boolean.TRUE);
1122
        rowVals.put("EN_COURS", Boolean.TRUE);
-
 
1123
        rowVals.put("ETAT_COMMANDE", EtatCommandeFournisseur.EN_ATTENTE.getId());
1102
 
1124
 
1103
        // User
1125
        // User
1104
        // SQLSelect sel = new SQLSelect(Configuration.getInstance().getBase());
1126
        // SQLSelect sel = new SQLSelect(Configuration.getInstance().getBase());
1105
        SQLElement eltComm = Configuration.getInstance().getDirectory().getElement("COMMERCIAL");
1127
        SQLElement eltComm = Configuration.getInstance().getDirectory().getElement("COMMERCIAL");
1106
        int idUser = UserManager.getInstance().getCurrentUser().getId();
1128
        int idUser = UserManager.getInstance().getCurrentUser().getId();