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