OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 156 | Rev 177 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
18 ilm 1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
10
 *
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
13
 
14
 package org.openconcerto.erp.core.sales.invoice.element;
15
 
16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
17
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
132 ilm 18
import org.openconcerto.erp.core.common.element.NumerotationAutoSQLElement;
18 ilm 19
import org.openconcerto.erp.core.common.ui.DeviseField;
132 ilm 20
import org.openconcerto.erp.core.customerrelationship.customer.element.RelanceSQLElement;
174 ilm 21
import org.openconcerto.erp.core.customerrelationship.mail.EmailTemplate;
22
import org.openconcerto.erp.core.customerrelationship.mail.ValueListener;
73 ilm 23
import org.openconcerto.erp.core.finance.accounting.element.MouvementSQLElement;
174 ilm 24
import org.openconcerto.erp.core.finance.payment.element.EncaisserMontantSQLElement;
25
import org.openconcerto.erp.core.sales.invoice.action.ImportReglementSage;
132 ilm 26
import org.openconcerto.erp.core.sales.invoice.report.MailRelanceCreator;
27
import org.openconcerto.erp.core.sales.invoice.report.VenteFactureXmlSheet;
73 ilm 28
import org.openconcerto.erp.rights.ComptaUserRight;
18 ilm 29
import org.openconcerto.sql.Configuration;
30
import org.openconcerto.sql.element.BaseSQLComponent;
31
import org.openconcerto.sql.element.SQLComponent;
151 ilm 32
import org.openconcerto.sql.element.SQLElement;
174 ilm 33
import org.openconcerto.sql.model.ConnectionHandlerNoSetup;
80 ilm 34
import org.openconcerto.sql.model.FieldPath;
73 ilm 35
import org.openconcerto.sql.model.SQLBase;
174 ilm 36
import org.openconcerto.sql.model.SQLDataSource;
73 ilm 37
import org.openconcerto.sql.model.SQLField;
38
import org.openconcerto.sql.model.SQLRow;
39
import org.openconcerto.sql.model.SQLRowAccessor;
174 ilm 40
import org.openconcerto.sql.model.SQLRowListRSH;
18 ilm 41
import org.openconcerto.sql.model.SQLRowValues;
174 ilm 42
import org.openconcerto.sql.model.SQLRowValuesListFetcher;
73 ilm 43
import org.openconcerto.sql.model.SQLTable;
174 ilm 44
import org.openconcerto.sql.model.Where;
45
import org.openconcerto.sql.model.graph.Link;
80 ilm 46
import org.openconcerto.sql.model.graph.Path;
47
import org.openconcerto.sql.model.graph.PathBuilder;
18 ilm 48
import org.openconcerto.sql.request.ListSQLRequest;
49
import org.openconcerto.sql.sqlobject.ElementComboBox;
73 ilm 50
import org.openconcerto.sql.users.rights.UserRightsManager;
174 ilm 51
import org.openconcerto.sql.utils.SQLUtils;
151 ilm 52
import org.openconcerto.sql.view.EditFrame;
53
import org.openconcerto.sql.view.EditPanel.EditMode;
80 ilm 54
import org.openconcerto.sql.view.list.BaseSQLTableModelColumn;
73 ilm 55
import org.openconcerto.sql.view.list.IListe;
56
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
57
import org.openconcerto.sql.view.list.RowAction;
58
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
142 ilm 59
import org.openconcerto.sql.view.list.SQLTableModelSource;
18 ilm 60
import org.openconcerto.ui.DefaultGridBagConstraints;
73 ilm 61
import org.openconcerto.ui.EmailComposer;
18 ilm 62
import org.openconcerto.ui.JDate;
174 ilm 63
import org.openconcerto.ui.SwingThreadUtils;
80 ilm 64
import org.openconcerto.utils.CollectionUtils;
132 ilm 65
import org.openconcerto.utils.ExceptionHandler;
73 ilm 66
import org.openconcerto.utils.GestionDevise;
132 ilm 67
import org.openconcerto.utils.ListMap;
18 ilm 68
 
