OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 21 → Rev 25

/trunk/OpenConcerto/src/org/openconcerto/erp/core/supplychain/order/action/ListeDesCommandesClientAction.java
22,6 → 22,10
import org.openconcerto.sql.model.SQLRow;
import org.openconcerto.sql.view.IListFrame;
import org.openconcerto.sql.view.ListeAddPanel;
import org.openconcerto.sql.view.list.IListe;
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
import org.openconcerto.sql.view.list.RowAction;
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
import org.openconcerto.ui.DefaultGridBagConstraints;
 
import java.awt.GridBagConstraints;
63,43 → 67,49
frame.getPanel().add(legendePanel, c);
JTable table = frame.getPanel().getListe().getJTable();
for (int i = 0; i < table.getColumnCount(); i++) {
// if (table.getColumnClass(i) == Long.class || table.getColumnClass(i) ==
// if (table.getColumnClass(i) == Long.class ||
// table.getColumnClass(i) ==
// BigInteger.class) {
table.getColumnModel().getColumn(i).setCellRenderer(rend);
// }
}
 
frame.getPanel().getListe().getJTable().addMouseListener(new MouseSheetXmlListeListener(frame.getPanel().getListe(), CommandeClientXmlSheet.class) {
frame.getPanel().getListe().addIListeActions(new MouseSheetXmlListeListener(CommandeClientXmlSheet.class) {
@Override
public List<AbstractAction> addToMenu() {
public List<RowAction> addToMenu() {
// Transfert vers facture
AbstractAction bonAction = (new AbstractAction("Transfert vers BL") {
PredicateRowAction bonAction = new PredicateRowAction(new AbstractAction("Transfert vers BL") {
public void actionPerformed(ActionEvent e) {
transfertBonLivraisonClient(frame.getPanel().getListe().getSelectedRow());
transfertBonLivraisonClient(IListe.get(e).getSelectedRow());
}
});
}, false);
 
// Transfert vers facture
AbstractAction factureAction = (new AbstractAction("Transfert vers facture") {
PredicateRowAction factureAction = new PredicateRowAction(new AbstractAction("Transfert vers facture") {
public void actionPerformed(ActionEvent e) {
transfertFactureClient(frame.getPanel().getListe().getSelectedRow());
transfertFactureClient(IListe.get(e).getSelectedRow());
}
});
}, false);
 
// Transfert vers commande
AbstractAction cmdAction = (new AbstractAction("Transfert vers commande fournisseur") {
PredicateRowAction cmdAction = new PredicateRowAction(new AbstractAction("Transfert vers commande fournisseur") {
public void actionPerformed(ActionEvent e) {
CommandeClientSQLElement elt = (CommandeClientSQLElement) Configuration.getInstance().getDirectory().getElement("COMMANDE_CLIENT");
elt.transfertCommande(frame.getPanel().getListe().getSelectedRow().getID());
elt.transfertCommande(IListe.get(e).getSelectedId());
}
});
List<AbstractAction> l = new ArrayList<AbstractAction>();
 
}, false);
 
cmdAction.setPredicate(IListeEvent.getSingleSelectionPredicate());
factureAction.setPredicate(IListeEvent.getSingleSelectionPredicate());
bonAction.setPredicate(IListeEvent.getSingleSelectionPredicate());
List<RowAction> l = new ArrayList<RowAction>();
l.add(bonAction);
l.add(factureAction);
l.add(cmdAction);
return l;
}
});
}.getRowActions());
 
return frame;
}
/trunk/OpenConcerto/src/org/openconcerto/erp/core/supplychain/order/action/ListeDesCommandesAction.java
21,6 → 21,10
import org.openconcerto.sql.model.SQLRow;
import org.openconcerto.sql.view.IListFrame;
import org.openconcerto.sql.view.ListeAddPanel;
import org.openconcerto.sql.view.list.IListe;
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
import org.openconcerto.sql.view.list.RowAction;
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
 
