OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 174 → Rev 177

/trunk/OpenConcerto/src/org/openconcerto/erp/core/humanresources/payroll/element/ContratSalarieSQLElement.java
22,6 → 22,8
 
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
98,8 → 100,10
this.add(labelNature, c);
c.gridx++;
c.weightx = 1;
c.gridwidth = 3;
this.add(textNature, c);
 
c.gridwidth = 1;
// Catégorie socioprofessionnelle
JLabel labelCatSocio = new JLabel(getLabelFor("ID_CODE_EMPLOI"));
labelCatSocio.setHorizontalAlignment(SwingConstants.RIGHT);
113,13 → 117,10
c.weightx = 1;
this.add(selCodeCatSocio, c);
JLabel complPCSLabel = new JLabel(getLabelFor("COMPLEMENT_PCS"));
complPCSLabel.setHorizontalAlignment(SwingConstants.RIGHT);
JTextField complPCS = new JTextField();
c.gridy++;
c.gridx = 0;
c.gridx++;
c.weightx = 0;
this.add(complPCSLabel, c);
c.gridx++;
127,6 → 128,49
this.add(complPCS, c);
addView(complPCS,"COMPLEMENT_PCS");
 
JLabel objetSpecLabel = new JLabel(getLabelFor("SPECTACLE_OBJET"));
objetSpecLabel.setHorizontalAlignment(SwingConstants.RIGHT);
JTextField objetSpec = new JTextField();
c.gridy++;
c.gridx = 0;
c.weightx = 0;
this.add(objetSpecLabel, c);
c.gridx++;
c.weightx = 1;
this.add(objetSpec, c);
addView(objetSpec, "SPECTACLE_OBJET");
objetSpec.setEditable(false);
 
JLabel jourContratLabel = new JLabel(getLabelFor("SPECTACLE_JOUR_CONTRAT"));
jourContratLabel.setHorizontalAlignment(SwingConstants.RIGHT);
JTextField jourContrat = new JTextField();
c.gridx++;
c.weightx = 0;
this.add(jourContratLabel, c);
c.gridx++;
c.weightx = 1;
this.add(jourContrat, c);
addView(jourContrat, "SPECTACLE_JOUR_CONTRAT");
jourContrat.setEditable(false);
 
final ElementComboBox selCaractActivite = new ElementComboBox();
selCaractActivite.setInfoIconVisible(false);
this.addRequiredSQLObject(selCaractActivite, "ID_CODE_CARACT_ACTIVITE");
selCaractActivite.addModelListener("wantedID", new PropertyChangeListener() {
 
@Override
public void propertyChange(PropertyChangeEvent evt) {
final boolean b = selCaractActivite.getSelectedRow() != null && selCaractActivite.getSelectedRow().getString("CODE").equals("04");
objetSpec.setEditable(b);
jourContrat.setEditable(b);
if (!b) {
objetSpec.setText("");
;
jourContrat.setText("");
}
}
});
 
// Contrat de travail
JLabel labelContratTravail = new JLabel(getLabelFor("ID_CODE_CONTRAT_TRAVAIL"));
labelContratTravail.setHorizontalAlignment(SwingConstants.RIGHT);
145,8 → 189,7
labelDroitContrat.setHorizontalAlignment(SwingConstants.RIGHT);
ElementComboBox selDroitContrat = new ElementComboBox();
selDroitContrat.setInfoIconVisible(false);
c.gridy++;
c.gridx = 0;
c.gridx++;
c.weightx = 0;
this.add(labelDroitContrat, c);
c.gridx++;
156,8 → 199,7
// caracteristiques activité
JLabel labelCaractActivite = new JLabel(getLabelFor("ID_CODE_CARACT_ACTIVITE"));
labelCaractActivite.setHorizontalAlignment(SwingConstants.RIGHT);
ElementComboBox selCaractActivite = new ElementComboBox();
selCaractActivite.setInfoIconVisible(false);
 
c.gridy++;
c.gridx = 0;
c.weightx = 0;
171,8 → 213,7
labelStatutProf.setHorizontalAlignment(SwingConstants.RIGHT);
ElementComboBox selStatutProf = new ElementComboBox();
selStatutProf.setInfoIconVisible(false);
c.gridy++;
c.gridx = 0;
c.gridx++;
c.weightx = 0;
this.add(labelStatutProf, c);
c.gridx++;
189,7 → 230,6
c.weightx = 0;
this.add(labelStatutCat, c);
c.gridx++;
c.weighty = 1;
c.weightx = 1;
this.add(selStatutCat, c);
 
198,25 → 238,28
labelStatutCatConv.setHorizontalAlignment(SwingConstants.RIGHT);
ElementComboBox selStatutCatConv = new ElementComboBox();
selStatutCatConv.setInfoIconVisible(false);
c.gridy++;
c.gridx = 0;
c.gridx++;
c.weightx = 0;
this.add(labelStatutCatConv, c);
c.gridx++;
c.weighty = 1;
c.weightx = 1;
this.add(selStatutCatConv, c);
 
