OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 173 → Rev 174

/trunk/OpenConcerto/src/org/openconcerto/erp/core/humanresources/payroll/element/SalarieSQLElement.java
15,6 → 15,7
 
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
import org.openconcerto.erp.core.common.element.NumerotationAutoSQLElement;
import org.openconcerto.erp.core.customerrelationship.customer.element.ContactItemTable;
import org.openconcerto.erp.core.edm.AttachmentAction;
import org.openconcerto.sql.element.BaseSQLComponent;
import org.openconcerto.sql.element.ElementSQLObject;
25,15 → 26,17
import org.openconcerto.sql.model.SQLRowValues;
import org.openconcerto.sql.model.SQLSelect;
import org.openconcerto.sql.model.SQLTable;
import org.openconcerto.sql.model.UndefinedRowValuesCache;
import org.openconcerto.sql.model.Where;
import org.openconcerto.sql.sqlobject.ElementComboBox;
import org.openconcerto.sql.view.EditFrame;
import org.openconcerto.sql.view.EditPanel.EditMode;
import org.openconcerto.sql.view.EditPanelListener;
import org.openconcerto.sql.view.EditPanel.EditMode;
import org.openconcerto.sql.view.list.IListe;
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
import org.openconcerto.ui.DefaultGridBagConstraints;
import org.openconcerto.ui.FormLayouter;
import org.openconcerto.ui.FrameUtil;
import org.openconcerto.ui.warning.JLabelWarning;
import org.openconcerto.utils.checks.ValidState;
46,9 → 49,11
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
 
import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
94,6 → 99,7
try {
rowInfosAncien.createEmptyUpdateRow().put("ID_SALARIE", rowSelected.getID()).commit();
rowSelected.createEmptyUpdateRow().put("ID_INFOS_SALARIE_PAYE", id).commit();
infosPayeElement.getTable().getRow(id).createEmptyUpdateRow().put("ID_SALARIE", rowSelected.getID()).commit();
} catch (SQLException e) {
e.printStackTrace();
}
141,7 → 147,7
return new BaseSQLComponent(this) {
private final JLabel warningCodeSalLabel = new JLabelWarning();
private final JTextField textCode = new JTextField();
 
ContactItemTable tableContact = new ContactItemTable(UndefinedRowValuesCache.getInstance().getDefaultRowValues(getTable().getTable("CONTACT_SALARIE")));
private JTabbedPane tabbedPane;
private final SQLTable tableNum = getTable().getBase().getTable("NUMEROTATION_AUTO");
 
206,6 → 212,18
}
});
 
// User
final JLabel labelUser = new JLabel(getLabelFor("ID_USER_COMMON"));
final ElementComboBox comboUser = new ElementComboBox(false, 50);
c.gridx = 0;
c.gridy++;
this.add(labelUser, c);
c.gridx++;
c.weightx = 0;
c.fill = GridBagConstraints.NONE;
this.add(comboUser, c);
this.addView(comboUser, "ID_USER_COMMON");
 
/***********************************************************************************
* TABBED PANE
**********************************************************************************/
218,6 → 236,18
scrollEtatCivil.setBorder(null);
this.tabbedPane.add("Etat Civil", scrollEtatCivil);
 
// Contact
JPanel panelContact = new JPanel(new GridBagLayout());
DefaultGridBagConstraints cContact = new DefaultGridBagConstraints();
cContact.weighty = 1;
cContact.weightx = 1;
cContact.fill = GridBagConstraints.BOTH;
 
panelContact.add(tableContact, cContact);
JScrollPane scrollContact = new JScrollPane(panelContact);
scrollContact.setBorder(null);
this.tabbedPane.add("Contacts", scrollContact);
 
// Règlement de la paye
this.addView("ID_REGLEMENT_PAYE", REQ + ";" + DEC + ";" + SEP);
ElementSQLObject eltReglPaye = (ElementSQLObject) this.getView("ID_REGLEMENT_PAYE");
286,7 → 316,18
this.tabbedPane.add("Cumuls et variables de la période", new JScrollPane(panelAllCumul));
// this.tabbedPane.setEnabledAt(this.tabbedPane.getTabCount() - 1, false);
 
Map<String, JComponent> additionalFields = getElement().getAdditionalFields();
if (additionalFields != null && additionalFields.size() > 0) {
// Champ Module
c.gridx = 0;
c.gridy++;
c.gridwidth = GridBagConstraints.REMAINDER;
final JPanel addP = ComptaSQLConfElement.createAdditionalPanel();
this.setAdditionalFieldsPanel(new FormLayouter(addP, 2));
this.tabbedPane.add("Compléments", new JScrollPane(addP));
}
 
c.gridy++;
c.gridx = 0;
c.weighty = 1;
c.gridwidth = GridBagConstraints.REMAINDER;
335,15 → 376,19
* }
*/
checkCode();
if (r != null) {
this.tableContact.insertFrom("ID_SALARIE", r.asRowValues());
}
}
 
public void update() {
 
super.update();
 
SQLTable tableFichePaye = getTable().getBase().getTable("FICHE_PAYE");
SQLRowValues rowVals = new SQLRowValues(tableFichePaye);
rowVals.put("ID_SALARIE", getSelectedID());
rowVals.put("ID_SALARIE",
 
getSelectedID());
SQLRow row = getTable().getRow(getSelectedID());
try {
rowVals.update(row.getInt("ID_FICHE_PAYE"));
350,6 → 395,7
} catch (SQLException e) {
e.printStackTrace();
}
this.tableContact.updateField("ID_SALARIE", getSelectedID());
}
 
public int insert(SQLRow order) {
387,9 → 433,10
e.printStackTrace();
}
}
 
this.tableContact.updateField("ID_SALARIE", id);
return id;
}
 
};
}