-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnew1.js
37 lines (32 loc) · 1.53 KB
/
new1.js
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
// alert("hi");
function p(){
var details_list = document.getElementById("table_details");
for(let i=0 ; i < details_list.rows.length ; i++)
{
if(i == 0)
continue;
details_list.rows[i].cells[9].onclick = function(){
details_provider(details_list.rows[i]);
}
}
function details_provider(t){
needed_details = [t.cells[4].innerHTML,t.cells[6].innerHTML,t.cells[1].innerHTML,t.cells[2].innerHTML,t.cells[5].innerHTML,t.cells[7].innerHTML];
temp();
}
function temp(){
localStorage["i_n"] = "Invoice Number : " + needed_details[0];
localStorage["i_d"] = "Invoice Date : " + needed_details[1];
localStorage["p_n"] = "Phone Number : " + needed_details[2].slice(0,2) + "*****" + needed_details[2].slice(7,10);
localStorage["c_name"] = needed_details[3];
localStorage["repair"] = needed_details[4];
localStorage["ninty_seven_percent"] = "₹" + ((parseInt(needed_details[5].slice(0,needed_details[5].length-2))/100)*97).toFixed(2) + "/-";
localStorage["three_percent"] = "₹" + ((parseInt(needed_details[5].slice(0,needed_details[5].length-2))/100)*3).toFixed(2) + "/-";
localStorage["total_cost"] = "₹" + needed_details[5];
window.open("printpage.html", "_blank");
}
}
window.addEventListener("resize", applychanges);
function applychanges(){
table_height = document.getElementById("table_details").offsetHeight;
document.getElementsByClassName("page2_card_prepare")[0].style.height = table_height + 82 + "px";
}