List<String> dsnFF = Arrays.asList("ID_CONTRAT_MODALITE_TEMPS", "ID_CONTRAT_REGIME_MALADIE", "ID_CONTRAT_REGIME_VIEILLESSE", "ID_CONTRAT_DETACHE_EXPATRIE",
"ID_CONTRAT_DISPOSITIF_POLITIQUE");
 
"ID_CONTRAT_DISPOSITIF_POLITIQUE", "ID_CONTRAT_MOTIF_RECOURS");
int p = 0;
for (String ffName : dsnFF) {
JLabel labelFF = new JLabel(getLabelFor(ffName));
labelFF.setHorizontalAlignment(SwingConstants.RIGHT);
ElementComboBox selFF = new ElementComboBox();
selFF.setInfoIconVisible(false);
if (p % 2 == 0) {
c.gridy++;
c.gridx = 0;
} else {
c.gridx++;
}
p++;
c.weightx = 0;
this.add(labelFF, c);
c.gridx++;
223,21 → 266,12
c.weighty = 1;
c.weightx = 1;
this.add(selFF, c);
if (ffName.equals("ID_CONTRAT_MOTIF_RECOURS")) {
this.addSQLObject(selFF, ffName);
} else {
this.addRequiredSQLObject(selFF, ffName);
}
JLabel labelFF = new JLabel(getLabelFor("ID_CONTRAT_MOTIF_RECOURS"));
labelFF.setHorizontalAlignment(SwingConstants.RIGHT);
ElementComboBox selFF = new ElementComboBox();
selFF.setInfoIconVisible(false);
c.gridy++;
c.gridx = 0;
c.weightx = 0;
this.add(labelFF, c);
c.gridx++;
c.weighty = 1;
c.weightx = 1;
this.add(selFF, c);
this.addSQLObject(selFF, "ID_CONTRAT_MOTIF_RECOURS");
}
 
// Code Arrco, agirc retirés du contrat et ajoutés dans les caisses de cotisations
 
338,18 → 372,18
// this.add(textCodeRegimeRetraite, c);
// addRequiredSQLObject(textCodeRegimeRetraite, "CODE_REGIME_RETRAITE_DSN");
 
JLabel labelDateModif = new JLabel(getLabelFor("DATE_MODIFICATION"));
labelDateModif.setHorizontalAlignment(SwingConstants.RIGHT);
JDate textDateModif = new JDate();
c.gridy++;
c.gridx = 0;
c.weightx = 0;
this.add(textDateModif, c);
c.gridx++;
c.weighty = 1;
c.weightx = 1;
this.add(textDateModif, c);
addSQLObject(textDateModif, "DATE_MODIFICATION");
// JLabel labelDateModif = new JLabel(getLabelFor("DATE_MODIFICATION"));
// labelDateModif.setHorizontalAlignment(SwingConstants.RIGHT);
// JDate textDateModif = new JDate();
// c.gridy++;
// c.gridx = 0;
// c.weightx = 0;
// this.add(textDateModif, c);
// c.gridx++;
// c.weighty = 1;
// c.weightx = 1;
// this.add(textDateModif, c);
// addSQLObject(textDateModif, "DATE_MODIFICATION");
 
// JLabel labelCM = new JLabel(getLabelFor("ID_INFOS_SALARIE_PAYE_MODIFIE"));
// labelCM.setHorizontalAlignment(SwingConstants.RIGHT);
376,7 → 410,6
c.weightx = 0;
this.add(labelDateDebut, c);
c.gridx++;
c.weighty = 1;
c.weightx = 1;
this.add(textDateDebut, c);
addSQLObject(textDateDebut, "DATE_DEBUT", REQ);
384,19 → 417,64
JLabel labelDateFin = new JLabel(getLabelFor("DATE_PREV_FIN"));
labelDateFin.setHorizontalAlignment(SwingConstants.RIGHT);
JDate textDateFin = new JDate();
c.gridy++;
c.gridx = 0;
c.gridx++;
c.weightx = 0;
this.add(labelDateFin, c);
c.gridx++;
c.weighty = 1;
c.weightx = 1;
this.add(textDateFin, c);
addSQLObject(textDateFin, "DATE_PREV_FIN");
 
JLabel labelAmen = new JLabel(getLabelFor("ID_CODE_AMENAGEMENT_PARTIEL"));
labelAmen.setHorizontalAlignment(SwingConstants.RIGHT);
ElementComboBox selAmen = new ElementComboBox();
selAmen.setInfoIconVisible(false);
c.gridy++;
c.gridx = 0;
c.weightx = 0;
this.add(labelAmen, c);
c.gridx++;
c.weightx = 1;
this.add(selAmen, c);
this.addSQLObject(selAmen, "ID_CODE_AMENAGEMENT_PARTIEL");
 
