Skip to content

Commit

Permalink
Merge pull request #164 from ResidenciaTICBrisa/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
pedrobarbosaocb authored Dec 8, 2023
2 parents 67541d8 + 5db4b2f commit 990bb90
Show file tree
Hide file tree
Showing 107 changed files with 2,268 additions and 285 deletions.
Binary file removed project/app/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/admin.cpython-311.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/apps.cpython-311.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/apps.cpython-38.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/capa.cpython-38.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/estilo.cpython-38.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/estilo_fundep.cpython-38.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/models.cpython-311.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/new_dev.cpython-38.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/oracle_cruds.cpython-38.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/preenche_fub.cpython-38.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed project/app/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/urls.cpython-311.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/views.cpython-311.pyc
Binary file not shown.
Binary file removed project/app/__pycache__/views.cpython-38.pyc
Binary file not shown.
16 changes: 9 additions & 7 deletions project/app/capa.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def inserir_round_retangulo(planilha,data1,data2,dicionariofin):
worksheet = workbook['Capa Finatec']



# List of image names
image_names = [
'agencia.png',#0
Expand Down Expand Up @@ -168,18 +168,20 @@ def inserir_round_retangulo(planilha,data1,data2,dicionariofin):
'centrodecusto_branco.png'
]

# Path to the images
path = '/home/ubuntu/Desktop/entrega/05_PipelineFinatec/project/app/capa_60/'


# List to hold Image objects
images = []

nomePasta = "imagensCapa"
diretorio = os.path.dirname(__file__)

# Loop through the list of image names and create Image objects
for i, name in enumerate(image_names):
image_path = path + name
pil_image = PILImage.open(image_path)
pil_image.save(image_path)
img = Image(image_path)
caminhoImage = os.path.join(diretorio, nomePasta, name)
pil_image = PILImage.open(caminhoImage)
pil_image.save(caminhoImage)
img = Image(caminhoImage)
images.append(img)


Expand Down
369 changes: 369 additions & 0 deletions project/app/estiloFINEP.py

Large diffs are not rendered by default.

1,055 changes: 1,055 additions & 0 deletions project/app/estiloIBICT.py

Large diffs are not rendered by default.

178 changes: 178 additions & 0 deletions project/app/estiloOPAS.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
import openpyxl
from openpyxl.styles import Font, PatternFill, Alignment,NamedStyle,Border, Side
import os
#pegar o caminho do arquivo
def pegar_caminho(nome_arquivo):

# Obter o caminho absoluto do arquivo Python em execução
caminho_script = os.path.abspath(__file__)

# Obter o diretório da pasta onde o script está localizado
pasta_script = os.path.dirname(caminho_script)

# Combinar o caminho da pasta com o nome do arquivo Excel
caminho = os.path.join(pasta_script, nome_arquivo)

return caminho

def estiloOpas(tabela,tamanho,nomeVariavel,nomeTabela):
nomeSheet=nomeVariavel
print(tabela)
caminho = pegar_caminho(tabela)
workbook = openpyxl.load_workbook(caminho)
worksheet = workbook[nomeTabela]
size = tamanho + 10
print(size)
cinza = "d9d9d9"
cinza_escuro = "d8e0f2"


borda = Border(right=Side(border_style="medium"))
worksheet.sheet_view.showGridLines = False
#
for row in worksheet.iter_rows(min_row=12, max_row=size+10,min_col=5,max_col=5):
for cell in row:
cell.border = borda


worksheet.column_dimensions['a'].width = 20 #N
worksheet.column_dimensions['b'].width = 65 #Fornecedor
worksheet.column_dimensions['c'].width = 35 # ateogira de despesa
worksheet.column_dimensions['d'].width = 35 #data
worksheet.column_dimensions['e'].width = 35 #montante


#Aumentar a altura das celulas
for row in worksheet.iter_rows(min_row=11, max_row=size, min_col=1, max_col=5):
worksheet.row_dimensions[row[0].row].height = 60
input3 = f'customNumber{nomeVariavel}'

