OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Compare Revisions

Regard whitespace Rev 155 → Rev 156

/trunk/OpenConcerto/src/org/openconcerto/erp/core/sales/order/action/ListeDesCommandesClientItemsAction.java
13,12 → 13,13
package org.openconcerto.erp.core.sales.order.action;
 
import org.openconcerto.erp.action.CreateFrameAbstractAction;
import org.openconcerto.erp.action.CreateIListFrameAbstractAction;
import org.openconcerto.erp.config.ComptaPropsConfiguration;
import org.openconcerto.erp.core.common.ui.IListFilterDatePanel;
import org.openconcerto.erp.core.common.ui.IListTotalPanel;
import org.openconcerto.erp.core.common.ui.IListTotalPanel.Type;
import org.openconcerto.erp.core.common.ui.ListeViewPanel;
import org.openconcerto.sql.Configuration;
import org.openconcerto.erp.core.sales.order.element.CommandeClientElementSQLElement;
import org.openconcerto.sql.element.SQLElement;
import org.openconcerto.sql.model.FieldPath;
import org.openconcerto.sql.model.SQLRowAccessor;
25,38 → 26,48
import org.openconcerto.sql.model.Where;
import org.openconcerto.sql.model.graph.Path;
import org.openconcerto.sql.view.IListFrame;
import org.openconcerto.sql.view.IListPanel;
import org.openconcerto.sql.view.list.BaseSQLTableModelColumn;
import org.openconcerto.sql.view.list.IListe;
import org.openconcerto.sql.view.list.SQLTableModelColumn;
import org.openconcerto.sql.view.list.SQLTableModelSourceOnline;
import org.openconcerto.sql.view.list.SQLTableModelSource;
import org.openconcerto.ui.DefaultGridBagConstraints;
import org.openconcerto.utils.CollectionUtils;
import org.openconcerto.utils.Tuple2;
 
import java.awt.GridBagConstraints;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
 
import javax.swing.Action;
import javax.swing.JFrame;
public class ListeDesCommandesClientItemsAction extends CreateIListFrameAbstractAction<CommandeClientElementSQLElement> {
 
public class ListeDesCommandesClientItemsAction extends CreateFrameAbstractAction {
public ListeDesCommandesClientItemsAction(final ComptaPropsConfiguration conf) {
super(conf, CommandeClientElementSQLElement.class);
}
 
public ListeDesCommandesClientItemsAction() {
super();
this.putValue(Action.NAME, "Liste des articles commandés");
@Override
protected SQLTableModelSource createTableSource() {
final SQLTableModelSource res = super.createTableSource();
res.getReq().setWhere(new Where(getElem().getTable().getField("ID_COMMANDE_CLIENT"), ">", 1));
return res;
}
 
public JFrame createFrame() {
final SQLElement element = Configuration.getInstance().getDirectory().getElement("COMMANDE_CLIENT_ELEMENT");
@Override
protected IListPanel instantiateListPanel(final SQLTableModelSource tableSource, String panelVariant) {
return new ListeViewPanel(tableSource.getElem(), new IListe(tableSource));
}
 
final SQLTableModelSourceOnline tableSource = element.getTableSource(true);
IListe liste = new IListe(tableSource);
final ListeViewPanel listeAddPanel = new ListeViewPanel(element, liste);
listeAddPanel.getListe().getRequest().setWhere(new Where(element.getTable().getField("ID_COMMANDE_CLIENT"), ">", 1));
@Override
protected void initFrame(IListFrame frame) {
super.initFrame(frame);
final SQLElement element = getElem();
 
final IListPanel listeAddPanel = frame.getPanel();
final SQLTableModelSource tableSource = listeAddPanel.getListe().getSource();
 
final Set<FieldPath> paths = FieldPath.create(new Path(getElem().getTable()), Arrays.asList("QTE", "QTE_UNITAIRE", "QTE_LIVREE"));
BaseSQLTableModelColumn colStockR = new BaseSQLTableModelColumn("Qté restante à livrer", BigDecimal.class) {
 
@Override
72,8 → 83,7
 
@Override
public Set<FieldPath> getPaths() {
Path p = new Path(element.getTable());
return CollectionUtils.createSet(new FieldPath(p, "QTE"), new FieldPath(p, "QTE_UNITAIRE"), new FieldPath(p, "QTE_LIVREE"));
return paths;
}
};
tableSource.getColumns().add(colStockR);
92,8 → 102,8
c.anchor = GridBagConstraints.EAST;
c.fill = GridBagConstraints.NONE;
listeAddPanel.add(total, c);
IListFrame frame = new IListFrame(listeAddPanel);
frame.setTextTitle("Liste des articles commandés");
 
frame.setTextTitle(String.valueOf(getValue(NAME)));
frame.getPanel().getListe().setModificationAllowed(false);
frame.getPanel().setAddVisible(false);
frame.getPanel().setSearchFullMode(true);
103,7 → 113,5
c.gridy++;
c.anchor = GridBagConstraints.CENTER;
frame.getPanel().add(datePanel, c);
 
return frame;
}
}