-
Notifications
You must be signed in to change notification settings - Fork 2
/
bill_code
34 lines (32 loc) · 1.05 KB
/
bill_code
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
def bill_top(self):
invoice=int(time.strftime("%H%M%S"))+int(time.strftime("%d%m%Y"))
bill_top_temp=f'''
\t\tXYZ-Inventory
\t Phone No. 98725***** , Delhi-125001
{str("="*47)}
Customer Name: {self.var_cname.get()}
Ph no. :{self.var_contact.get()}
Bill No. {str(invoice)}\t\t\tDate: {str(time.strftime("%d/%m/%Y"))}
{str("="*47)}
Product Name\t\t\tQTY\tPrice
{str("="*47)}
'''
self.txt_bill_area.delete('1.0',END)
self.txt_bill_area.insert('1.0',bill_top_temp)
def bill_bottom(self):
bill_bottom_temp=f'''
{str("="*47)}
Bill Amount\t\t\t\tRs.{self.bill_amnt}
Discount\t\t\t\tRs.{self.discount}
Net Pay\t\t\t\tRs.{self.net_pay}
{str("="*47)}\n
'''
self.txt_bill_area.insert(END,bill_bottom_temp)
def bill_middle(self):
for row in self.cart_list:
pid,name,price,qty,stock
name=row[1]
qty=row[3]
price=float(row[2])*int(row[3])
price=str(price)
self.txt_bill_area.insert(END,"\n "+name+"\t\t\t"+qty+"\tRs."+price)