# MASCARA R$

locals()[input3] = NamedStyle(name=f'{input3}')
locals()[input3].number_format = 'R$ #,##0.00'
locals()[input3].font = Font(name="Arial", size=12, color="000000")
locals()[input3].alignment = Alignment(horizontal="center",vertical="center",wrap_text=True)

for row in range(12,size+1):
cell = worksheet[f'E{row}']
cell.style = locals()[input3]

#estilocinzasimcinzanao
value_to_stop = size
start_row = 12
#


for rows in worksheet.iter_rows(min_row=12, max_row=size, min_col=1, max_col=5):
for cell in rows:
if cell.row % 2:
cell.fill = PatternFill(start_color=cinza, end_color=cinza,
fill_type = "solid")
if cell.column == 5:
cell.font = Font(name="Arial", size=12, color="000000")
cell.alignment = Alignment(horizontal="center",vertical="center",wrap_text=True)
cell.border = Border(top=Side(border_style="hair") ,left = Side(border_style="hair") ,right =Side(border_style="medium") ,bottom=Side(border_style="hair") )
else:
cell.font = Font(name="Arial", size=12, color="000000")
cell.alignment = Alignment(horizontal="center",vertical="center",wrap_text=True)
cell.border = Border(top=Side(border_style="hair") ,left = Side(border_style="hair") ,right =Side(border_style="hair") ,bottom=Side(border_style="hair") )



#subtotal
stringAfinarCelula =size+1
worksheet.row_dimensions[size+1].height = 6
celulas_mergidas_subtotal = f"A{size+2}:B{size+2}"
worksheet.merge_cells(celulas_mergidas_subtotal)
left_celula_cell = f"A{size+2}"
left_celula_cell2 = f"B{size+2}"
top_left_cell = worksheet[left_celula_cell]
top_left_cell.value = "Total"
top_left_cell.fill = PatternFill(start_color=cinza_escuro, end_color=cinza_escuro,fill_type = "solid")
top_left_cell.font = Font(name="Arial", size=12, color="000000",bold=True)
top_left_cell.alignment = Alignment(horizontal="center",vertical="center")
top_left_cell.border = Border(top=Side(border_style="medium") ,left = Side(border_style="medium") ,right =Side(border_style="thin") ,bottom=Side(border_style="medium") )
worksheet[left_celula_cell2].border = Border(top=Side(border_style="medium") ,right =Side(border_style="thin") ,bottom=Side(border_style="medium") )



worksheet.row_dimensions[size+2].height = 56.25


# FORMULATOTAL
celulas_mergidas_total = f"C{size+2}:E{size+2}"
worksheet.merge_cells(celulas_mergidas_total)
formula = f"=SUM(E10:E{size})"
celula = f'C{size+2}'
celula2 =f'D{size+2}'
celula3 =f'E{size+2}'
worksheet[celula] = formula
worksheet[celula].fill = PatternFill(start_color=cinza_escuro, end_color=cinza_escuro,fill_type = "solid")
worksheet[celula].font = Font(name="Arial", size=12, color="000000",bold=True)
worksheet[celula].border = Border(top=Side(border_style="medium") ,left = Side(border_style="thin") ,right =Side(border_style="medium") ,bottom=Side(border_style="medium") )
worksheet[celula2].border = Border(top=Side(border_style="medium") , bottom=Side(border_style="medium") )
worksheet[celula3].border = Border(top=Side(border_style="medium") ,left = Side(border_style="thin") ,right =Side(border_style="medium") ,bottom=Side(border_style="medium") )

worksheet[celula].number_format = 'R$ #,##0.00'


#Local
brasilia_row = size + 4
brasilia_formula = f"Local:"
top_left_brasilia_cell_formula = f'B{brasilia_row}'
top_left_brasilia_cell = worksheet[top_left_brasilia_cell_formula]
top_left_brasilia_cell.value = brasilia_formula
top_left_brasilia_cell.alignment = Alignment(horizontal="center",vertical="center")
worksheet[celula].font = Font(name="Arial", size=12, color="000000",bold=True)

