-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscripterp.py
93 lines (74 loc) · 3.15 KB
/
scripterp.py
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
from minierp import *
while True:
print('Welcome to mini ERP\n')
if len(id_s)==0:
print("This is a fresh start of mini ERP, you need to transfer some current inventory data \n If no current inevtory needs to be transfered, juts open the ID's with value 0 \n")
m = input('Do you wish to continue? Y/N')
if m[0].lower() == 'y':
n = int(input("Please insert the no of articles you want to register: "))
if n > 0:
try:
initial_stock(n)
except:
print('Value needs to be greater than 0')
else:
if m[0].lower() == 'n':
savedata()
print('Application closed')
break
else:
print('What would you like to do next? \n\n-> Register a purchase -P- \n-> Issue a sale invoice -S- \n-> Vizualise stock inventory -I- \n-> Reports -R-')
x = input('Insert your choice or x to exit: ')
if x[0].lower == 'x':
savedata()
print('Application closed')
break
if x[0].lower() == 'p':
n = int(input("Please insert the no of articles you want to register: "))
if n > 0:
purch_invoice(n)
else:
m = input('Number needs to be >0! Do you wish to exit? (insert Y or N)')
if m[0].lower() == 'n':
n = int(input("Please insert the no of articles you want to register: "))
if n > 0:
purch_invoice(n)
else:
if m[0].lower == 'y':
break
elif x[0].lower() == 's':
n = int(input("Please insert the no of articles in the invoice: "))
if n > 0:
sales_invoice(n)
else:
m = input('Number needs to be >0! Do you wish to exit? (insert Y or N)')
if m[0].lower() == 'n':
n = int(input("Please insert the no of articles you invoice: "))
if n > 0:
sales_invoice(n)
else:
if m[0].lower == 'y':
break
elif x[0].lower() == 'i':
print("Do you want to interogate a single ID or the whole stock?")
nn = input("(Q - for single interogation) (W - for whole stock)")
if nn[0].lower() == 'q':
show_stock()
elif nn[0].lower() == 'w':
show_total_stock()
else:
print('Please select something from the above options')
elif x[0].lower() == 'r':
print("Chose report:")
nn = input("(P - for purchase report) (S - total sales report)")
if nn[0].lower() == 'p':
total_purchases_ids()
elif nn[0].lower() == 's':
total_sold_ids()
else:
print('Please select something from the above options')
else:
if x[0].lower() == 'x':
savedata()
print('Application closed')
break