OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 27 → Rev 28

/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/shipment/component/BonDeLivraisonSQLComponent.java
13,6 → 13,7
package org.openconcerto.erp.core.sales.shipment.component;
 
import static org.openconcerto.utils.CollectionUtils.createSet;
import org.openconcerto.erp.core.common.component.TransfertBaseSQLComponent;
import org.openconcerto.erp.core.common.element.NumerotationAutoSQLElement;
import org.openconcerto.erp.core.common.ui.DeviseField;
33,6 → 34,7
import org.openconcerto.sql.model.SQLTable;
import org.openconcerto.sql.sqlobject.ElementComboBox;
import org.openconcerto.sql.sqlobject.JUniqueTextField;
import org.openconcerto.sql.sqlobject.SQLRequestComboBox;
import org.openconcerto.sql.view.EditFrame;
import org.openconcerto.sql.view.list.RowValuesTableModel;
import org.openconcerto.ui.DefaultGridBagConstraints;
168,18 → 170,14
 
this.add(this.comboClient, c);
final ElementComboBox boxTarif = new ElementComboBox();
if (this.comboClient.getElement().getTable().contains("ID_TARIF")) {
this.comboClient.addValueListener(new PropertyChangeListener() {
 
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (comboClient.getValue() != null) {
Integer id = comboClient.getValue();
 
if (id > 1) {
 
SQLRow row = comboClient.getElement().getTable().getRow(id);
if (comboClient.getElement().getTable().getFieldsName().contains("ID_TARIF")) {
 
if (BonDeLivraisonSQLComponent.this.isFilling())
return;
final SQLRow row = ((SQLRequestComboBox) evt.getSource()).getSelectedRow();
if (row != null) {
// SQLRowAccessor foreignRow = row.getForeignRow("ID_TARIF");
// if (foreignRow.isUndefined() &&
// !row.getForeignRow("ID_DEVISE").isUndefined()) {
200,11 → 198,9
}
}
}
});
}
 
}
});
 
// Bouton tout livrer
JButton boutonAll = new JButton("Tout livrer");
 
417,6 → 413,10
 
}
 
public BonDeLivraisonItemTable getTableBonItem() {
return this.tableBonItem;
}
 
private void reconfigure(JTextField field) {
field.setEnabled(false);
field.setHorizontalAlignment(JTextField.RIGHT);
470,7 → 470,20
if (r != null) {
this.textNumeroUnique.setIdSelected(r.getID());
}
if (r == null || r.getIDNumber() == null)
super.select(r);
else {
System.err.println(r);
final SQLRowValues rVals = r.asRowValues();
final SQLRowValues vals = new SQLRowValues(r.getTable());
vals.load(rVals, createSet("ID_CLIENT"));
vals.setID(rVals.getID());
System.err.println("Select CLIENT");
super.select(vals);
rVals.remove("ID_CLIENT");
super.select(rVals);
}
 
if (r != null) {
this.tableBonItem.insertFrom("ID_BON_DE_LIVRAISON", r.getID());
}
/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/credit/component/AvoirClientSQLComponent.java
188,7 → 188,7
e.printStackTrace();
}
}
vals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(AvoirClientSQLElement.class));
vals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(AvoirClientSQLElement.class, new Date()));
vals.put("MONTANT_TTC", Long.valueOf(0));
vals.put("MONTANT_SERVICE", Long.valueOf(0));
vals.put("MONTANT_HT", Long.valueOf(0));
644,9 → 644,10
 
id = super.insert(order);
this.table.updateField("ID_AVOIR_CLIENT", id);
final SQLRow row = getTable().getRow(id);
 
// incrémentation du numéro auto
if (NumerotationAutoSQLElement.getNextNumero(AvoirClientSQLElement.class).equalsIgnoreCase(this.textNumero.getText().trim())) {
if (NumerotationAutoSQLElement.getNextNumero(AvoirClientSQLElement.class, row.getDate("DATE").getTime()).equalsIgnoreCase(this.textNumero.getText().trim())) {
SQLRowValues rowVals = new SQLRowValues(tableNum);
int val = tableNum.getRow(2).getInt("AVOIR_START");
val++;
660,7 → 661,6
}
}
 
final SQLRow row = getTable().getRow(id);
SQLRowValues rowVals2 = row.createUpdateRow();
Long l = rowVals2.getLong("MONTANT_SOLDE");
Long l2 = rowVals2.getLong("MONTANT_TTC");
/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/order/component/CommandeClientSQLComponent.java
13,6 → 13,7
package org.openconcerto.erp.core.sales.order.component;
 
import static org.openconcerto.utils.CollectionUtils.createSet;
import org.openconcerto.erp.config.ComptaPropsConfiguration;
import org.openconcerto.erp.core.common.component.TransfertBaseSQLComponent;
import org.openconcerto.erp.core.common.element.NumerotationAutoSQLElement;
50,6 → 51,7
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.sql.SQLException;
import java.util.Date;
 
import javax.swing.JLabel;
import javax.swing.JOptionPane;
82,19 → 84,6
this.setLayout(new GridBagLayout());
final GridBagConstraints c = new DefaultGridBagConstraints();
 
// Champ Module
c.gridx = 0;
c.gridy++;
c.gridwidth = GridBagConstraints.REMAINDER;
final JPanel addP = new JPanel();
this.setAdditionalFieldsPanel(new FormLayouter(addP, 1));
this.add(addP, c);
 
c.gridy++;
c.gridwidth = 1;
 
this.comboDevis = new ElementComboBox();
 
// Numero du commande
c.gridx = 0;
this.add(new JLabel(getLabelFor("NUMERO"), SwingConstants.RIGHT), c);
118,6 → 107,22
c.fill = GridBagConstraints.NONE;
this.add(dateCommande, c);
 
