OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 90 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 90 Rev 156
Line 15... Line 15...
15
 * Créé le 27 oct. 2014
15
 * Créé le 27 oct. 2014
16
 */
16
 */
17
package org.openconcerto.erp.core.common.ui;
17
package org.openconcerto.erp.core.common.ui;
18
 
18
 
19
import org.openconcerto.erp.preferences.DefaultNXProps;
19
import org.openconcerto.erp.preferences.DefaultNXProps;
-
 
20
import org.openconcerto.erp.utils.TM;
20
import org.openconcerto.sql.model.SQLRowAccessor;
21
import org.openconcerto.sql.model.SQLRowAccessor;
21
import org.openconcerto.ui.DefaultGridBagConstraints;
22
import org.openconcerto.ui.DefaultGridBagConstraints;
22
import org.openconcerto.ui.JLabelBold;
23
import org.openconcerto.ui.JLabelBold;
23
 
24
 
24
import java.awt.GridBagConstraints;
25
import java.awt.GridBagConstraints;
Line 61... Line 62...
61
 
62
 
62
        c.gridheight = 1;
63
        c.gridheight = 1;
63
        c.fill = GridBagConstraints.HORIZONTAL;
64
        c.fill = GridBagConstraints.HORIZONTAL;
64
        c.weighty = 0;
65
        c.weighty = 0;
65
        c.gridx++;
66
        c.gridx++;
66
        this.add(new JLabelBold("Global"), c);
67
        this.add(new JLabelBold(TM.tr("TotalPanel.global")), c); //$NON-NLS-1$
67
        c.gridy++;
68
        c.gridy++;
68
        c.gridx = 4;
69
        c.gridx = 4;
69
        c.gridwidth = 2;
70
        c.gridwidth = 2;
70
        c.weightx = 1;
71
        c.weightx = 1;
71
        this.add(createSeparator(), c);
72
        this.add(createSeparator(), c);
Line 73... Line 74...
73
        c.gridwidth = 1;
74
        c.gridwidth = 1;
74
        c.weightx = 0;
75
        c.weightx = 0;
75
 
76
 
76
        // Total HA HT
77
        // Total HA HT
77
        c.gridy++;
78
        c.gridy++;
78
        this.add(new JLabel("Total achat HT"), c);
79
        this.add(new JLabel(TM.tr("TotalPanel.purchaseTotal.taxExcluded")), c); //$NON-NLS-1$
79
 
80
 
80
        c.gridx++;
81
        c.gridx++;
81
        c.weightx = 1;
82
        c.weightx = 1;
82
        this.add(this.textTotalHA, c);
83
        this.add(this.textTotalHA, c);
83
 
84
 
84
        // Marge
85
        // Marge
85
        c.gridy++;
86
        c.gridy++;
86
        c.gridx = 4;
87
        c.gridx = 4;
87
        c.weightx = 0;
88
        c.weightx = 0;
88
        this.add(new JLabel("Marge"), c);
89
        this.add(new JLabel(TM.tr("TotalPanel.margin")), c); //$NON-NLS-1$
89
 
90
 
90
        c.gridx++;
91
        c.gridx++;
91
        c.weightx = 1;
92
        c.weightx = 1;
92
        this.add(this.marge, c);
93
        this.add(this.marge, c);
93
 
94
 
Line 102... Line 103...
102
 
103
 
103
        // Total HT
104
        // Total HT
104
        c.gridy++;
105
        c.gridy++;
105
        c.gridx = 4;
106
        c.gridx = 4;
106
        c.weightx = 0;
107
        c.weightx = 0;
107
        this.add(new JLabelBold("Total HT"), c);
108
        this.add(new JLabelBold(TM.tr("TotalPanel.total.taxExcluded")), c); //$NON-NLS-1$
108
 
109
 
109
        c.gridx++;
110
        c.gridx++;
110
        c.weightx = 1;
111
        c.weightx = 1;
111
        this.add(textTotalHT, c);
112
        this.add(textTotalHT, c);
112
 
113
 