#data
data_row = size + 5
data_formula = f"Data:"
top_left_data_cell_formula = f'B{data_row}'
top_left_data_cell = worksheet[top_left_data_cell_formula]
top_left_data_cell.value = data_formula
top_left_data_cell.alignment = Alignment(horizontal="center",vertical="center")
worksheet[celula].font = Font(name="Arial", size=12, color="000000",bold=True)

#Representante Legal da Instituição Beneficiária:
repre_row = size + 7
repre_formula = f"Representante Legal da Instituição Beneficiária::"
top_left_repre_cell_formula = f'B{repre_row}'
top_left_repre_cell = worksheet[top_left_repre_cell_formula]
top_left_repre_cell.value = repre_formula
top_left_repre_cell.alignment = Alignment(horizontal="center",vertical="center")
worksheet[celula].font = Font(name="Arial", size=12, color="000000",bold=True)


#diretor preseitente
diretor_row = size + 9
diretor = f"Diretor-Presidente"
top_left_diretor_cell_formula = f'C{diretor_row}'
top_left_diretor_cell = worksheet[top_left_diretor_cell_formula]
top_left_diretor_cell.value = diretor
top_left_diretor_cell.alignment = Alignment(horizontal="center",vertical="center")

for row in worksheet.iter_rows(min_row=diretor_row+1, max_row=diretor_row+1,min_col=1,max_col=5):
for cell in row:
if cell.column == 5:
cell.border = Border(top=Side(border_style="none") ,left = Side(border_style="none") ,right =Side(border_style="medium") ,bottom=Side(border_style="medium") )
else:
cell.border = Border(top=Side(border_style="none") ,left = Side(border_style="none") ,right =Side(border_style="none") ,bottom=Side(border_style="medium") )

workbook.save(tabela)
workbook.close()




tabela = pegar_caminho('ModeloOPAS.xlsx')
workbook = openpyxl.load_workbook(tabela)
nomeTabela ="Relatório Detalhado"
tituloStyle = "aff"
workbook.save("tabelapreenchida.xlsx")
workbook.close()
maior = 20
tabela2 = pegar_caminho('tabelapreenchida.xlsx')
print(tabela2)
estiloOpas(tabela2,maior,tituloStyle,nomeTabela)
8 changes: 4 additions & 4 deletions project/app/estilo_fub.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def estiloGeral(tabela,tamanho,nomeVariavel,nomeTabela):
worksheet['A1'] = f'R E L A Ç Ã O D E P A G A M E N T O S - OUTROS SERVIÇOS DE TERCEIROS - PESSOA JURÍDICA'
elif nomeSheet == "passagenDespLocomo":
worksheet['A1'] = f'R E L A Ç Ã O D E P A G A M E N T O S - PASSAGENS E DESPESAS COM LOCOMOÇÃO'
elif nomeSheet == "outrosServiçosTerceiros":
worksheet['A1'] = f'R E L A Ç Ã O D E P A G A M E N T O S - O U T R O S S E R V I Ç O S D E T E R C E I R O S - C E L E T I S T A S'
# elif nomeSheet == "outrosServiçosTerceiros":
# worksheet['A1'] = f'R E L A Ç Ã O D E P A G A M E N T O S - O U T R O S S E R V I Ç O S D E T E R C E I R O S - C E L E T I S T A S'
elif nomeSheet == "auxilioEstudante":
worksheet['A1'] = f'R E L A Ç Ã O D E P A G A M E N T O S - AUXÍLIO FINANCEIRO A ESTUDANTE'
elif nomeSheet == "bolsaExtensao":
Expand Down Expand Up @@ -876,7 +876,7 @@ def estilo_rendimento_de_aplicacao(tabela,tamanho):

