1 | # File: Entrada.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 | |
---|
25 | from AccessControl import ClassSecurityInfo |
---|
26 | from Products.Archetypes.atapi import * |
---|
27 | from Products.ILSAALMaterial.interfaces.IEntrada import IEntrada |
---|
28 | |
---|
29 | |
---|
30 | from Products.Archetypes.SQLStorage import * |
---|
31 | # additional imports from tagged value 'import' |
---|
32 | from DateTime import DateTime |
---|
33 | from Products.ILSAAL.saalapi import * |
---|
34 | |
---|
35 | from Products.ILSAALMaterial.config import * |
---|
36 | ##code-section module-header #fill in your manual code here |
---|
37 | ##/code-section module-header |
---|
38 | |
---|
39 | schema=Schema(( |
---|
40 | StringField('cod_entrada', |
---|
41 | widget=StringWidget( |
---|
42 | label="Codigo", |
---|
43 | description="Informe o codigo da entrada.", |
---|
44 | label_msgid='ILSAALMaterial_label_cod_entrada', |
---|
45 | description_msgid='ILSAALMaterial_help_cod_entrada', |
---|
46 | i18n_domain='ILSAALMaterial', |
---|
47 | ), |
---|
48 | required=1 |
---|
49 | ), |
---|
50 | |
---|
51 | DateTimeField('dat_entrada', |
---|
52 | widget=CalendarWidget( |
---|
53 | label="Data de entrada", |
---|
54 | description="Data de entrada dos materiais.", |
---|
55 | format="%d/%m/%Y", |
---|
56 | date_only=1, |
---|
57 | label_msgid='ILSAALMaterial_label_dat_entrada', |
---|
58 | description_msgid='ILSAALMaterial_help_dat_entrada', |
---|
59 | i18n_domain='ILSAALMaterial', |
---|
60 | ), |
---|
61 | required=1 |
---|
62 | ), |
---|
63 | |
---|
64 | FloatField('vlr_total_entrada', |
---|
65 | widget=DecimalWidget( |
---|
66 | label="Total", |
---|
67 | description="Informe o valor total da entrada.", |
---|
68 | label_msgid='ILSAALMaterial_label_vlr_total_entrada', |
---|
69 | description_msgid='ILSAALMaterial_help_vlr_total_entrada', |
---|
70 | i18n_domain='ILSAALMaterial', |
---|
71 | ), |
---|
72 | required=1 |
---|
73 | ), |
---|
74 | |
---|
75 | BooleanField('cod_status_entrada', |
---|
76 | widget=BooleanWidget( |
---|
77 | label="Status", |
---|
78 | description="Codigo do status na qual se encontra a entrada.", |
---|
79 | label_msgid='ILSAALMaterial_label_cod_status_entrada', |
---|
80 | description_msgid='ILSAALMaterial_help_cod_status_entrada', |
---|
81 | i18n_domain='ILSAALMaterial', |
---|
82 | ), |
---|
83 | required=1 |
---|
84 | ), |
---|
85 | |
---|
86 | StringField('num_nota_fiscal', |
---|
87 | widget=StringWidget( |
---|
88 | label="Nota fiscal", |
---|
89 | description="Numero da nota fiscal correspondente a entrada.", |
---|
90 | label_msgid='ILSAALMaterial_label_num_nota_fiscal', |
---|
91 | description_msgid='ILSAALMaterial_help_num_nota_fiscal', |
---|
92 | i18n_domain='ILSAALMaterial', |
---|
93 | ), |
---|
94 | required=1 |
---|
95 | ), |
---|
96 | |
---|
97 | StringField('num_processo', |
---|
98 | widget=StringWidget( |
---|
99 | label="Processo", |
---|
100 | description="Numero do processo correspondente a entrada.", |
---|
101 | label_msgid='ILSAALMaterial_label_num_processo', |
---|
102 | description_msgid='ILSAALMaterial_help_num_processo', |
---|
103 | i18n_domain='ILSAALMaterial', |
---|
104 | ), |
---|
105 | required=1 |
---|
106 | ), |
---|
107 | |
---|
108 | IntegerField('cod_forma_ingresso', |
---|
109 | widget=IntegerWidget( |
---|
110 | label="Forma", |
---|
111 | description="Codigo da forma de entrada do material.", |
---|
112 | label_msgid='ILSAALMaterial_label_cod_forma_ingresso', |
---|
113 | description_msgid='ILSAALMaterial_help_cod_forma_ingresso', |
---|
114 | i18n_domain='ILSAALMaterial', |
---|
115 | ), |
---|
116 | required=1 |
---|
117 | ), |
---|
118 | |
---|
119 | BooleanField('cod_status_consumo_imediato', |
---|
120 | widget=BooleanWidget( |
---|
121 | label="Consumo", |
---|
122 | description="Informa se a entrada foi para consumo imediato ou nao.", |
---|
123 | label_msgid='ILSAALMaterial_label_cod_status_consumo_imediato', |
---|
124 | description_msgid='ILSAALMaterial_help_cod_status_consumo_imediato', |
---|
125 | i18n_domain='ILSAALMaterial', |
---|
126 | ), |
---|
127 | required=1 |
---|
128 | ), |
---|
129 | |
---|
130 | FloatField('cod_id_almoxarife', |
---|
131 | widget=DecimalWidget( |
---|
132 | label="Almoxarife Responsavel", |
---|
133 | description="Identificacao do almoxarife responsavel pela entrada.", |
---|
134 | label_msgid='ILSAALMaterial_label_cod_id_almoxarife', |
---|
135 | description_msgid='ILSAALMaterial_help_cod_id_almoxarife', |
---|
136 | i18n_domain='ILSAALMaterial', |
---|
137 | ), |
---|
138 | required=1 |
---|
139 | ), |
---|
140 | |
---|
141 | |
---|
142 | ReferenceField('cod_cnpj_fornecedor', |
---|
143 | widget=ReferenceWidget( |
---|
144 | label='Cod_cnpj_fornecedor', |
---|
145 | label_msgid='ILSAALMaterial_label_cod_cnpj_fornecedor', |
---|
146 | description_msgid='ILSAALMaterial_help_cod_cnpj_fornecedor', |
---|
147 | i18n_domain='ILSAALMaterial', |
---|
148 | ), |
---|
149 | allowed_types=('Fornecedor',), |
---|
150 | multiValued=0, |
---|
151 | relationship='Entrada_Fornecedor' |
---|
152 | ), |
---|
153 | |
---|
154 | ), |
---|
155 | ) |
---|
156 | |
---|
157 | |
---|
158 | ##code-section after-local-schema #fill in your manual code here |
---|
159 | ##/code-section after-local-schema |
---|
160 | |
---|
161 | Entrada_schema = BaseFolderSchema + \ |
---|
162 | schema |
---|
163 | |
---|
164 | ##code-section after-schema #fill in your manual code here |
---|
165 | ##/code-section after-schema |
---|
166 | |
---|
167 | class Entrada(BaseFolder): |
---|
168 | """ |
---|
169 | Representa uma entrada (fornecimento) de materiais. |
---|
170 | """ |
---|
171 | security = ClassSecurityInfo() |
---|
172 | __implements__ = (getattr(BaseFolder,'__implements__',()),) + (IEntrada,) |
---|
173 | |
---|
174 | |
---|
175 | # This name appears in the 'add' box |
---|
176 | archetype_name = 'Entrada' |
---|
177 | |
---|
178 | meta_type = 'Entrada' |
---|
179 | portal_type = 'Entrada' |
---|
180 | allowed_content_types = ['ItemEntrada', 'Fornecedor'] |
---|
181 | filter_content_types = 1 |
---|
182 | global_allow = 0 |
---|
183 | allow_discussion = 0 |
---|
184 | #content_icon = 'Entrada.gif' |
---|
185 | immediate_view = 'base_view' |
---|
186 | default_view = 'base_view' |
---|
187 | suppl_views = () |
---|
188 | typeDescription = "Entrada" |
---|
189 | typeDescMsgId = 'description_edit_entrada' |
---|
190 | |
---|
191 | schema = Entrada_schema |
---|
192 | |
---|
193 | ##code-section class-header #fill in your manual code here |
---|
194 | ##/code-section class-header |
---|
195 | |
---|
196 | |
---|
197 | #Methods |
---|
198 | #methods from Interface IEntrada |
---|
199 | |
---|
200 | security.declarePrivate('_titulo') |
---|
201 | def _titulo(self): |
---|
202 | """ |
---|
203 | |
---|
204 | """ |
---|
205 | |
---|
206 | pass |
---|
207 | |
---|
208 | |
---|
209 | |
---|
210 | registerType(Entrada,PROJECTNAME) |
---|
211 | # end of class Entrada |
---|
212 | |
---|
213 | ##code-section module-footer #fill in your manual code here |
---|
214 | ##/code-section module-footer |
---|
215 | |
---|
216 | |
---|
217 | |
---|