JLabel labelSupsension = new JLabel(getLabelFor("ID_CODE_SUSPENSION"));
labelSupsension.setHorizontalAlignment(SwingConstants.RIGHT);
ElementComboBox selSupsension = new ElementComboBox();
selSupsension.setInfoIconVisible(false);
c.gridx++;
c.weightx = 0;
this.add(labelSupsension, c);
c.gridx++;
c.weightx = 1;
this.add(selSupsension, c);
this.addSQLObject(selSupsension, "ID_CODE_SUSPENSION");
 
JLabel labelDateDebutSusp = new JLabel(getLabelFor("DATE_DEBUT_SUSPENSION"));
labelDateDebutSusp.setHorizontalAlignment(SwingConstants.RIGHT);
JDate textDateDebutSups = new JDate();
c.gridy++;
c.gridx = 0;
c.weightx = 0;
this.add(labelDateDebutSusp, c);
c.gridx++;
c.weightx = 1;
this.add(textDateDebutSups, c);
this.addSQLObject(textDateDebutSups, "DATE_DEBUT_SUSPENSION");
 
JLabel labelDateFinSups = new JLabel(getLabelFor("DATE_FIN_SUSPENSION"));
labelDateFinSups.setHorizontalAlignment(SwingConstants.RIGHT);
JDate textDateFinSuspension = new JDate();
c.gridx++;
c.weightx = 0;
this.add(labelDateFinSups, c);
c.gridx++;
c.weightx = 1;
this.add(textDateFinSuspension, c);
this.addSQLObject(textDateFinSuspension, "DATE_FIN_SUSPENSION");
 
this.addRequiredSQLObject(selCodeCatSocio, "ID_CODE_EMPLOI");
this.addRequiredSQLObject(selContratTravail, "ID_CODE_CONTRAT_TRAVAIL");
this.addRequiredSQLObject(selCaractActivite, "ID_CODE_CARACT_ACTIVITE");
this.addRequiredSQLObject(selDroitContrat, "ID_CODE_DROIT_CONTRAT");
this.addRequiredSQLObject(selStatutProf, "ID_CODE_STATUT_PROF");
this.addRequiredSQLObject(selStatutCat, "ID_CODE_STATUT_CATEGORIEL");
/trunk/OpenConcerto/src/org/openconcerto/erp/core/humanresources/payroll/element/CodeAmenagementPartielSQLElement.java
New file
0,0 → 1,28
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
*
* The contents of this file are subject to the terms of the GNU General Public License Version 3
* only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
* copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each file.
*/
package org.openconcerto.erp.core.humanresources.payroll.element;
 
import org.openconcerto.sql.model.DBRoot;
 
public class CodeAmenagementPartielSQLElement extends AbstractCodeSQLElement {
 
public CodeAmenagementPartielSQLElement(final DBRoot root) {
super(root.getTable("CODE_AMENAGEMENT_PARTIEL"), "un code d'aménagement partiel", "codes d'aménagement partiel");
}
 
@Override
protected String createCode() {
return createCodeOfPackage() + ".partiel.code";
}
}
/trunk/OpenConcerto/src/org/openconcerto/erp/core/humanresources/payroll/element/FichePayeSQLElement.java
21,7 → 21,6
import org.openconcerto.erp.core.humanresources.payroll.report.FichePayeSheetXML;
import org.openconcerto.erp.core.humanresources.payroll.ui.FichePayeRenderer;
import org.openconcerto.erp.core.humanresources.payroll.ui.PanelCumulsPaye;
import org.openconcerto.erp.generationEcritures.GenerationMvtFichePaye;
import org.openconcerto.erp.model.FichePayeModel;
import org.openconcerto.erp.model.MouseSheetXmlListeListener;
import org.openconcerto.erp.model.RubriquePayeTree;
49,9 → 48,9
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
import org.openconcerto.ui.DefaultGridBagConstraints;
import org.openconcerto.ui.JDate;
import org.openconcerto.ui.component.ITextArea;
import org.openconcerto.ui.component.InteractionMode;
import org.openconcerto.utils.ExceptionHandler;
import org.openconcerto.utils.ListMap;
 
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
102,9 → 101,32
}, true);
actionCumuls.setPredicate(IListeEvent.getSingleSelectionPredicate());
getRowActions().add(actionCumuls);
PredicateRowAction genererNonSimplifie = new PredicateRowAction(new AbstractAction("Créer le bulletin détaillé") {
 
@Override
public void actionPerformed(ActionEvent e) {
 
SQLRow row = IListe.get(e).getSelectedRow().asRow();
FichePayeSheetXML sheet = new FichePayeSheetXML(row, false);
try {
sheet.createDocument();
sheet.showPrintAndExport(true, false, true);
} catch (Exception e1) {
ExceptionHandler.handle("Erreur lors de la création du document.", e1);
}
}
}, false);
genererNonSimplifie.setPredicate(IListeEvent.getSingleSelectionPredicate());
getRowActions().add(genererNonSimplifie);
}
 