for row in worksheet.iter_rows(min_row=coordenadora_cpf_row+1, max_row=coordenadora_cpf_row+1,min_col=1,max_col=8):
for cell in row:
if cell.column == 4:
if cell.column == 8:
cell.border = Border(top=Side(border_style="none") ,left = Side(border_style="none") ,right =Side(border_style="medium") ,bottom=Side(border_style="medium") )
else:
cell.border = Border(top=Side(border_style="none") ,left = Side(border_style="none") ,right =Side(border_style="none") ,bottom=Side(border_style="medium") )
Expand Down Expand Up @@ -1477,7 +1477,7 @@ def estilo_demonstrativoDeReceita(tabela,tamanho):

for row in worksheet.iter_rows(min_row=coordenadora_cpf_row+1, max_row=coordenadora_cpf_row+1,min_col=1,max_col=4):
for cell in row:
if cell.column == 8:
if cell.column == 4:
cell.border = Border(top=Side(border_style="none") ,left = Side(border_style="none") ,right =Side(border_style="medium") ,bottom=Side(border_style="medium") )
else:
cell.border = Border(top=Side(border_style="none") ,left = Side(border_style="none") ,right =Side(border_style="none") ,bottom=Side(border_style="medium") )
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added project/app/imagensIBICIT/finatec.png
Binary file added project/app/imagensIBICIT/ibict.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added project/app/planilhas/IBICT.xlsx
Binary file not shown.
Binary file removed project/app/planilhas/ModeloFINEP.xlsx
Binary file not shown.
Binary file modified project/app/planilhas/ModeloOPAS.xlsx
Binary file not shown.
Binary file not shown.
Binary file not shown.
90 changes: 81 additions & 9 deletions project/app/preenche_fub.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@ def criaout(planilha,codigo,data1,data2):
workbook.save(planilha)
workbook.close()

# ##########################################Pessoa Fisica#########################################
# ##########################################Pessoa Fisica######################################### CANCELADO
def pessoa_fisica(codigo,data1,data2,keys,planilha):
tabela = pegar_caminho(planilha)
nomeTabela ="Pessoa Fisica"
nomeTabela ="Outros Serviços Terceiros - PF"
tituloStyle = "pessoaFisica"
workbook = openpyxl.load_workbook(tabela)
sheet2 = workbook.create_sheet(title="Pessoa Fisica")
sheet2 = workbook.create_sheet(title="Outros Serviços Terceiros - PF")
workbook.save(tabela)
workbook.close()
categorized_data= separarporrubrica(codigo,data1,data2)
Expand All @@ -219,7 +219,7 @@ def pessoa_fisica(codigo,data1,data2,keys,planilha):
# caminho = pegar_caminho(planilha)

workb = openpyxl.load_workbook(tabela)
worksheet5 = workb['Pessoa Fisica']
worksheet5 = workb['Outros Serviços Terceiros - PF']

for i in range(1,maior+1):
valor_coluna = 9 + i
Expand All @@ -246,6 +246,78 @@ def pessoa_fisica(codigo,data1,data2,keys,planilha):
workb.save(tabela)
workb.close()



def pessoaFisica(codigo,data1,data2,keys,planilha):

tabela = pegar_caminho(planilha)
nomeTabela ="Outros Serviços Terceiros - PF"
tituloStyle = "pessoaFisica"
workbook = openpyxl.load_workbook(tabela)
sheet2 = workbook.create_sheet(title="Outros Serviços Terceiros - PF")
workbook.save(tabela)
workbook.close()
categorized_data= separarporrubrica(codigo,data1,data2)

tamanho = []

if 87 in categorized_data and 25 in categorized_data:
categorized_data[87].extend(categorized_data[25])
elif 87 not in categorized_data and 25 in categorized_data:
categorized_data[87] = categorized_data[25]
else:
print("Data not available or empty.")
maior = 1
tabela = pegar_caminho(planilha)
estiloGeral(tabela,maior,tituloStyle,nomeTabela)
return None # or handle the case accordingly

