-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp_plastic.py
More file actions
213 lines (91 loc) · 3.66 KB
/
app_plastic.py
File metadata and controls
213 lines (91 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
#app plastic by fler
import os
import time
#------------- VARIABLES ---------------------------
opcion_menu_principal=""
opcion_menu_ventas="" # puede ser 1,2 o 3 como texto!!!!!!!!
nombre_producto=""
precio_producto=0
cantidad=0
es_mayorista= False # Por defecto NO es mayorista
total_pagar=0
#--------- variables estadísticas---------
cant_ventas=0 # contador de ventas
monto_total_ventas=0 # acumulador de ventas
cant_ventas_mayoristas=0 # contador de ventas mayoristas
monto_total_ventas_mayoristas=0 # acumulador ventas mayoristas
forma_pago=""
#------------- CÓDIGO PRINCIPAL ---------------------------
while True:
os.system("cls")
opcion_menu_principal= str(input('''
-------------- APP PLASTIC -----------------
1-- Realizar venta
2.- Ver estadísticas de ventas
3.- Salir
Elija opcion de menu: '''))
if opcion_menu_principal=="1":
os.system("cls")
print("------------ventas------------")
opcion_menu_ventas= str(input('''
Producto \t Valor Unitario
1.- Tazón \t $ 500
2.- Llavero \t $ 200
3.- Polera estampada \t $ 3.000
Elija opcion: '''))
cantidad= int(input("Ingrese cantidad: "))
if opcion_menu_ventas=="1":
nombre_producto="Tazón"
if cantidad>=100:
precio_producto=300
es_mayorista=True
else:
precio_producto=500
if opcion_menu_ventas=="2":
nombre_producto="LLavero"
if cantidad>=300:
precio_producto=150
es_mayorista=True
else:
precio_producto=200
if opcion_menu_ventas=="3":
nombre_producto="Polera estampada"
if cantidad>=50:
precio_producto=2000
es_mayorista=True
else:
precio_producto=3000
total_pagar= precio_producto*cantidad
print(f" TOTAL PAGAR ${total_pagar}")
if es_mayorista:
print(f'''
Si cancela en efectivo tiene un 10% descuento,
es decir, total ${total_pagar*0.9} ''')
forma_pago= str(input("¿Cancela en efectivo? S/N "))
if es_mayorista and forma_pago.upper()=="S":
total_pagar= total_pagar*0.9
#### carga de estadísticas ####
cant_ventas= cant_ventas+1
monto_total_ventas= monto_total_ventas+total_pagar
print(f'''
-------------- BOLETA -------------
Producto: {nombre_producto}
{cantidad} unidades X {precio_producto} c/u
${total_pagar}
''')
os.system("pause")
if opcion_menu_principal=="2":
os.system("cls")
print("------------estadísticas-----------")
print(f'''
Cant. ventas realizadas: {cant_ventas}
Monto total recaudado ${monto_total_ventas}
''')
os.system("pause")
if opcion_menu_principal=="3":
opcion = str(input('''
¿Estas seguro de salir? S/N ''')).upper()
if opcion=="S":
print("Saliendo de la app.....")
time.sleep(1.5) # delay de 1.5 seg
break