Line 29... |
Line 29... |
29 |
import org.openconcerto.erp.action.CreateFrameAbstractAction;
|
29 |
import org.openconcerto.erp.action.CreateFrameAbstractAction;
|
30 |
import org.openconcerto.erp.config.MainFrame;
|
30 |
import org.openconcerto.erp.config.MainFrame;
|
31 |
import org.openconcerto.erp.core.common.element.AdresseSQLElement;
|
31 |
import org.openconcerto.erp.core.common.element.AdresseSQLElement;
|
32 |
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
|
32 |
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
|
33 |
import org.openconcerto.erp.core.common.ui.ListeViewPanel;
|
33 |
import org.openconcerto.erp.core.common.ui.ListeViewPanel;
|
34 |
import org.openconcerto.erp.core.customerrelationship.customer.element.ContactSQLElement;
|
34 |
import org.openconcerto.erp.core.customerrelationship.customer.element.ComptaContactSQLElement;
|
35 |
import org.openconcerto.erp.core.customerrelationship.customer.element.CustomerSQLElement;
|
35 |
import org.openconcerto.erp.core.customerrelationship.customer.element.CustomerSQLElement;
|
36 |
import org.openconcerto.erp.modules.AbstractModule;
|
36 |
import org.openconcerto.erp.modules.AbstractModule;
|
37 |
import org.openconcerto.erp.modules.ComponentsContext;
|
37 |
import org.openconcerto.erp.modules.ComponentsContext;
|
38 |
import org.openconcerto.erp.modules.DBContext;
|
38 |
import org.openconcerto.erp.modules.DBContext;
|
39 |
import org.openconcerto.erp.modules.MenuContext;
|
39 |
import org.openconcerto.erp.modules.MenuContext;
|
Line 164... |
Line 164... |
164 |
createTable.addColumn("DATE_VALIDITE_INSCRIPTION", "date");
|
164 |
createTable.addColumn("DATE_VALIDITE_INSCRIPTION", "date");
|
165 |
createTable.addColumn("DATE_NAISSANCE", "date");
|
165 |
createTable.addColumn("DATE_NAISSANCE", "date");
|
166 |
|
166 |
|
167 |
createTable.addForeignColumn("ID_ADRESSE", addrElem.getTable());
|
167 |
createTable.addForeignColumn("ID_ADRESSE", addrElem.getTable());
|
168 |
createTable.addForeignColumn("ID_PLAGE_HORAIRE", new SQLName("PLAGE_HORAIRE"), SQLSyntax.ID_NAME, null);
|
168 |
createTable.addForeignColumn("ID_PLAGE_HORAIRE", new SQLName("PLAGE_HORAIRE"), SQLSyntax.ID_NAME, null);
|
- |
|
169 |
ctxt.executeSQL();
|
169 |
}
|
170 |
}
|
170 |
// at least v1.0
|
171 |
// at least v1.0
|
171 |
|
172 |
|
172 |
if (dbVersion.getMerged() < ModuleVersion.getMerged(1, 1)) {
|
173 |
if (dbVersion.getMerged() < ModuleVersion.getMerged(1, 1)) {
|
173 |
// migrate from non-private
|
174 |
// migrate from non-private
|
Line 238... |
Line 239... |
238 |
final SQLRowValues vals = fillFields(new SQLRowValues(clientT).put("NOM", firstLastName), adhR, true, addrElem);
|
239 |
final SQLRowValues vals = fillFields(new SQLRowValues(clientT).put("NOM", firstLastName), adhR, true, addrElem);
|
239 |
if (!StringUtils.isEmpty(code))
|
240 |
if (!StringUtils.isEmpty(code))
|
240 |
vals.put("CODE", code);
|
241 |
vals.put("CODE", code);
|
241 |
newClient = vals.insert();
|
242 |
newClient = vals.insert();
|
242 |
}
|
243 |
}
|
243 |
final SQLRowValues contactVals = new SQLRowValues(ctxt.getElementDirectory().getElement(ContactSQLElement.class).getTable());
|
244 |
final SQLRowValues contactVals = new SQLRowValues(ctxt.getElementDirectory().getElement(ComptaContactSQLElement.class).getTable());
|
244 |
contactVals.putForeignID("ID_CLIENT", newClient);
|
245 |
contactVals.putForeignID("ID_CLIENT", newClient);
|
245 |
contactVals.load(adhR.asRow(), Arrays.asList("NOM", "DATE_NAISSANCE"));
|
246 |
contactVals.load(adhR.asRow(), Arrays.asList("NOM", "DATE_NAISSANCE"));
|
246 |
contactVals.put("PRENOM", firstName);
|
247 |
contactVals.put("PRENOM", firstName);
|
247 |
contactVals.put("EMAIL", adhR.getString("MAIL"));
|
248 |
contactVals.put("EMAIL", adhR.getString("MAIL"));
|
248 |
contactVals.insert();
|
249 |
contactVals.insert();
|