if 87 not in categorized_data or not categorized_data[87]:
maior = 1
tabela = pegar_caminho(planilha)
estiloGeral(tabela,maior,tituloStyle,nomeTabela)
print("Data not available or empty.")
return None # or handle the case accordingly
maior = len(categorized_data[87])
print(maior)
print(len(categorized_data[87]))
tabela = pegar_caminho(planilha)

estiloGeral(tabela,maior,tituloStyle,nomeTabela)


coluna = 2
# caminho = pegar_caminho(planilha)

workb = openpyxl.load_workbook(tabela)
worksheet5 = workb['Outros Serviços Terceiros - PF']

for i in range(1,maior+1):
valor_coluna = 9 + i
worksheet5.cell(row=valor_coluna, column=1, value=i) # column index starts from 1


for i in keys:
li = [i]
if 87 not in categorized_data or not categorized_data[87]:
print("Data not available or empty.")
maior = 1
tabela = pegar_caminho(planilha)
estiloGeral(tabela,maior,tituloStyle,nomeTabela)
return None # or handle the case accordingly
valores_preenchimento = retornavalores(categorized_data[87],li)

n = len(valores_preenchimento)
for rowkek, cell_data in enumerate(valores_preenchimento, start=10):
worksheet5.cell(row=rowkek, column=coluna, value=cell_data)
if coluna == 5 or coluna == 7 :
coluna = coluna + 1
coluna = coluna + 1

workb.save(tabela)
workb.close()


# ##########################################Pessoa Juridica#########################################
def pessoa_juridica(codigo,data1,data2,keys,planilha):

Expand Down Expand Up @@ -318,7 +390,7 @@ def pessoa_juridica(codigo,data1,data2,keys,planilha):
workb.save(tabela)
workb.close()

# ##########################################ISS#########################################
# ##########################################ISS#########################################CANCELADO
def iss(codigo,data1,data2,keys,planilha):
tabela = pegar_caminho(planilha)
nomeTabela ="ISS"
Expand Down Expand Up @@ -430,7 +502,7 @@ def passagem_locomção(codigo,data1,data2,keys,planilha):
workb.save(tabela)
workb.close()

# ##########################################Serv.Terceiro CLTa#########################################
# ##########################################Serv.Terceiro CLTa#########################################CANCELADO
def terclt(codigo,data1,data2,keys,planilha):
tabela = pegar_caminho(planilha)
nomeTabela ="Serv. Terceiro CLT"
Expand Down Expand Up @@ -458,7 +530,7 @@ def terclt(codigo,data1,data2,keys,planilha):
# caminho = pegar_caminho(planilha)

workb = openpyxl.load_workbook(tabela)
worksheet4 = workb['Outros Serviços Terceiros - PF']
worksheet4 = workb['Serv. Terceiro CLT']

for i in range(1,maior+1):
valor_coluna = 9 + i
Expand Down Expand Up @@ -850,11 +922,11 @@ def demonstrativo(codigo,data1,data2,planilha):
def preencher_fub_teste(codigo,data1,data2,keys,tabela):
criaout(tabela,codigo,data1,data2)
preencherCapa(codigo,tabela)
pessoa_fisica(codigo,data1,data2,keys,tabela)
pessoaFisica(codigo,data1,data2,keys,tabela)
pessoa_juridica(codigo,data1,data2,keys,tabela)
#iss(codigo,data1,data2,keys,tabela)
passagem_locomção(codigo,data1,data2,keys,tabela)
terclt(codigo,data1,data2,keys,tabela)
#terclt(codigo,data1,data2,keys,tabela)
obricacao_tributaria(codigo,data1,data2,keys,tabela)
conciliacao_bancaria(codigo,data1,data2,tabela)
rendimentodeaplicacao(codigo,data1,data2,tabela)
Expand Down
1 change: 1 addition & 0 deletions project/app/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ body {
height: 100vh;
width: 100vw;
}

header {
display: flex;
align-items: center;
Expand Down
Binary file added project/app/static/imagem/baixar.png
Binary file added project/app/static/imagem/pesquisar.png
Loading

0 comments on commit 990bb90

Please sign in to comment.