Spaces:
Sleeping
Sleeping
Commit
·
e87112e
1
Parent(s):
52ef085
Upload 10 files
Browse files- caixa.py +300 -0
- chaveSheet.json +13 -0
- codigos.py +7 -0
- dados.json +7 -0
- database.py +26 -0
- envios.py +46 -0
- login.py +78 -0
- requirements.txt +75 -0
- style.css +10 -0
- usuarios.db +0 -0
caixa.py
ADDED
@@ -0,0 +1,300 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gspread
|
2 |
+
import pandas as pd
|
3 |
+
import numpy as np
|
4 |
+
import streamlit as st
|
5 |
+
import envios
|
6 |
+
import codigos
|
7 |
+
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
status = 'negative'
|
12 |
+
code = '1g9afHN6H_ThVBExwNkXlhN4AH75TVTERmGP1KB0F1PU'
|
13 |
+
gc = gspread.service_account(filename='chaveSheet.json')
|
14 |
+
sh = gc.open_by_key(code)
|
15 |
+
|
16 |
+
ws=sh.worksheet('FechamentoCaixa')
|
17 |
+
pd.set_option('display.max_colwidth', None)
|
18 |
+
df = pd.DataFrame(ws.get_all_records())
|
19 |
+
|
20 |
+
print(df)
|
21 |
+
position = []
|
22 |
+
|
23 |
+
def Verificar():
|
24 |
+
|
25 |
+
vazios = []
|
26 |
+
|
27 |
+
a = df.loc[:,('controlador','[FechamentoCaixa ] Quantos Caixas foram abertos neste dia por esta secretária?')]
|
28 |
+
|
29 |
+
for i in range(len(a)):
|
30 |
+
if a.loc[i,'[FechamentoCaixa ] Quantos Caixas foram abertos neste dia por esta secretária?'] != "":
|
31 |
+
position.append(i)
|
32 |
+
|
33 |
+
else:
|
34 |
+
vazios.append(i)
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
print(vazios)
|
39 |
+
|
40 |
+
ultimo = position[-1] #posição do ultimo elemento preenchido
|
41 |
+
proximo = ultimo + 1
|
42 |
+
|
43 |
+
#print('proximo registro é ',proximo, ' linha -> ',linha)
|
44 |
+
#print("qtd",len(df))
|
45 |
+
|
46 |
+
#print(len(a) <= int(proximo))
|
47 |
+
|
48 |
+
if (len(vazios) == 0):
|
49 |
+
print('sem dado para preencher')
|
50 |
+
st.text('Não existe dado para preencher')
|
51 |
+
|
52 |
+
#elif (df.loc[int(proximo),'Nome'] != ""):
|
53 |
+
elif (vazios != ""):
|
54 |
+
|
55 |
+
st.text('Existe dado para preencher')
|
56 |
+
|
57 |
+
#st.header('preenchimento')
|
58 |
+
|
59 |
+
#numeroKeySorteado = random.sample(range(0,1000), len(df))
|
60 |
+
|
61 |
+
#print(numeroKeySorteado[2])
|
62 |
+
#print('Proximo = ',proximo, "Position = ",len(position))
|
63 |
+
|
64 |
+
for i in vazios:
|
65 |
+
key = "numeroKeySorteado_{}".format(i)
|
66 |
+
#print(key)
|
67 |
+
#
|
68 |
+
|
69 |
+
with st.expander(df.loc[i,'Nome']):
|
70 |
+
one = st.text_input('[FechamentoCaixa ] Quantos Caixas foram abertos neste dia por esta secretária?',key=key+'1')
|
71 |
+
two = st.file_uploader('[FechamentoCaixa ] Anexe aqui o relatório de caixa do dia, quem mostra quantos caixa apenas neste dia foram abertos.',key=key+'2')
|
72 |
+
|
73 |
+
tree = st.selectbox('FechamentoCaixa ] Todos os caixas desta secretária tiveram prestação de contas?',key=key+'3',options=['Sim','Não'])
|
74 |
+
|
75 |
+
four = st.selectbox('[FechamentoCaixa ] Alguém além das secretárias abriu caixa neste dia?',key=key+'4',options=['Sim','Não'])
|
76 |
+
if four == 'Sim':
|
77 |
+
five = st.text_input('[FechamentoCaixa ] Quem abriu o caixa nesse dia?',key=key+'5')
|
78 |
+
else:
|
79 |
+
five = ''
|
80 |
+
|
81 |
+
six = st.selectbox('[FechamentoCaixa ] Confira no extrato da conta se o comprovante de depósito de dinheiro foi compensado devidamente. Foi?',key=key+'6',options=['Sim, foi compensado.','Não','Foi realizada uma sangria.','Não Houve entradas nesse dia.','Houve entradas, porém foi utilizado ao longo do dia.'])
|
82 |
+
seven = ''
|
83 |
+
if six == 'Sim, foi compensado.':
|
84 |
+
seven = st.file_uploader('[FechamentoCaixa ] Anexe aqui o print do extrato do depósito correspondente:',key=key+'7')
|
85 |
+
|
86 |
+
oito = ''
|
87 |
+
if six == 'Foi realizada uma sangria.':
|
88 |
+
oito = st.text_input('[FechamentoCaixa ] Qual o valor da sangria?',key=key+'8')
|
89 |
+
|
90 |
+
|
91 |
+
|
92 |
+
#valores = [[one,two,tree,four,five,six,seven,oito]]
|
93 |
+
|
94 |
+
|
95 |
+
if st.button('clicar',key=key):
|
96 |
+
envios.convertion(two,two.name,codigos.CodeFechamentoCaixa)
|
97 |
+
print('upload feito')
|
98 |
+
|
99 |
+
|
100 |
+
if six == 'Sim, foi compensado.':
|
101 |
+
envios.convertion(seven,seven.name,codigos.CodeFechamentoCaixa)
|
102 |
+
print('upload feito')
|
103 |
+
|
104 |
+
if seven != "":
|
105 |
+
seven = 'https://drive.google.com/drive/folders/1NaucQ1-vhkQKOY993Su8EN7ooguPpoFQIkaRxDeu772n5APURpXD1Ni2tFBTP4clixSme9DT '+seven.name
|
106 |
+
else:
|
107 |
+
seven = ""
|
108 |
+
|
109 |
+
|
110 |
+
|
111 |
+
|
112 |
+
#print('Mario: ',(df.loc[df['Nome'] == 'Mario']).index[0])
|
113 |
+
print(i)
|
114 |
+
status = 'positive'
|
115 |
+
print('MINHA LINHA POHA MARIO',i+2)
|
116 |
+
linha = i+2
|
117 |
+
att = 'S{}:Z{}'.format(linha,linha)
|
118 |
+
print(att)
|
119 |
+
#valores = [[one,'teste',tree]]
|
120 |
+
valores = [[one,'https://drive.google.com/drive/folders/1NaucQ1-vhkQKOY993Su8EN7ooguPpoFQIkaRxDeu772n5APURpXD1Ni2tFBTP4clixSme9DT '+two.name,tree,four,five,six,seven,oito]]
|
121 |
+
if status == 'positive':
|
122 |
+
preenchendo = ws.update(att,valores)
|
123 |
+
st.experimental_rerun()
|
124 |
+
|
125 |
+
|
126 |
+
|
127 |
+
|
128 |
+
|
129 |
+
|
130 |
+
# st.session_state.clic = False
|
131 |
+
# st.session_state.botao = True
|
132 |
+
|
133 |
+
def PgCartao():
|
134 |
+
|
135 |
+
control = []
|
136 |
+
pergunta = df.loc[:,['[FechamentoCaixa ] Qual o valor recebido em cartão por esta secretária?']]
|
137 |
+
for i in range(len(df)):
|
138 |
+
if (df.loc[i,('[FechamentoCaixa ] Qual o valor recebido em cartão por esta secretária?')] == '') and (df.loc[i,('[FechamentoCaixa ] Confira no extrato da conta se o comprovante de depósito de dinheiro foi compensado devidamente. Foi?')] != ""):
|
139 |
+
control.append(i)
|
140 |
+
print(i,df.loc[i,('Nome')])
|
141 |
+
|
142 |
+
print(control)
|
143 |
+
|
144 |
+
if len(control) == 0:
|
145 |
+
st.text('Não Tem dados para preencher nessa fase')
|
146 |
+
|
147 |
+
elif len(control)>0:
|
148 |
+
for i in control:
|
149 |
+
key = "numeroKeySorteado_{}".format(i)
|
150 |
+
|
151 |
+
with st.expander(df.loc[i,'Nome']):
|
152 |
+
|
153 |
+
one = st.text_input('[FechamentoCaixa ] Qual o valor recebido em cartão por esta secretária?',key=key+'10')
|
154 |
+
two = st.text_input('[FechamentoCaixa ] Qual o valor total em cartão das duas secretárias?',key=key+'20')
|
155 |
+
tree = st.text_input('[FechamentoCaixa ] O valor recebido em cartão por ambas as secretárias é igual ao valor total do relatório da máquina de cartão?',key=key+'30')
|
156 |
+
four = st.file_uploader('[FechamentoCaixa ] Anexe aqui o print do valor em cartão do site da maquininha de cartão:',key=key+'40')
|
157 |
+
|
158 |
+
if st.button('Enviar dados ',key=key+'50'):
|
159 |
+
envios.convertion(four,four.name,codigos.CodeFechamentoCaixa)
|
160 |
+
|
161 |
+
print('Enviar')
|
162 |
+
linha = i+2
|
163 |
+
coord = 'AA{}:AD{}'.format(linha,linha)
|
164 |
+
print(coord)
|
165 |
+
#valores = [[one,'teste',tree]]
|
166 |
+
valores = [[one,two,tree,'https://drive.google.com/drive/folders/1NaucQ1-vhkQKOY993Su8EN7ooguPpoFQIkaRxDeu772n5APURpXD1Ni2tFBTP4clixSme9DT '+four.name]]
|
167 |
+
preenchendo = ws.update(coord,valores)
|
168 |
+
st.experimental_rerun()
|
169 |
+
|
170 |
+
def Consultando():
|
171 |
+
st.dataframe(df)
|
172 |
+
|
173 |
+
campo = (st.text_input('Digite o ID ',placeholder=f'Ultimo Registro N° {len(df)-1}'))
|
174 |
+
if st.button('Pesquisar indice'):
|
175 |
+
a = int(campo)
|
176 |
+
print(len(df))
|
177 |
+
if a<(len(df)):
|
178 |
+
st.table(df.loc[a,:])
|
179 |
+
|
180 |
+
elif a>=len(df):
|
181 |
+
st.text('Não temos esse registro')
|
182 |
+
|
183 |
+
graphic = st.selectbox('Graficos',['--------','Grafico','Kanban','al'])
|
184 |
+
if graphic == 'Grafico':
|
185 |
+
unidade = df['Unidade'].value_counts()
|
186 |
+
new = pd.DataFrame(unidade)
|
187 |
+
new.columns = ['QTD de Envio por Unidade']
|
188 |
+
# unity.rename(columns={"count":"Unidade"},inplace=True)
|
189 |
+
st.header('Incidencia de dados por unidade')
|
190 |
+
|
191 |
+
st.bar_chart(new)
|
192 |
+
|
193 |
+
if graphic == "al":
|
194 |
+
print('oi')
|
195 |
+
brotas = df.loc[:,['Unidade','[FechamentoCaixa ] Quanto em dinheiro entrou no caixa?','[FechamentoCaixa ] Quanto foi gasto em dinheiro neste caixa?','[FechamentoCaixa ] Qual o saldo final em dinheiro no caixa?']]
|
196 |
+
|
197 |
+
st.table(brotas.value_counts)
|
198 |
+
|
199 |
+
|
200 |
+
|
201 |
+
|
202 |
+
|
203 |
+
def CaixaInit():
|
204 |
+
|
205 |
+
st.header('Fechamento caixa')
|
206 |
+
|
207 |
+
box = st.selectbox('Selecione uma fase',['---','Consulta','Conferencia','Pagamento Cartao'])
|
208 |
+
|
209 |
+
|
210 |
+
|
211 |
+
if "visibility" not in st.session_state:
|
212 |
+
st.session_state.visibility = "visivel"
|
213 |
+
|
214 |
+
|
215 |
+
if 'botao' not in st.session_state:
|
216 |
+
st.session_state.botao = False
|
217 |
+
|
218 |
+
if 'conferencia' not in st.session_state:
|
219 |
+
st.session_state.conferencia = False
|
220 |
+
|
221 |
+
if 'consulta' not in st.session_state:
|
222 |
+
st.session_state.consulta = False
|
223 |
+
|
224 |
+
|
225 |
+
|
226 |
+
if box =='Consulta':
|
227 |
+
st.text('Vamos iniciar uma consulta ao pipeline Fechmaneto Caixa')
|
228 |
+
if st.button('Consultar') or (st.session_state.consulta == True
|
229 |
+
):
|
230 |
+
st.session_state.consulta = True
|
231 |
+
Consultando()
|
232 |
+
|
233 |
+
if box =='Conferencia':
|
234 |
+
if st.button('Verificar se há conferencia: ') or (st.session_state.conferencia == True ):
|
235 |
+
st.session_state.conferencia = True
|
236 |
+
Verificar()
|
237 |
+
|
238 |
+
|
239 |
+
if box =='Pagamento Cartao':
|
240 |
+
if st.button('Verificar se há card na fase Pagamento Cartao: ') or st.session_state.botao == True:
|
241 |
+
st.session_state.botao = True
|
242 |
+
PgCartao()
|
243 |
+
#st.session_state é como se fosse um contador que não é alterado pela inicialização
|
244 |
+
|
245 |
+
if box =='---':
|
246 |
+
st.markdown('<hr></hr>',unsafe_allow_html=True)
|
247 |
+
st.markdown('<div class="container"></div>',unsafe_allow_html=True)
|
248 |
+
st.markdown('<style>' + open('style.css').read() + '</style>',unsafe_allow_html=True)
|
249 |
+
st.header('Kanban :orange[FECHAMENTO CAIXA]')
|
250 |
+
|
251 |
+
col1 , col2,col3 = st.tabs(['Conferencia','Pagamento em Cartão','Concluido'])
|
252 |
+
|
253 |
+
with col1:
|
254 |
+
st.header('Conferencia')
|
255 |
+
#if controlado tiver preenchido e [FechamentoCaixa ] Quantos Caixas foram abertos neste dia por esta secretária? tiver vazio esta nessa fase
|
256 |
+
st.text('Conferencia')
|
257 |
+
for control in range(len(df)):
|
258 |
+
if (df.loc[control,'[FechamentoCaixa ] Quantos Caixas foram abertos neste dia por esta secretária?']) == "":
|
259 |
+
#st.text(df.loc[control,'Nome'])
|
260 |
+
with st.expander(df.loc[control,'Nome']):
|
261 |
+
st.text(df.loc[control,'Unidade'])
|
262 |
+
|
263 |
+
|
264 |
+
with col2:
|
265 |
+
st.header('Pagamento em Cartão')
|
266 |
+
#if [FechamentoCaixa ] Confira no extrato da conta se o comprovante de depósito de dinheiro foi compensado devidamente. Foi? tiver preenchido e [FechamentoCaixa ] Qual o valor recebido em cartão por esta secretária? tiver vazio
|
267 |
+
st.text('Pagamento em Cartão')
|
268 |
+
for control in range(len(df)):
|
269 |
+
if (df.loc[control,'[FechamentoCaixa ] Confira no extrato da conta se o comprovante de depósito de dinheiro foi compensado devidamente. Foi?']) != "" and (df.loc[control,'[FechamentoCaixa ] O valor recebido em cartão por ambas as secretárias é igual ao valor total do relatório da máquina de cartão?']) == "":
|
270 |
+
#st.text(df.loc[control,'Nome'])
|
271 |
+
with st.expander(df.loc[control,'Nome']):
|
272 |
+
st.text(df.loc[control,'Unidade'])
|
273 |
+
|
274 |
+
with col3:
|
275 |
+
|
276 |
+
#if [FechamentoCaixa ] O valor recebido em cartão por ambas as secretárias é igual ao valor total do relatório da máquina de cartão? tiver preenchido
|
277 |
+
st.header('Concluido')
|
278 |
+
st.text('Concluido')
|
279 |
+
for control in range(len(df)):
|
280 |
+
if (df.loc[control,'[FechamentoCaixa ] O valor recebido em cartão por ambas as secretárias é igual ao valor total do relatório da máquina de cartão?']) != "":
|
281 |
+
#st.text(df.loc[control,'Nome'])
|
282 |
+
with st.expander(df.loc[control,'Nome']):
|
283 |
+
st.text(df.loc[control,'Unidade'])
|
284 |
+
|
285 |
+
|
286 |
+
'''
|
287 |
+
|
288 |
+
st.sidebar.header('Main menu')
|
289 |
+
sideBarSelect = st.sidebar.selectbox('SELECIONANDO O PIPELINE',['-------------','Fechamento de Caixa','Rotina Secretaria'])
|
290 |
+
|
291 |
+
if sideBarSelect == '-------------':
|
292 |
+
#st.header('Pagina Principal ')
|
293 |
+
st.markdown('<h1 class="h11">Ola usuario :)</h1> <br>',unsafe_allow_html=True)
|
294 |
+
st.text('site ainda em desenvolvimento')
|
295 |
+
st.markdown('<style>' + open('style.css').read() + '</style>', unsafe_allow_html=True)
|
296 |
+
|
297 |
+
|
298 |
+
if sideBarSelect == 'Fechamento de Caixa':
|
299 |
+
CaixaInit()
|
300 |
+
'''
|
chaveSheet.json
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"type": "service_account",
|
3 |
+
"project_id": "newlastsheet",
|
4 |
+
"private_key_id": "b9a58e8f80329c6979ffa3b83e3d80cd588dba3b",
|
5 |
+
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQD4DZuHWzaGpcmg\n6L2LAUXEf8v5hpso5sn/g6X8SJMeAYviC3xYkXG7UzhMsFekLhc22BkfwOqlTrQO\nOocbknV/u67rkwAH+gfZjo0SZaJmW2Egrx0MvockH31NL+1a4R2keHnewQIN9E+o\nLiPljFer/4qqDdPIitrWrsR3T9v87bjoskGXkGy09DUom8eNMspOhuBDNuGXUfn+\n95SxENQGsx79IDuSvghEU0F/8y9taNUEJrbhpqWjVi9wIvYTTRmEbDHN3eR4VjJc\nv/n5/+V6pyFQ4qV26qcJFmWh8QP6JZfrEjDTcn+QZUYv9XFEK/yHkhxlWH1tl2H7\nxdLdvsmrAgMBAAECggEAT3xIyLxtQgNRE2tRBYCAY0GSUqCUCqy9sM92OlvlLJnR\nQbttepIMsDqwET72rokIbk4b6uVuK0+HegG+NpMdbLNvD1TZDzVLG6dGxEzmF8eT\nXZ5PgDxzYJtokvnXJKZ7Ua87Wipd5qvRdLJoVU+97kMiI3Dv2tTH4EA7e4IPG8JN\n23XMDW8pf/TQ68JKsRSjg1kx1sFH8IehuKYRAWmA00eExzQS5UJgGuaZrkz33tx/\n7+PSWbr7n5ZA/ZUjgqBUj19jlkyfYiuzNIiXe7EKrbyI1vHUkgRHgqXDL/lSZPNQ\n5+iHCVliarZbYqJTtwM21UU0NlQeXEyQfQokcWqJZQKBgQD+HlQhjI2nJSedxkDm\n2AEi4FK3H+1M5MZTYV87OV8V8XFlOaLqLmmSh8WC9wvRx5uue2NMf2U5XlzLx9J1\nC7R7gQ0r1FPjbAkJYzX/bEkGlHKZscQOdO6l7K1qfkHDK7dmjaZOSuSW+9fSxCJP\nUotKYtYftI+Xk+Ot433xuc92rQKBgQD548hG84YY719bSSGC5+au6MklmOJ63/WM\nzjlvUAiO4RKMhey/Sdl7GlrLXbyLsrsLYcamLRDSi1NCr11rG8XaTainDbel5HHP\ntZM3+4kRUg+1WOI3wWiheUimB93Qrw5yX1kpVFUhJc0mRQVSSTcOvxYElVQTtfxS\nsamF5vdEtwKBgB4L7fyths49mWqRV3k0DyZVidI3RzKxVjXjrIPvK6wHiVXjs7ym\n0jrOLO9oUJB0XpcJ5drUsV5QJv69WMgYIzX7M1h8WZLpYkQm4+qYniXWBZrgpwLi\nlpkt2+9ckGAIWj4Y/5IATvj/PCyinj/szaV0/EZxbg0JIoGcBXdAdiRdAoGAI0j8\nsLgWSVMTneo3pypjsnMAZCSwZjVVkOpVxdgBPVueqOUIRwKAiRdxlqHHy9oS+0p1\nKGXYqEIwIYxtnoAvceHhXKVdNzmIsJGtFgyYkC+MNEk2uDTBN3vOvFMECUGOwqug\nBWv5EVMrIqpAVBwugBCPZVpIovfhhzO7AkNYywUCgYEAsIyLFuR0TZxBKpkxnf0C\nTk0+yS4By1hXu2pEIv8bM+Rht313OT3ojSzYYrXpuJsPIUmuSbdR91ga+iMpLdHU\npYp+7/hUqGJa0/w3tbSNpVWN39Z5ovCqIYQlkKFoxXMp0lak6YgFbzDQgYqI/U7J\nOKj6dMR+OTCgyolZtdHT3l4=\n-----END PRIVATE KEY-----\n",
|
6 |
+
"client_email": "sheetgooglelas@newlastsheet.iam.gserviceaccount.com",
|
7 |
+
"client_id": "111589441675645231089",
|
8 |
+
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
|
9 |
+
"token_uri": "https://oauth2.googleapis.com/token",
|
10 |
+
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
|
11 |
+
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/sheetgooglelas%40newlastsheet.iam.gserviceaccount.com",
|
12 |
+
"universe_domain": "googleapis.com"
|
13 |
+
}
|
codigos.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#codigos google drive pastas
|
2 |
+
|
3 |
+
CodeFechamentoCaixa = '1NaucQ1-vhkQKOY993Su8EN7ooguPpoFQIkaRxDeu772n5APURpXD1Ni2tFBTP4clixSme9DT'
|
4 |
+
|
5 |
+
CodePasta2 = '1bEKyLRa3wXgQ1MxHmEEYX9_kb74mWLld'
|
6 |
+
|
7 |
+
|
dados.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"pessoa": [
|
3 |
+
{ "nome": "Guilhereme","senha":"123", "id": "admin" },
|
4 |
+
{ "nome": "Daniel","senha":"123", "id": "admin" },
|
5 |
+
{ "nome": "Vitor","senha":"123", "id": "admin" }
|
6 |
+
]
|
7 |
+
}
|
database.py
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import _sqlite3 as sq
|
2 |
+
|
3 |
+
usuario = ''
|
4 |
+
def DataBaseConsulta(nome,senha):
|
5 |
+
conexao = sq.connect('usuarios.db')
|
6 |
+
cursor = conexao.cursor()
|
7 |
+
cursor.execute("SELECT * FROM Usuarios WHERE name=? AND senha=?",(nome,senha))
|
8 |
+
usuario = cursor.fetchone()
|
9 |
+
|
10 |
+
if usuario !='' and usuario!=None:
|
11 |
+
print('Logado com sucesso')
|
12 |
+
|
13 |
+
else:
|
14 |
+
print('Usuario nao existe')
|
15 |
+
|
16 |
+
return usuario
|
17 |
+
|
18 |
+
|
19 |
+
|
20 |
+
|
21 |
+
|
22 |
+
|
23 |
+
|
24 |
+
|
25 |
+
|
26 |
+
|
envios.py
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import json
|
2 |
+
import requests
|
3 |
+
import tempfile
|
4 |
+
|
5 |
+
|
6 |
+
def convertion(arquivo,nome,codeLocal):
|
7 |
+
#st.text(arquivo)
|
8 |
+
with tempfile.NamedTemporaryFile(delete=False) as temp_file:
|
9 |
+
temp_file.write(arquivo.read())
|
10 |
+
temp_file.seek(0)
|
11 |
+
temp_file_path = temp_file.name
|
12 |
+
#st.text(temp_file_path)
|
13 |
+
|
14 |
+
EnvioDrive(temp_file_path,nome,codeLocal)
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
def EnvioDrive(arquivo,nome,codeLocal):
|
19 |
+
|
20 |
+
|
21 |
+
headers = {"Authorization": "Bearer ya29.a0AfB_byCCV4qg-2G_UC-YLKIf1hAHYC1bvGnfWyoC0-rgeu0oIcr4sqWP55yQCum8F57QMydDMIOlsGo9hyPpeUhxJ3FfXj5epin5Urfx8yAVVIgBoGFXRUTbJvU6Gvsu7P_B8o7n0K9f99WuJWkLDQTtB1oEaCgYKAQMSARESFQHsvYls4ErYFpVlO_aOj0tzgW7pMA0163"}
|
22 |
+
para = {
|
23 |
+
"name": nome,
|
24 |
+
"parents":[codeLocal]
|
25 |
+
#["167kh3HWDdZ1nXSrjp0q2xLOv4kn55miodb02lQTGwSq2csCjE_XlTPIOmS6tSsFmxdMMv-oh"]
|
26 |
+
}
|
27 |
+
files = {
|
28 |
+
'data': ('metadata', json.dumps(para), 'application/json; charset=UTF-8'),
|
29 |
+
'file': open(arquivo, "rb")
|
30 |
+
}
|
31 |
+
r = requests.post(
|
32 |
+
"https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart",
|
33 |
+
headers=headers,
|
34 |
+
files=files
|
35 |
+
)
|
36 |
+
print(r.text)
|
37 |
+
|
38 |
+
|
39 |
+
|
40 |
+
|
41 |
+
''' if __name__ == '__main__':
|
42 |
+
print('oi guilherme')
|
43 |
+
|
44 |
+
|
45 |
+
EnvioDrive('./style.css','meuEstiloCSS','1NaucQ1-vhkQKOY993Su8EN7ooguPpoFQIkaRxDeu772n5APURpXD1Ni2tFBTP4clixSme9DT')
|
46 |
+
'''
|
login.py
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import time
|
3 |
+
import caixa
|
4 |
+
import database
|
5 |
+
if 'sessao' not in st.session_state:
|
6 |
+
st.session_state.sessao = False
|
7 |
+
|
8 |
+
if 'nomeUsu' not in st.session_state:
|
9 |
+
st.session_state.name = ''
|
10 |
+
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
+
def Login():
|
15 |
+
container = st.empty()
|
16 |
+
lout2 = st.container()
|
17 |
+
with container.container():
|
18 |
+
name = st.text_input('Name Usuario')
|
19 |
+
senha = st.text_input('Senha',type='password')
|
20 |
+
button = st.button('desabled')
|
21 |
+
if button:
|
22 |
+
returnDatabse = database.DataBaseConsulta(name,senha)
|
23 |
+
print(returnDatabse)
|
24 |
+
|
25 |
+
if returnDatabse!= '' and returnDatabse != None:
|
26 |
+
st.session_state.name = name
|
27 |
+
st.session_state.sessao = True
|
28 |
+
container.empty()
|
29 |
+
return returnDatabse
|
30 |
+
|
31 |
+
|
32 |
+
else:
|
33 |
+
st.error('Usuario Incorreto')
|
34 |
+
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
|
39 |
+
# vitor, gustavo, admin
|
40 |
+
|
41 |
+
def principal():
|
42 |
+
#st.text(turn)
|
43 |
+
permissao = st.session_state.turn[2]
|
44 |
+
st.sidebar.header('Main menu')
|
45 |
+
|
46 |
+
if permissao == 'admin':
|
47 |
+
sideBarSelect = st.sidebar.selectbox('SELECIONANDO O PIPELINE',['-------------','Fechamento de Caixa','Rotina Secretaria','Rotina Cirleide','Rotina Cobrança','Rotina Monitoria','Rotina Lider Pedagogico'])
|
48 |
+
|
49 |
+
elif permissao == 'gustavo':
|
50 |
+
sideBarSelect = st.sidebar.selectbox('SELECIONANDO O PIPELINE',['-------------','Fechamento de Caixa'])
|
51 |
+
|
52 |
+
elif permissao == 'vitor':
|
53 |
+
sideBarSelect = st.sidebar.selectbox('SELECIONANDO O PIPELINE',['-------------','Rotina Secretaria','Rotina Cirleide','Rotina Cobrança','Rotina Monitoria'])
|
54 |
+
|
55 |
+
|
56 |
+
if sideBarSelect == '-------------':
|
57 |
+
#st.header('Pagina Principal ')
|
58 |
+
st.markdown(f'<h1 class="h11">Ola {st.session_state.name} :)</h1> <br>',unsafe_allow_html=True)
|
59 |
+
st.text('site ainda em desenvolvimento')
|
60 |
+
st.markdown('<style>' + open('style.css').read() + '</style>', unsafe_allow_html=True)
|
61 |
+
|
62 |
+
|
63 |
+
if sideBarSelect == 'Fechamento de Caixa':
|
64 |
+
caixa.CaixaInit()
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
if st.session_state.sessao == False:
|
70 |
+
if 'turn' not in st.session_state:
|
71 |
+
st.session_state.turn = ''
|
72 |
+
st.session_state.turn = Login()
|
73 |
+
|
74 |
+
|
75 |
+
lout3 = st.empty()
|
76 |
+
if st.session_state.sessao == True:
|
77 |
+
with lout3.container():
|
78 |
+
principal()
|
requirements.txt
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
altair==5.0.1
|
2 |
+
antiorm==1.2.1
|
3 |
+
attrs==23.1.0
|
4 |
+
beautifulsoup4==4.12.2
|
5 |
+
blinker==1.6.2
|
6 |
+
cachetools==4.2.4
|
7 |
+
certifi==2023.5.7
|
8 |
+
charset-normalizer==3.2.0
|
9 |
+
click==8.1.4
|
10 |
+
colorama==0.4.6
|
11 |
+
dataclasses==0.6
|
12 |
+
db==0.1.1
|
13 |
+
db-sqlite3==0.0.1
|
14 |
+
decorator==5.1.1
|
15 |
+
gitdb==4.0.10
|
16 |
+
GitPython==3.1.32
|
17 |
+
google==3.0.0
|
18 |
+
google-api-core==1.34.0
|
19 |
+
google-api-python-client==2.93.0
|
20 |
+
google-auth==2.22.0
|
21 |
+
google-auth-httplib2==0.1.0
|
22 |
+
google-auth-oauthlib==1.0.0
|
23 |
+
google-drive==0.5.0
|
24 |
+
googleapis-common-protos==1.59.1
|
25 |
+
gspread==5.10.0
|
26 |
+
httplib2==0.22.0
|
27 |
+
idna==3.4
|
28 |
+
importlib-metadata==6.8.0
|
29 |
+
Jinja2==3.1.2
|
30 |
+
jsonschema==4.18.2
|
31 |
+
jsonschema-specifications==2023.6.1
|
32 |
+
markdown-it-py==3.0.0
|
33 |
+
MarkupSafe==2.1.3
|
34 |
+
mdurl==0.1.2
|
35 |
+
numpy==1.25.1
|
36 |
+
oauth2client==4.1.3
|
37 |
+
oauthlib==3.2.2
|
38 |
+
packaging==23.1
|
39 |
+
pandas==2.0.3
|
40 |
+
Pillow==9.5.0
|
41 |
+
protobuf==3.20.3
|
42 |
+
pyarrow==12.0.1
|
43 |
+
pyasn1==0.5.0
|
44 |
+
pyasn1-modules==0.3.0
|
45 |
+
pydeck==0.8.1b0
|
46 |
+
PyDrive==1.3.1
|
47 |
+
Pygments==2.15.1
|
48 |
+
Pympler==1.0.1
|
49 |
+
pyparsing==3.1.0
|
50 |
+
python-dateutil==2.8.2
|
51 |
+
pytz==2023.3
|
52 |
+
pytz-deprecation-shim==0.1.0.post0
|
53 |
+
PyYAML==6.0
|
54 |
+
referencing==0.29.1
|
55 |
+
requests==2.31.0
|
56 |
+
requests-oauthlib==1.3.1
|
57 |
+
rich==13.4.2
|
58 |
+
rpds-py==0.8.10
|
59 |
+
rsa==4.9
|
60 |
+
six==1.16.0
|
61 |
+
smmap==5.0.0
|
62 |
+
soupsieve==2.4.1
|
63 |
+
streamlit==1.24.1
|
64 |
+
tenacity==8.2.2
|
65 |
+
toml==0.10.2
|
66 |
+
toolz==0.12.0
|
67 |
+
tornado==6.3.2
|
68 |
+
typing_extensions==4.7.1
|
69 |
+
tzdata==2023.3
|
70 |
+
tzlocal==4.3.1
|
71 |
+
uritemplate==3.0.1
|
72 |
+
urllib3==1.26.16
|
73 |
+
validators==0.20.0
|
74 |
+
watchdog==3.0.0
|
75 |
+
zipp==3.16.0
|
style.css
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.h11{
|
2 |
+
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
|
3 |
+
text-align: center;
|
4 |
+
}
|
5 |
+
|
6 |
+
.container{
|
7 |
+
margin-top:10% ;
|
8 |
+
}
|
9 |
+
|
10 |
+
|
usuarios.db
ADDED
Binary file (8.19 kB). View file
|
|