OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 142 | Rev 156 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
80 ilm 1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
10
 *
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
13
 
14
 package org.openconcerto.erp.core.supplychain.order.element;
15
 
94 ilm 16
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
151 ilm 17
import org.openconcerto.erp.core.edm.AttachmentAction;
94 ilm 18
import org.openconcerto.erp.core.supplychain.order.component.FactureFournisseurSQLComponent;
19
import org.openconcerto.erp.generationDoc.gestcomm.FactureFournisseurXmlSheet;
20
import org.openconcerto.erp.model.MouseSheetXmlListeListener;
21
import org.openconcerto.sql.element.SQLComponent;
151 ilm 22
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
23
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
142 ilm 24
import org.openconcerto.utils.ListMap;
94 ilm 25
 
151 ilm 26
import java.util.ArrayList;
27
import java.util.List;
28
 
80 ilm 29
public class FactureFournisseurSQLElement extends ComptaSQLConfElement {
30
 
31
    public FactureFournisseurSQLElement() {
32
        super("FACTURE_FOURNISSEUR", "une facture fournisseur", "factures fournisseur");
94 ilm 33
        MouseSheetXmlListeListener mouseSheetXmlListeListener = new MouseSheetXmlListeListener(FactureFournisseurXmlSheet.class);
34
        mouseSheetXmlListeListener.setGenerateHeader(true);
35
        mouseSheetXmlListeListener.setShowHeader(true);
36
        getRowActions().addAll(mouseSheetXmlListeListener.getRowActions());
151 ilm 37
        if (getTable().contains("ATTACHMENTS")) {
38
            PredicateRowAction actionAttachment = new PredicateRowAction(new AttachmentAction().getAction(), true);
39
            actionAttachment.setPredicate(IListeEvent.getSingleSelectionPredicate());
40
            getRowActions().add(actionAttachment);
41
        }
80 ilm 42
    }
43
 
44
    protected List<String> getListFields() {
45
        final List<String> l = new ArrayList<String>();
46
        l.add("NUMERO");
47
        l.add("NOM");
48
        l.add("DATE");
49
        l.add("ID_FOURNISSEUR");
50
        l.add("T_HT");
51
        l.add("T_TTC");
52
        l.add("INFOS");
53
        return l;
54
    }
55
 
142 ilm 56
    @Override
57
    public ListMap<String, String> getShowAs() {
58
        ListMap<String, String> map = new ListMap<String, String>();
59
        map.putCollection(null, "NUMERO", "DATE");
60
        return map;
61
    }
62
 
80 ilm 63
    protected List<String> getComboFields() {
64
        final List<String> l = new ArrayList<String>();
65
        l.add("NUMERO");
66
        l.add("NOM");
67
        l.add("DATE");
68
        return l;
69
    }
70
 
71
    /*
72
     * (non-Javadoc)
73
     *
74
     * @see org.openconcerto.devis.SQLElement#getComponent()
75
     */
76
    public SQLComponent createComponent() {
77
        return new FactureFournisseurSQLComponent();
78
    }
79
 
80
    @Override
81
    protected String createCode() {
82
        return createCodeFromPackage() + ".invoice.purchase";
83
    }
84
}