-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvendas.html
More file actions
55 lines (50 loc) · 2.03 KB
/
Copy pathvendas.html
File metadata and controls
55 lines (50 loc) · 2.03 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
<html>
<head>
<meta charset="utf-8">
<script type="text/javascript" src="js/tabletop/src/tabletop.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<link rel="stylesheet" href="css/sss.css">
<script type="text/javascript">
window.onload = function() {
init();
document.getElementById("dblink").href = getDBLink();
};
function init() {
Tabletop.init( { key: getDBLink(),
callback: showInfo,
simpleSheet: false } );
}
function showInfo(data) {
var total_elementos=0;
var total_valor = 0;
var html;
html = "<h3>Vendas Realizadas:</h3>";
for(var i=0; i< data.Vendas.elements.length; i++) {
var produto = buscaProduto(data.Produtos, data.Vendas.elements[i].CodigoProduto);
if (produto==null) {
continue;
}
html += boxProduto(produto);
total_elementos += parseInt(data.Vendas.elements[i].Quantidade);
var valor = converteMoedaFloat(data.Vendas.elements[i].ValorTotal);
total_valor += valor;
}
document.getElementById('vendas').innerHTML = html;
document.getElementById('TotalElementos').innerHTML = "Encontrados "+total_elementos+" itens nas vendas";
document.getElementById('TotalValor').innerHTML = "Somados R$"+total_valor+" em vendas";
}
</script>
</head>
<body class="index">
<div class="container">
<div class="pageTitle">
<div class="back"> <a href="index.html"> <p> Voltar </p> </a> </div>
<div class="print"> <a href="javascript:window.print()" > <img src="images/printer.png"> </a> </div>
<div class="title"> <center> <h1> Vendas </h1> </center> </div>
</div>
<p> <h6> <a id="dblink" href="#" target='_new'> Visualizar banco de dados </a></h6></p>
<div id="TotalElementos"> </div>
<div id="TotalValor"> </div>
<div id="vendas"> Carregando... </div>
</body>
</html>