import java.awt.event.ActionEvent;
import java.util.ArrayList;
39,29 → 43,33
public JFrame createFrame() {
final IListFrame frame = new IListFrame(new ListeAddPanel(Configuration.getInstance().getDirectory().getElement("COMMANDE")));
 
frame.getPanel().getListe().getJTable().addMouseListener(new MouseSheetXmlListeListener(frame.getPanel().getListe(), CommandeXmlSheet.class) {
frame.getPanel().getListe().addIListeActions(new MouseSheetXmlListeListener(CommandeXmlSheet.class) {
@Override
public List<AbstractAction> addToMenu() {
public List<RowAction> addToMenu() {
// Transfert vers BR
AbstractAction bonAction = (new AbstractAction("Transfert vers BR") {
PredicateRowAction bonAction = new PredicateRowAction(new AbstractAction("Transfert vers BR") {
public void actionPerformed(ActionEvent e) {
transfertBonReceptionClient(frame.getPanel().getListe().getSelectedRow());
transfertBonReceptionClient(IListe.get(e).getSelectedRow());
}
});
}, false);
 
bonAction.setPredicate(IListeEvent.getSingleSelectionPredicate());
 
// Transfert vers facture
AbstractAction factureAction = (new AbstractAction("Transfert vers facture") {
PredicateRowAction factureAction = new PredicateRowAction(new AbstractAction("Transfert vers facture") {
public void actionPerformed(ActionEvent e) {
transfertFactureFournisseur(frame.getPanel().getListe().getSelectedRow());
transfertFactureFournisseur(IListe.get(e).getSelectedRow());
}
});
}, false);
 
List<AbstractAction> l = new ArrayList<AbstractAction>();
factureAction.setPredicate(IListeEvent.getSingleSelectionPredicate());
 
List<RowAction> l = new ArrayList<RowAction>();
l.add(bonAction);
l.add(factureAction);
return l;
}
});
}.getRowActions());
 
return frame;
}
/trunk/OpenConcerto/src/org/openconcerto/erp/core/supplychain/order/component/SaisieAchatSQLComponent.java
34,6 → 34,7
import org.openconcerto.sql.sqlobject.ElementComboBox;
import org.openconcerto.sql.sqlobject.SQLTextCombo;
import org.openconcerto.ui.DefaultGridBagConstraints;
import org.openconcerto.ui.FormLayouter;
import org.openconcerto.ui.JDate;
import org.openconcerto.ui.TitledSeparator;
import org.openconcerto.ui.component.ITextArea;
120,6 → 121,17
this.textIdSource = new JTextField();
this.textSource = new JTextField();
 
// 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;
 
/*******************************************************************************************
* * RENSEIGNEMENTS
******************************************************************************************/
/trunk/OpenConcerto/src/org/openconcerto/erp/core/supplychain/order/component/CommandeSQLComponent.java
35,6 → 35,7
import org.openconcerto.sql.users.UserManager;
import org.openconcerto.sql.view.EditFrame;
import org.openconcerto.ui.DefaultGridBagConstraints;
import org.openconcerto.ui.FormLayouter;
import org.openconcerto.ui.JDate;
import org.openconcerto.ui.TitledSeparator;
import org.openconcerto.ui.component.ITextArea;
79,6 → 80,17
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;
 
// Numero du commande
c.gridx = 0;
c.weightx = 0;
311,7 → 323,6
 
panel.add(totalTTC, c);
 
 
table.getModel().addTableModelListener(new TableModelListener() {
 
public void tableChanged(TableModelEvent e) {
362,15 → 373,16
this.table.createArticle(idCommande, this.getElement());
 
// generation du document
CommandeXmlSheet sheet = new CommandeXmlSheet(getTable().getRow(idCommande));
sheet.genere(this.checkVisu.isSelected(), this.checkImpression.isSelected());
final CommandeXmlSheet sheet = new CommandeXmlSheet(getTable().getRow(idCommande));
sheet.createDocumentAsynchronous();
sheet.showPrintAndExportAsynchronous(this.checkVisu.isSelected(), this.checkImpression.isSelected(), true);
 
// incrémentation du numéro auto
if (NumerotationAutoSQLElement.getNextNumero(CommandeSQLElement.class).equalsIgnoreCase(this.numeroUniqueCommande.getText().trim())) {
SQLRowValues rowVals = new SQLRowValues(this.tableNum);
int val = this.tableNum.getRow(2).getInt("COMMANDE_CLIENT_START");
int val = this.tableNum.getRow(2).getInt("COMMANDE_START");
val++;
rowVals.put("COMMANDE_CLIENT_START", new Integer(val));
rowVals.put("COMMANDE_START", new Integer(val));
 
try {
rowVals.update(2);
419,8 → 431,10
this.table.createArticle(getSelectedID(), this.getElement());
 
// generation du document
CommandeXmlSheet dSheet = new CommandeXmlSheet(getTable().getRow(getSelectedID()));
dSheet.genere(this.checkVisu.isSelected(), this.checkImpression.isSelected());
final CommandeXmlSheet sheet = new CommandeXmlSheet(getTable().getRow(getSelectedID()));
sheet.createDocumentAsynchronous();
sheet.showPrintAndExportAsynchronous(this.checkVisu.isSelected(), this.checkImpression.isSelected(), true);
 
}
 
public void setDefaults() {
454,6 → 468,7
rowVals.put("T_SERVICE", Long.valueOf(0));
rowVals.put("T_TVA", Long.valueOf(0));
rowVals.put("T_TTC", Long.valueOf(0));
rowVals.put("NUMERO", NumerotationAutoSQLElement.getNextNumero(CommandeSQLElement.class));
 
return rowVals;
}