Dépôt officiel du code source de l'ERP OpenConcerto
/trunk/Modules/Module Subscription/src/org/openconcerto/modules/subscription/panel/AboPanel.java |
---|
240,6 → 240,7 |
SubscriptionChecker checker = new SubscriptionChecker(elt.getTable()); |
Map<SQLRow, Calendar> listLastCreateElt = checker.check(); |
Date today = new Date(); |
for (SQLRow rowAbonnement : listLastCreateElt.keySet()) { |
// FIXME On recupere des abonnements archives (à tester sur BD 2Si) |
249,26 → 250,29 |
Calendar date = listLastCreateElt.get(rowAbonnement); |
if (date == null) { |
date = rowsCmd.getDate("DATE"); |
date.add(Calendar.MONTH, rowAbonnement.getInt("NB_MOIS_" + type)); |
} |
date.add(Calendar.MONTH, rowAbonnement.getInt("NB_MOIS_" + type)); |
while (date.getTime().compareTo(today) < 0) { |
// Si l'abonnement n'est pas expiré |
if (rowAbonnement.getObject("DATE_FIN_" + type) == null || date.compareTo(rowAbonnement.getDate("DATE_FIN_" + type)) <= 0) { |
// Si l'abonnement n'est pas expiré |
if (rowAbonnement.getObject("DATE_FIN_" + type) == null || date.compareTo(rowAbonnement.getDate("DATE_FIN_" + type)) <= 0) { |
final SQLRowValues rowVals = new SQLRowValues(elt.getTable()); |
final SQLRowValues rowVals = new SQLRowValues(elt.getTable()); |
injectRow(rowsCmd, rowVals, date.getTime(), rowAbonnement); |
// On duplique items |
copyItems(rowsCmd, itemsElement.getTable(), rowVals); |
injectRow(rowsCmd, rowVals, date.getTime(), rowAbonnement); |
// On duplique items |
copyItems(rowsCmd, itemsElement.getTable(), rowVals); |
try { |
try { |
rowVals.commit(); |
// FIXME Voir avec Guillaume create or not create document |
} catch (SQLException exn) { |
rowVals.commit(); |
// FIXME Voir avec Guillaume create or not create document |
} catch (SQLException exn) { |
ExceptionHandler.handle("Erreur lors de la création " + elt.getSingularName() + " d'abonnement.", exn); |
ExceptionHandler.handle("Erreur lors de la création " + elt.getSingularName() + " d'abonnement.", exn); |
} |
} |
date.add(Calendar.MONTH, rowAbonnement.getInt("NB_MOIS_" + type)); |
} |
} |
} |