function unReserve() {
const SPREADSHEET_ID = '';
const SHEET_NAME = 'Лист1';
const wareHouse = SpreadsheetApp.openById(SPREADSHEET_ID).getSheetByName(SHEET_NAME);
let values = wareHouse.getDataRange().getValues();
const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
let findingRange = sheet.getDataRange().getValues();
const chekBoxOff = false;
const color = '#ff0000';
let arrRowDel = []
findingRange.forEach(function (el, index) {
if (el[5] == chekBoxOff) {
let getA = el[0]
let getB = el[1]
let getI = findingRange[0][0]
sheet.getRange(index + 1, 6).setBackground(color)
values.forEach(function (elem, i) {
if (elem[0] == getA && elem[1] == getB && elem[8] == getI) {
let row = i + 1
arrRowDel.push(row)
}
})
}
})
arrRowDel = arrRowDel.reverse()
arrRowDel.forEach(function (el) {
wareHouse.deleteRow(el)
})
};
function setDateA7() {
const date = new Date()
const ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Лист1')
let valuesR = ss.getRange('R:R').getValues()
let start = 1
let row
valuesR.forEach(function (el, index) {
row = start + index
if (el == "Готово") {
let cell = 'A' + row
ss.getRange(cell).setValue(date)
}
})
}