/google-sheets-cash-money-report

Google apps scripts - Spreadsheet for generating daily reports with input/output of cash transactions in companies.

Primary LanguageJavaScript

Cash money daily reports generator

The main purpose of this application is to facilitate recording and reporting cash money transactions. This application has three main functions:

  • importData - parse old-formatted spreadsheet reports, identify data categories and intercalate them with current working data;
  • cleanRawData - efficient algorithm for data type checking (with predefined field validators), automatic type conversion, duplicates removal and sorting data records;
  • renderReport - validate records and creates daily report sheets (using a customizable json mini-template) for archiving or printing.

Google Sheets apps script

Usage:

  • Open your Chromium based browser (Chrome)
  • Add you Google account (something like "Sign in to Chrome")
  • the next link is a template spreadsheet; open it in your browser: report-generator-template
  • make you own copy: File -> Make a copy
  • in you copy go to Extensions -> Apps Script (this will open a new tab "https://script.google.com/")
  • make sure you see your google email account in top-right of scripts page
  • to reveal "appsscript.json" go to Project Settings -> Check Show "appsscript.json" manifest file in editor ->
  • on the left you will see two files: "Code.js" and "appsscript.json"
  • replace content of Code.js with this_source_code and save it (Ctrl+S)
  • replace content of appsscript.json with this_source_code and save it (Ctrl+S)
  • reports will be sent to a specific spreadsheet, like Reports. Let't create it. Go to Google Sheets, create it, then copy it's id. A spreadsheet ID can be extracted from its URL. For example, the spreadsheet ID in the URL https://docs.google.com/spreadsheets/d/abc1234567/edit#gid=0 is "abc1234567".
  • paste this id in spreadsheet Copy of report-generator-template, sheet settings, column procedure.variable.value, row 2.
  • to run the script and generate reports, go to sheet Interface and click on that button (make sure you have selected a reasonable date range)
  • a pop-up "Authorization Required" might appear; click Continue -> chose your account -> Alert "This app isn't verified" -> Advanced -> Click Go to makeReport (unsafe) -> Allow
  • if all worked (no errors appeared) you should see your reports in Reports spreadsheet
  • done!

Development - debugging:

(
clasp login
# you will see `Default credentials saved to: ~/.clasprc.json (/home/user/.clasprc.json).`
git clone https://github.com/CosminEugenDinu/google-sheets-cash-money-report.git
cd google-sheets-cash-money-report/src
)
  • go to https://script.google.com/home and select the project
  • got to File -> Project Details -> Project Settings -> Script ID -> you will copy this and paste it after running next script
# Make sure you run this in src directory
(
read -p "Paste here your Script ID:" SCRIPT_ID
echo "{\"scriptId\":\"$SCRIPT_ID\"}" > .clasp.json && echo "File .clasp.json created!"
)
# Run this in src directory
# push local changes to google scripts
clasp push
  • testing:
cd test
npm install
node nodejs_test.js

Description

  • purpose
  • how to use
  • how it works

Interface sheet Reports