OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 168 → Rev 169

/trunk/Modules/Module Subscription/src/org/openconcerto/modules/subscription/element/SubscriptionSQLComponent.java
20,7 → 20,6
import javax.swing.SwingConstants;
 
import org.openconcerto.erp.core.common.element.NumerotationAutoSQLElement;
import org.openconcerto.erp.core.sales.quote.element.DevisSQLElement;
import org.openconcerto.sql.element.BaseSQLComponent;
import org.openconcerto.sql.element.SQLElement;
import org.openconcerto.sql.model.SQLRow;
53,7 → 52,6
labelNumero.setVisible(b);
labelDate.setVisible(b);
textNumero.setVisible(b);
 
date.setVisible(b);
client.setVisible(b);
}
150,7 → 148,6
this.addView(textDescription, "DESCRIPTION");
this.addView(client, "ID_CLIENT");
 
// Codé mais jamais lancé.. a verifier: nom des champs
}
 
private Component createTypeAboComponent(String type, String idName) {
180,11 → 177,6
c.gridx++;
c.weightx = 1;
final ElementComboBox item = new ElementComboBox();
// SQLElement elt =
// Configuration.getInstance().getDirectory().getElement(getTable().getForeignTable(idName));
// ComboSQLRequest req = new ComboSQLRequest(elt.getComboRequest(true),
// Arrays.asList(elt.getTable().getField("NUMERO"), elt.getTable().getField("ID_CLIENT")));
// item.init(elt, req);
panel.add(item, c);
 
// Start
241,15 → 233,7
return panel;
}
 
// @Override
// protected SQLRowValues createDefaults() {
// SQLRowValues rowVals = new SQLRowValues(getTable());
// return super.createDefaults();
// }
 
public void setFieldEnabled(JComponent item, JComponent startDate, JComponent stopDate, JComponent textPeriod, boolean b) {
System.err.println(b);
// Thread.dumpStack();
item.setEnabled(b);
startDate.setEnabled(b);
stopDate.setEnabled(b);
265,7 → 249,6
 
@Override
public void select(SQLRowAccessor r) {
// TODO Auto-generated method stub
super.select(r);
if (r != null) {
this.textNumero.setIdSelected(r.getID());
274,14 → 257,13
 
@Override
public int insert(SQLRow order) {
// TODO Auto-generated method stub
int id = super.insert(order);
// incrémentation du numéro auto
if (NumerotationAutoSQLElement.getNextNumero(DevisSQLElement.class).equalsIgnoreCase(this.textNumero.getText().trim())) {
if (NumerotationAutoSQLElement.getNextNumero(SubscriptionSQLElement.class).equalsIgnoreCase(this.textNumero.getText().trim())) {
final SQLRowValues rowVals = new SQLRowValues(this.tableNum);
int val = this.tableNum.getRow(2).getInt(NumerotationAutoSQLElement.getLabelNumberFor(DevisSQLElement.class));
int val = this.tableNum.getRow(2).getInt(NumerotationAutoSQLElement.getLabelNumberFor(SubscriptionSQLElement.class));
val++;
rowVals.put(NumerotationAutoSQLElement.getLabelNumberFor(DevisSQLElement.class), new Integer(val));
rowVals.put(NumerotationAutoSQLElement.getLabelNumberFor(SubscriptionSQLElement.class), val);
try {
rowVals.update(2);
} catch (final SQLException e) {
291,9 → 273,4
return id;
}
 
@Override
public void update() {
// TODO Auto-generated method stub
super.update();
}
}