// Champ Module
c.gridx = 0;
c.gridy++;
c.gridwidth = GridBagConstraints.REMAINDER;
final JPanel addP = new JPanel();
 
this.setAdditionalFieldsPanel(new FormLayouter(addP, 2));
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1;
this.add(addP, c);
 
c.gridy++;
c.gridwidth = 1;
 
this.comboDevis = new ElementComboBox();
 
// Reference
c.gridx = 0;
c.gridy++;
174,7 → 179,7
 
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (comboClient.getValue() != null) {
if (!isFilling() && comboClient.getValue() != null) {
Integer id = comboClient.getValue();
 
if (id > 1) {
367,7 → 372,7
addSQLObject(this.infos, "INFOS");
addSQLObject(this.comboDevis, "ID_DEVIS");
 
this.numeroUniqueCommande.setText(NumerotationAutoSQLElement.getNextNumero(CommandeClientSQLElement.class));
this.numeroUniqueCommande.setText(NumerotationAutoSQLElement.getNextNumero(CommandeClientSQLElement.class, new Date()));
 
this.table.getModel().addTableModelListener(new TableModelListener() {
 
405,7 → 410,7
}
 
// incrémentation du numéro auto
if (NumerotationAutoSQLElement.getNextNumero(CommandeClientSQLElement.class).equalsIgnoreCase(this.numeroUniqueCommande.getText().trim())) {
if (NumerotationAutoSQLElement.getNextNumero(CommandeClientSQLElement.class, new Date()).equalsIgnoreCase(this.numeroUniqueCommande.getText().trim())) {
SQLRowValues rowVals = new SQLRowValues(this.tableNum);
int val = this.tableNum.getRow(2).getInt("COMMANDE_CLIENT_START");
val++;
436,7 → 441,19
if (r != null) {
this.numeroUniqueCommande.setIdSelected(r.getID());
}
if (r == null || r.getIDNumber() == null)
super.select(r);
else {
System.err.println(r);
final SQLRowValues rVals = r.asRowValues();
final SQLRowValues vals = new SQLRowValues(r.getTable());
vals.load(rVals, createSet("ID_CLIENT"));
vals.setID(rVals.getID());
System.err.println("Select CLIENT");
super.select(vals);
rVals.remove("ID_CLIENT");
super.select(rVals);
}
if (r != null) {
this.table.insertFrom("ID_COMMANDE_CLIENT", r.getID());
}
473,7 → 490,7
 
public void setDefaults() {
this.resetValue();
this.numeroUniqueCommande.setText(NumerotationAutoSQLElement.getNextNumero(CommandeClientSQLElement.class));
this.numeroUniqueCommande.setText(NumerotationAutoSQLElement.getNextNumero(CommandeClientSQLElement.class, new Date()));
this.table.getModel().clearRows();
}
 
505,7 → 522,7
protected SQLRowValues createDefaults() {
SQLRowValues rowVals = new SQLRowValues(getTable());
rowVals.put("T_POIDS", 0.0F);
rowVals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(getElement().getClass()));
rowVals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(CommandeClientSQLElement.class, new Date()));
// User
// SQLSelect sel = new SQLSelect(Configuration.getInstance().getBase());
SQLElement eltComm = Configuration.getInstance().getDirectory().getElement("COMMERCIAL");
/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/order/element/CommandeClientSQLElement.java
82,6 → 82,13
return set;
}
 
@Override
public Set<String> getReadOnlyFields() {
Set<String> s = new HashSet<String>();
s.add("ID_DEVIS");
return s;
}
 
/*
* (non-Javadoc)
*
/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/invoice/element/SaisieVenteFactureItemSQLElement.java
13,9 → 13,9
package org.openconcerto.erp.core.sales.invoice.element;
 
 
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
import org.openconcerto.erp.core.common.ui.DeviseField;
import org.openconcerto.erp.preferences.DefaultNXProps;
import org.openconcerto.sql.element.BaseSQLComponent;
import org.openconcerto.sql.element.SQLComponent;
import org.openconcerto.sql.sqlobject.ElementComboBox;
64,9 → 64,12
l.add("ID_SAISIE_VENTE_FACTURE");
l.add("CODE");
l.add("NOM");
 
String articleAdvanced = DefaultNXProps.getInstance().getStringProperty("ArticleModeVenteAvance");
Boolean bArticleAdvanced = Boolean.valueOf(articleAdvanced);
if (bArticleAdvanced) {
l.add("PRIX_METRIQUE_VT_1");
l.add("ID_MODE_VENTE_ARTICLE");
}
l.add("PA_HT");
l.add("PV_HT");
 
/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/invoice/report/ListeDebiteursXmlSheet.java
74,7 → 74,7
if (rowMvt.getString("SOURCE").equalsIgnoreCase(eltVf.getTable().getName())) {
SQLRow rowVf = eltVf.getTable().getRow(rowMvt.getInt("IDSOURCE"));
mValues.put("NUMERO_FACTURE", rowVf.getString("NUMERO"));
mValues.put("REFERENCE", "");
mValues.put("REFERENCE", rowVf.getString("NOM"));
mValues.put("DATE", dateFormat.format(rowVf.getDate("DATE").getTime()));
mValues.put("MODE_REGLEMENT", "");
mValues.put("MONTANT", GestionDevise.currencyToString(rowVf.getLong("T_TTC")));
/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/invoice/report/VenteFactureXmlSheet.java
19,9 → 19,7
import org.openconcerto.sql.Configuration;
import org.openconcerto.sql.model.SQLRow;
import org.openconcerto.sql.model.SQLTable;
import org.openconcerto.utils.Tuple2;
 
import java.io.File;
import java.util.List;
 
public class VenteFactureXmlSheet extends AbstractSheetXMLWithDate {
72,7 → 70,7
} else if (row.getBoolean("ACOMPTE")) {
type = "Acompte";
} else {
type = "null";
type = null;
 
}
 
/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/invoice/report/VenteFactureXmlSheet.java.r11815
New file
0,0 → 1,87
/*
* 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.sales.invoice.report;
 
import org.openconcerto.erp.config.ComptaPropsConfiguration;
import org.openconcerto.erp.generationDoc.AbstractSheetXMLWithDate;
import org.openconcerto.erp.preferences.PrinterNXProps;
import org.openconcerto.sql.Configuration;
import org.openconcerto.sql.model.SQLRow;
import org.openconcerto.sql.model.SQLTable;
import org.openconcerto.utils.Tuple2;
 
import java.io.File;
import java.util.List;
 
public class VenteFactureXmlSheet extends AbstractSheetXMLWithDate {
 
public static final String TEMPLATE_ID = "VenteFacture";
public static final String TEMPLATE_PROPERTY_NAME = "LocationFacture";
 
@Override
public String getReference() {
return this.row.getString("NOM");
}
 
@Override
public String getName() {
final String startName;
if (row.getBoolean("COMPLEMENT")) {
startName = "FactureComplement_";
} else if (row.getBoolean("ACOMPTE")) {
startName = "FactureAcompte_";
} else {
startName = "Facture_";
}
return startName + this.row.getString("NUMERO");
}
 
@Override
public SQLRow getRowLanguage() {
SQLRow rowClient = this.row.getForeignRow("ID_CLIENT");
if (rowClient.getTable().contains("ID_LANGUE")) {
return rowClient.getForeignRow("ID_LANGUE");
} else {
return super.getRowLanguage();
}
}
 
public VenteFactureXmlSheet(SQLRow row) {
super(row);
this.printer = PrinterNXProps.getInstance().getStringProperty("FacturePrinter");
this.elt = Configuration.getInstance().getDirectory().getElement("SAISIE_VENTE_FACTURE");
getDefaultTemplateId();
}
 
@Override
public String getType() {
String type;
if (row.getBoolean("COMPLEMENT")) {
type = "Complement";
} else if (row.getBoolean("ACOMPTE")) {
type = "Acompte";
} else {
type = "null";
 
}
 
return type;
}
 
@Override
public String getDefaultTemplateId() {
return TEMPLATE_ID;
}
 
}
/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/invoice/report/VenteFactureXmlSheet.java.r11694
New file
0,0 → 1,84
/*
* 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.sales.invoice.report;
 
import org.openconcerto.erp.config.ComptaPropsConfiguration;
import org.openconcerto.erp.generationDoc.AbstractSheetXMLWithDate;
import org.openconcerto.erp.preferences.PrinterNXProps;
import org.openconcerto.sql.Configuration;
import org.openconcerto.sql.model.SQLRow;
import org.openconcerto.sql.model.SQLTable;
import org.openconcerto.utils.Tuple2;
 
import java.util.List;
 
public class VenteFactureXmlSheet extends AbstractSheetXMLWithDate {
 
static {
tuple = Tuple2.create("LocationFacture", "Factures");
}
 
@Override
public String getReference() {
return this.row.getString("NOM");
}
 
@Override
public String getName() {
final String startName;
if (row.getBoolean("COMPLEMENT")) {
startName = "FactureComplement_";
} else if (row.getBoolean("ACOMPTE")) {
startName = "FactureAcompte_";
} else {
startName = "Facture_";
}
return startName + this.row.getString("NUMERO");
}
 
@Override
public SQLRow getRowLanguage() {
SQLRow rowClient = this.row.getForeignRow("ID_CLIENT");
if (rowClient.getTable().contains("ID_LANGUE")) {
return rowClient.getForeignRow("ID_LANGUE");
} else {
return super.getRowLanguage();
}
}
 
public VenteFactureXmlSheet(SQLRow row) {
super(row);
this.printer = PrinterNXProps.getInstance().getStringProperty("FacturePrinter");
this.elt = Configuration.getInstance().getDirectory().getElement("SAISIE_VENTE_FACTURE");
getDefaultModele();
}
 
@Override
public String getDefaultModele() {
String modele;
if (row.getBoolean("COMPLEMENT")) {
modele = "VenteFactureComplement";
} else {
if (row.getBoolean("ACOMPTE")) {
modele = "VenteFactureAcompte";
} else {
modele = "VenteFacture";
}
}
 
return modele;
 
}
 
}
/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/invoice/report/VenteFactureXmlSheet.java.mine
New file
0,0 → 1,85
/*
* 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.sales.invoice.report;
 
import org.openconcerto.erp.config.ComptaPropsConfiguration;
import org.openconcerto.erp.generationDoc.AbstractSheetXMLWithDate;
import org.openconcerto.erp.preferences.PrinterNXProps;
import org.openconcerto.sql.Configuration;
import org.openconcerto.sql.model.SQLRow;
import org.openconcerto.sql.model.SQLTable;
 
import java.util.List;
 
public class VenteFactureXmlSheet extends AbstractSheetXMLWithDate {
 
public static final String TEMPLATE_ID = "VenteFacture";
public static final String TEMPLATE_PROPERTY_NAME = "LocationFacture";
 
@Override
public String getReference() {
return this.row.getString("NOM");
}
 
@Override
public String getName() {
final String startName;
if (row.getBoolean("COMPLEMENT")) {
startName = "FactureComplement_";
} else if (row.getBoolean("ACOMPTE")) {
startName = "FactureAcompte_";
} else {
startName = "Facture_";
}
return startName + this.row.getString("NUMERO");
}
 
@Override
public SQLRow getRowLanguage() {
SQLRow rowClient = this.row.getForeignRow("ID_CLIENT");
if (rowClient.getTable().contains("ID_LANGUE")) {
return rowClient.getForeignRow("ID_LANGUE");
} else {
return super.getRowLanguage();
}
}
 
public VenteFactureXmlSheet(SQLRow row) {
super(row);
this.printer = PrinterNXProps.getInstance().getStringProperty("FacturePrinter");
this.elt = Configuration.getInstance().getDirectory().getElement("SAISIE_VENTE_FACTURE");
getDefaultTemplateId();
}
 
@Override
public String getType() {
String type;
if (row.getBoolean("COMPLEMENT")) {
type = "Complement";
} else if (row.getBoolean("ACOMPTE")) {
type = "Acompte";
} else {
type = null;
 
}
 
return type;
}
 
@Override
public String getDefaultTemplateId() {
return TEMPLATE_ID;
}
 
}
/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/invoice/action/ListeSaisieVenteFactureAction.java
109,10 → 109,9
}
final SQLTableModelColumn dateEnvoiCol = src.getColumn(eltFacture.getTable().getField("DATE_ENVOI"));
 
if (dateEnvoiCol != null) {
((SQLTableModelColumnPath) dateEnvoiCol).setEditable(true);
 
final SQLTableModelColumn dateReglCol = src.getColumn(eltFacture.getTable().getField("DATE_REGLEMENT"));
((SQLTableModelColumnPath) dateReglCol).setEditable(true);
 
dateEnvoiCol.setColumnInstaller(new IClosure<TableColumn>() {
@Override
121,6 → 120,9
columnDateEnvoi.setCellRenderer(new DateEnvoiRenderer());
}
});
}
final SQLTableModelColumn dateReglCol = src.getColumn(eltFacture.getTable().getField("DATE_REGLEMENT"));
((SQLTableModelColumnPath) dateReglCol).setEditable(true);
 
// Edition des dates de reglement
dateReglCol.setColumnInstaller(new IClosure<TableColumn>() {
/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/invoice/ui/ListeDesEcheancesClientsPanel.java
405,7 → 405,7
rowVals.put("ID_SAISIE_VENTE_FACTURE", rowMvtSource.getInt("IDSOURCE"));
rowVals.put("MONTANT", rowSource.getObject("MONTANT"));
rowVals.put("ID_CLIENT", rowSource.getInt("ID_CLIENT"));
rowVals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(RelanceSQLElement.class));
rowVals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(RelanceSQLElement.class, new Date()));
this.editRelance.getSQLComponent().select(rowVals);
 
this.editRelance.pack();
/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/invoice/component/SaisieVenteFactureSQLComponent.java
51,6 → 51,7
import org.openconcerto.sql.sqlobject.ElementComboBox;
import org.openconcerto.sql.sqlobject.ISQLElementWithCodeSelector;
import org.openconcerto.sql.sqlobject.JUniqueTextField;
import org.openconcerto.sql.sqlobject.SQLRequestComboBox;
import org.openconcerto.sql.sqlobject.SQLTextCombo;
import org.openconcerto.sql.users.UserManager;
import org.openconcerto.sql.view.EditFrame;
72,9 → 73,9
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.math.BigDecimal;
import java.sql.Date;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
 
609,44 → 610,7
if (id > 1) {
 
SQLRow row = SaisieVenteFactureSQLComponent.this.client.getTable().getRow(id);
if (SaisieVenteFactureSQLComponent.this.client.getTable().getFieldsName().contains("ID_TARIF")) {
 
SQLRowAccessor foreignRow = row.getForeignRow("ID_TARIF");
if (!foreignRow.isUndefined() && (boxTarif.getSelectedRow() == null || boxTarif.getSelectedId() != foreignRow.getID())
&& JOptionPane.showConfirmDialog(null, "Appliquer les tarifs associés au client?") == JOptionPane.YES_OPTION) {
boxTarif.setValue(foreignRow.getID());
// SaisieVenteFactureSQLComponent.this.tableFacture.setTarif(foreignRow,
// true);
} else {
boxTarif.setValue(foreignRow.getID());
}
// if (foreignRow.isUndefined() &&
// !row.getForeignRow("ID_DEVISE").isUndefined()) {
// SQLRowValues rowValsD = new SQLRowValues(foreignRow.getTable());
// rowValsD.put("ID_DEVISE", row.getObject("ID_DEVISE"));
// foreignRow = rowValsD;
//
// }
}
int idCpt = row.getInt("ID_COMPTE_PCE");
 
if (idCpt <= 1) {
// Select Compte client par defaut
idCpt = rowPrefsCompte.getInt("ID_COMPTE_PCE_CLIENT");
if (idCpt <= 1) {
try {
idCpt = ComptePCESQLElement.getIdComptePceDefault("Clients");
} catch (Exception e) {
e.printStackTrace();
}
}
}
if (SaisieVenteFactureSQLComponent.this.compteSel != null) {
Integer i = SaisieVenteFactureSQLComponent.this.compteSel.getValue();
if (i == null || i.intValue() != idCpt) {
SaisieVenteFactureSQLComponent.this.compteSel.setValue(idCpt);
}
}
if (SaisieVenteFactureSQLComponent.this.contact != null) {
Where w = new Where(SaisieVenteFactureSQLComponent.this.eltContact.getTable().getField("ID_CLIENT"), "=", SQLRow.NONEXISTANT_ID);
w = w.or(new Where(SaisieVenteFactureSQLComponent.this.eltContact.getTable().getField("ID_CLIENT"), "=", id));
710,8 → 674,58
totalTTC.updateTotal();
}
});
this.comboClient.addValueListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (SaisieVenteFactureSQLComponent.this.isFilling())
return;
final SQLRow row = ((SQLRequestComboBox) evt.getSource()).getSelectedRow();
if (row != null) {
SaisieVenteFactureSQLComponent.this.defaultContactRowValues.put("ID_CLIENT", row.getIDNumber());
if (SaisieVenteFactureSQLComponent.this.client.getTable().contains("ID_TARIF")) {
SQLRowAccessor foreignRow = row.getForeignRow("ID_TARIF");
if (!foreignRow.isUndefined() && (boxTarif.getSelectedRow() == null || boxTarif.getSelectedId() != foreignRow.getID())
&& JOptionPane.showConfirmDialog(null, "Appliquer les tarifs associés au client?") == JOptionPane.YES_OPTION) {
boxTarif.setValue(foreignRow.getID());
// SaisieVenteFactureSQLComponent.this.tableFacture.setTarif(foreignRow,
// true);
} else {
boxTarif.setValue(foreignRow.getID());
}
// if (foreignRow.isUndefined() &&
// !row.getForeignRow("ID_DEVISE").isUndefined()) {
// SQLRowValues rowValsD = new SQLRowValues(foreignRow.getTable());
// rowValsD.put("ID_DEVISE", row.getObject("ID_DEVISE"));
// foreignRow = rowValsD;
//
// }
}
 
int idCpt = row.getInt("ID_COMPTE_PCE");
 
if (idCpt <= 1) {
// Select Compte client par defaut
idCpt = rowPrefsCompte.getInt("ID_COMPTE_PCE_CLIENT");
if (idCpt <= 1) {
try {
idCpt = ComptePCESQLElement.getIdComptePceDefault("Clients");
} catch (Exception e) {
e.printStackTrace();
}
}
}
if (SaisieVenteFactureSQLComponent.this.compteSel != null) {
Integer i = SaisieVenteFactureSQLComponent.this.compteSel.getValue();
if (i == null || i.intValue() != idCpt) {
SaisieVenteFactureSQLComponent.this.compteSel.setValue(idCpt);
}
}
}
 
}
});
}
 
private JPanel createPanelAvoir() {
JPanel panelAvoir = new JPanel(new GridBagLayout());
panelAvoir.setOpaque(false);
881,9 → 895,9
 
if (getMode() == Mode.INSERTION) {
idSaisieVF = super.insert(order);
 
rowFacture = getTable().getRow(idSaisieVF);
// incrémentation du numéro auto
if (NumerotationAutoSQLElement.getNextNumero(SaisieVenteFactureSQLElement.class).equalsIgnoreCase(this.textNumeroUnique.getText().trim())) {
if (NumerotationAutoSQLElement.getNextNumero(SaisieVenteFactureSQLElement.class, rowFacture.getDate("DATE").getTime()).equalsIgnoreCase(this.textNumeroUnique.getText().trim())) {
SQLRowValues rowVals = new SQLRowValues(this.tableNum);
int val = this.tableNum.getRow(2).getInt("FACT_START");
val++;
1087,7 → 1101,7
SQLRow row = fact.getTable().getRow(idFacture);
SQLRowValues rowVals = new SQLRowValues(fact.getTable());
rowVals.put("ID_CLIENT", row.getInt("ID_CLIENT"));
rowVals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(SaisieVenteFactureSQLElement.class));
rowVals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(SaisieVenteFactureSQLElement.class, new Date()));
this.select(rowVals);
}
 
1123,7 → 1137,7
SQLRowValues rowVals = new SQLRowValues(fact.getTable());
rowVals.put("ID_CLIENT", row.getInt("ID_CLIENT"));
rowVals.put("ID_AFFAIRE", row.getInt("ID_AFFAIRE"));
rowVals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(SaisieVenteFactureSQLElement.class));
rowVals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(SaisieVenteFactureSQLElement.class, new Date()));
rowVals.put("NOM", "Acompte de " + GestionDevise.currencyToString(acompte) + "€");
this.select(rowVals);
}
1282,7 → 1296,7
 
// User
final ComptaPropsConfiguration comptaPropsConfiguration = ((ComptaPropsConfiguration) Configuration.getInstance());
vals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(SaisieVenteFactureSQLElement.class));
vals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(SaisieVenteFactureSQLElement.class, new Date()));
int idCompteVenteProduit = rowPrefsCompte.getInt("ID_COMPTE_PCE_VENTE_PRODUIT");
if (idCompteVenteProduit <= 1) {
try {
1314,7 → 1328,7
public void setDefaults() {
this.resetValue();
 
this.textNumeroUnique.setText(NumerotationAutoSQLElement.getNextNumero(SaisieVenteFactureSQLElement.class));
this.textNumeroUnique.setText(NumerotationAutoSQLElement.getNextNumero(SaisieVenteFactureSQLElement.class, new java.util.Date()));
this.tableFacture.getModel().clearRows();
}
 
1332,7 → 1346,7
public void setPrevisonnelle(boolean b) {
this.checkPrevisionnelle.setSelected(b);
if (!b) {
this.textNumeroUnique.setText(NumerotationAutoSQLElement.getNextNumero(SaisieVenteFactureSQLElement.class));
this.textNumeroUnique.setText(NumerotationAutoSQLElement.getNextNumero(SaisieVenteFactureSQLElement.class, new Date()));
}
}
 
/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/quote/element/DevisItemSQLElement.java
15,6 → 15,7
 
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
import org.openconcerto.erp.core.common.ui.DeviseField;
import org.openconcerto.erp.preferences.DefaultNXProps;
import org.openconcerto.sql.element.SQLComponent;
import org.openconcerto.sql.element.UISQLComponent;
import org.openconcerto.sql.sqlobject.ElementComboBox;
24,7 → 25,6
 
import javax.swing.JTextField;
 
 
public class DevisItemSQLElement extends ComptaSQLConfElement {
 
public DevisItemSQLElement() {
32,14 → 32,22
}
 
protected List<String> getListFields() {
final List<String> l = new ArrayList<String>();
l.add("ID_STYLE");
List<String> l = new ArrayList<String>();
l.add("ID_DEVIS");
l.add("CODE");
l.add("NOM");
String articleAdvanced = DefaultNXProps.getInstance().getStringProperty("ArticleModeVenteAvance");
Boolean bArticleAdvanced = Boolean.valueOf(articleAdvanced);
if (bArticleAdvanced) {
l.add("PRIX_METRIQUE_VT_1");
l.add("ID_MODE_VENTE_ARTICLE");
}
l.add("PA_HT");
l.add("PV_HT");
l.add("ID_TAXE");
l.add("POIDS");
 
l.add("QTE");
l.add("T_PV_HT");
l.add("T_PV_TTC");
return l;
}
 
/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/quote/element/DevisSQLElement.java
19,7 → 19,6
import org.openconcerto.erp.core.sales.invoice.component.SaisieVenteFactureSQLComponent;
import org.openconcerto.erp.core.sales.order.component.CommandeClientSQLComponent;
import org.openconcerto.erp.core.sales.quote.component.DevisSQLComponent;
import org.openconcerto.erp.core.supplychain.order.component.CommandeSQLComponent;
import org.openconcerto.sql.Configuration;
import org.openconcerto.sql.element.SQLComponent;
import org.openconcerto.sql.element.SQLElement;
26,6 → 25,7
import org.openconcerto.sql.model.SQLRowValues;
import org.openconcerto.sql.request.ListSQLRequest;
import org.openconcerto.sql.view.EditFrame;
import org.openconcerto.utils.CollectionMap;
 
import java.util.ArrayList;
import java.util.HashSet;
62,6 → 62,14
}
 
@Override
public CollectionMap<String, String> getShowAs() {
 
CollectionMap<String, String> map = new CollectionMap<String, String>();
map.put(null, "NUMERO");
return map;
}
 
@Override
public synchronized ListSQLRequest createListRequest() {
return new ListSQLRequest(getTable(), getListFields()) {
@Override
/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/quote/action/ListeDesDevisAction.java
19,6 → 19,7
import org.openconcerto.erp.core.common.ui.IListTotalPanel;
import org.openconcerto.erp.core.common.ui.PanelFrame;
import org.openconcerto.erp.core.sales.quote.element.DevisSQLElement;
import org.openconcerto.erp.core.sales.quote.element.EtatDevisSQLElement;
import org.openconcerto.erp.core.sales.quote.report.DevisTextSheet;
import org.openconcerto.erp.core.sales.quote.ui.ListeDesDevisPanel;
import org.openconcerto.erp.generationDoc.DocumentLocalStorageManager;
27,8 → 28,10
import org.openconcerto.sql.Configuration;
import org.openconcerto.sql.model.SQLField;
import org.openconcerto.sql.model.SQLRow;
import org.openconcerto.sql.model.SQLRowValues;
import org.openconcerto.sql.view.IListFrame;
import org.openconcerto.sql.view.ListeAddPanel;
import org.openconcerto.sql.view.list.IListe;
import org.openconcerto.ui.DefaultGridBagConstraints;
import org.openconcerto.utils.ExceptionHandler;
 
39,6 → 42,7
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.File;
import java.sql.SQLException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
126,6 → 130,36
menu.add(item);
}
 
AbstractAction actionAcc = new AbstractAction("Marquer comme accepté") {
public void actionPerformed(ActionEvent e) {
SQLRowValues rowVals = IListe.get(e).getSelectedRow().createEmptyUpdateRow();
rowVals.put("ID_ETAT_DEVIS", EtatDevisSQLElement.ACCEPTE);
try {
rowVals.update();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
IListe.get(e).getSelectedRow().getTable().fireTableModified(IListe.get(e).getSelectedId());
}
};
menu.add(actionAcc);
 
AbstractAction actionRefus = new AbstractAction("Marquer comme refusé") {
public void actionPerformed(ActionEvent e) {
SQLRowValues rowVals = IListe.get(e).getSelectedRow().createEmptyUpdateRow();
rowVals.put("ID_ETAT_DEVIS", EtatDevisSQLElement.REFUSE);
try {
rowVals.update();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
IListe.get(e).getSelectedRow().getTable().fireTableModified(IListe.get(e).getSelectedId());
}
};
menu.add(actionRefus);
 
// Voir le document
AbstractAction actionTransfert = new AbstractAction("Transférer en facture") {
public void actionPerformed(ActionEvent e) {
/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/quote/ui/ListeDesDevisPanel.java
32,24 → 32,18
import org.openconcerto.sql.model.Where;
import org.openconcerto.sql.view.EditFrame;
import org.openconcerto.sql.view.EditPanel;
import org.openconcerto.sql.view.IListener;
import org.openconcerto.sql.view.ListeAddPanel;
import org.openconcerto.sql.view.list.IListe;
import org.openconcerto.sql.view.list.RowAction;
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
import org.openconcerto.sql.view.list.SQLTableModelColumn;
import org.openconcerto.sql.view.list.SQLTableModelColumnPath;
import org.openconcerto.sql.view.list.SQLTableModelSourceOnline;
import org.openconcerto.ui.DefaultGridBagConstraints;
import org.openconcerto.utils.CollectionMap;
import org.openconcerto.utils.ExceptionHandler;
 
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
91,105 → 85,6
this.map.put(this.tabbedPane.getTabCount(), panelRefuse);
this.tabbedPane.add("Refusé", panelRefuse);
 
// Bouton generer
this.buttonGen = new JButton("Générer le document");
this.add(this.buttonGen, c);
this.buttonGen.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
final ListeAddPanel selectedPanel = ListeDesDevisPanel.this.map.get(ListeDesDevisPanel.this.tabbedPane.getSelectedIndex());
SQLRow row = selectedPanel.getListe().getSelectedRow();
DevisXmlSheet sheet = new DevisXmlSheet(row);
sheet.createDocumentAsynchronous();
sheet.showPrintAndExportAsynchronous(true, false, true);
} catch (Exception ex) {
ExceptionHandler.handle("Erreur lors de de la génération du document", ex);
}
}
});
 
// Bouton voir le document
this.buttonShow = new JButton("Voir le document");
c.gridx++;
this.add(this.buttonShow, c);
// this.buttonShow.setToolTipText("Voir le document");
// this.buttonShow.setBorder(null);
this.buttonShow.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
final ListeAddPanel selectedPanel = ListeDesDevisPanel.this.map.get(ListeDesDevisPanel.this.tabbedPane.getSelectedIndex());
SQLRow row = selectedPanel.getListe().getSelectedRow();
DevisXmlSheet sheet = new DevisXmlSheet(row);
sheet.getOrCreateDocumentFile();
sheet.openDocument(false);
} catch (Exception ex) {
ExceptionHandler.handle("Erreur lors de de la génération du document", ex);
}
 
}
});
 
// Bouton Impression
this.buttonPrint = new JButton("Impression");
c.gridx++;
this.add(this.buttonPrint, c);
// this.buttonPrint.setToolTipText("Impression");
// this.buttonPrint.setBorder(null);
this.buttonPrint.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
final ListeAddPanel selectedPanel = ListeDesDevisPanel.this.map.get(ListeDesDevisPanel.this.tabbedPane.getSelectedIndex());
SQLRow row = selectedPanel.getListe().getSelectedRow();
DevisXmlSheet sheet = new DevisXmlSheet(row);
sheet.fastPrintDocument();
// printDoc(row);
}
});
 
// Vers facture
this.buttonFacture = new JButton("Transfert en facture");
c.gridx++;
this.add(this.buttonFacture, c);
// this.buttonFacture.setToolTipText("Transfert vers facture");
// this.buttonFacture.setBorder(null);
this.buttonFacture.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
final ListeAddPanel selectedPanel = ListeDesDevisPanel.this.map.get(ListeDesDevisPanel.this.tabbedPane.getSelectedIndex());
SQLRow row = selectedPanel.getListe().getSelectedRow();
transfertFacture(row);
}
});
 
// Vers cmd
this.buttonCmd = new JButton("Transfert en commande client");
c.gridx++;
this.add(this.buttonCmd, c);
this.buttonCmd.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
final ListeAddPanel selectedPanel = ListeDesDevisPanel.this.map.get(ListeDesDevisPanel.this.tabbedPane.getSelectedIndex());
SQLRow row = selectedPanel.getListe().getSelectedRow();
transfertCommandeClient(row);
}
});
 
// Dupliquer
this.buttonClone = new JButton("Créer à partir de");
c.gridx++;
this.add(this.buttonClone, c);
this.buttonClone.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
final ListeAddPanel selectedPanel = ListeDesDevisPanel.this.map.get(ListeDesDevisPanel.this.tabbedPane.getSelectedIndex());
SQLRow row = selectedPanel.getListe().getSelectedRow();
 
if (ListeDesDevisPanel.this.editFrame == null) {
SQLElement eltFact = Configuration.getInstance().getDirectory().getElement("DEVIS");
ListeDesDevisPanel.this.editFrame = new EditFrame(eltFact, EditPanel.CREATION);
}
 
((DevisSQLComponent) ListeDesDevisPanel.this.editFrame.getSQLComponent()).loadDevisExistant(row.getID());
ListeDesDevisPanel.this.editFrame.setVisible(true);
}
});
 
c.weightx = 1;
c.weighty = 1;
c.fill = GridBagConstraints.BOTH;
198,15 → 93,7
c.gridwidth = GridBagConstraints.REMAINDER;
this.add(this.tabbedPane, c);
 
this.tabbedPane.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
final ListeAddPanel selectedPanel = ListeDesDevisPanel.this.map.get(ListeDesDevisPanel.this.tabbedPane.getSelectedIndex());
selectedPanel.getListe().getModel().fireTableDataChanged();
}
});
checkButton(-1);
}
 
private ListeAddPanel createPanel(int idFilter) {
// Filter
243,16 → 130,16
}
}
 
pane.getListe().addIListeActions(new MouseSheetXmlListeListener(DevisXmlSheet.class) {
MouseSheetXmlListeListener mouseSheetXmlListeListener = new MouseSheetXmlListeListener(DevisXmlSheet.class) {
@Override
public List<RowAction> addToMenu() {
List<RowAction> list = new ArrayList<RowAction>();
// Transfert vers facture
PredicateRowAction factureAction = new PredicateRowAction(new AbstractAction("Transfert vers facture") {
RowAction factureAction = new RowAction(new AbstractAction("Transfert vers facture") {
public void actionPerformed(ActionEvent e) {
transfertFacture(IListe.get(e).getSelectedRow());
}
}, false) {
}, true) {
public boolean enabledFor(java.util.List<org.openconcerto.sql.model.SQLRowAccessor> selection) {
if (selection != null && selection.size() == 1) {
if (selection.get(0).getInt("ID_ETAT_DEVIS") == EtatDevisSQLElement.ACCEPTE) {
263,8 → 150,10
};
};
 
list.add(factureAction);
 
// Voir le document
PredicateRowAction actionTransfertCmd = new PredicateRowAction(new AbstractAction("Transférer en commande") {
RowAction actionTransfertCmd = new RowAction(new AbstractAction("Transférer en commande") {
public void actionPerformed(ActionEvent e) {
transfertCommande(IListe.get(e).getSelectedRow());
}
278,13 → 167,14
return false;
};
};
list.add(actionTransfertCmd);
 
// Transfert vers commande
PredicateRowAction commandeAction = new PredicateRowAction(new AbstractAction("Transfert vers commande client") {
RowAction commandeAction = new RowAction(new AbstractAction("Transfert vers commande client") {
public void actionPerformed(ActionEvent e) {
transfertCommandeClient(IListe.get(e).getSelectedRow());
}
}, false) {
}, true) {
public boolean enabledFor(java.util.List<org.openconcerto.sql.model.SQLRowAccessor> selection) {
if (selection != null && selection.size() == 1) {
if (selection.get(0).getInt("ID_ETAT_DEVIS") == EtatDevisSQLElement.ACCEPTE) {
295,8 → 185,10
};
};
 
list.add(commandeAction);
 
// Marqué accepté
PredicateRowAction accepteAction = new PredicateRowAction(new AbstractAction("Marquer comme accepté") {
RowAction accepteAction = new RowAction(new AbstractAction("Marquer comme accepté") {
public void actionPerformed(ActionEvent e) {
SQLRowValues rowVals = IListe.get(e).getSelectedRow().createEmptyUpdateRow();
rowVals.put("ID_ETAT_DEVIS", EtatDevisSQLElement.ACCEPTE);
319,6 → 211,55
};
};
 
list.add(accepteAction);
 
RowAction accepteEtCmdAction = new RowAction(new AbstractAction("Marquer comme accepté et Transfert en commande client") {
public void actionPerformed(ActionEvent e) {
SQLRow selectedRow = IListe.get(e).getSelectedRow();
SQLRowValues rowVals = selectedRow.createEmptyUpdateRow();
rowVals.put("ID_ETAT_DEVIS", EtatDevisSQLElement.ACCEPTE);
try {
rowVals.update();
} catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
selectedRow.getTable().fireTableModified(IListe.get(e).getSelectedId());
transfertCommandeClient(selectedRow);
}
}, false) {
public boolean enabledFor(java.util.List<org.openconcerto.sql.model.SQLRowAccessor> selection) {
if (selection != null && selection.size() == 1) {
if (selection.get(0).getInt("ID_ETAT_DEVIS") == EtatDevisSQLElement.EN_ATTENTE) {
return true;
}
}
return false;
};
};
list.add(accepteEtCmdAction);
 
// // Dupliquer
RowAction cloneAction = new RowAction(new AbstractAction("Créer à partir de") {
public void actionPerformed(ActionEvent e) {
SQLRow selectedRow = IListe.get(e).getSelectedRow();
 
if (ListeDesDevisPanel.this.editFrame == null) {
SQLElement eltFact = Configuration.getInstance().getDirectory().getElement("DEVIS");
ListeDesDevisPanel.this.editFrame = new EditFrame(eltFact, EditPanel.CREATION);
}
 
((DevisSQLComponent) ListeDesDevisPanel.this.editFrame.getSQLComponent()).loadDevisExistant(selectedRow.getID());
ListeDesDevisPanel.this.editFrame.setVisible(true);
}
}, true) {
public boolean enabledFor(java.util.List<org.openconcerto.sql.model.SQLRowAccessor> selection) {
return (selection != null && selection.size() == 1);
};
};
 
list.add(cloneAction);
 
// int type =
// pane.getListe().getSelectedRow().getInt("ID_ETAT_DEVIS");
// factureAction.setEnabled(type ==
333,45 → 274,23
// list.add(actionTransfertCmd);
return list;
}
}.getRowActions());
};
mouseSheetXmlListeListener.setGenerateHeader(true);
mouseSheetXmlListeListener.setShowHeader(true);
pane.getListe().addIListeActions(mouseSheetXmlListeListener.getRowActions());
 
// activation des boutons
pane.getListe().addIListener(new IListener() {
public void selectionId(int id, int field) {
checkButton(id);
}
});
// pane.getListe().addIListener(new IListener() {
// public void selectionId(int id, int field) {
// checkButton(id);
// }
// });
pane.getListe().setOpaque(false);
 
pane.setOpaque(false);
return pane;
}
 
private void checkButton(int id) {
 
if (id > 1) {
 
final ListeAddPanel selectedPanel = this.map.get(this.tabbedPane.getSelectedIndex());
SQLRow row = selectedPanel.getListe().getSelectedRow();
 
DevisXmlSheet sheet = new DevisXmlSheet(row);
int etat = row.getInt("ID_ETAT_DEVIS");
this.buttonFacture.setEnabled(etat == EtatDevisSQLElement.ACCEPTE);
this.buttonCmd.setEnabled(etat == EtatDevisSQLElement.ACCEPTE);
 
this.buttonPrint.setEnabled(sheet.getGeneratedFile().exists());
this.buttonShow.setEnabled(sheet.getGeneratedFile().exists());
this.buttonGen.setEnabled(true);
this.buttonClone.setEnabled(true);
 
} else {
this.buttonClone.setEnabled(false);
this.buttonFacture.setEnabled(false);
this.buttonCmd.setEnabled(false);
this.buttonGen.setEnabled(false);
this.buttonPrint.setEnabled(false);
this.buttonShow.setEnabled(false);
}
}
 
/**
* Transfert en facture
*
/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/product/element/ReferenceArticleSQLElement.java
59,6 → 59,7
l.add("PV_HT");
l.add("ID_TAXE");
l.add("PV_TTC");
l.add("ID_FAMILLE_ARTICLE");
l.add("ID_FOURNISSEUR");
l.add("ID_STOCK");
String val = DefaultNXProps.getInstance().getStringProperty("ArticleService");
/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/product/element/FamilleArticleSQLElement.java
20,6 → 20,7
import org.openconcerto.sql.model.SQLRowValues;
import org.openconcerto.sql.sqlobject.ElementComboBox;
import org.openconcerto.ui.DefaultGridBagConstraints;
import org.openconcerto.ui.FormLayouter;
 
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
28,6 → 29,7
import java.util.List;
 
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
 
87,6 → 89,18
this.add(familleBox, c);
 
this.addSQLObject(familleBox, "ID_FAMILLE_ARTICLE_PERE");
 
// Champ Module
c.gridx = 0;
c.gridy++;
c.gridwidth = GridBagConstraints.REMAINDER;
final JPanel addP = new JPanel();
 
this.setAdditionalFieldsPanel(new FormLayouter(addP, 2));
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1;
this.add(addP, c);
 
}
 
@Override