174 ilm 69
import java.awt.Component;
70
import java.awt.FileDialog;
71
import java.awt.Frame;
18 ilm 72
import java.awt.GridBagConstraints;
73
import java.awt.GridBagLayout;
73 ilm 74
import java.awt.event.ActionEvent;
132 ilm 75
import java.io.File;
73 ilm 76
import java.io.IOException;
77
import java.sql.SQLException;
78
import java.text.SimpleDateFormat;
18 ilm 79
import java.util.ArrayList;
174 ilm 80
import java.util.Calendar;
73 ilm 81
import java.util.Date;
18 ilm 82
import java.util.List;
73 ilm 83
import java.util.Locale;
84
import java.util.Set;
18 ilm 85
 
73 ilm 86
import javax.swing.AbstractAction;
18 ilm 87
import javax.swing.JLabel;
73 ilm 88
import javax.swing.JOptionPane;
18 ilm 89
import javax.swing.JTextField;
90
 
91
public class EcheanceClientSQLElement extends ComptaSQLConfElement {
92
 
73 ilm 93
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd MMMM yyyy", Locale.ENGLISH);
94
 
18 ilm 95
    public EcheanceClientSQLElement() {
96
        super("ECHEANCE_CLIENT", "une échéance client", "échéances clients");
73 ilm 97
        {
151 ilm 98
            PredicateRowAction action = new PredicateRowAction(new AbstractAction("Détails client") {
99
 
100
                @Override
101
                public void actionPerformed(ActionEvent arg0) {
102
 
103
                    SQLElement eltClient = Configuration.getInstance().getDirectory().getElement(((ComptaPropsConfiguration) Configuration.getInstance()).getRootSociete().getTable("CLIENT"));
104
 
105
                    EditFrame edit = new EditFrame(eltClient, EditMode.MODIFICATION);
106
 
107
                    edit.selectionId(IListe.get(arg0).getSelectedRow().asRow().getInt("ID_CLIENT"));
108
                    edit.setVisible(true);
109
                }
110
            }, false);
111
            action.setPredicate(IListeEvent.getSingleSelectionPredicate());
112
            getRowActions().add(action);
113
        }
114
        {
73 ilm 115
            PredicateRowAction action = new PredicateRowAction(new AbstractAction("Voir la source") {
116
 
117
                @Override
118
                public void actionPerformed(ActionEvent arg0) {
119
 
80 ilm 120
                    SQLRow row = IListe.get(arg0).fetchSelectedRow();
73 ilm 121
                    MouvementSQLElement.showSource(row.getInt("ID_MOUVEMENT"));
122
                }
123
            }, false);
124
            action.setPredicate(IListeEvent.getSingleSelectionPredicate());
125
            getRowActions().add(action);
126
        }
127
 
128
        {
174 ilm 129
            PredicateRowAction action = new PredicateRowAction(new AbstractAction("Envoyer un mail de relance") {
73 ilm 130
 
131
                @Override
174 ilm 132
                public void actionPerformed(ActionEvent e) {
133
                    final IListe iListe = IListe.get(e);
134
                    if (iListe.getSelectedRows().isEmpty()) {
135
                        int result = JOptionPane.showConfirmDialog(iListe,
136
                                "Souhaitez vous envoyer un email de relance pour toutes les factures\ndont l'échéance est dépassée?\nLes relances ne seront pas envoyées si les factures ont déjà  une relance de moins d'un mois. ",
137
                                "Relance automatique", JOptionPane.YES_NO_OPTION);
138
                        if (result == JOptionPane.YES_OPTION) {
139
                            EmailTemplate.askTemplate(iListe, getTable().getDBRoot(), new ValueListener() {
73 ilm 140
 
174 ilm 141
                                @Override
142
                                public void valueSelected(Object value) {
143
                                    final Thread t = new Thread(new Runnable() {
144
                                        @Override
145
                                        public void run() {
146
                                            try {
147
                                                EmailTemplate template = (EmailTemplate) value;
148
                                                final SQLTable table = getTable();
149
                                                final SQLRowValues v = new SQLRowValues(table);
150
                                                v.putNulls(table.getFieldsName());
151
                                                Where w = new Where(table.getField("REGLE"), "=", false);
152
                                                w = w.and(new Where(table.getField("REG_COMPTA"), "=", false));
153
                                                final Calendar c = Calendar.getInstance();
154
                                                c.add(Calendar.MONTH, -1);
155
                                                w = w.and(new Where(table.getField("DATE_LAST_RELANCE"), ">", c.getTime()));
156
                                                w = w.and(new Where(table.getField("DATE"), "<=", Calendar.getInstance().getTime()));
157
                                                List<SQLRowValues> rowValues = SQLRowValuesListFetcher.create(v).fetch(w);
158
                                                if (rowValues.isEmpty()) {
159
                                                    JOptionPane.showMessageDialog(iListe, "Aucune relance à  envoyer.");
160
                                                } else {
161
                                                    for (SQLRowValues row : rowValues) {
162
                                                        sendMail(row.asRow(), template);
163
                                                    }
164
                                                }
165
                                            } catch (Exception e) {
166
                                                ExceptionHandler.handle("erreur lors de l'envoi", e);
167
                                            }
168
 
169
                                        }
170
                                    });
171
                                    t.setDaemon(true);
172
                                    t.setName("email relance");
173
                                    t.start();
174
 
175
                                }
176
                            });
177
 
178
                        }
179
 
180
                    } else {
181
                        final SQLTable primaryTable = iListe.getRequest().getPrimaryTable();
182
                        final List<Integer> selectedIDs = iListe.getSelection().getSelectedIDs();
183
                        EmailTemplate.askTemplate(iListe, getTable().getDBRoot(), new ValueListener() {
184
 
185
                            @Override
186
                            public void valueSelected(Object value) {
187
                                final Thread t = new Thread(new Runnable() {
188
                                    @Override
189
                                    public void run() {
190
                                        try {
191
                                            EmailTemplate template = (EmailTemplate) value;
192
                                            final List<SQLRow> rows = SQLRowListRSH.fetch(primaryTable, selectedIDs);
193
                                            for (SQLRow row : rows) {
194
                                                sendMail(row, template);
195
                                            }
196
                                        } catch (Exception e) {
197
                                            ExceptionHandler.handle("erreur lors de l'envoi", e);
198
                                        }
199
 
200
                                    }
201
                                });
202
                                t.setDaemon(true);
203
                                t.setName("email relance selection");
204
                                t.start();
205
 
206
                            }
207
                        });
208
 
209
                    }
73 ilm 210
                }
174 ilm 211
            }, true);
212
            action.setPredicate(IListeEvent.createTotalRowCountPredicate(0, Integer.MAX_VALUE));
73 ilm 213
            getRowActions().add(action);
214
        }
215
 
216
        if (UserRightsManager.getCurrentUserRights().haveRight(ComptaUserRight.MENU)) {
217
            RowAction actionCancel = new RowAction(new AbstractAction("Annuler la régularisation en comptabilité") {
218
 
219
                public void actionPerformed(ActionEvent e) {
220
 
221
                    int answer = JOptionPane.showConfirmDialog(null, "Etes vous sûr de vouloir annuler la régularisation ?");
222
                    if (answer == JOptionPane.YES_OPTION) {
80 ilm 223
                        SQLRow row = IListe.get(e).getSelectedRow().asRow();
73 ilm 224
                        SQLRowValues rowVals = row.createEmptyUpdateRow();
225
                        rowVals.put("REG_COMPTA", Boolean.FALSE);
226
                        try {
227
                            rowVals.commit();
228
                        } catch (SQLException e1) {
229
                            // TODO Auto-generated catch block
230
                            e1.printStackTrace();
231
                        }
232
                    }
233
                }
234
            }, false) {
174 ilm 235
 
73 ilm 236
                @Override
93 ilm 237
                public boolean enabledFor(List<SQLRowValues> selection) {
73 ilm 238
                    if (selection != null && selection.size() == 1) {
239
                        SQLRowAccessor row = selection.get(0);
240
                        return row.getBoolean("REG_COMPTA");
241
                    } else {
242
                        return true;
243
                    }
244
                }
245
            };
246
            getRowActions().add(actionCancel);
247
 
248
            RowAction actionRegul = new RowAction(new AbstractAction("Régularisation en comptabilité") {
249
 
250
                public void actionPerformed(ActionEvent e) {
251
 
80 ilm 252
                    SQLRow row = IListe.get(e).fetchSelectedRow();
73 ilm 253
                    String price = GestionDevise.currencyToString(row.getLong("MONTANT"));
254
                    SQLRow rowClient = row.getForeignRow("ID_CLIENT");
255
                    String nomClient = rowClient.getString("NOM");
256
                    String piece = "";
257
                    SQLRow rowMvt = row.getForeignRow("ID_MOUVEMENT");
258
                    if (rowMvt != null) {
259
                        SQLRow rowPiece = rowMvt.getForeignRow("ID_PIECE");
260
                        piece = rowPiece.getString("NOM");
261
                    }
132 ilm 262
                    int answer = JOptionPane.showConfirmDialog(null,
263
                            "Etes vous sûr de vouloir régulariser l'échéance de " + nomClient + " d'un montant de " + price + "€ avec une saisie au kilometre?\nNom de la piéce : " + piece + ".");
73 ilm 264
                    if (answer == JOptionPane.YES_OPTION) {
265
 
266
                        SQLRowValues rowVals = row.createEmptyUpdateRow();
267
                        rowVals.put("REG_COMPTA", Boolean.TRUE);
268
                        try {
269
                            rowVals.commit();
270
                        } catch (SQLException e1) {
271
                            // TODO Auto-generated catch block
272
                            e1.printStackTrace();
273
                        }
274
                    }
275
                }
276
            }, false) {
174 ilm 277
 
73 ilm 278
                @Override
93 ilm 279
                public boolean enabledFor(List<SQLRowValues> selection) {
73 ilm 280
                    if (selection != null && selection.size() == 1) {
281
                        SQLRowAccessor row = selection.get(0);
282
                        return !row.getBoolean("REG_COMPTA");
283
                    } else {
284
                        return true;
285
                    }
286
                }
174 ilm 287
 
73 ilm 288
            };
289
            getRowActions().add(actionRegul);
290
        }
291
 
174 ilm 292
        RowAction actionImport = new RowAction(new AbstractAction("Importer") {
293
 
294
            public void actionPerformed(ActionEvent e) {
295
 
296
                final Frame frame = SwingThreadUtils.getAncestorOrSelf(Frame.class, (Component) e.getSource());
297
                final FileDialog fd = new FileDialog(frame, "Import XML des réglements Sage", FileDialog.LOAD);
298
                if (fd.getFile() != null) {
299
                    try {
300
                        SQLUtils.executeAtomic(getTable().getDBSystemRoot().getDataSource(), new ConnectionHandlerNoSetup<Object, IOException>() {
301
                            @Override
302
                            public Object handle(final SQLDataSource ds) throws SQLException, IOException {
303
 
304
                                ImportReglementSage sageImporter = new ImportReglementSage(getDirectory().getElement(EncaisserMontantSQLElement.class));
305
                                try {
306
                                    sageImporter.importFromFile(new File(fd.getDirectory(), fd.getFile()));
307
                                } catch (Exception e) {
308
                                    e.printStackTrace();
309
                                    new SQLException(e);
310
                                }
311
                                return null;
312
                            }
313
 
314
                        });
315
                        JOptionPane.showMessageDialog(null, "Import des paiements terminés!");
316
                    } catch (IOException exn) {
317
                        ExceptionHandler.handle(frame, "Erreur lors de la lecture du fichier", exn);
318
                    } catch (SQLException exn) {
319
                        ExceptionHandler.handle(frame, "Erreur lors de l'insertion des paiements dans la base", exn);
320
                    }
321
 
322
                }
323
                fd.setVisible(true);
324
            }
325
        }, true) {
326
            @Override
327
            public boolean enabledFor(List<SQLRowValues> selection) {
328
                return true;
329
            }
330
        };
331
        getRowActions().add(actionImport);
332
 
18 ilm 333
    }
334
 
80 ilm 335
 
174 ilm 336
    private void sendMail(final SQLRow row, EmailTemplate template) throws Exception {
73 ilm 337
 
338
        SQLBase base = ((ComptaPropsConfiguration) Configuration.getInstance()).getSQLBaseSociete();
339
 
174 ilm 340
        int idMvtSource = MouvementSQLElement.getSourceId(row.getInt("ID_MOUVEMENT"));
341
        SQLRow rowMvtSource = base.getTable("MOUVEMENT").getRow(idMvtSource);
132 ilm 342
 
174 ilm 343
        if (!rowMvtSource.getString("SOURCE").equalsIgnoreCase("SAISIE_VENTE_FACTURE")) {
344
            return;
345
        }
346
        int idFact = rowMvtSource.getInt("IDSOURCE");
347
        SQLRow rowFacture = base.getTable("SAISIE_VENTE_FACTURE").getRow(idFact);
73 ilm 348
 
174 ilm 349
        final VenteFactureXmlSheet sheet = new VenteFactureXmlSheet(rowFacture);
73 ilm 350
 
174 ilm 351
        Set<SQLField> setContact = null;
352
        SQLTable tableContact = Configuration.getInstance().getRoot().findTable("CONTACT");
353
        setContact = row.getTable().getForeignKeys(tableContact);
132 ilm 354
 
174 ilm 355
        Set<SQLField> setClient = null;
356
        SQLTable tableClient = ((ComptaPropsConfiguration) Configuration.getInstance()).getSQLBaseSociete().getTable("CLIENT");
357
        setClient = row.getTable().getForeignKeys(tableClient);
73 ilm 358
 
174 ilm 359
        // Récupération du mail du client
360
        String mail = "";
361
        for (SQLField field : setContact) {
362
            if (mail == null || mail.trim().length() == 0) {
363
                mail = row.getForeignRow(field.getName()).getString("EMAIL");
73 ilm 364
            }
174 ilm 365
        }
73 ilm 366
 
174 ilm 367
        for (SQLField field : setClient) {
368
            SQLRow rowCli = row.getForeignRow(field.getName());
369
            if (mail == null || mail.trim().length() == 0) {
370
                mail = rowCli.getString("MAIL");
73 ilm 371
            }
174 ilm 372
        }
373
        final String adresseMail = mail;
73 ilm 374
 
174 ilm 375
        MailRelanceCreator creator = new MailRelanceCreator(template, row);
376
        final String references = creator.getObject();
377
        final String text = creator.getValue();
132 ilm 378
 
174 ilm 379
        final File f;
73 ilm 380
 
174 ilm 381
        f = sheet.getOrCreatePDFDocumentFile(true);
132 ilm 382
 
174 ilm 383
        EmailComposer.getInstance().compose(adresseMail, references, text, f.getAbsoluteFile());
142 ilm 384
 
174 ilm 385
        // Création d'une relance
386
        String numero = NumerotationAutoSQLElement.getNextNumero(RelanceSQLElement.class);
387
        SQLRowValues rowValsR = new SQLRowValues(row.getTable().getTable("RELANCE"));
388
        rowValsR.put("DATE", new Date());
389
        rowValsR.put("NUMERO", numero);
390
        rowValsR.put("ID_CLIENT", row.getForeignID("ID_CLIENT"));
391
        rowValsR.put("ID_SAISIE_VENTE_FACTURE", row.getForeignID("ID_SAISIE_VENTE_FACTURE"));
392
        rowValsR.put("MONTANT", row.getObject("MONTANT"));
393
        rowValsR.put("INFOS", "Email");
394
        rowValsR.put("ID_ECHEANCE_CLIENT", row.getID());
132 ilm 395
 
174 ilm 396
        rowValsR.insert();
132 ilm 397
 
174 ilm 398
        SQLTable tableNum = getTable().getBase().getTable("NUMEROTATION_AUTO");
399
        SQLRowValues rowVals = new SQLRowValues(tableNum);
400
        int val = tableNum.getRow(2).getInt("RELANCE_START");
401
        val++;
402
        rowVals.put("RELANCE_START", Integer.valueOf(val));
132 ilm 403
 
174 ilm 404
        rowVals.update(2);
132 ilm 405
 
174 ilm 406
        // Incrémentation du nombre de relance
407
        int nbRelance = row.getInt("NOMBRE_RELANCE");
408
        nbRelance++;
132 ilm 409
 
174 ilm 410
        SQLRowValues rowValsEch = new SQLRowValues(row.getTable());
411
        rowValsEch.put("NOMBRE_RELANCE", nbRelance);
412
        rowValsEch.put("DATE_LAST_RELANCE", new Date());
132 ilm 413
 
174 ilm 414
        rowValsEch.update(row.getID());
132 ilm 415
 
73 ilm 416
    }
417
 
83 ilm 418
    @Override
132 ilm 419
    public ListMap<String, String> getShowAs() {
420
        ListMap<String, String> map = new ListMap<String, String>();
83 ilm 421
        return map;
422
    }
423
 
18 ilm 424
    protected List<String> getListFields() {
425
        final List<String> l = new ArrayList<String>();
426
 
83 ilm 427
 
428
            l.add("ID_SAISIE_VENTE_FACTURE");
429
            l.add("DATE");
430
            l.add("ID_CLIENT");
431
            l.add("MONTANT");
432
            l.add("ID_MOUVEMENT");
433
                l.add("NOMBRE_RELANCE");
434
            l.add("INFOS");
435
            l.add("DATE_LAST_RELANCE");
18 ilm 436
        return l;
437
    }
438
 
439
    protected List<String> getComboFields() {
440
        final List<String> l = new ArrayList<String>();
441
        l.add("DATE");
442
        l.add("ID_CLIENT");
443
        l.add("MONTANT");
444
        return l;
445
    }
446
 
447
    @Override
132 ilm 448
    protected void _initListRequest(ListSQLRequest req) {
449
        super._initListRequest(req);
450
        req.addToGraphToFetch("REG_COMPTA", "REGLE");
18 ilm 451
    }
452
 
453
    /*
454
     * (non-Javadoc)
455
     *
456
     * @see org.openconcerto.devis.SQLElement#getComponent()
457
     */
458
    public SQLComponent createComponent() {
459
        return new BaseSQLComponent(this) {
460
 
461
            private DeviseField montant;
462
            private JTextField nbRelance;
463
            private JDate date;
464
            private JTextField idMouvement;
465
            private ElementComboBox comboClient;
466
 
467
            public void addViews() {
468
                this.setLayout(new GridBagLayout());
469
                final GridBagConstraints c = new DefaultGridBagConstraints();
470
 
471
                this.montant = new DeviseField();
472
                this.nbRelance = new JTextField();
473
                this.date = new JDate();
474
                this.idMouvement = new JTextField();
475
                this.comboClient = new ElementComboBox();
476
 
477
                // Mouvement
478
                JLabel labelMouvement = new JLabel("Mouvement");
479
                this.add(labelMouvement, c);
480
 
481
                c.weightx = 1;
482
                c.gridx++;
483
                this.add(this.idMouvement, c);
484
 
485
                // Date
486
                JLabel labelDate = new JLabel("Date");
487
                c.gridx++;
488
                this.add(labelDate, c);
489
 
490
                c.gridx++;
491
                c.weightx = 1;
492
                this.add(this.date, c);
493
 
494
                // Client
495
                JLabel labelClient = new JLabel("Client");
496
                c.gridy++;
497
                c.gridx = 0;
498
 
499
                this.add(labelClient, c);
500
 
501
                c.gridx++;
502
                c.weightx = 1;
503
                c.gridwidth = GridBagConstraints.REMAINDER;
504
                this.add(this.comboClient, c);
505
 
506
                // libellé
507
                JLabel labelRelance = new JLabel("Nombre de relance");
508
                c.gridy++;
509
                c.gridx = 0;
510
                c.gridwidth = 1;
511
                this.add(labelRelance, c);
512
 
513
                c.gridx++;
514
                c.weightx = 1;
515
                this.add(this.nbRelance, c);
516
 
517
                // montant
518
                c.gridwidth = 1;
519
                JLabel labelMontant = new JLabel("Montant");
520
                c.gridx++;
521
                this.add(labelMontant, c);
522
 
523
                c.gridx++;
524
                c.weightx = 1;
525
                this.add(this.montant, c);
526
 
527
                this.addSQLObject(this.montant, "MONTANT");
528
                this.addRequiredSQLObject(this.date, "DATE");
529
                this.addSQLObject(this.nbRelance, "NOMBRE_RELANCE");
530
                this.addRequiredSQLObject(this.comboClient, "ID_CLIENT");
531
                this.addSQLObject(this.idMouvement, "ID_MOUVEMENT");
532
            }
533
        };
534
    }
535
 
57 ilm 536
    @Override
537
    protected String createCode() {
156 ilm 538
        return createCodeOfPackage() + ".commitment";
57 ilm 539
    }
540
 
18 ilm 541
}