OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 174 Rev 180
Line 389... Line 389...
389
                        if (rowClient.getObject("ID_CATEGORIE_COMPTABLE") != null && !rowClient.isForeignEmpty("ID_CATEGORIE_COMPTABLE")) {
389
                        if (rowClient.getObject("ID_CATEGORIE_COMPTABLE") != null && !rowClient.isForeignEmpty("ID_CATEGORIE_COMPTABLE")) {
390
                            tableBonItem.setRowCatComptable(rowClient.getForeign("ID_CATEGORIE_COMPTABLE"));
390
                            tableBonItem.setRowCatComptable(rowClient.getForeign("ID_CATEGORIE_COMPTABLE"));
391
                        } else {
391
                        } else {
392
                            tableBonItem.setRowCatComptable(null);
392
                            tableBonItem.setRowCatComptable(null);
393
                        }
393
                        }
394
                        if (!isFilling()) {
-
 
-
 
394
 
395
                            tableBonItem.setClient(rowClient, true);
395
                        tableBonItem.setClient(rowClient, !isFilling());
396
                        }
-
 
397
 
396
 
398
                    } else {
397
                    } else {
399
                        comboContact.getRequest().setWhere(Where.FALSE);
398
                        comboContact.getRequest().setWhere(Where.FALSE);
400
                        tableBonItem.setRowCatComptable(null);
399
                        tableBonItem.setRowCatComptable(null);
401
                        if (!isFilling()) {
400
                        if (!isFilling()) {
Line 407... Line 406...
407
            });
406
            });
408
 
407
 
409
            // Commercial
408
            // Commercial
410
            JLabel labelCommercial = new JLabel(getLabelFor("ID_COMMERCIAL"));
409
            JLabel labelCommercial = new JLabel(getLabelFor("ID_COMMERCIAL"));
411
            labelCommercial.setHorizontalAlignment(SwingConstants.RIGHT);
410
            labelCommercial.setHorizontalAlignment(SwingConstants.RIGHT);
412
 
-
 
-
 
411
            c.fill = GridBagConstraints.HORIZONTAL;
413
            c.gridx++;
412
            c.gridx++;
414
            c.weightx = 0;
413
            c.weightx = 0;
415
            this.add(labelCommercial, c);
414
            this.add(labelCommercial, c);
416
 
415
 
417
            this.comboCommercial = new ElementComboBox(false, 25);
416
            this.comboCommercial = new ElementComboBox(false, 25);
Line 1084... Line 1083...
1084
     * @throws SQLException
1083
     * @throws SQLException
1085
     */
1084
     */
1086
    private void updateStock(int id) throws SQLException {
1085
    private void updateStock(int id) throws SQLException {
1087
 
1086
 
1088
        SQLPreferences prefs = new SQLPreferences(getTable().getDBRoot());
1087
        SQLPreferences prefs = new SQLPreferences(getTable().getDBRoot());
-
 
1088
        // Check if tr from bl or cmd pour DS
1089
        if (!prefs.getBoolean(GestionArticleGlobalPreferencePanel.STOCK_FACT, true)) {
1089
        boolean stockWithBL = !prefs.getBoolean(GestionArticleGlobalPreferencePanel.STOCK_FACT, true);
-
 
1090
        if (getTable().getForeignTable("ID_CLIENT").contains("NOTE_2018")) {
-
 
1091
            SQLRow row = getTable().getRow(id);
-
 
1092
            List<SQLRow> trCmd = row.getReferentRows(getTable().getTable("TR_COMMANDE_CLIENT"));
-
 
1093
            if (!trCmd.isEmpty()) {
-
 
1094
                stockWithBL = true;
-
 
1095
            }
1090
 
1096
        }
-
 
1097
        if (stockWithBL) {
1091
            SQLRow row = getTable().getRow(id);
1098
            SQLRow row = getTable().getRow(id);
1092
            StockItemsUpdater stockUpdater = new StockItemsUpdater(new StockLabel() {
1099
            StockItemsUpdater stockUpdater = new StockItemsUpdater(new StockLabel() {
1093
                @Override
1100
                @Override
1094
                public String getLabel(SQLRowAccessor rowOrigin, SQLRowAccessor rowElt) {
1101
                public String getLabel(SQLRowAccessor rowOrigin, SQLRowAccessor rowElt) {
1095
                    return getLibelleStock(rowOrigin, rowElt);
1102
                    return getLibelleStock(rowOrigin, rowElt);