@Override
public ListMap<String, String> getShowAs() {
final ListMap<String, String> map = new ListMap<>();
map.put("ID_SALARIE", Arrays.asList("CODE", "NOM", "PRENOM", "ID_REGLEMENT_PAYE"));
return map;
}
 
protected List<String> getListFields() {
final List<String> l = new ArrayList<String>();
l.add("ID_SALARIE");
155,7 → 177,6
JDate dateDu, dateAu;
private JScrollPane paneTreeLeft;
private JPanel pDate;
private JButton buttonValider, buttonGenCompta;
 
public void addViews() {
 
187,7 → 208,7
c.gridheight = 1;
c.gridwidth = 2;
this.selSalCombo = new ElementComboBox();
// c.gridx++;
 
panelRight.add(this.selSalCombo, c);
 
// Mois
199,7 → 220,6
this.dateDu = new JDate();
this.dateAu = new JDate();
 
// JTextField textMois = new JTextField();
JLabel labelAnnee = new JLabel("Année");
this.textAnnee = new JTextField();
{
225,7 → 245,6
this.pDate.add(this.dateAu, cDate);
 
c.gridy++;
// c.gridx++;
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1;
c.weighty = 0;
233,11 → 252,6
c.gridwidth = 2;
panelRight.add(this.pDate, c);
}
// c.gridx += 2;
// c.weightx = 1;
// c.gridwidth = 1;
// c.fill = GridBagConstraints.HORIZONTAL;
// panelRight.add(new JPanel(), c);
 
// Action Button
 
303,16 → 317,16
 
// Total Periode
JPanel panelTotal = new JPanel(new GridBagLayout());
panelTotal.setBorder(BorderFactory.createTitledBorder("Total période"));
panelTotal.setBorder(BorderFactory.createTitledBorder("Totaux sur la période"));
 
GridBagConstraints cPanel = new DefaultGridBagConstraints();
 
JLabel labelInfosConges = new JLabel(getLabelFor("DETAILS_CONGES"));
panelTotal.add(labelInfosConges, cPanel);
ITextArea textConges = new ITextArea();
JTextField textConges = new JTextField();
cPanel.gridx++;
cPanel.weightx = 1;
cPanel.gridwidth = GridBagConstraints.REMAINDER;
cPanel.gridwidth = 5;
panelTotal.add(textConges, cPanel);
addView(textConges, "DETAILS_CONGES");
 
325,7 → 339,7
panelTotal.add(labelBrut, cPanel);
JTextField textSalBrut = new JTextField(10);
cPanel.gridx++;
cPanel.weightx = 0;
cPanel.weightx = 1;
panelTotal.add(textSalBrut, cPanel);
textSalBrut.setEditable(false);
textSalBrut.setEnabled(false);
332,10 → 346,12
 
// acompte
cPanel.gridx++;
cPanel.weightx = 0;
JLabel labelAcompte = new JLabel(getLabelFor("ACOMPTE"));
panelTotal.add(labelAcompte, cPanel);
JTextField textAcompte = new JTextField(10);
cPanel.gridx++;
cPanel.weightx = 1;
panelTotal.add(textAcompte, cPanel);
// textAcompte.setEditable(false);
// textAcompte.setEnabled(false);
342,19 → 358,23
 
// Conges Acquis
cPanel.gridx++;
cPanel.weightx = 0;
JLabel labelCongesAcquis = new JLabel(getLabelFor("CONGES_ACQUIS"));
panelTotal.add(labelCongesAcquis, cPanel);
JTextField textCongesAcquis = new JTextField(10);
cPanel.gridx++;
cPanel.weightx = 1;
panelTotal.add(textCongesAcquis, cPanel);
 
// cotisation salariale
cPanel.gridx = 0;
cPanel.gridy++;
cPanel.weightx = 0;
JLabel labelCotSal = new JLabel(getLabelFor("COT_SAL"));
panelTotal.add(labelCotSal, cPanel);
JTextField textCotSal = new JTextField(10);
cPanel.gridx++;
cPanel.weightx = 1;
panelTotal.add(textCotSal, cPanel);
textCotSal.setEditable(false);
textCotSal.setEnabled(false);
361,10 → 381,12
 
// cotisation patronale
cPanel.gridx++;
cPanel.weightx = 0;
JLabel labelCotPat = new JLabel(getLabelFor("COT_PAT"));
panelTotal.add(labelCotPat, cPanel);
JTextField textCotPat = new JTextField(10);
cPanel.gridx++;
cPanel.weightx = 1;
panelTotal.add(textCotPat, cPanel);
textCotPat.setEditable(false);
textCotPat.setEnabled(false);
371,9 → 393,11
 
JLabel labelCSG = new JLabel(getLabelFor("CSG"));
cPanel.gridx++;
cPanel.weightx = 0;
panelTotal.add(labelCSG, cPanel);
JTextField textCSG = new JTextField(10);
cPanel.gridx++;
cPanel.weightx = 1;
panelTotal.add(textCSG, cPanel);
textCSG.setEditable(false);
textCSG.setEnabled(false);
381,28 → 405,34
// net imposable
cPanel.gridx = 0;
cPanel.gridy++;
cPanel.weightx = 0;
JLabel labelNetImp = new JLabel(getLabelFor("NET_IMP"));
panelTotal.add(labelNetImp, cPanel);
JTextField textNetImp = new JTextField(10);
cPanel.gridx++;
cPanel.weightx = 1;
panelTotal.add(textNetImp, cPanel);
textNetImp.setEditable(false);
textNetImp.setEnabled(false);
 
cPanel.gridx++;
cPanel.weightx = 0;
JLabel labelNetAPayer = new JLabel(getLabelFor("NET_A_PAYER"));
panelTotal.add(labelNetAPayer, cPanel);
JTextField textNetAPayer = new JTextField(10);
cPanel.gridx++;
cPanel.weightx = 1;
panelTotal.add(textNetAPayer, cPanel);
textNetAPayer.setEditable(false);
textNetAPayer.setEnabled(false);
 
cPanel.gridx++;
cPanel.weightx = 0;
JLabel labelCice = new JLabel(getLabelFor("CICE"));
panelTotal.add(labelCice, cPanel);
JTextField textCice = new JTextField(10);
cPanel.gridx++;
cPanel.weightx = 1;
panelTotal.add(textCice, cPanel);
textCice.setEditable(false);
textCice.setEnabled(false);
418,18 → 448,6
 
// Cumuls
 
c.gridx = 1;
c.gridy++;
c.gridwidth = 1;
c.fill = GridBagConstraints.NONE;
this.buttonValider = new JButton("Valider");
// panelRight.add(buttonValider, c);
 
c.gridx++;
c.gridwidth = 1;
this.buttonGenCompta = new JButton("Generer la comptabilité");
// panelRight.add(buttonGenCompta, c);
 
GridBagConstraints cGlobal = new DefaultGridBagConstraints();
cGlobal.gridx = 0;
cGlobal.gridy = 0;
440,32 → 458,6
cGlobal.weighty = 1;
this.add(new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, this.paneTreeLeft, panelRight), cGlobal);
 
// Listeners
this.buttonGenCompta.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
int[] i = new int[1];
i[0] = getSelectedID();
 
SQLRow rowMois = getTable().getBase().getTable("MOIS").getRow(selMois.getSelectedId());
 
new GenerationMvtFichePaye(i, rowMois.getString("NOM"), textAnnee.getText());
} catch (Exception ex) {
ExceptionHandler.handle("Erreur de génération des mouvements", ex);
}
}
});
 
