|
|
@ -76,7 +76,7 @@ class CasasLegislativasLabels(Report): |
|
|
|
top=1*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='parlamentar', |
|
|
|
attribute_name='presidente', |
|
|
|
top=1.5*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
@ -111,7 +111,7 @@ class CasasLabelsNomeMaior(CasasLegislativasLabels): |
|
|
|
top=1*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='parlamentar', |
|
|
|
attribute_name='presidente', |
|
|
|
top=1.5*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
@ -146,7 +146,7 @@ class CasasLabelsEnderecoMaior(CasasLegislativasLabels): |
|
|
|
top=1*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='parlamentar', |
|
|
|
attribute_name='presidente', |
|
|
|
top=1.5*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
@ -181,7 +181,7 @@ class CasasLabelsNomeMaiorEnderecoMaior(CasasLegislativasLabels): |
|
|
|
top=1*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='parlamentar', |
|
|
|
attribute_name='presidente', |
|
|
|
top=1.5*cm, left=0.5*cm, width=9.4*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
@ -213,6 +213,7 @@ class CasasLabelsNomeMaiorEnderecoMaior(CasasLegislativasLabels): |
|
|
|
|
|
|
|
class CasasLegislativasReport(ReportDefault): |
|
|
|
title = u'Relatório de Casas Legislativas' |
|
|
|
height = 80*cm |
|
|
|
|
|
|
|
class band_page_header(ReportDefault.band_page_header): |
|
|
|
|
|
|
@ -263,7 +264,7 @@ class CasasLegislativasReport(ReportDefault): |
|
|
|
left=label_left[1]*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='parlamentar', |
|
|
|
attribute_name='presidente', |
|
|
|
left=label_left[2]*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
@ -290,27 +291,32 @@ class CasasSemConvenioReport(CasasLegislativasReport): |
|
|
|
title = u'Relatório de Casas Legislativas sem Convênio' |
|
|
|
|
|
|
|
class InfoCasaLegislativa(ReportDefault): |
|
|
|
title = u'Casa legislativa' |
|
|
|
class band_detail(ReportDefault.band_detail): |
|
|
|
|
|
|
|
posicao_left = [ |
|
|
|
0,1.3, #Tipo |
|
|
|
0,1.8, #Regiao |
|
|
|
5.5,6.8, #U.F. |
|
|
|
12,13.3, #Tipo |
|
|
|
0,2.3, #Municipio |
|
|
|
0,2.8, #Logradouro |
|
|
|
0,1.6, #Bairro |
|
|
|
0,1.3, #CEP |
|
|
|
0,1.6, #CNPJ |
|
|
|
0,2.3, #Telefone |
|
|
|
0,2.7, #Presidente |
|
|
|
] |
|
|
|
posicao_top = [ |
|
|
|
0.5, #Regiao |
|
|
|
0.5, #U.F. |
|
|
|
0.5, #Tipo |
|
|
|
1.3, #Municipio |
|
|
|
2.1, #Logradouro |
|
|
|
2.9, #Bairro |
|
|
|
3.7, #CEP |
|
|
|
4.5, #Presidente |
|
|
|
1.3, #Regiao |
|
|
|
1.3, #U.F. |
|
|
|
2.1, #Municipio |
|
|
|
2.9, #Logradouro |
|
|
|
3.7, #Bairro |
|
|
|
4.5, #CEP |
|
|
|
5.3, #CNPJ |
|
|
|
6.1, #Telefone |
|
|
|
6.9, #Presidente |
|
|
|
] |
|
|
|
|
|
|
|
height=30*cm |
|
|
@ -320,42 +326,40 @@ class InfoCasaLegislativa(ReportDefault): |
|
|
|
|
|
|
|
elements = [ |
|
|
|
|
|
|
|
# Linha 1 |
|
|
|
Label( |
|
|
|
text="Região: ", |
|
|
|
text="Tipo: ", |
|
|
|
left=posicao_left[0]*cm, |
|
|
|
top=posicao_top[0]*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='municipio.uf.regiao', |
|
|
|
attribute_name='tipo.nome', |
|
|
|
left=posicao_left[1]*cm, |
|
|
|
top=posicao_top[0]*cm, |
|
|
|
get_value=lambda instance: |
|
|
|
{'SL': 'Sul','SD': 'Sudeste','CO': 'Centro-Oeste','NE': 'Nordeste','NO': 'Norte',} |
|
|
|
[instance.municipio.uf.regiao] |
|
|
|
width=6*cm, |
|
|
|
), |
|
|
|
Label( |
|
|
|
text="U.F.: ", |
|
|
|
text="Região: ", |
|
|
|
left=posicao_left[2]*cm, |
|
|
|
top=posicao_top[1]*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='municipio.uf', |
|
|
|
attribute_name='municipio.uf.regiao', |
|
|
|
left=posicao_left[3]*cm, |
|
|
|
top=posicao_top[1]*cm, |
|
|
|
get_value=lambda instance: |
|
|
|
{'SL': 'Sul','SD': 'Sudeste','CO': 'Centro-Oeste','NE': 'Nordeste','NO': 'Norte',} |
|
|
|
[instance.municipio.uf.regiao] |
|
|
|
), |
|
|
|
Label( |
|
|
|
text="Tipo: ", |
|
|
|
text="U.F.: ", |
|
|
|
left=posicao_left[4]*cm, |
|
|
|
top=posicao_top[2]*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='tipo.nome', |
|
|
|
attribute_name='municipio.uf', |
|
|
|
left=posicao_left[5]*cm, |
|
|
|
top=posicao_top[2]*cm, |
|
|
|
width=6*cm, |
|
|
|
), |
|
|
|
# Linha 2 |
|
|
|
Label( |
|
|
|
text="Município: ", |
|
|
|
left=posicao_left[6]*cm, |
|
|
@ -400,67 +404,130 @@ class InfoCasaLegislativa(ReportDefault): |
|
|
|
top=posicao_top[6]*cm, |
|
|
|
), |
|
|
|
Label( |
|
|
|
text="Presidente: ", |
|
|
|
text="CNPJ: ", |
|
|
|
left=posicao_left[14]*cm, |
|
|
|
top=posicao_top[7]*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='parlamentar', |
|
|
|
attribute_name='cnpj', |
|
|
|
left=posicao_left[15]*cm, |
|
|
|
top=posicao_top[7]*cm, |
|
|
|
), |
|
|
|
Label( |
|
|
|
text="Telefone: ", |
|
|
|
left=posicao_left[16]*cm, |
|
|
|
top=posicao_top[8]*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='telefone', |
|
|
|
left=posicao_left[17]*cm, |
|
|
|
top=posicao_top[8]*cm, |
|
|
|
), |
|
|
|
Label( |
|
|
|
text="Presidente: ", |
|
|
|
left=posicao_left[18]*cm, |
|
|
|
top=posicao_top[9]*cm, |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='presidente', |
|
|
|
left=posicao_left[19]*cm, |
|
|
|
top=posicao_top[9]*cm, |
|
|
|
width=20*cm, |
|
|
|
), |
|
|
|
] |
|
|
|
label_top = 1.5*cm |
|
|
|
label_left = [0,1.5,4,8,10.5,13,15.5,18] |
|
|
|
# Telefones |
|
|
|
tel_top = 2*cm |
|
|
|
tel_left = [0,3,5] |
|
|
|
# Contato |
|
|
|
cont_top = 2*cm |
|
|
|
cont_left = [0,6,9] |
|
|
|
# Convenios |
|
|
|
convenio_top = 2*cm |
|
|
|
convenio_left = [0,1.8,4.5,8,10.5,13,15.5,18] |
|
|
|
subreports = [ |
|
|
|
# Telefones |
|
|
|
SubReport( |
|
|
|
queryset_string = '%(object)s.convenio_set.all()', |
|
|
|
queryset_string = '%(object)s.telefones.all()', |
|
|
|
band_header = ReportBand( |
|
|
|
default_style = {'fontName': 'Helvetica', 'fontSize':11}, |
|
|
|
height=2*cm, |
|
|
|
default_style = {'fontName': 'Helvetica', 'fontSize':12 }, |
|
|
|
height=2.5*cm, |
|
|
|
elements = [ |
|
|
|
Label( |
|
|
|
text="Convênio(s)", |
|
|
|
text="Telefone(s)", |
|
|
|
style = {'fontSize':14,'alignment': TA_CENTER}, |
|
|
|
width=BAND_WIDTH, |
|
|
|
top=1*cm, |
|
|
|
), |
|
|
|
Label( |
|
|
|
text="Projeto", |
|
|
|
left=label_left[0]*cm, |
|
|
|
top=label_top |
|
|
|
Label(text="Número",left=tel_left[0]*cm,top=tel_top), |
|
|
|
Label(text="Tipo",left=tel_left[1]*cm,top=tel_top), |
|
|
|
Label(text="Nota",left=tel_left[2]*cm,top=tel_top), |
|
|
|
], |
|
|
|
borders = {'bottom': True}, |
|
|
|
), |
|
|
|
Label( |
|
|
|
text="Nº Convenio", |
|
|
|
left=label_left[1]*cm, |
|
|
|
top=label_top |
|
|
|
band_detail = ReportBand( |
|
|
|
default_style = {'fontName': 'Helvetica', 'fontSize':11}, |
|
|
|
height=0.5*cm, |
|
|
|
elements= [ |
|
|
|
ObjectValue(attribute_name='__unicode__',left=tel_left[0]*cm), |
|
|
|
ObjectValue(attribute_name='tipo',left=tel_left[1]*cm, |
|
|
|
get_value = lambda instance: |
|
|
|
{'F':'Fixo','M':u'Móvel','X':'Fax','I':'Indefinido'}[instance.tipo], |
|
|
|
), |
|
|
|
Label( |
|
|
|
text="Nº Processo SF", |
|
|
|
left=label_left[2]*cm, |
|
|
|
top=label_top |
|
|
|
ObjectValue(attribute_name='nota',left=tel_left[2]*cm), |
|
|
|
], |
|
|
|
borders = {'all':True}, |
|
|
|
), |
|
|
|
Label( |
|
|
|
text="Adesão", |
|
|
|
left=label_left[3]*cm, |
|
|
|
top=label_top |
|
|
|
), |
|
|
|
#Contatos |
|
|
|
SubReport( |
|
|
|
queryset_string = '%(object)s.contatos.all()', |
|
|
|
band_header = ReportBand( |
|
|
|
default_style = {'fontName': 'Helvetica', 'fontSize':12 }, |
|
|
|
height=2.5*cm, |
|
|
|
elements = [ |
|
|
|
Label( |
|
|
|
text="Convênio", |
|
|
|
left=label_left[4]*cm, |
|
|
|
top=label_top |
|
|
|
text="Contato(s)", |
|
|
|
style = {'fontSize':14,'alignment': TA_CENTER}, |
|
|
|
width=BAND_WIDTH, |
|
|
|
top=1*cm, |
|
|
|
), |
|
|
|
Label(text="Nome",left=cont_left[0]*cm,top=cont_top), |
|
|
|
Label(text="Nota",left=cont_left[1]*cm,top=cont_top), |
|
|
|
Label(text="E-mail",left=cont_left[2]*cm,top=cont_top), |
|
|
|
], |
|
|
|
borders = {'bottom': True,'top':True}, |
|
|
|
), |
|
|
|
band_detail = ReportBand( |
|
|
|
default_style = {'fontName': 'Helvetica', 'fontSize':11}, |
|
|
|
height=0.5*cm, |
|
|
|
elements= [ |
|
|
|
ObjectValue(attribute_name='nome',left=cont_left[0]*cm), |
|
|
|
ObjectValue(attribute_name='nota',left=cont_left[1]*cm), |
|
|
|
ObjectValue(attribute_name='email',left=cont_left[2]*cm), |
|
|
|
], |
|
|
|
borders = {'all':True}, |
|
|
|
), |
|
|
|
Label( |
|
|
|
text="Equipada", |
|
|
|
left=label_left[5]*cm, |
|
|
|
top=label_top |
|
|
|
), |
|
|
|
#Convenios |
|
|
|
SubReport( |
|
|
|
queryset_string = '%(object)s.convenio_set.all()', |
|
|
|
band_header = ReportBand( |
|
|
|
default_style = {'fontName': 'Helvetica', 'fontSize':12 }, |
|
|
|
height=2.5*cm, |
|
|
|
elements=[ |
|
|
|
Label( |
|
|
|
text="Data D.O.", |
|
|
|
left=label_left[6]*cm, |
|
|
|
top=label_top |
|
|
|
text="Convênio(s)", |
|
|
|
style = {'fontSize':14,'alignment': TA_CENTER}, |
|
|
|
width=BAND_WIDTH, |
|
|
|
top=1*cm, |
|
|
|
), |
|
|
|
Label(text="Projeto",left=convenio_left[0]*cm,top=convenio_top), |
|
|
|
Label(text="Nº Convenio",left=convenio_left[1]*cm,top=convenio_top), |
|
|
|
Label(text="Nº Processo SF",left=convenio_left[2]*cm,top=convenio_top), |
|
|
|
Label(text="Adesão",left=convenio_left[3]*cm,top=convenio_top), |
|
|
|
Label(text="Convênio",left=convenio_left[4]*cm,top=convenio_top), |
|
|
|
Label(text="Equipada",left=convenio_left[5]*cm,top=convenio_top), |
|
|
|
Label(text="Data D.O.",left=convenio_left[6]*cm,top=convenio_top), |
|
|
|
], |
|
|
|
borders = {'bottom': True} |
|
|
|
), |
|
|
@ -468,47 +535,27 @@ class InfoCasaLegislativa(ReportDefault): |
|
|
|
default_style = {'fontName': 'Helvetica', 'fontSize':11}, |
|
|
|
height=0.5*cm, |
|
|
|
elements=[ |
|
|
|
ObjectValue( |
|
|
|
attribute_name='projeto.sigla', |
|
|
|
left=label_left[0]*cm |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='num_convenio', |
|
|
|
left=label_left[1]*cm |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='num_processo_sf', |
|
|
|
left=label_left[2]*cm |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='data_adesao', |
|
|
|
left=label_left[3]*cm, |
|
|
|
ObjectValue(attribute_name='projeto.sigla',left=convenio_left[0]*cm), |
|
|
|
ObjectValue(attribute_name='num_convenio',left=convenio_left[1]*cm), |
|
|
|
ObjectValue(attribute_name='num_processo_sf',left=convenio_left[2]*cm), |
|
|
|
ObjectValue(attribute_name='data_adesao',left=convenio_left[3]*cm, |
|
|
|
get_value=lambda instance: |
|
|
|
instance.data_adesao.strftime('%d/%m/%Y') if instance.data_adesao != None else '-' |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='data_retorno_assinatura', |
|
|
|
left=label_left[4]*cm, |
|
|
|
ObjectValue(attribute_name='data_retorno_assinatura',left=convenio_left[4]*cm, |
|
|
|
get_value=lambda instance: |
|
|
|
instance.data_retorno_assinatura.strftime('%d/%m/%Y') if instance.data_retorno_assinatura != None else '-' |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='data_termo_aceite', |
|
|
|
left=label_left[5]*cm, |
|
|
|
ObjectValue(attribute_name='data_termo_aceite',left=convenio_left[5]*cm, |
|
|
|
get_value=lambda instance: |
|
|
|
instance.data_termo_aceite.strftime('%d/%m/%Y') if instance.data_termo_aceite != None else '-' |
|
|
|
), |
|
|
|
ObjectValue( |
|
|
|
attribute_name='data_pub_diario', |
|
|
|
left=label_left[6]*cm, |
|
|
|
ObjectValue(attribute_name='data_pub_diario',left=convenio_left[6]*cm, |
|
|
|
get_value=lambda instance: |
|
|
|
instance.data_pub_diario.strftime('%d/%m/%Y') if instance.data_pub_diario != None else '-' |
|
|
|
), |
|
|
|
], |
|
|
|
#borders={'left': True, 'right': True}, |
|
|
|
), |
|
|
|
band_footer = ReportBand( |
|
|
|
#height=0.5*cm, |
|
|
|
borders = {'all':True}, |
|
|
|
), |
|
|
|
) |
|
|
|
] |
|
|
|