This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const html_get_4x=` | |
| <div id="div-4x" style="border: 1px solid; box-shadow: 5px 5px darkgrey;border-radius:.5rem;max-width:400px; background-color:white;display:none;margin:2rem;padding:1rem"> | |
| <div style="margin-bottom:1rem;font-size:1.5rem;font-weight:bold">Foreign Exchange</div> | |
| Convert this invoice to currency of the customer's country.<br><br>This requires a free API key from <a href="https://www.alphavantage.co/" target="_blank">Alpha Vantage</a>.<br><br> | |
| API Key: <input id="api-key-4x" size="10" /> <br><br><button onClick="jade_modules.invoice_complete_example.configure_4x()">Convert</button> | |
| </div>` | |
| const html_toggle_4x=` | |
| <div id="div-4x-toggle" style="border: 1px solid; box-shadow: 5px 5px darkgrey;border-radius:.5rem;max-width:400px; background-color:white;display:none;margin:2rem;padding:1rem"> | |
| <div style="margin-bottom:1rem;font-size:1.5rem;font-weight:bold">Foreign Exchange</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function auto_exec(){ | |
| Jade.open_automations(true, "Automations", [ | |
| {action:"Excel.run(make_pdf)", | |
| name:"Make a PDF", | |
| description:"Builds and downloads a PDF file"} | |
| ]) | |
| Jade.add_library('https://cdn.jsdelivr.net/npm/pdfmake@latest/build/pdfmake.min.js') | |
| Jade.add_library('https://cdn.jsdelivr.net/npm/pdfmake@latest/build/vfs_fonts.min.js') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class excel_tools{ | |
| static async array_to_table(sheet_name, address, range_data){ | |
| const start_row = excel_tools.row_from_address(address) | |
| const start_col = excel_tools.column_from_address(address) | |
| await Excel.run(async function(excel){ | |
| var sheet = excel.workbook.worksheets.getItemOrNullObject(sheet_name); | |
| await excel.sync() | |
| if (sheet.isNullObject) { | |
| sheet = excel.workbook.worksheets.add(sheet_name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jade.use("excel_tools") | |
| class dw_tools{ | |
| static async query(query, id, owner, token, sheet_name, address){ | |
| const url=`https://api.data.world/v0/sql/${owner}/${id}` | |
| const options={ | |
| headers: { | |
| 'Content-Type' : 'application/json', | |
| 'Authorization': 'Bearer ' + token, | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jade.use("excel_tools") | |
| class airtable_tools{ | |
| static async query(base_id, table, token, fields, filter_formula, sheet_name, address){ | |
| const data=await airtable_tools.get_airtable_data(base_id, token, table, filter_formula,fields) | |
| if(!fields){ | |
| fields=[] | |
| //fields were not specified so we must scan all the data to find the complete set of fields |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function dw_query(){ | |
| await jade.use("dw_tools") | |
| // specify the query | |
| const query='select * from episode limit 3' | |
| // information to access the right data set | |
| const token="YOUR READ/WRITE TOKEN GOES HERE" | |
| const id='simpsons' | |
| const owner='atlas-query' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function airtable_query(){ | |
| await jade.use("airtable_tools") | |
| // infomration about where to place data | |
| const sheet_name="MEMBER2" | |
| const address="b2" | |
| const token="YOUR API KEY GOES HERE"//https://airtable.com/account | |
| const base_id= "appACNRk6PmArvtj1" // replace with a base ID from https://airtable.com/api | |
| const table="member" // replace with your table name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function create_sheets(excel){ | |
| /*Jade.listing:{"name":"Create Worksheets","description":"Generate 10 sheets named for differnt kinds of apples"}*/ | |
| excel.workbook.worksheets.add("Evercrisp") | |
| excel.workbook.worksheets.add("Braeburn") | |
| excel.workbook.worksheets.add("Fuji") | |
| excel.workbook.worksheets.add("Honeycrisp") | |
| excel.workbook.worksheets.add("Ambrosia") | |
| excel.workbook.worksheets.add("Gala") | |
| excel.workbook.worksheets.add("Idared") | |
| excel.workbook.worksheets.add("Cameo") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const html_get_4x=` | |
| <div id="div-4x" style="border: 1px solid; box-shadow: 5px 5px darkgrey;border-radius:.5rem;max-width:400px; background-color:white;display:none;margin:2rem;padding:1rem"> | |
| <div style="margin-bottom:1rem;font-size:1.5rem;font-weight:bold">Foreign Exchange</div> | |
| Convert this invoice to currency of the customer's country.<br><br>This requires a free API key from <a href="https://www.alphavantage.co/" target="_blank">Alpha Vantage</a>.<br><br> | |
| API Key: <input id="api-key-4x" size="10" /> <br><br><button onClick="jade_modules.invoice_complete_example.configure_4x()">Convert</button> | |
| </div>` | |
| const html_toggle_4x=` | |
| <div id="div-4x-toggle" style="border: 1px solid; box-shadow: 5px 5px darkgrey;border-radius:.5rem;max-width:400px; background-color:white;display:none;margin:2rem;padding:1rem"> | |
| <div style="margin-bottom:1rem;font-size:1.5rem;font-weight:bold">Foreign Exchange</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*Make a worksheet with a name of "Invoice"*/ | |
| async function add_a_worksheet(excel) { | |
| // This example will fail if there is already a | |
| // worksheet named "Invoice" | |
| const sheet = excel.workbook.worksheets.add("Invoice") | |
| sheet.activate() | |
| await excel.sync(); | |
| } |
NewerOlder