113
        if (DefaultNXProps.getInstance().getBooleanValue(AbstractVenteArticleItemTable.ARTICLE_SERVICE, false)) {
114
        if (DefaultNXProps.getInstance().getBooleanValue(AbstractVenteArticleItemTable.ARTICLE_SERVICE, false)) {
114
            // Service
115
            // Service
115
            c.gridx = 4;
116
            c.gridx = 4;
116
            c.gridy++;
117
            c.gridy++;
117
            c.weightx = 0;
118
            c.weightx = 0;
118
            this.add(new JLabelBold("Service HT inclus "), c);
119
            this.add(new JLabelBold(TM.tr("TotalPanel.service.taxExcluded")), c); //$NON-NLS-1$
119
            c.gridx++;
120
            c.gridx++;
120
            c.weightx = 1;
121
            c.weightx = 1;
121
            this.add(this.textService, c);
122
            this.add(this.textService, c);
122
        }
123
        }
123
        // TVA
124
        // TVA
124
        c.gridx = 4;
125
        c.gridx = 4;
125
        c.gridy++;
126
        c.gridy++;
126
        c.weightx = 0;
127
        c.weightx = 0;
127
        this.add(new JLabelBold("Total TVA"), c);
128
        this.add(new JLabelBold(TM.tr("TotalPanel.total.VAT")), c); //$NON-NLS-1$
128
        c.gridx++;
129
        c.gridx++;
129
        c.weightx = 1;
130
        c.weightx = 1;
130
        this.add(textTotalTVA, c);
131
        this.add(textTotalTVA, c);
131
 
132
 
132
        // Sep
133
        // Sep
Line 141... Line 142...
141
        c.gridwidth = 1;
142
        c.gridwidth = 1;
142
        c.gridx = 4;
143
        c.gridx = 4;
143
        c.gridy++;
144
        c.gridy++;
144
        c.weightx = 0;
145
        c.weightx = 0;
145
        c.fill = GridBagConstraints.HORIZONTAL;
146
        c.fill = GridBagConstraints.HORIZONTAL;
146
        this.add(new JLabelBold("Total TTC"), c);
147
        this.add(new JLabelBold(TM.tr("TotalPanel.total.taxIncluded")), c); //$NON-NLS-1$
147
        c.gridx++;
148
        c.gridx++;
148
        c.weightx = 1;
149
        c.weightx = 1;
149
        textTotalTTC.setFont(textTotalHT.getFont());
150
        textTotalTTC.setFont(textTotalHT.getFont());
150
        this.add(textTotalTTC, c);
151
        this.add(textTotalTTC, c);
151
 
152
 
Line 156... Line 157...
156
        DefaultGridBagConstraints.lockMinimumSize(sep);
157
        DefaultGridBagConstraints.lockMinimumSize(sep);
157
        return sep;
158
        return sep;
158
    }
159
    }
159
 
160
 
160
    public void loadFromCmd(SQLRowAccessor rowCmd) {
161
    public void loadFromCmd(SQLRowAccessor rowCmd) {
161
        this.textTotalHT.setValue(rowCmd.getLong("T_HT"));
162
        this.textTotalHT.setValue(rowCmd.getLong("T_HT")); //$NON-NLS-1$
162
        this.textTotalTVA.setValue(rowCmd.getLong("T_TVA"));
163
        this.textTotalTVA.setValue(rowCmd.getLong("T_TVA")); //$NON-NLS-1$
163
        this.textTotalTTC.setValue(rowCmd.getLong("T_TTC"));
164
        this.textTotalTTC.setValue(rowCmd.getLong("T_TTC")); //$NON-NLS-1$
164
        this.textTotalHA.setValue(rowCmd.getLong("T_HA"));
165
        this.textTotalHA.setValue(rowCmd.getLong("T_HA")); //$NON-NLS-1$
165
        this.marge.setValue(rowCmd.getLong("T_HT") - rowCmd.getLong("T_HA"));
166
        this.marge.setValue(rowCmd.getLong("T_HT") - rowCmd.getLong("T_HA")); //$NON-NLS-1$ //$NON-NLS-2$
166
 
167
 
167
    }
168
    }
168
}
169
}