Beruflich Dokumente
Kultur Dokumente
//
===================================================================================
=
// This script is customized to work with Tiller's Budget Dashboard Sheet Version
1.0.0
// No changes are required below.
//
// The script can be customized for other sheets by adjusting the settings below.
// Fill in this top section with your custom information
//
===================================================================================
=
// By default, the script will send an email to the owner of the sheet.
// But you can sent a custom email or multiple custom emails
//
// Default setting
// var customEmail = "none";
//
// Single email example
// var customEmail = "test@test.com";
//
// Multiple email example - each email address must be separated by commas
// var customEmail = "first@test.com,second@test.com";
// By default, the script uses the email subject "Tiller Budget Dashboard Email"
// But you can use any subject line you want
// Default setting
// var subject = "Tiller Budget Dashboard Email";
// You can set the alignment method for the cells in the email
// The default Budget sheet uses the custom alignment
//
// var alignment = "left"; puts all the columns aligned left
// var alignment = "right"; puts all the columns aligned right
// var alignment = "custom"; let's you set the set the alignment for each column
// If you set alignment to "custom", set a value [left or right or skip] for each
column in your sheet separated by a comma.
// The skip settings lets you skip a column so it won't display
// Make sure each column has a value or else it won't work
// This is the default setting for the Budget sheet
// var customAlign =
["skip","left","skip","right","right","right","skip","skip","right"];
var customAlign =
["skip","left","skip","right","right","right","skip","skip","right"];
// The email can display call rows and columns OR you can set the number of rows
and columns manually
// To display all rows and column, use
// var rowDisplay = "all";
// var columnDisplay = "all"
//
// To manually set the number of rows or columns, enter the number you want
// Don't use the letter for the column. Count the number of columns instead.
// If entering a number, you don't need quotes around it.
// The default settings for the Budget email are:
// var rowDisplay = "all";
// var columnDisplay = 9;
// ================================================================
// This ends the configuration section
// DO NOT make any changes below unless you know what you are doing
// ================================================================
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName(sheetName);
// this gets an array of font weights, normal or bold, for each cell
var weights = range.getFontWeights();
if (rowDisplay == 'all')
{ rowDisplay = range.getLastRow(); }
if (columnDisplay == 'all')
{ columnDisplay = range.getLastColumn(); }
var message = '';
// only display the custom message for the default budget tempalte
if (customBudgetSheet)
{
// this custom message is for the budget template
var customBudgetMessage = "<b>" + values[6][11] + "</b> needs Categorizing<br
/>\n" +
"<b>" + values[8][10] + "</b> are waiting for me to categorize.<br
/>\n" +
"Net Cash Flow: <b>" + values[14][11] + "</b><br />\n" +
values[16][10] + " " + values[17][10] +"<br />\n" +
values[18][10] + "<br />\n" +
"Expense Budget Remaining: <b>" + values[23][11] + "</b><br />\n" +
values[25][10] + "<br />\n" +
values[26][10] + "<br />\n";
if (customAlign[j] != 'skip')
{
message = message + "<td style='text-align: ";
if (alignment == 'custom')
{
message = message + customAlign[j];
}
else
{
message = message + alignment;
}
message = message + "; font-weight: " + weights[i][j] + ";'>" + values[i]
[j] + "</td>\n";
} // ends if no skip
} // ends the for loop for each column