source: publico/ILSAALTesouraria/trunk/Conciliacao.py @ 901

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

Pequena correção no formato das datas com apóstrofes

File size: 4.3 KB
Linha 
1# File: Conciliacao.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.ILSAALTesouraria.interfaces.IConciliacao import IConciliacao
28
29
30from Products.Archetypes.SQLStorage import *
31# additional imports from tagged value 'import'
32from Products.ILSAAL.saalapi import *
33from DateTime import DateTime
34
35from Products.ILSAALTesouraria.config import *
36##code-section module-header #fill in your manual code here
37##/code-section module-header
38
39schema=Schema((
40    DateTimeField('dat_conciliacao',
41        default=DateTime(),
42        widget=CalendarWidget(
43            label="Data da Conciliacao",
44            description="Informe a data da conciliacao.",
45            date_only=1,
46            format="%d/%m/%Y",
47            label_msgid='ILSAALTesouraria_label_dat_conciliacao',
48            description_msgid='ILSAALTesouraria_help_dat_conciliacao',
49            i18n_domain='ILSAALTesouraria',
50        ),
51        required=1
52    ),
53
54
55    ReferenceField('num_seq_mb',
56        vocabulary_display_path_bound=-1,
57        widget=ReferenceWidget(
58            label="Movimento Bancario",
59            description="Selecione o movimento bancario desta conciliacao.",
60            format="select",
61            label_msgid='ILSAALTesouraria_label_num_seq_mb',
62            description_msgid='ILSAALTesouraria_help_num_seq_mb',
63            i18n_domain='ILSAALTesouraria',
64        ),
65        allowed_types=('MovimentoBancario',),
66        multiValued=0,
67        relationship='Conciliacao_MovimentoBancario'
68    ),
69
70),
71)
72
73
74##code-section after-local-schema #fill in your manual code here
75##/code-section after-local-schema
76
77Conciliacao_schema = BaseSchema + \
78    schema
79
80##code-section after-schema #fill in your manual code here
81##/code-section after-schema
82
83class Conciliacao(BaseContent):
84    """
85    Mantem dados sobre a conciliacao entre as instancias da classe
86    MovimentoTesouraria e da classe MovimentoBancario.
87    """
88    security = ClassSecurityInfo()
89    __implements__ = (getattr(BaseContent,'__implements__',()),) + (IConciliacao,)
90
91
92    # This name appears in the 'add' box
93    archetype_name             = 'Conciliacao'
94
95    meta_type                  = 'Conciliacao'
96    portal_type                = 'Conciliacao'
97    allowed_content_types      = []
98    filter_content_types       = 0
99    global_allow               = 0
100    allow_discussion           = 0
101    content_icon               = 'conciliacao_icon.gif'
102    immediate_view             = 'base_view'
103    default_view               = 'base_view'
104    suppl_views                = ()
105    typeDescription            = "Conciliacao"
106    typeDescMsgId              = 'description_edit_conciliacao'
107
108    schema = Conciliacao_schema
109
110    ##code-section class-header #fill in your manual code here
111    ##/code-section class-header
112
113
114    #Methods
115    #methods from Interface IConciliacao
116
117    security.declarePrivate('_titulo')
118    def _titulo(self):
119        """
120        Define um titulo personalizado para este objeto.
121        """
122       
123        data_conciliacao = self.getDat_conciliacao()
124
125        if data_conciliacao is not None:
126            return DateTime(data_conciliacao).strftime('%d-%m-%Y')
127        else:
128            return ''
129
130
131
132registerType(Conciliacao,PROJECTNAME)
133# end of class Conciliacao
134
135##code-section module-footer #fill in your manual code here
136##/code-section module-footer
137
138
139
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.