OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 148 → Rev 149

/trunk/OpenConcerto/src/org/openconcerto/erp/core/humanresources/payroll/report/FichePayeSheetXML.java
15,6 → 15,7
 
import org.openconcerto.erp.core.common.element.StyleSQLElement;
import org.openconcerto.erp.generationDoc.AbstractSheetXMLWithDate;
import org.openconcerto.erp.preferences.PayeGlobalPreferencePanel;
import org.openconcerto.erp.preferences.PrinterNXProps;
import org.openconcerto.sql.Configuration;
import org.openconcerto.sql.model.SQLRow;
23,6 → 24,7
import org.openconcerto.sql.model.SQLRowValues;
import org.openconcerto.sql.model.SQLSelect;
import org.openconcerto.sql.model.SQLTable;
import org.openconcerto.sql.preferences.SQLPreferences;
import org.openconcerto.utils.cc.ITransformer;
 
import java.math.BigDecimal;
39,8 → 41,7
 
public class FichePayeSheetXML extends AbstractSheetXMLWithDate {
 
private static boolean prefBulletinSimpl = true;
public static final String TEMPLATE_ID = prefBulletinSimpl ? "FichePayeSimplifiee" : "FichePaye";
public static final String TEMPLATE_ID = "FichePayeSimplifiee";
public static final String TEMPLATE_PROPERTY_NAME = "LocationFichePaye";
final Map<Integer, String> cotisationSimplifieeLink = new HashMap<>();
 
48,6 → 49,9
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) {
SQLSelect sel = new SQLSelect();
sel.addSelect(row.getTable().getDBRoot().findTable("RUBRIQUE_COTISATION").getField("LIGNE_PAYE_SIMPLIFIEE"));
189,13 → 193,14
if (sqlRowAccessor.getBigDecimal("MONTANT_PAT") != null) {
montantPatLigne = sqlRowAccessor.getBigDecimal("MONTANT_PAT");
}
if (montantPatLigne.add(montantSalLigne).signum() != 0) {
ligneSimplifiee.put("NB_BASE", sqlRowAccessor.getBigDecimal("NB_BASE"));
ligneSimplifiee.put("MONTANT_SAL_DED", montantSalBulletinSimpl.add(montantSalLigne));
ligneSimplifiee.put("MONTANT_PAT", montantPatBulletinSimpl.add(montantPatLigne));
 
}
}
}
}
 
private StyleSQLElement eltStyle = Configuration.getInstance().getDirectory().getElement(StyleSQLElement.class);
 
260,10 → 265,15
 
@Override
public String getName() {
SQLPreferences prefs = new SQLPreferences(elt.getTable().getDBRoot());
boolean prefNomSal = prefs.getBoolean(PayeGlobalPreferencePanel.SALARIE_NOM_FICHIER, Boolean.FALSE);
SQLRow rowSal = row.getForeign("ID_SALARIE");
SQLRow rowMois = row.getForeign("ID_MOIS");
Calendar du = row.getDate("DU");
String suffix = "";
if (prefNomSal) {
suffix = "_" + rowSal.getString("NOM");
}
if (du != null && du.get(Calendar.DAY_OF_MONTH) != 1) {
suffix = "_" + du.get(Calendar.DAY_OF_MONTH);
}