OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 174 Rev 177
Line 954... Line 954...
954
                            rowVals.put("MONTANT_SOLDE", m);
954
                            rowVals.put("MONTANT_SOLDE", m);
955
                            rowVals.put("MONTANT_RESTANT", totalAvoirTTC - m);
955
                            rowVals.put("MONTANT_RESTANT", totalAvoirTTC - m);
956
                        }
956
                        }
957
 
957
 
958
                        rowVals.update();
958
                        rowVals.update();
959
                        EcritureSQLElement eltEcr = (EcritureSQLElement) Configuration.getInstance().getDirectory().getElement("ECRITURE");
959
                        List<SQLRow> rowEch = rowFacture.getReferentRows(rowFacture.getTable().getTable("ECHEANCE_CLIENT"));
960
                        final int foreignIDmvt = rowFacture.getForeignID("ID_MOUVEMENT");
960
                        for (SQLRow sqlRow : rowEch) {
961
                        eltEcr.archiveMouvementProfondeur(foreignIDmvt, false);
961
                            if (!sqlRow.getBoolean("REG_COMPTA") && !sqlRow.getBoolean("REGLE")) {
962
 
-
 
963
                        System.err.println("Regeneration des ecritures");
962
                                // update echeance
964
                        new GenerationMvtSaisieVenteFacture(rowFacture.getID(), foreignIDmvt);
963
                                SQLRowValues createEmptyUpdateRow2 = sqlRow.createEmptyUpdateRow();
-
 
964
                                createEmptyUpdateRow2.put("MONTANT", Math.max(0, sqlRow.getLong("MONTANT") - totalAvoir));
965
                        System.err.println("Fin regeneration");
965
                                createEmptyUpdateRow2.commit();
-
 
966
                                break;
-
 
967
                            }
-
 
968
                        }
966
                    } catch (SQLException e1) {
969
                    } catch (SQLException e1) {
967
                        ExceptionHandler.handle("Erreur lors de l'affection de l'avoir sur la facture!", e1);
970
                        ExceptionHandler.handle("Erreur lors de l'affection de l'avoir sur la facture!", e1);
968
                    } finally {
971
                    } finally {
969
                        f.dispose();
972
                        f.dispose();
970
                    }
973
                    }