OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 19 → Rev 21

/trunk/OpenConcerto/src/org/openconcerto/erp/core/supplychain/order/component/SaisieAchatSQLComponent.java
38,6 → 38,7
import org.openconcerto.ui.TitledSeparator;
import org.openconcerto.ui.component.ITextArea;
import org.openconcerto.utils.GestionDevise;
import org.openconcerto.utils.checks.ValidState;
import org.openconcerto.utils.text.SimpleDocumentListener;
 
import java.awt.GridBagConstraints;
404,8 → 405,9
}
 
@Override
public synchronized boolean isValidated() {
boolean b = true;
public ValidState getValidState() {
ValidState result = super.getValidState();
if (result.isValid()) {
if (this.montant.getMontantTTC() != null && this.montant.getMontantTTC().getUncheckedValue() != null) {
 
long l = ((Long) this.montant.getMontantTTC().getUncheckedValue());
415,10 → 417,13
SQLRow rowAvoir = eltAvoir.getTable().getRow(this.comboAvoir.getSelectedId());
l -= ((Number) rowAvoir.getObject("MONTANT_TTC")).longValue();
}
b = l >= 0;
if (l < 0) {
result = new ValidState(false, "Le montant est négatif");
}
return super.isValidated() && b;
}
}
return result;
}
 
/***********************************************************************************************
* * GENERATION DU MOUVEMENT ET DES ECRITURES ASSOCIEES A L'INSERTION
/trunk/OpenConcerto/src/org/openconcerto/erp/core/supplychain/supplier/element/FournisseurSQLElement.java
15,6 → 15,7
 
import org.openconcerto.erp.config.ComptaPropsConfiguration;
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
import org.openconcerto.erp.core.customerrelationship.customer.element.ContactItemTable;
import org.openconcerto.erp.core.finance.accounting.element.ComptePCESQLElement;
import org.openconcerto.erp.model.ISQLCompteSelector;
import org.openconcerto.erp.preferences.ModeReglementDefautPrefPanel;
28,6 → 29,7
import org.openconcerto.sql.model.SQLRowAccessor;
import org.openconcerto.sql.model.SQLRowValues;
import org.openconcerto.sql.model.SQLTable;
import org.openconcerto.sql.model.UndefinedRowValuesCache;
import org.openconcerto.sql.request.ListSQLRequest;
import org.openconcerto.sql.sqlobject.ElementComboBox;
import org.openconcerto.sql.sqlobject.SQLTextCombo;
35,6 → 37,7
import org.openconcerto.ui.TitledSeparator;
import org.openconcerto.ui.component.ITextArea;
 
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionListener;
105,6 → 108,9
JCheckBox checkEnlevement;
ElementSQLObject comp2;
TitledSeparator sep2;
private ContactItemTable table;
private SQLTable contactTable = Configuration.getInstance().getDirectory().getElement("CONTACT_FOURNISSEUR").getTable();
private SQLRowValues defaultContactRowVals = new SQLRowValues(UndefinedRowValuesCache.getInstance().getDefaultRowValues(this.contactTable));
 
public void addViews() {
this.setLayout(new GridBagLayout());
281,6 → 287,24
};
});
 
// Contact
final TitledSeparator sepContact = new TitledSeparator("Contacts fournisseurs");
c.weightx = 1;
c.gridwidth = GridBagConstraints.REMAINDER;
c.gridx = 0;
c.gridy++;
this.add(sepContact, c);
this.table = new ContactItemTable(this.defaultContactRowVals);
this.table.setPreferredSize(new Dimension(this.table.getSize().width, 150));
 
c.gridx = 0;
c.gridy++;
c.anchor = GridBagConstraints.WEST;
c.fill = GridBagConstraints.BOTH;
c.gridwidth = GridBagConstraints.REMAINDER;
c.weighty = 0.8;
this.add(this.table, c);
 
// Mode de régelement
TitledSeparator reglSep = new TitledSeparator(getLabelFor("ID_MODE_REGLEMENT"));
c.gridwidth = GridBagConstraints.REMAINDER;
386,10 → 410,31
this.sep2.setVisible(true);
}
 
if (r != null) {
this.table.insertFrom("ID_FOURNISSEUR", r.getID());
this.defaultContactRowVals.put("TEL_DIRECT", r.getString("TEL"));
this.defaultContactRowVals.put("FAX", r.getString("FAX"));
}
 
super.select(r);
}
 
@Override
public void update() {
// TODO Raccord de méthode auto-généré
super.update();
this.table.updateField("ID_FOURNISSEUR", getSelectedID());
}
 
@Override
public int insert(SQLRow order) {
// TODO Raccord de méthode auto-généré
int id = super.insert(order);
this.table.updateField("ID_FOURNISSEUR", id);
return id;
}
 
@Override
protected SQLRowValues createDefaults() {
SQLRowValues vals = new SQLRowValues(this.getTable());
SQLRowAccessor r;
/trunk/OpenConcerto/src/org/openconcerto/erp/core/supplychain/supplier/action/ListeDesContactsFournisseursAction.java
New file
0,0 → 1,38
/*
* 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.
*/
/*
* Créé le 11 oct. 2011
*/
package org.openconcerto.erp.core.supplychain.supplier.action;
 
import org.openconcerto.erp.action.CreateFrameAbstractAction;
import org.openconcerto.sql.Configuration;
import org.openconcerto.sql.view.IListFrame;
import org.openconcerto.sql.view.ListeAddPanel;
 
import javax.swing.Action;
import javax.swing.JFrame;
 
public class ListeDesContactsFournisseursAction extends CreateFrameAbstractAction {
 
public ListeDesContactsFournisseursAction() {
super();
this.putValue(Action.NAME, "Liste des contacts fournisseurs");
}
 
public JFrame createFrame() {
IListFrame frame = new IListFrame(new ListeAddPanel(Configuration.getInstance().getDirectory().getElement("CONTACT_FOURNISSEUR")));
return frame;
}
}