-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate.htm
116 lines (104 loc) · 4.57 KB
/
generate.htm
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body{
background-image: url("https://media.istockphoto.com/photos/shopping-cart-view-in-supermarket-aisle-with-product-shelves-abstract-picture-id838816102?k=6&m=838816102&s=612x612&w=0&h=uPCuplmaLnfDesOl422jsccqTHwDvnAh5L0ydxa3HRA=");
background-repeat: no-repeat;
background-attachment: fixed;
background-size: cover;
}
.div1{
height: 70px;
border: solid;
background-color: dimgrey;
}
.div3{
border-bottom:5px gray groove;
position: fixed;
width: 700px;
z-index: 8;
height: 45px;
bottom: 5px;
margin-left: 300px;
background-color: rgba(197, 197, 197, 0.712);
}
.div4{
height: 50px;
}
.btn4{
border: solid darkslategrey 3px;
border-bottom: none;
margin-left: 60px;
height: 45px;
width: 100px;
}
.btn4:hover{
background-color: dimgray;
}
.div2{
width: 400px;
min-height: 400px;
border: solid;
margin-left: 450px;
background-color: white;
}
td{text-align:center;}
</style>
</head>
<body><center>
<div class="div1"><h1>BILLING</h1></div> </center>
<div class="div2" id="div2">
<script>
let val= [[1,2,3,4],[1,2,3,4,5,6],[1,2,3,3],[1,2,3,3],[1,2,3,3],[1,2,3,3],[1,2,3,3],[1,2,3,3],[1,2,3,3],[1,2,3,3],[1,2,3,3],[1,2,3,3],[1,2,3,3],[1,2,3,3],[1,2,3,3]]
let a=val[0]
let p=val[1]
let v=val.slice(2)
document.write('---------------------------------------------------------------------------')
document.write('<center>Invoice<center>')
document.write('---------------------------------------------------------------------------')
document.write('<table style="width:400px;"><tr><th>Bill-id :'+a[0]+'</th>,<th>Date:'+a[3]+'</th></tr>')
document.write('<tr><th>Cust-Id :'+a[1]+'</th>,<th>Name:'+a[2]+'</th></tr></table>')
document.write('---------------------------------------------------------------------------')
document.write('<table style="width:400px;"><tr><th>Item ID</th><th>ITEM Name</th><th>Qnty</th><th>Price</th></tr>')
for(i in v){
document.write("<tr>")
document.write("<td>"+v[i][0]+"</td><td>"+v[i][1]+"</td><td>"+v[i][2]+"</td><td>"+v[i][3]+"</td>")
document.write("</tr>")
}
document.write('</table>')
document.write('---------------------------------------------------------------------------')
document.write('<table style="width:400px;"><tr><th>Items :'+a[0]+'</th><th>Qnty:'+a[3]+'</th><th>Subtotal:'+a[3]+'</th></tr></table>')
document.write('---------------------------------------------------------------------------')
document.write('<table style="width:400px;"><tr><th>CGST :'+a[0]+'</th><th>SGST:'+a[3]+'</th><th>Total:'+a[3]+'</th></tr></table>')
document.write()
document.write()
document.write()
</script>
</div>
<div class="div4"></div>
<div class="div3">
<form action="generate" method="post">
<button type="submit" class="btn4" name="status" value="0" formaction="bill">Back</button>
<button type="button" class="btn4" onclick="billprint()">Print</button>
<button type="submit" class="btn4" name="status" value="1">Send</button>
<button type="submit" class="btn4" name="status" value="2" formaction="bill">NewBill</button>
</form>
</div>
<script>
function billprint(){
var divContents = document.getElementById("div2").innerHTML;
var a = window.open('', '', 'height=400, width=400');
a.document.write('<html>');
a.document.write('<body >');
a.document.write(divContents);
a.document.write('</body></html>');
a.document.close();
a.print();
}
</script>
</body>
</html>