this.buttonValider.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
validationFiche();
} catch (SQLException e1) {
ExceptionHandler.handle("Error while updating pay slip", e1);
}
}
});
 
buttonUp.addActionListener(new ActionListener() {
 
public void actionPerformed(ActionEvent e) {
565,7 → 557,6
 
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.set(Calendar.MONTH, selMois.getSelectedId() - 2);
System.err.println("Du " + cal.getTime());
dateDu.setValue(cal.getTime());
}
fireValidChange();
591,7 → 582,6
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.set(Calendar.MONTH, selMois.getSelectedId() - 2);
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
System.err.println("Au " + cal.getTime());
dateAu.setValue(cal.getTime());
}
fireValidChange();
680,7 → 670,6
 
this.selSalCombo.setVisible(((Boolean) r.getObject("VALIDE")).booleanValue());
this.paneTreeLeft.setVisible(!((Boolean) r.getObject("VALIDE")).booleanValue());
this.buttonValider.setVisible(!((Boolean) r.getObject("VALIDE")).booleanValue());
setpDateEnabled(!((Boolean) r.getObject("VALIDE")).booleanValue());
}
this.selSalCombo.setInteractionMode(InteractionMode.DISABLED);
690,30 → 679,16
}
 
private void setpDateEnabled(boolean b) {
 
// System.err.println("Set date enable --> " + b);
 
this.selMois.setInteractionMode((b) ? InteractionMode.READ_WRITE : InteractionMode.DISABLED);
// this.selMois.setEnabled(b);
 
this.textAnnee.setEditable(b);
this.textAnnee.setEnabled(b);
 
this.dateDu.setInteractionMode((b) ? InteractionMode.READ_WRITE : InteractionMode.DISABLED);
this.dateAu.setInteractionMode((b) ? InteractionMode.READ_WRITE : InteractionMode.DISABLED);
}
 
