-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pendentes
67 lines (44 loc) · 1.44 KB
/
Pendentes
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
function rotina(){
var motor = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var colunaInicial;
var validacao;
var linhaInicial;
colunaInicial = motor.getCurrentCell().getColumn();
linhaInicial = motor.getCurrentCell().getRow();
validacao = motor.getCurrentCell().isChecked();
if (colunaInicial == 17 && validacao == true){
statusAguarde();
transferirValores();
posicaoInicial(linhaInicial,colunaInicial);
concluir();
}
}
function transferirValores(){
var motor = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var valores = [];
var coluna = motor.getCurrentCell().getColumn();
var linha = motor.getCurrentCell().getRow();
for(coluna ; coluna > 0;coluna--){
valores[coluna] = motor.getRange(linha, coluna).getValue();
}
chamaMatriz();
guardarValores(valores);
chamaPendentes();
limparEmBranco(linha);
}
function guardarValores(valores){
var motor = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var coluna = 1;
var linha = motor.getLastRow();
while(coluna!=12){
if(coluna == 11){ //Caso a coluna seja 11 é inserido a data e hora atual.
valores[coluna] = motor.getRange(linha+1,coluna).setValue(new Date());
break;
}
motor.getRange(linha+1,coluna).setValue(valores[coluna]);
coluna = coluna+1;
}
}
function limparEmBranco(linha){
var motor = SpreadsheetApp.getActive().deleteRow(linha)
}