OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 151 Rev 156
Line 676... Line 676...
676
            addSQLObject(fieldHA, "T_HA");
676
            addSQLObject(fieldHA, "T_HA");
677
        }
677
        }
678
 
678
 
679
        final TotalPanel totalTTC = new TotalPanel(this.table, fieldEco, this.fieldHT, fieldTVA, fieldTTC, textPortHT, this.textRemiseHT, fieldService, fieldHA, fieldDevise, poids, null,
679
        final TotalPanel totalTTC = new TotalPanel(this.table, fieldEco, this.fieldHT, fieldTVA, fieldTTC, textPortHT, this.textRemiseHT, fieldService, fieldHA, fieldDevise, poids, null,
680
                (getTable().contains("ID_TAXE_PORT") ? boxTaxePort : null), null);
680
                (getTable().contains("ID_TAXE_PORT") ? boxTaxePort : null), null);
681
 
-
 
682
        cBottom.gridy = 0;
681
        cBottom.gridy = 0;
683
        cBottom.gridx += 2;
682
        cBottom.gridx += 2;
684
        cBottom.gridheight = 2;
683
        cBottom.gridheight = 2;
685
        cBottom.gridwidth = 1;
684
        cBottom.gridwidth = 1;
686
        cBottom.fill = GridBagConstraints.NONE;
685
        cBottom.fill = GridBagConstraints.NONE;
Line 1187... Line 1186...
1187
        rowVals.put("T_TTC", Long.valueOf(0));
1186
        rowVals.put("T_TTC", Long.valueOf(0));
1188
        if (getTable().contains("ID_TAXE_PORT")) {
1187
        if (getTable().contains("ID_TAXE_PORT")) {
1189
            SQLRow taxeDefault = TaxeCache.getCache().getFirstTaxe();
1188
            SQLRow taxeDefault = TaxeCache.getCache().getFirstTaxe();
1190
            rowVals.put("ID_TAXE_PORT", taxeDefault.getID());
1189
            rowVals.put("ID_TAXE_PORT", taxeDefault.getID());
1191
        }
1190
        }
-
 
1191
        if (getTable().contains("ID_TAXE_FRAIS_DOCUMENT")) {
-
 
1192
            SQLRow taxeDefault = TaxeCache.getCache().getFirstTaxe();
-
 
1193
            rowVals.put("ID_TAXE_FRAIS_DOCUMENT", taxeDefault.getID());
-
 
1194
        }
1192
        if (getTable().getFieldsName().contains("DATE_VALIDITE")) {
1195
        if (getTable().getFieldsName().contains("DATE_VALIDITE")) {
1193
            Calendar cal = Calendar.getInstance();
1196
            Calendar cal = Calendar.getInstance();
1194
            cal.add(Calendar.MONTH, 1);
1197
            cal.add(Calendar.MONTH, 1);
1195
            rowVals.put("DATE_VALIDITE", new java.sql.Date(cal.getTimeInMillis()));
1198
            rowVals.put("DATE_VALIDITE", new java.sql.Date(cal.getTimeInMillis()));
1196
        }
1199
        }
Line 1362... Line 1365...
1362
        // On duplique le devis
1365
        // On duplique le devis
1363
        if (idDevis > 1) {
1366
        if (idDevis > 1) {
1364
            final SQLRow row = devis.getTable().getRow(idDevis);
1367
            final SQLRow row = devis.getTable().getRow(idDevis);
1365
            final SQLRowValues rowVals = new SQLRowValues(devis.getTable());
1368
            final SQLRowValues rowVals = new SQLRowValues(devis.getTable());
1366
            rowVals.put("ID_CLIENT", row.getInt("ID_CLIENT"));
1369
            rowVals.put("ID_CLIENT", row.getInt("ID_CLIENT"));
-
 
1370
            if (row.getObject("ID_TARIF") != null && !row.isForeignEmpty("ID_TARIF")) {
-
 
1371
                rowVals.put("ID_TARIF", row.getInt("ID_TARIF"));
-
 
1372
            }
1367
            rowVals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(getElement().getClass()));
1373
            rowVals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(getElement().getClass()));
1368
 
1374
 
1369
 
1375
 
1370
            this.select(rowVals);
1376
            this.select(rowVals);
1371
        }
1377
        }