source: publico/ILSAALMaterial/trunk/Consolidacao.py @ 781

Última Alteração nesse arquivo desde 781 foi 781, incluída por brunopinheiro, 14 anos atrás

Implementados mtodos _titulo() das classes e fechado ticket #57.

File size: 6.0 KB
Linha 
1# File: Consolidacao.py
2#
3# Copyright (c) 2005 by Interlegis
4# Generator: ArchGenXML Version 1.4.0-beta2 devel
5#            http://plone.org/products/archgenxml
6#
7# GNU General Public Licence (GPL)
8#
9# This program is free software; you can redistribute it and/or modify it under
10# the terms of the GNU General Public License as published by the Free Software
11# Foundation; either version 2 of the License, or (at your option) any later
12# version.
13# This program is distributed in the hope that it will be useful, but WITHOUT
14# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
16# details.
17# You should have received a copy of the GNU General Public License along with
18# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19# Place, Suite 330, Boston, MA  02111-1307  USA
20#
21__author__  = '''STC Interlegis <admin-stc@interlegis.gov.br>'''
22__docformat__ = 'plaintext'
23
24
25from AccessControl import ClassSecurityInfo
26from Products.Archetypes.atapi import *
27from Products.ILSAALMaterial.interfaces.IConsolidacao import IConsolidacao
28
29
30from Products.Archetypes.SQLStorage import *
31# additional imports from tagged value 'import'
32from Products.ILSAAL.saalapi import *
33
34from Products.ILSAALMaterial.config import *
35##code-section module-header #fill in your manual code here
36##/code-section module-header
37
38schema=Schema((
39    IntegerField('cod_conta',
40        widget=IntegerWidget(
41            label="Conta",
42            description="Codigo da conta que a consolidacao se refere.",
43            label_msgid='ILSAALMaterial_label_cod_conta',
44            description_msgid='ILSAALMaterial_help_cod_conta',
45            i18n_domain='ILSAALMaterial',
46        ),
47        required=1
48    ),
49
50    FloatField('vlr_saldo_ant',
51        widget=DecimalWidget(
52            label="Saldo Anterior",
53            description="Valor do saldo no inicio da consolidacao.",
54            label_msgid='ILSAALMaterial_label_vlr_saldo_ant',
55            description_msgid='ILSAALMaterial_help_vlr_saldo_ant',
56            i18n_domain='ILSAALMaterial',
57        ),
58        required=1
59    ),
60
61    FloatField('vlr_entrada_orc',
62        widget=DecimalWidget(
63            label="Entrada",
64            description="Valor total das entradas orcamentarias.",
65            label_msgid='ILSAALMaterial_label_vlr_entrada_orc',
66            description_msgid='ILSAALMaterial_help_vlr_entrada_orc',
67            i18n_domain='ILSAALMaterial',
68        ),
69        required=1
70    ),
71
72    FloatField('vlr_entrada_extra_orc',
73        widget=DecimalWidget(
74            label="Entrada Extra",
75            description="Valor total das entradas extra orcamentarias.",
76            label_msgid='ILSAALMaterial_label_vlr_entrada_extra_orc',
77            description_msgid='ILSAALMaterial_help_vlr_entrada_extra_orc',
78            i18n_domain='ILSAALMaterial',
79        ),
80        required=1
81    ),
82
83    FloatField('vlr_saida',
84        widget=DecimalWidget(
85            label="Saida",
86            description="Valor total das saidas.",
87            label_msgid='ILSAALMaterial_label_vlr_saida',
88            description_msgid='ILSAALMaterial_help_vlr_saida',
89            i18n_domain='ILSAALMaterial',
90        ),
91        required=1
92    ),
93
94    FloatField('vlr_saldo_atual',
95        widget=DecimalWidget(
96            label="Saldo Atual",
97            description="Valor do saldo atual.",
98            label_msgid='ILSAALMaterial_label_vlr_saldo_atual',
99            description_msgid='ILSAALMaterial_help_vlr_saldo_atual',
100            i18n_domain='ILSAALMaterial',
101        ),
102        required=1
103    ),
104
105    DateTimeField('dat_referencia',
106        widget=CalendarWidget(
107            label="Referencia",
108            description="Data de referencia da consolidacao.",
109            date_only=1,
110            format="%d/%m/%Y",
111            label_msgid='ILSAALMaterial_label_dat_referencia',
112            description_msgid='ILSAALMaterial_help_dat_referencia',
113            i18n_domain='ILSAALMaterial',
114        ),
115        required=1
116    ),
117
118
119    ReferenceField('cod_item_material',
120        widget=ReferenceWidget(
121            label='Cod_item_material',
122            label_msgid='ILSAALMaterial_label_cod_item_material',
123            description_msgid='ILSAALMaterial_help_cod_item_material',
124            i18n_domain='ILSAALMaterial',
125        ),
126        allowed_types=('Material',),
127        multiValued=0,
128        relationship='Cosolidacao_Material'
129    ),
130
131),
132)
133
134
135##code-section after-local-schema #fill in your manual code here
136##/code-section after-local-schema
137
138Consolidacao_schema = BaseSchema + \
139    schema
140
141##code-section after-schema #fill in your manual code here
142##/code-section after-schema
143
144class Consolidacao(BaseContent):
145    """
146    Define a consolidacao de materiais.
147    """
148    security = ClassSecurityInfo()
149    __implements__ = (getattr(BaseContent,'__implements__',()),) + (IConsolidacao,)
150
151
152    # This name appears in the 'add' box
153    archetype_name             = 'Consolidacao'
154
155    meta_type                  = 'Consolidacao'
156    portal_type                = 'Consolidacao'
157    allowed_content_types      = []
158    filter_content_types       = 0
159    global_allow               = 0
160    allow_discussion           = 0
161    #content_icon               = 'Consolidacao.gif'
162    immediate_view             = 'base_view'
163    default_view               = 'base_view'
164    suppl_views                = ()
165    typeDescription            = "Consolidacao"
166    typeDescMsgId              = 'description_edit_consolidacao'
167
168    schema = Consolidacao_schema
169
170    ##code-section class-header #fill in your manual code here
171    ##/code-section class-header
172
173
174    #Methods
175    #methods from Interface IConsolidacao
176
177    security.declarePrivate('_titulo')
178    def _titulo(self):
179        """
180        Configuracao do titulo que esse objeto deseja disponibilizar.
181        """
182       
183        return self.getDat_referencia()
184
185
186
187registerType(Consolidacao,PROJECTNAME)
188# end of class Consolidacao
189
190##code-section module-footer #fill in your manual code here
191##/code-section module-footer
192
193
194
Note: Veja TracBrowser para ajuda no uso do navegador do trac.
 

The contents and data of this website are published under license:
Creative Commons 4.0 Brasil - Atribuir Fonte - Compartilhar Igual.