Skip to content

Instantly share code, notes, and snippets.


Piyush Goel goelp

View GitHub Profile
goelp / quickbooks_js_timezone.js
Last active Apr 11, 2018
Timezone conversion in Javascript for Quickbooks API
View quickbooks_js_timezone.js
/** Add hours to a given date object **/
Date.prototype.addHours = function(h) {
this.setTime(this.getTime() + (h*60*60*1000));
return this;
/** overall function to create QBO invoices **/
function generateInvoices(){
var invoiceDate = new Date();
goelp / pick_range.js
Created Mar 27, 2018
Google Apps Script functions to pick a range and populate in text field in sidebar
View pick_range.js
// Add the options to the custom menu
function onOpen() {
SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
.createMenu('Custom Menu')
.addItem('Show Settings', 'showSidebar')
// initiates the sidebar
function showSidebar() {
goelp / pick_range_sidebar.html
Last active May 1, 2020
Sidebar HTML code to show fields and buttons to select the range
View pick_range_sidebar.html
<!DOCTYPE html>
<base target="_top">
<link rel="stylesheet" href="">
<div class="sidebar branding-below">
<div class="block form-group">
<label for="names-range"><b>Comissions</b></label>
goelp / gas_qbo_oauth2.js
Last active Jul 3, 2022
Google Apps Script OAuth2 script for QuickBooks integration with Google Sheets
View gas_qbo_oauth2.js
var CLIENT_ID = '...'; // Get from Quickbooks Developer Console
var CLIENT_SECRET = '...'; // Get from Quickbooks Developer Console
var BASE_AUTH_URL = '';
var TOKEN_URL = '';
var API_SCOPE = '';
var REDIRECT_URI = '...'; // Generate using the logRedirectUri() function mentioned at the end of this script
var RESPONSE_TYPE = 'code';
* Authorizes and makes a request to the Quickbooks API using OAuth 2.