private void validationFiche() throws SQLException {
 
this.update();
FichePayeSQLElement.validationFiche(this.getSelectedID());
}
 
protected SQLRowValues createDefaults() {
 
System.err.println("**********Set Defaults on FichePaye.date");
SQLRowValues rowVals = new SQLRowValues(getTable());
Calendar cal = Calendar.getInstance();
final SQLRowValues rowVals = new SQLRowValues(getTable());
final Calendar cal = Calendar.getInstance();
rowVals.put("ID_MOIS", cal.get(Calendar.MONTH) + 2);
rowVals.put("ANNEE", cal.get(Calendar.YEAR));
 
739,7 → 714,6
if (JOptionPane.showConfirmDialog(null, "Soustraire les cumuls de cette fiche à celle en cours?", "Suppression d'une fiche de paye",
JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
// on effectue le cumul
// System.err.println("Calcul des cumuls");
 
SQLRow rowSal = row.getForeignRow("ID_SALARIE");
 
845,13 → 819,8
// creer et associer une nouvelle fiche au salarie
final SQLRowValues rowValsNewFiche = new SQLRowValues(tableFiche);
 
try {
SQLRow r = rowValsNewFiche.insert();
rowValsNewFiche.put("ID", r.getID());
// System.err.println("rowValsNewFiche -----> " + r.getID());
} catch (SQLException e) {
e.printStackTrace();
}
 
// mis a jour de la periode
int mois = rowFiche.getInt("ID_MOIS");
865,22 → 834,6
calDu.set(Calendar.DAY_OF_MONTH, calDu.getActualMaximum(Calendar.DAY_OF_MONTH));
rowValsNewFiche.put("AU", calDu.getTime());
rowValsNewFiche.put("ID_PROFIL_PAYE", rowFiche.getInt("ID_PROFIL_PAYE"));
 
/*
* int ancMois = rowFiche.getInt("ID_MOIS"); int ancAnnee = rowFiche.getInt("ANNEE");
*
* rowValsSal.put("DERNIER_MOIS", ancMois); rowValsSal.put("DERNIERE_ANNEE", ancAnnee);
*
* try { rowValsSal.update(rowFiche.getInt("ID_SALARIE")); } catch (SQLException e1) {
* e1.printStackTrace(); }
*
* int mois = ancMois - 2; mois = (mois + 1) % 12; mois += 2; int annee = ancAnnee; if (mois
* == 2) { annee++; } rowValsNewFiche.put("ID_MOIS", mois); rowValsNewFiche.put("ANNEE",
* annee); rowValsNewFiche.put("ID_PROFIL_PAYE", rowFiche.getInt("ID_PROFIL_PAYE"));
*
* try { rowValsNewFiche.update(); } catch (SQLException e) { e.printStackTrace(); }
*/
 
rowValsNewFiche.put("ID_SALARIE", rowSal.getID());
rowValsSal.put("ID_FICHE_PAYE", rowValsNewFiche.getID());
 
919,7 → 872,6
}
 
// on effectue le cumul
// System.err.println("Calcul des cumuls");
final SQLRow rowVarSal = tableVariableSal.getRow(rowSal.getInt("ID_VARIABLE_SALARIE"));
int idCumuls = rowSal.getInt("ID_CUMULS_PAYE");
SQLRow rowCumuls = tableCumuls.getRow(idCumuls);
932,10 → 884,9
float netAPayer = rowCumuls.getFloat("NET_A_PAYER_C") + rowFiche.getFloat("NET_A_PAYER") + rowFiche.getFloat("ACOMPTE");
rowValsCumul.put("NET_A_PAYER_C", new Float(netAPayer));
 
SQLRow r = rowValsCumul.insert();
rowValsCumul.put("ID", r.getID());
SQLRow row = rowValsCumul.insert();
rowValsCumul.put("ID", row.getID());
 
// System.err.println("Mis a jour de la fiche de paye");
rowValsSal.put("ID_CUMULS_PAYE", rowValsCumul.getID());
 
SwingUtilities.invokeLater(new Runnable() {
1054,13 → 1005,7
e1.printStackTrace();
}
}
/*
* int mois = ancMois - 2; mois = (mois + 1) % 12; mois += 2; int annee = ancAnnee; if (mois
* == 2) { annee++; } rowValsNewFiche.put("ID_MOIS", mois); rowValsNewFiche.put("ANNEE",
* annee); rowValsNewFiche.put("ID_PROFIL_PAYE", rowFiche.getInt("ID_PROFIL_PAYE"));
*
* try { rowValsNewFiche.update(); } catch (SQLException e) { e.printStackTrace(); }
*/
 
}
 
// stocke les éléments validés (cumuls congés, paye, ...)
1094,7 → 1039,6
private static void validElements(int id) {
 
SQLBase base = ((ComptaPropsConfiguration) Configuration.getInstance()).getSQLBaseSociete();
System.err.println("Validation des éléments de la fiche.");
String trueString = "1";
if (Configuration.getInstance().getBase().getServer().getSQLSystem() == SQLSystem.POSTGRESQL) {
trueString = "true";
1103,7 → 1047,6
 
base.getDataSource().execute(req);
 
System.err.println("Validation terminée.");
}
 
private static boolean checkDateValid(int idFiche) {
/trunk/OpenConcerto/src/org/openconcerto/erp/core/humanresources/payroll/element/CodeSuspensionSQLElement.java
New file
0,0 → 1,28
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
*
* The contents of this file are subject to the terms of the GNU General Public License Version 3
* only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
* copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each file.
*/
package org.openconcerto.erp.core.humanresources.payroll.element;
 
import org.openconcerto.sql.model.DBRoot;
 
public class CodeSuspensionSQLElement extends AbstractCodeSQLElement {
 
public CodeSuspensionSQLElement(final DBRoot root) {
super(root.getTable("CODE_SUSPENSION"), "un code de suspension", "codes suspension");
}
 
@Override
protected String createCode() {
return createCodeOfPackage() + ".supension.code";
}
}
/trunk/OpenConcerto/src/org/openconcerto/erp/core/humanresources/payroll/element/ReglementPayeSQLElement.java
57,8 → 57,8
 
protected List<String> getComboFields() {
final List<String> l = new ArrayList<String>();
l.add("NOM_BANQUE");
l.add("RIB");
l.add("IBAN");
l.add("BIC");
return l;
}
 
/trunk/OpenConcerto/src/org/openconcerto/erp/core/humanresources/payroll/element/VariablePayeSQLElement.java
261,6 → 261,7
l2.add(tableFichePaye.getField("NET_IMP"));
l2.add(tableFichePaye.getField("NET_A_PAYER"));
l2.add(tableFichePaye.getField("CSG"));
l2.add(tableFichePaye.getField("CSG_REDUITE"));
 
mapTree.put("Contenu paye", l2);
 
/trunk/OpenConcerto/src/org/openconcerto/erp/core/humanresources/payroll/element/RubriqueBrutSQLElement.java
27,6 → 27,7
import org.openconcerto.sql.sqlobject.SQLRequestComboBox;
import org.openconcerto.ui.DefaultGridBagConstraints;
import org.openconcerto.utils.ListMap;
import org.openconcerto.utils.NoneSelectedButtonGroup;
 
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
69,7 → 70,8
l.add("COTISABLE");
l.add("PART_CP");
l.add("TAXABLE_CM");
 
l.add("CSG_NORMAL");
l.add("CSG_REDUIT");
return l;
}
 
339,6 → 341,28
JCheckBox checkCP = new JCheckBox(getLabelFor("PART_CP"));
panelProp.add(checkCP, cPanel);
 
// CSG Normal
cPanel.gridx = 1;
cPanel.weightx = 1;
cPanel.gridy++;
c.fill = GridBagConstraints.HORIZONTAL;
cPanel.gridwidth = GridBagConstraints.REMAINDER;
JCheckBox checkCSGN = new JCheckBox(getLabelFor("CSG_NORMAL"));
panelProp.add(checkCSGN, cPanel);
 
// CSG Réduite
cPanel.gridx = 1;
cPanel.weightx = 1;
cPanel.gridy++;
c.fill = GridBagConstraints.HORIZONTAL;
cPanel.gridwidth = GridBagConstraints.REMAINDER;
JCheckBox checkCSGR = new JCheckBox(getLabelFor("CSG_REDUIT"));
panelProp.add(checkCSGR, cPanel);
 
NoneSelectedButtonGroup groupCSG = new NoneSelectedButtonGroup();
groupCSG.add(checkCSGN);
groupCSG.add(checkCSGR);
 
// Type
JLabel labelSelCodeRubrique = new JLabel("Code DSN (S21.G00.51.011)");
labelSelCodeRubrique.setHorizontalAlignment(SwingConstants.RIGHT);
377,6 → 401,8
this.addSQLObject(checkCotis, "COTISABLE");
this.addSQLObject(checkCP, "PART_CP");
this.addSQLObject(checkImpo, "TAXABLE_CM");
this.addSQLObject(checkCSGN, "CSG_NORMAL");
this.addSQLObject(checkCSGR, "CSG_REDUIT");
 
selSalarie.addValueListener(new PropertyChangeListener() {
 
394,7 → 420,7
rowVals.put("TAXABLE_CM", Boolean.TRUE);
rowVals.put("COTISABLE", Boolean.TRUE);
rowVals.put("PART_BRUT", Boolean.TRUE);
 
rowVals.put("CSG_NORMAL", Boolean.TRUE);
return rowVals;
}
};
/trunk/OpenConcerto/src/org/openconcerto/erp/core/humanresources/payroll/report/LivrePayeSheet.java
21,6 → 21,7
import org.openconcerto.sql.model.SQLSelect;
import org.openconcerto.sql.model.SQLTable;
import org.openconcerto.sql.model.Where;
import org.openconcerto.utils.StringUtils;
 
import java.text.DateFormat;
import java.util.Date;
156,6 → 157,19
 
mapSal.put(new Integer(idSal), "");
 
float montantTestTotal = 0;
if (rowFicheElt.getObject("MONTANT_SAL_AJ") != null) {
montantTestTotal += rowFicheElt.getFloat("MONTANT_SAL_AJ");
}
if (rowFicheElt.getObject("MONTANT_SAL_DED") != null) {
montantTestTotal -= rowFicheElt.getFloat("MONTANT_SAL_DED");
}
 
if (rowFicheElt.getObject("MONTANT_PAT") != null) {
montantTestTotal += rowFicheElt.getFloat("MONTANT_PAT");
}
if (montantTestTotal != 0) {
 
if (rowFicheElt.getString("SOURCE").equalsIgnoreCase("RUBRIQUE_BRUT")) {
 
mapRubriqueBrut.put(new Integer(rowFicheElt.getInt("IDSOURCE")), "");
224,8 → 238,8
mapValue.put(new Integer(rowFicheElt.getInt("IDSOURCE")) + "_PAT", new Float(montant));
mapTotal.put(new Integer(rowFicheElt.getInt("IDSOURCE")) + "_PAT", new Float(montantTotal));
}
 
}
}
 
// Dump
/*
287,7 → 301,7
int idRub = ((Number) mapRubriqueBrut.keySet().toArray()[i]).intValue();
SQLRow rowRub = tableRubBrut.getRow(idRub);
 
this.mCell.put("A" + posLine, rowRub.getObject("NOM"));
this.mCell.put("A" + posLine, StringUtils.limitLength(rowRub.getString("NOM"), 55));
 
this.mCell.put("B" + posLine, fillLine(mapSalarieBrut, idRub, mapSal, numFirstSal, mapTotalbrut, false));
this.mCell.put("C" + posLine, fillLine(mapSalarieBrut, idRub, mapSal, numFirstSal, mapTotalbrut, true));
303,7 → 317,7
int idRub = ((Number) mapRubriqueCot.keySet().toArray()[i]).intValue();
SQLRow rowRub = tableRubCot.getRow(idRub);
 
this.mCell.put("A" + posLine, rowRub.getObject("NOM"));
this.mCell.put("A" + posLine, StringUtils.limitLength(rowRub.getString("NOM"), 55));
 
this.mCell.put("B" + posLine, fillLine(mapSalarieCot, idRub, mapSal, numFirstSal, mapTotalCot, false));
this.mCell.put("C" + posLine, fillLine(mapSalarieCot, idRub, mapSal, numFirstSal, mapTotalCot, true));
320,7 → 334,7
int idRub = ((Number) mapRubriqueNet.keySet().toArray()[i]).intValue();
SQLRow rowRub = tableRubNet.getRow(idRub);
 
this.mCell.put("A" + posLine, rowRub.getObject("NOM"));
this.mCell.put("A" + posLine, StringUtils.limitLength(rowRub.getString("NOM"), 55));
 
this.mCell.put("B" + posLine, fillLine(mapSalarieNet, idRub, mapSal, numFirstSal, mapTotalNet, false));
this.mCell.put("C" + posLine, fillLine(mapSalarieNet, idRub, mapSal, numFirstSal, mapTotalNet, true));
/trunk/OpenConcerto/src/org/openconcerto/erp/core/humanresources/payroll/report/FichePayeSheetXML.java
46,13 → 46,16
final Map<Integer, String> cotisationSimplifieeLink = new HashMap<>();
 
public FichePayeSheetXML(final SQLRow row) {
this(row, !new SQLPreferences(row.getTable().getDBRoot()).getBoolean(PayeGlobalPreferencePanel.NOT_PAYE_SIMPL, Boolean.FALSE));
}
 
public FichePayeSheetXML(final SQLRow row, boolean simplifie) {
super(row);
this.printer = PrinterNXProps.getInstance().getStringProperty("FichePayePrinter");
this.elt = Configuration.getInstance().getDirectory().getElement("FICHE_PAYE");
SQLPreferences prefs = new SQLPreferences(elt.getTable().getDBRoot());
boolean prefBulletinSimpl = !prefs.getBoolean(PayeGlobalPreferencePanel.NOT_PAYE_SIMPL, Boolean.FALSE);
 
if (prefBulletinSimpl) {
if (simplifie) {
 
SQLSelect sel = new SQLSelect();
sel.addSelect(row.getTable().getDBRoot().findTable("RUBRIQUE_COTISATION").getField("LIGNE_PAYE_SIMPLIFIEE"));
sel.addSelect(row.getTable().getDBRoot().findTable("RUBRIQUE_COTISATION").getKey());