OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 156 | Rev 177 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 156 Rev 174
Line 17... Line 17...
17
import org.openconcerto.erp.core.edm.AttachmentAction;
17
import org.openconcerto.erp.core.edm.AttachmentAction;
18
import org.openconcerto.erp.core.supplychain.order.component.FactureFournisseurSQLComponent;
18
import org.openconcerto.erp.core.supplychain.order.component.FactureFournisseurSQLComponent;
19
import org.openconcerto.erp.generationDoc.gestcomm.FactureFournisseurXmlSheet;
19
import org.openconcerto.erp.generationDoc.gestcomm.FactureFournisseurXmlSheet;
20
import org.openconcerto.erp.model.MouseSheetXmlListeListener;
20
import org.openconcerto.erp.model.MouseSheetXmlListeListener;
21
import org.openconcerto.sql.element.SQLComponent;
21
import org.openconcerto.sql.element.SQLComponent;
-
 
22
import org.openconcerto.sql.model.SQLRowAccessor;
-
 
23
import org.openconcerto.sql.view.EditFrame;
-
 
24
import org.openconcerto.sql.view.EditPanel;
-
 
25
import org.openconcerto.sql.view.list.IListe;
22
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
26
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
-
 
27
import org.openconcerto.sql.view.list.RowAction;
23
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
28
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
24
import org.openconcerto.utils.ListMap;
29
import org.openconcerto.utils.ListMap;
25
 
30
 
-
 
31
import java.awt.event.ActionEvent;
26
import java.util.ArrayList;
32
import java.util.ArrayList;
27
import java.util.HashSet;
33
import java.util.HashSet;
28
import java.util.List;
34
import java.util.List;
29
import java.util.Set;
35
import java.util.Set;
30
 
36
 
-
 
37
import javax.swing.AbstractAction;
-
 
38
 
31
public class FactureFournisseurSQLElement extends ComptaSQLConfElement {
39
public class FactureFournisseurSQLElement extends ComptaSQLConfElement {
32
 
40
 
33
    public FactureFournisseurSQLElement() {
41
    public FactureFournisseurSQLElement() {
34
        super("FACTURE_FOURNISSEUR", "une facture fournisseur", "factures fournisseur");
42
        super("FACTURE_FOURNISSEUR", "une facture fournisseur", "factures fournisseur");
35
        MouseSheetXmlListeListener mouseSheetXmlListeListener = new MouseSheetXmlListeListener(FactureFournisseurXmlSheet.class);
43
        MouseSheetXmlListeListener mouseSheetXmlListeListener = new MouseSheetXmlListeListener(FactureFournisseurXmlSheet.class);
Line 39... Line 47...
39
        if (getTable().contains("ATTACHMENTS")) {
47
        if (getTable().contains("ATTACHMENTS")) {
40
            PredicateRowAction actionAttachment = new PredicateRowAction(new AttachmentAction().getAction(), true);
48
            PredicateRowAction actionAttachment = new PredicateRowAction(new AttachmentAction().getAction(), true);
41
            actionAttachment.setPredicate(IListeEvent.getSingleSelectionPredicate());
49
            actionAttachment.setPredicate(IListeEvent.getSingleSelectionPredicate());
42
            getRowActions().add(actionAttachment);
50
            getRowActions().add(actionAttachment);
43
        }
51
        }
-
 
52
        RowAction actionClone = new RowAction(new AbstractAction() {
-
 
53
            public void actionPerformed(ActionEvent e) {
-
 
54
 
-
 
55
                EditFrame editFrame = new EditFrame(FactureFournisseurSQLElement.this, EditPanel.CREATION);
-
 
56
 
-
 
57
                ((FactureFournisseurSQLComponent) editFrame.getSQLComponent()).loadFactureExistante(IListe.get(e).getSelectedId());
-
 
58
                editFrame.setVisible(true);
-
 
59
            }
-
 
60
        }, true, "supplychain.invoice.clone") {
-
 
61
            public boolean enabledFor(IListeEvent evt) {
-
 
62
                List<? extends SQLRowAccessor> l = evt.getSelectedRows();
-
 
63
                return (l != null && l.size() == 1);
-
 
64
            }
-
 
65
        };
-
 
66
        getRowActions().add(actionClone);
44
    }
67
    }
45
 
68
 
46
    @Override
69
    @Override
47
    public Set<String> getReadOnlyFields() {
70
    public Set<String> getReadOnlyFields() {
48
        Set<String> s = new HashSet<>();
71
        Set<String> s = new HashSet<>();