home / fishbowl_archive

📥 Export to Excel (CSV) ⚙ Advanced filters

biscript

33 rows

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: dateLastModified, description, name, note, typeId, fbVersion, fbName, published, dateLastModified (date)

id ▼ active data dateLastModified description name note typeId fbVersion fbName published
1 _binary  <html lang="en"> <head> {% Template Default_Header %} </head> <body> <div class="overflowHidden" style="height: 90vh; width: 100%;"> <div id="headerContainer"> <h1 id="title"></h1> <h2 id="subTitle"></h2> <h3 id="description"></h3> </div> <div id="chartContainer"> <canvas id="myChart"></canvas> </div> </div> <script> {% Script Util %} {% Script MTD_Chart %} {% Script Print %} {% Script Show_Header %} </script> </body> </html> 2024-05-15 08:55:40.400000 Compares current fulfilled month to date revenue against last year MTD Chart   10 3 mtd-chart 1
2 _binary  const today = new Date(); var canvas = document.querySelector('canvas'); function createYearQuery(subtractYear) { let mm = (today.getMonth() + 1).toString().padStart(2, '0'); // January is 0! let timestamp = (today.getFullYear() - subtractYear) + '-' + mm + '-01 00:00:00'; return "SELECT DAY(PostSo.postDate) AS PostedDate, SUM(PostSoItem.totalPrice) AS TotalPrice " + "FROM PostSoItem " + "JOIN PostSo ON PostSo.id = PostSoItem.postSoId " + "JOIN SoItem ON PostSoItem.soItemId = SoItem.id AND SoItem.typeId <> 40 AND SoItem.statusID = 50 " + "WHERE postDate >= '" + timestamp + "' " + "AND postDate < DATE_ADD('" + timestamp + "', INTERVAL 1 MONTH) " + "GROUP BY CAST(PostSo.postDate AS DATE)"; } function createData(query) { const result = runQuery(query); return JSON.parse(result); } function createDataset(label, data, backgroundColor, borderColor) { return { label: label, fill: true, data: data, backgroundColor: backgroundColor, borderColor: borderColor, borderWidth: 2, pointRadius: 3, pointHoverRadius: 5, pointHitRadius: 7, lineTension: 0 }; } const data = []; data.push(createData(createYearQuery(1))); data.push(createData(createYearQuery(0))); console.log(data); let runningTotal = 0; const monthData = []; const labels = []; for (let year = 0; year < data.length; year++) { if(data[year].length != 0){ data[year] = data[year].reduce( (obj, day) => { obj[day.posteddate] = day.totalprice; return obj; }, {}); runningTotal = 0; let mData = []; let yearOffset = 1 if (year == 1) {yearOffset = 0} for (let day = 1; day <= new Date((today.getFullYear() - yearOffset), today.getMonth() + 1, 0).getDate(); day++) { if (labels.length < moment().daysInMonth()) { l… 2024-05-15 08:55:40.430000 Query and logic for the MTD Chart page MTD Chart   20 3 mtd-chart 0
3 _binary  <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.21.0/moment.min.js"></script> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels"></script> <style type="text/css"> {% Style Default_Style %} </style> 2023-01-05 17:28:06.927000 Default header that includes common library dependencies Default Header   40 2 fb-gadget-header 0
4 _binary  const UTIL = { "convertHex": function(hex,opacity) { hex = hex.replace('#',''); r = parseInt(hex.substring(0,2), 16); g = parseInt(hex.substring(2,4), 16); b = parseInt(hex.substring(4,6), 16); const result = 'rgba('+r+','+g+','+b+','+opacity/100+')'; return result; }, "dollarify": function (amount, decimalCount = 2, decimal = ".", thousands = ",") { decimalCount = Math.abs(decimalCount); decimalCount = isNaN(decimalCount) ? 2 : decimalCount; const negativeSign = amount < 0 ? "-" : ""; let i = parseInt(amount = Math.abs(Number(amount) || 0).toFixed(decimalCount)).toString(); let j = (i.length > 3) ? i.length % 3 : 0; return '$' + negativeSign + (j ? i.substr(0, j) + thousands : '') + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thousands) + (decimalCount ? decimal + Math.abs(amount - i).toFixed(decimalCount).slice(2) : ""); }, "uomify" : function(qty, uom){ return qty.toString() + " " + uom; }, "convertDate": function(date, isFromDate) { const parsed = new Date(Date.parse(date)); if (isFromDate) { return moment(parsed.setDate(parsed.getDate() + 1)).format('MM/DD/YYYY'); } return moment(parsed.setDate(parsed.getDate())).format('MM/DD/YYYY'); }, "makeTable": function (query, headersArray, dontShow = []) { var tr = "<tr style=\"border-bottom:2pt solid black;\" >"; // SET COLUMN HEADERS for (var h = 0; h < headersArray.length; h++) { tr += "<td>" + headersArray[h] + "</td>"; } //ADD ROW DATA FROM QUERY for (var i = 0; i < query.length; i++) { // ADD NEW ROW tr += "<tr>"; // PRINT COLUMN DATA FOR THIS ROW for (var j in query[i]) { // CHECK TO SEE IF IT IS IN DONT SHOW LIST if (dontShow.includes(j)) { … 2023-01-05 17:28:06.927000 Helper JavaScript functions for manipulating data Util   20 3 fb-util 0
5 _binary  var mediaQueryList = window.matchMedia('print'); mediaQueryList.onchange= function(mql) { if(mql.matches) { beforePrintHandler(); } }; function beforePrintHandler() { for (var id in Chart.instances) { Chart.instances[id].resize(); } } 2023-01-05 17:28:06.927000 Allows the charts to fit the page when printing Print   20 1 fb-printing 0
6 _binary  {% Style Print_Landscape %} body { font-family: Roboto; color: #888; margin: 0; padding: 0; } .overflowHidden { overflow: hidden; } #chartContainer { position: relative; height: 85%; width: 100vw; padding-top: 20px; } @media (max-height: 450px){ #chartContainer { height: 75%; } } @media (max-height: 300px){ #chartContainer { height: 70%; } } h1, h2, h3 { margin: 2px; font-size: 16px; } #title { font-size: 24px; color: #666; } #headerContainer { text-align: center; } #button { background-color: #449D44; border-radius: 10%; border: 1px solid green; color: white; text-align: center; text-decoration: none; display: inline-block; font-size: 14px; visibility: hidden; position: absolute; top: 5; left: 5; z-index: 1; } 2023-01-05 17:28:06.943000 Default style settings for the pages Default Style   30 2 fb-template-style 0
7 _binary  const COLORS = { "blue": "rgb(0,0,255)", "red": "rgb(255,0,0)", "green": "rgb(0,255,0)", "colors": ["#673AB7", "#2196F3", "#E91E63", "#F44336", "#009688", "#4CAF50", "#FFC107", "#795548"], "get": function(num) { const full = []; const half = []; for (let i = 0; i < num; i++) { full.push(UTIL.convertHex(this.colors[i%this.colors.length], 100)); half.push(UTIL.convertHex(this.colors[i%this.colors.length], 50)); } return { "fullAlpha": full, "halfAlpha": half }; } }; 2023-01-05 17:28:06.943000 Set of default colors Colors   20 1 fb-colors 0
8 _binary  /** * [Chart.PieceLabel.js]{@link https://github.com/emn178/Chart.PieceLabel.js} * * @version 0.9.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2017 * @license MIT */ (function(){function c(){this.drawDataset=this.drawDataset.bind(this)}"undefined"===typeof Chart?console.warn("Can not find Chart object."):(c.prototype.beforeDatasetsUpdate=function(a){if(this.parseOptions(a)&&"outside"===this.position){var b=1.5*this.fontSize+2;a.chartArea.top+=b;a.chartArea.bottom-=b}},c.prototype.afterDatasetsDraw=function(a){this.parseOptions(a)&&(this.labelBounds=[],a.config.data.datasets.forEach(this.drawDataset))},c.prototype.drawDataset=function(a){for(var b=this.ctx,p=this.chartInstance, l=a._meta[Object.keys(a._meta)[0]],h=0,f=0;f<l.data.length;f++){var g=l.data[f],d=g._view;if(0!==d.circumference||this.showZero){switch(this.render){case "value":var e=a.data[f];this.format&&(e=this.format(e));e=e.toString();break;case "label":e=p.config.data.labels[f];break;case "image":e=this.images[f]?this.loadImage(this.images[f]):"";break;default:var q=d.circumference/this.options.circumference*100;q=parseFloat(q.toFixed(this.precision));this.showActualPercentages||(h+=q,100<h&&(q-=h-100,q=parseFloat(q.toFixed(this.precision)))); e=q+"%"}"function"===typeof this.render&&(e=this.render({label:p.config.data.labels[f],value:a.data[f],percentage:q,dataset:a,index:f}),"object"===typeof e&&(e=this.loadImage(e)));if(!e)break;b.save();b.beginPath();b.font=Chart.helpers.fontString(this.fontSize,this.fontStyle,this.fontFamily);if("outside"===this.position||"border"===this.position&&"pie"===p.config.type){var k=d.outerRadius/2;var c,m=this.fontSize+2;var n=d.startAngle+(d.endAngle-d.startAngle)/2;"border"===this.position?c=(d.outerRadius- k)/2+k:"outside"===this.position&&(c=d.outerRadius-k+k+m);n={x:d.x+Math.cos(n)*c,y:d.y+Math.sin(n)*c};if("outside"===this.position){n.x=n.x<d.x?n.x-m:n.x+m;var r=d.outerRadius+m}}else k=d.innerRadius,n=g.tooltipPosition();m=this.fontColor;"function"===typeof m?m=m({… 2023-01-05 17:28:06.943000 Chart js plugin to show labels on the chart Chart Piece Label   20 1 chart-piece-label 0
9 _binary  <html lang="en"> <head> {% Template Default_Header %} </head> <body> <div style="position: relative; width: 100%; height: 90%;"> <button id="button">back</button> <div id="headerContainer"> <h1 id="title"></h1> <h2 id="subTitle"></h2> <h3 id="description"></h3> </div> <div id="regions_div" style="position: relative; width: 100%; height: 90%; padding-top: 20px;"></div> </div> <script> {% Script Util %} {% Script Colors %} {% Script Chart_Piece_Label %} {% Script Sales_By_Region %} {% Script Print %} {% Script Show_Header %} </script> </body> </html> 2023-01-05 17:28:06.943000 Map that displays revenue by region Sales By Region Default Location Syntax: United States: US California: US-CA Utah: US-UT Australia: AU New South Wales, AU: AU-NSW 10 3 sales-by-region 1
10 _binary  google.charts.load('current', { 'packages': ['geochart'], 'mapsApiKey': 'AIzaSyBZsbr4RQBre8LIOeEN9P-qlmiKGSi95aU' }); const dateRange = $RANGE{Date_Range|This year-to-date}; let defaultDrillDown = { region: "$TEXT{Default_Location|Global}" }; let dateStr = UTIL.convertDate(dateRange.fromDate, true) + " - " + UTIL.convertDate(dateRange.toDate, false); if (moment(dateRange.fromDate).isSame('1000-01-01', 'year') && moment(dateRange.toDate).isSame('3000-01-01', 'year')) { dateStr = 'All'; } const VIEW = { world: "world", country: "country", province: "province" }; let currentView = VIEW.world; let previousCountry; google.charts.setOnLoadCallback(drawWorldMap); const btnBack = document.getElementById('button'); const subTitleHTML = document.getElementById('subTitle'); const titleHTML = document.getElementById('title'); const descriptionHTML = document.getElementById('description'); btnBack.addEventListener("click", btnBackEvent); let chart; let currentData = {}; let subTitle = 'Global'; let worldData; let countryData; let countryOptions = { legend: { textStyle: { fontSize: 16 }, numberFormat: '¤#,##0.00' }, resolution: "provinces", keepAspectRatio: true, width: '100%', height: '100%' }; function getWorldData() { let worldFbData = JSON.parse(runQuery("SELECT SUM(postSoItem.totalPrice) AS totalPrice, abbreviation FROM postSoItem " + "JOIN soItem ON postSoItem.soItemId = soItem.id " + "JOIN so ON so.id = soItem.soId AND soItem.statusID = 50 AND soItem.typeId <> 40 " + "JOIN CountryConst ON so.billToCountryId = CountryConst.id " + "JOIN postso ON postso.id = postsoitem.postsoid " + "WHERE postSoItem.totalPrice > 0 AND postSo.postDate >= '" + dateRange.fromDate + "' AND postSo.postDate <= '" + dateRange.toDate + "' " + "GROUP BY CountryConst.id")); let worldData = [ ['Country', 'Revenue', { type: 'string', role: 'tooltip' }] ]; for (let i = 0; i < w… 2023-01-05 17:28:06.959000 Query and logic for the Sales By Region page Sales By Region   20 3 sales-by-region 0
11 _binary  <html lang="en"> <head> {% Template Default_Header %} </head> <body> <div class="overflowHidden" style="position: relative; height: 100%; width: 95vw;"> <div id="headerContainer"> <h1 id="title"></h1> <h2 id="subTitle"></h2> <h3 id="description"></h3> </div> <div id="chartContainer"> <canvas id="topSalesman"></canvas> </div> </div> <script> {% Script Util %} {% Script Colors %} {% Script Chart_Piece_Label %} {% Script Sales_By_Rep %} {% Script Print %} {% Script Show_Header %} </script> </body> </html> 2023-01-05 17:28:06.959000 Compares fulfilled revenue by rep Sales By Rep   10 5 sales-by-rep 1
12 _binary  const dateRange = $RANGE{Date_Range|this month}; const includeReturns = $CHECK{IncludeReturns|false}; const includeDiscounts = $CHECK{IncludeDiscounts|false}; const query = `SELECT so.salesman, SUM(postSoItem.totalPrice) AS totalPrice FROM postSoItem JOIN soItem ON postSoItem.soItemId = soitem.id AND soItem.typeId <> 40 AND soItem.qtyfulfilled > 0 JOIN so ON soItem.soId = so.id JOIN postSo ON postSo.Id = postsoitem.postsoid WHERE postSo.postDate between '${dateRange.fromDate}' AND '${dateRange.toDate}' AND IF(${includeReturns} = 1,1=1,soitem.typeid NOT IN (20,21)) AND IF(${includeDiscounts} = 1,1=1,soitem.typeid NOT IN (30,31)) GROUP BY so.salesmanId ORDER BY totalPrice DESC`; const data = JSON.parse(runQuery(query)); console.log(query); console.log(data); let dateStr = UTIL.convertDate(dateRange.fromDate, true) + " - " + UTIL.convertDate(dateRange.toDate, false); if (moment(dateRange.fromDate).isSame('1000-01-01', 'year') && moment(dateRange.toDate).isSame('3000-01-01', 'year')) { dateStr = 'All'; } function createBar(totalPrice, tableColors){ return { backgroundColor: tableColors.halfAlpha, borderColor: tableColors.fullAlpha, borderWidth: 3, data: totalPrice, }; } const barLabels = []; const barTotalPrices = []; let barTotalPriceOverall = 0; const chartData = []; for (let salesman = 0; salesman < data.length; salesman++) { barLabels.push(data[salesman].salesman); barTotalPrices.push(data[salesman].totalprice); barTotalPriceOverall += barTotalPrices[salesman]; } let tableColors = COLORS.get(data.length); chartData.push(createBar(barTotalPrices, tableColors)); const barChartData = { labels: barLabels, datasets: chartData } const barOptions = { title: { display: true, padding: 3 }, mode: 'index', position: 'cursor', intersect: false, legend: { display: false, }, scales: { xAxes: [{ … 2023-01-05 17:28:06.974000 Query and logic for the Sales By Rep page Sales By Rep   20 5 sales-by-rep 0
13 _binary  <html lang="en"> <head> {% Template Default_Header %} </head> <body> <div class="overflowHidden" style="position: relative; height: 100%; width: 100%"> <div id="headerContainer"> <h1 id="title"></h1> <h2 id="subTitle"></h2> <h3 id="description"></h3> </div> <div id="chartContainer"> <canvas id="topSalesman"></canvas> </div> </div> <script> {% Script Util %} {% Script Colors %} {% Script Chart_Piece_Label %} {% Script Sales_Goal %} {% Script Print %} {% Script Show_Header %} </script> </body> </html> 2023-01-05 17:28:06.974000 Shows progress towards revenue goal Sales Goal Chart   10 3 sales-goal 1
14 _binary  const dateRange = $RANGE{Date_Range|this month}; const currentSalesColor = '$COLOR{Current_Sales_Color|#33D566}'; let goal = "$MONEY{Goal}"; goal = Number(goal.replace(/[^0-9\.-]+/g,"")); let rep = "$USER{Rep|%}"; if (rep != "%"){ rep = parseInt(rep); } if (rep == -1) { rep = "%"; } const data = JSON.parse(runQuery("SELECT sysuser.firstName, sysuser.lastName, DAY(PostSo.postDate) AS PostedDate, SUM(PostSoItem.totalPrice) AS TotalPrice " + "FROM PostSoItem " + "JOIN PostSo ON PostSo.id = PostSoItem.postSoId " + "JOIN SoItem ON PostSoItem.soItemId = SoItem.id AND SoItem.typeId <> 40 " + "JOIN so ON so.id = soitem.soId " + "JOIN sysuser ON so.salesmanId = sysuser.id " + "WHERE postDate >= '" + dateRange.fromDate + "' " + "AND postDate <= '" + dateRange.toDate + "' " + "AND salesmanId LIKE '" + rep + "' " + "GROUP BY CAST(PostSo.postDate AS DATE), sysuser.firstName, sysuser.lastName")); const doughnutLabels = ["Current Sales","Remaining Goal"]; const doughnutDatasets = []; const allSales = [] let totalSales = 0; for (let i = 0; i < data.length; i++) { totalSales += data[i].totalprice; } const goalSales = totalSales; let remainingGoal = goal - goalSales; remainingGoal = remainingGoal < 0 ? 0 : remainingGoal; allSales.push(goalSales); allSales.push(remainingGoal); doughnutDatasets.push(createDoughnut(allSales, [UTIL.convertHex(currentSalesColor,100),'rgba(0,0,0,0)'],[UTIL.convertHex(currentSalesColor,50),UTIL.convertHex(currentSalesColor,50)])); let dateStr = UTIL.convertDate(dateRange.fromDate, true) + " - " + UTIL.convertDate(dateRange.toDate, false); if (moment(dateRange.fromDate).isSame('1000-01-01', 'year') && moment(dateRange.toDate).isSame('3000-01-01', 'year')) { dateStr = 'All'; } const doughnutData = { labels: doughnutLabels, datasets: doughnutDatasets }; const doughnutOptions = { tooltips: { callbacks: { label: function (tooltipItem, data) { retu… 2023-01-05 17:28:06.990000 Query and logic for the Sales Goal page Sales Goal   20 3 sales-goal 0
15 _binary  <html lang="en"> <head> {% Template Default_Header %} </head> <body> <div class="overflowHidden" style="position: relative; height: 100%; width: 95vw;"> <div id="headerContainer"> <h1 id="title"></h1> <h2 id="subTitle"></h2> <h3 id="description"></h3> </div> <div id="chartContainer"> <canvas id="productChart"></canvas> </div> </div> <script> {% Script Util %} {% Script Colors %} {% Script Chart_Piece_Label %} {% Script Top_Products %} {% Script Print %} {% Script Show_Header %} </script> </body> </html> 2023-01-05 17:28:06.990000 Shows the top products by revenue Top Products Chart   10 4 top-products 1
16 _binary  const numOfProd = $NUM{Number_of_products|5}; const dateRange = $RANGE{Date_Range|this year}; const chartOption = "$LIST{Chart_Type|^bar,pie}"; const displayLegend = $CHECK{Display_pie_legend|true}; const displayMiscSale = $CHECK{Display_Misc_Sales_Items|false}; let miscSale = "AND soItem.typeId <> 11 " if (displayMiscSale == true) { miscSale = " "; } else { miscSale = "AND soItem.typeId <> 11 " } const data = JSON.parse(runQuery("SELECT soItem.productNum, SUM(postSoItem.totalPrice) AS totalPrice from postSoItem " + "JOIN soItem ON postSoItem.soItemId = soItem.id AND soItem.typeId <> 40 " + "WHERE statusId <> 40 AND dateLastFulfillment >= '" + dateRange.fromDate + "' AND dateLastFulfillment <= '" + dateRange.toDate + "' " + miscSale + "GROUP BY productNum " + "ORDER BY totalPrice " + "DESC LIMIT " + numOfProd)); const other = JSON.parse(runQuery("SELECT SUM(totalPrice) AS totalPrice " + "FROM (SELECT SUM(postSoItem.totalPrice) AS totalPrice " + "FROM postSoItem " + "JOIN soItem ON postSoItem.soItemId = soItem.id AND soItem.typeId <> 40 AND soItem.statusId = 50 " + "JOIN postSo ON postSo.soId = soItem.soId " + "WHERE postSo.postDate >= '" + dateRange.fromDate + "' AND postSo.postDate <= '" + dateRange.toDate + "' " + "GROUP BY productNum " + "ORDER BY totalPrice DESC " + "LIMIT " + numOfProd + ", 18446744073709551615) AS subQuery")); //This offset is MySQL Infitity. See https://dev.mysql.com/doc/refman/5.7/en/select.html#id4651990 let dateStr = UTIL.convertDate(dateRange.fromDate, true) + " - " + UTIL.convertDate(dateRange.toDate, false); if (moment(dateRange.fromDate).isSame('1000-01-01', 'year') && moment(dateRange.toDate).isSame('3000-01-01', 'year')) { dateStr = 'All'; } function createBar(totalPrice, tableColors){ return { backgroundColor: tableColors.halfAlpha, borderColor: tableColors.fullAlpha, borderWidth: 3, data: totalPrice, }; } … 2023-01-05 17:28:07.005000 Query and logic for the Top Products page Top Products   20 4 top-products 0
17 _binary  const displayHeader = $CHECK{Display_header|true}; let headerContainer = document.getElementById('headerContainer'); displayHeader ? headerContainer.style.display = 'block' : headerContainer.style.display = 'none'; 2023-01-05 17:28:07.005000 Logic to hide or display the page header Show Header   20 1 show-header 0
18 _binary  <!DOCTYPE html> <html> <head> <meta charset='utf-8' /> {% Template Bootstrap_Dependencies %} <link href='/releases/fullcalendar/3.9.0/fullcalendar.min.css' rel='stylesheet' /> <link href='/releases/fullcalendar/3.9.0/fullcalendar.print.css' rel='stylesheet' media='print' /> <script src='/assets/demo-to-codepen.js'></script> <style> html, body { margin: 0; padding: 0; font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif; font-size: 14px; } #calendar { max-width: 900px; margin: 40px auto; } {% Style Calendar_Styling %} {% Style Print_Landscape %} </style> <script> {% Script Capacity_Planning %} </script> </head> <div id='calendar'></div> </body> </html> 2023-01-05 17:28:07.005000 A report that displays your scheduled work orders and your total time scheduled per day. Also allows you to reschedule those Work Orders to manage your schedule. Capacity Planning Report   10 3 capacity-planning 1
19 _binary  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.1/moment.js"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.10.1/bootstrap-table.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.10.1/bootstrap-table.min.js"></script> <!-- JQUERY UI --> <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js" integrity="sha256-T0Vest3yCU7pafRw9r+settMBX6JkKN06dqBnpQ8d30=" crossorigin="anonymous"></script> <!-- Calendar Plugin --> <script src="https://cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.9.0/fullcalendar.min.js"></script> 2023-01-05 17:28:07.021000 The necessary includes for bootstrap tables Bootstrap Dependencies   40 3 capacity-planning 0
20 _binary  /*! * FullCalendar v3.9.0 * Docs & License: https://fullcalendar.io/ * (c) 2018 Adam Shaw */ .fc { direction: ltr; text-align: left; } input[type=number]{ width: 33px; border: none; border-color: transparent; background: #f7f5ed; } .fc-rtl { text-align: right; } body .fc { /* extra precedence to overcome jqui */ font-size: 1em; } /* Colors --------------------------------------------------------------------------------------------------*/ .fc-highlight { /* when user is selecting cells */ background: #bce8f1; opacity: .3; } .fc-bgevent { /* default look for background events */ background: #8fdf82; opacity: .3; } .fc-nonbusiness { /* default look for non-business-hours areas */ /* will inherit .fc-bgevent's styles */ background: #d7d7d7; } /* Buttons (styled <button> tags, normalized to work cross-browser) --------------------------------------------------------------------------------------------------*/ .fc button { /* force height to include the border and padding */ -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; /* dimensions */ margin: 0; height: 2.1em; padding: 0 .6em; /* text & cursor */ font-size: 1em; /* normalize */ white-space: nowrap; cursor: pointer; } /* Firefox has an annoying inner border */ .fc button::-moz-focus-inner { margin: 0; padding: 0; } .fc-state-default { /* non-theme */ border: 1px solid; } .fc-state-default.fc-corner-left { /* non-theme */ border-top-left-radius: 4px; border-bottom-left-radius: 4px; } .fc-state-default.fc-corner-right { /* non-theme */ border-top-right-radius: 4px; bord… 2023-01-05 17:28:07.021000 Full Calendar Styling Sheet Calendar Styling   30 3 capacity-planning 0
21 _binary  {% Script Util %} //Filter Variables var dailyCapacityParam = $NUM{Daily_Capacity}; var parameterCatName = "$TEXT{Calendar_Category|%}"; parameterCatName = "\'" + parameterCatName.toUpperCase() + "\'"; console.log("CatName = " + parameterCatName); var defaultView, parameterDefaultView = "$LIST{Default_View|^Week,Month,Day}"; switch (parameterDefaultView) { case "Month": defaultView = "month"; break; case "Week": defaultView = "agendaWeek"; break; case "Day": defaultView = "agendaDay"; break; } var DailyCapacities = {}; var calendarDate = moment("$DATE{Date|Today}"); // CHANGE WOITEM DATE SCHEDULED API CALL function updateWOItem(event, view) { let eventStart = moment(event.start).format('YYYY-MM-DD[T]HH:mm:ss'); let eventEnd = moment(event.end).format('YYYY-MM-DD[T]HH:mm:ss'); if (eventStart == null) { return "No Start Date Found"; } console.log("\r\nEvent Start = " + eventStart + " Event End = " + eventEnd); let WONum = {GetWorkOrderRq: {WorkOrderNumber: event.wonum}}; console.log("\r\nEvent WO Num = " + WONum); let WOAPIObject = JSON.parse(runApiRequest('GetWorkOrderRq', JSON.stringify(WONum))); if (WOAPIObject.statusCode == 1001) { console.log("\r\nUnable to parse API request. WO Num = " + WONum); return WOAPIObject; } else { let WO = WOAPIObject.GetWorkOrderRs.WO; // CHECK TO SEE IF THE EVENT HAS AN END DATE if (!moment(event.end).isValid()) { // CHANGE EACH WO ITEM DATE SCHEDULED for (i = 0; i < WO.WOItems; i++) { WO.WOItems[i].DateScheduled = eventStart; } // CHANGE WO DATE SCHEDULED/DATE SCHEDULED TO START console.log("Event end was null"); WO.DateScheduled = eventStart; WO.DateScheduledToStart = eventStart; } else { console.log("Event end was not null"); … 2023-01-05 17:28:07.021000 The script for the capacity planning BisKit Capacity Planning   20 3 capacity-planning 0
22 _binary  <head> <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha256-pasqAKBDmFT4eHoN2ndd6lN370kFiGUFyTiUHWhU7k8=" crossorigin="anonymous" ></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script> <style> {% Style Category_Capacity_Planning %} </style> </head> <body> <div id="button-header" class="wrapper"> <button id="prev-button" class="previous button">Prev</button> <button id="next-button" class="next button">Next</button> </div> <div id="table-wrapper" class="wrapper"> <table id="schedule-table" class="table table-bordered"></table> </div> </body> <script> {% Script Category_Capacity_Planning %} </script> 2023-01-05 17:28:07.037000 Capacity planning separated out by calendar category Category Capacity Planning   10 1 category-capacity-planning 1
23 _binary  :root { --light: 80; --threshold: 60; --border-threshold: 80; } td.day:not(.busy) { padding-bottom: 40px !important; } td { padding: 8px !important; } div.event { min-height: 40px; margin-left: 5px; margin-right: 5px; padding: 8px; --switch: calc((var(--light) - var(--threshold)) * -100%); color: hsl(0, 0%, var(--switch)); --border-light: calc(var(--light) * 0.7%); --border-alpha: calc((var(--light) - var(--border-threshold)) * 10); border: 0.1em solid hsla( var(--hue), calc(var(--sat) * 1%), var(--border-light), var(--border-alpha) ); } div.event-wrapper { padding: 8px; } td.bg-danger { color: white !important; } div.capacity { border-bottom: 1px solid black; } div.wrapper { overflow: auto; width: 100%; } div.capacity-modal { position: absolute; display: none; width: 150px; height: fit-content; padding: 8px; text-align: right; } .dropdown-content { position: relative; right: 0; background-color: #f1f1f1; box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); z-index: 9999; } .capacity-input { width: 40px; } .resizer { width: 5px; min-height: 40px; height: 100%; background: transparent; position: relative; display: inline-block; } .resizer.left { float: left; cursor: w-resize; /*resizer cursor*/ } .resizer.right { float: right; cursor: e-resize; } #button-header { margin-bottom: 10px; text-align: right; } body { margin: 15px; font-family: 'Open Sans', sans-serif; } thead { background-color: #eaeaea; } .capacity-button { display: flex; } 2023-01-05 17:28:07.037000 Capacity planning separated out by calendar category Category Capacity Planning   30 1 category-capacity-planning 0
24 _binary  let capacities; const daysInWeek = 7; const tableId = 'schedule-table'; const HeaderDateFormat = 'dddd MMM-D'; const NameOfResource = 'Machine'; let currentViewWeek = moment().startOf('day'); let getEventData = (momentDate) => { console.groupCollapsed('getEventData'); let queryDate = moment(momentDate); const QUERY = `SELECT CONCAT('WO#:',wo.num) AS eventName, wo.num AS eventNameRaw, wo.note AS eventDescription, DATE(wo.dateScheduledToStart) AS startDate, DATE(wo.dateScheduled) AS endDate, COALESCE(calcategory.id,0) AS resourceId, CONCAT('#',COALESCE(REPLACE(calcategory.color,'x',''),'A9A9A9')) AS color, (COALESCE(bom.estimatedduration,0) / 60) * wo.qtyTarget AS estimatedHours, ROUND(((COALESCE(bom.estimatedduration,0) / 60) * wo.qtyTarget) / (DATEDIFF(wo.dateScheduled,wo.dateScheduledToStart) + 1),2) AS estimatedDailyHours, (DATEDIFF(wo.dateScheduled,wo.dateScheduledToStart) + 1) AS datediff FROM wo LEFT JOIN calcategory ON wo.calcategoryid = calcategory.id LEFT JOIN moitem ON wo.moitemid = moitem.id LEFT JOIN bom ON moitem.bomid = bom.id WHERE wo.statusid < 40 AND (YEARWEEK(wo.dateScheduledToStart) = YEARWEEK('${queryDate.format( 'YYYY-MM-DD' )}') OR YEARWEEK(wo.dateScheduled) = YEARWEEK('${queryDate.format( 'YYYY-MM-DD' )}'))`; console.log('Query', QUERY); let events = JSON.parse(runQuery(QUERY)); if (events.length > 0) { console.log('events exist', events); } else { console.log( `No events found this week: ${queryDate.format('YYYY-MM-DD')}` ); } console.groupEnd('getEventData'); return events; }; function getOffset(el) { var _x = 0; var _y = 0; while (el && !isNaN(el.offsetLeft) && !isNaN(el.offsetTop)) { _x +=… 2023-01-05 17:28:07.037000 Capacity planning separated out by calendar category Category Capacity Planning   20 1 category-capacity-planning 0
25 _binary  @media print { html,body { height: 100%; width: 100%; margin: 0; padding: 0; overflow: hidden; } #button { display: none !important; } @page { $PRINT{Print|Letter|Print} } } 2023-01-05 17:28:07.052000 Default portrait print settings. Print Portrait   30 1 fb-print-portrait 0
26 _binary  @media print { html,body { height: 100%; width: 100%; margin: 0; padding: 0; overflow: hidden; } #button { display: none !important; } @page { $PRINT{Print|Letter:landscape|Print} } } 2023-01-05 17:28:07.052000 Default landscape print settings. Print Landscape   30 1 fb-print-landscape 0
27 _binary  <!DOCTYPE html> <html lang="en"> <head> {% Template Inventory_Watch_List %} <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Inventory Watch List</title> </head> <body> <div class="overflowHidden" style="position: relative; height: 100%; width: 100%"> <div id="headerContainer" style="float: left;"> <h1>Inventory Watch List</h1> </div> <div id="bodyContainer"> <div id="body"> <table id=report-table class='display' style='width:100%''></table> </div> </div> </div> <script> {% Script Inventory_Watch_List %} {% Script Show_Header %} </script> </body> </html> 2023-01-05 17:28:07.052000 Replicates the functionality of the Monitor Module, but adds the option to display it on your dashboard. Watches must be created in the Monitor Module. Inventory Watch List   10 2 inventory-watch-list 1
28 _binary  <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs4-4.1.1/jq-3.3.1/jszip-2.5.0/dt-1.10.20/b-1.6.1/b-colvis-1.6.1/b-html5-1.6.1/b-print-1.6.1/cr-1.5.2/fh-3.1.6/r-2.2.3/sc-2.0.1/datatables.min.css"/> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/pdfmake.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.36/vfs_fonts.js"></script> <script type="text/javascript" src="https://cdn.datatables.net/v/bs4-4.1.1/jq-3.3.1/jszip-2.5.0/dt-1.10.20/b-1.6.1/b-colvis-1.6.1/b-html5-1.6.1/b-print-1.6.1/cr-1.5.2/fh-3.1.6/r-2.2.3/sc-2.0.1/datatables.min.js"></script> <style type="text/css"> {% Style Inventory_Watch_List %} </style> 2023-01-05 17:28:07.052000 Replicates the functionality of the Monitor Module, but adds the option to display it on your dashboard. Watches must be created in the Monitor Module. Inventory Watch List   40 2 inventory-watch-list 0
29 _binary  {% Style Print_Landscape %} .dot { height: 20px; width: 20px; border-radius: 50%; display: inline-block; } .fb10 { background-color: #28a745 !important; z-index: 99; } .fb20 { background-color: #ffc107; z-index: 99; } .fb30 { background-color: #dc3545; z-index: 99; } tr > td.stateText { color: rgba(0,0,0,0); font-size: 1px; text-align: center; } optgroup { background: #d3d3d3; } .selector { width: 100%; margin-bottom: 5px; } .csv-button-margin { margin-bottom: 10px; } body { height: 100%; font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; } .dropdown-content { display: none; position: absolute; right: 0; background-color: #f1f1f1; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); z-index: 9999; } .show { display: block; } div.love-on-top { z-index: 2; position: relative; } /* The Modal (background) */ .modal { display: none; /* Hidden by default */ position: fixed; /* Stay in place */ z-index: 1; /* Sit on top */ padding-top: 100px; /* Location of the box */ left: 0; top: 0; width: 100%; /* Full width */ height: 100%; /* Full height */ overflow: auto; /* Enable scroll if needed */ background-color: rgb(0, 0, 0); /* Fallback color */ background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */ } /* Modal Content */ .modal-content { background-color: #fefefe; margin: auto; padding: 20px; width: 80%; } /* The Close Button */ .close { color: #aaaaaa; float: right; font-size: 28px; font-weight: bold; } .close:hover, .close:focus { color: #000; text-decoration: none; cursor: pointer; } div.columnWrapper { position: relative; float: left; margin: 5px; } div.columnWrapper:hover img { opacity: 0.5; } div.columnWrapper:hover button { display: block; } div.columnWrapper button { position: absolute; display: none; } div.columnWrapper button.delete { top: 1px;… 2023-01-05 17:28:07.068000 Replicates the functionality of the Monitor Module, but adds the option to display it on your dashboard. Watches must be created in the Monitor Module. Inventory Watch List   30 2 inventory-watch-list 0
30 _binary  let partNum = '$PART{Part|%|General}'; partNum == -1 ? (partNum = '%') : true; let locationGroupId = '$LG{Location_Group|%|General}'; locationGroupId == -1 ? (locationGroupId = '%') : true; let user = JSON.parse(getUser()); let currentUser = user.id; let dataset; function monitor() { function getData() { let query = `SELECT COALESCE((SELECT (sysvalue) * 1000 FROM sysproperties WHERE syskey = 'Refresh Rate'),300000) as refresh, watch.id as watchid, part.num as partnum, part.description as partdescription, COALESCE(locationgroup.name,'Company Wide') as locationgroup, coalesce(uom.code,'') as uom, @avail:= coalesce(IF(coalesce(qtyonhand.qty,0) - coalesce(qtyallocated.qty,0) - coalesce(qtynotavailable.qty,0) + coalesce(qtydropship.qty,0) < 0,0,coalesce(qtyonhand.qty,0) - coalesce(qtyallocated.qty,0) - coalesce(qtynotavailable.qty,0) + coalesce(qtydropship.qty,0))) as avail, @onhand:=(CASE WHEN watch.locationgroupid IS NOT NULL THEN coalesce(qtyonhand.qty,0) ELSE coalesce(totals.qtyonhand, 0) END) as onhand, @available:=(CASE WHEN watch.locationgroupid IS NOT NULL THEN coalesce(@avail,0) ELSE coalesce(totals.qtyavailable, 0) END) as available, @committed:=(CASE WHEN watch.locationgroupid IS NOT NULL THEN coalesce(qtycommitted.qty,0) ELSE coalesce((SELECT sum(qty) FROM qtycommitted qtyc WHERE qtyc.partid = part.id GROUP BY partid),0) END) as committed, @allocated:=(CASE WHEN watch.locationgroupid IS NOT NULL THEN coalesce(qtyallocated.qty,0) ELSE coalesce(totals.qtyallocated, 0) END) as allocated, @notavailable:=(CASE WHEN watch.locationgroupid IS NOT NULL THEN coalesce(qtynotavailable.qty,0) ELSE coalesce(totals.qtynotavailable, 0) END) as 'not available', @onorder:=(CASE WHEN watch.locationgroupid IS NOT NULL THEN coalesce(qtyonorder.qty,0) ELSE coalesce(totals.qtyonorder, 0) END) as 'on order', (CASE WHEN @onhand > watch.alertlevel THEN 'fb10' WHEN @onhand <= watch.alertlevel… 2023-01-05 17:28:07.068000 Replicates the functionality of the Monitor Module, but adds the option to display it on your dashboard. Watches must be created in the Monitor Module. Inventory Watch List   20 2 inventory-watch-list 0
31 _binary  <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700;800&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet"> <style> {% Style Part_QR_Code_Label %} </style> </head> <body> <div class="wrap"> <div class="toolbar"> <button id="bold"><i class="fa fa-bold"></i></button> <button id="italic"><i class="fa fa-italic"></i></button> <button id="underline"><i class="fa fa-underline"></i></button> <select name="fonts" id="fonts" disabled> <option disabled selected value></option> <option value="Arial">Arial</option> <option value="Courier New">Courier New</option> <option value="Georgia">Georgia</option> <option value="Impact">Impact</option> <option value="Open Sans">Open Sans</option> <option value="Roboto">Roboto</option> <option value="Tahoma">Tahoma</option> <option value="Times New Roman">Times New Roman</option> <option value="Verdana">Verdana</option> </select> <select name="size" id="size" disabled> <option disabled selected value></option> <option value="8">8</option> <op… 2023-04-20 16:40:15.578000 Resizable part labels with QR code Part QR Code Label   10 4 part-qr-code-label 1
32 _binary  let zoom = 100; let canvas = document.querySelector("#canvas"); let printable = document.querySelector("#printable"); const partContainer = document.querySelector('#partContainer'); let qr = document.querySelector(".qr-code"); let save = document.querySelector("#save"); let edit = document.querySelector("#edit"); let desc = document.querySelector(".desc-drag"); let part = document.querySelector(".part-drag"); let custText = document.querySelector(".custom-drag"); let select = document.querySelector(".selected"); let partNum = '$PART{Part_Number|%|General}'; let count = '$NUM{Count|90|General}' partNum == -1 ? (partNum = '%') : true; let showDesc = '$CHECK{Show_Description|1|General}'; let showPart = '$CHECK{Show_Part_Num|1|General}'; let showBarcode = '$CHECK{Show_Barcode|1|General}'; let showCustomText = '$CHECK{Show_Custom_Text|0|General}'; let startRange = '$NUM{Page_Start_From|1|General}'; let endRange = '$NUM{Through_To_Page|90|General}'; startRange -= 1; var total; var limit; var offset; var qrWidth; var editMode = false; let LABEL = { width: 2, height: 1, qrWidth: 84, qrTransform: "translate(9px, 5px)", qrTranslateX: 9, qrTranslateY: 5, partFontSize: 14, partTransform: "translate(98px, 13px)", partTranslateX: 98, partTranslateY: 13, partWidth: 84.375, partHeight: 17, partBold: "false", partItalic: "false", partUnderlined: "false", partAlign: "center", partVAlign: "start", partFontFamily: "Arial", descFontSize: 12, descTransform: "translate(98px, 42px)", descTranslateX: 98, descTranslateY: 42, descWidth: 84.0469, descHeight: 42, descBold: "false", descItalic: "false", descUnderlined: "false", descAlign: "center", descVAlign: "start", descFontFamily: "Arial", descFontSize: 12, custTransform: "translate(0px, 0px)", custTranslateX: 0, custTranslateY: 0, custWidth: 84.0469, custHeight: 17, custBold: "false", custItalic: "false", c… 2023-04-20 16:40:15.656000 Resizable part labels with QR code Part QR Code Label   20 4 part-qr-code-label 0
33 _binary  body { font-family: Arial, sans-serif; margin: 0; padding: 0; height: 100vh; width: 100vw; position: relative; background: #ECECEC; } #printable { width: 2in; height: 1in; box-shadow: 0 5px 8px 0 rgba(0,0,0,.4); position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; margin: auto; z-index: 0; background: white; transform: scale(1); border-radius: 10px; } #canvas { position: relative; width: 100vw; height: 100vh; overflow: scroll; overflow-x: scroll; overflow-y: scroll; } .wrap { display: flex; flex-direction: row; padding: 10px; width: 100% - 20px; min-width: 856px; background: #fafafa; box-shadow: 0 2px 8px 0 rgba(0,0,0,.4); z-index: 5; justify-content: space-between; position: absolute; left: 0px; top: 0px; right: 0px; margin: auto; z-index: 1; cursor: default; } #toolbarButtons { display: flex; fled-direction: row; } .qr-code { position: absolute; z-index: 2; max-width: 1064px; max-height: 1064px; min-width: 25px; min-height: 25px; } .desc-drag { flex-wrap: wrap; position: absolute; width: fit-content; height: fit-content; z-index: 2; overflow: hidden; } .part-drag { flex-wrap: wrap; position: absolute; width: fit-content; height: fit-content; z-index: 2; overflow: hidden; } .custom-drag { flex-wrap: wrap; position: absolute; width: fit-content; height: fit-content; z-index: 2; overflow: hidden; } #customText { outline: 0px solid transparent; } .selected { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } ::selection { background-color: transparent; … 2023-04-20 16:40:15.687000 Resizable part labels with QR code Part QR Code Label   30 4 part-qr-code-label 0

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE "biscript" (
 "id" INTEGERNOT NULL ,
 "active" INTEGER DEFAULT NULL,
 "data" TEXT ,
 "dateLastModified" TEXT DEFAULT NULL,
 "description" TEXT ,
 "name" TEXT NOT NULL,
 "note" TEXT ,
 "typeId" INTEGERNOT NULL,
 "fbVersion" INTEGERDEFAULT NULL,
 "fbName" TEXT DEFAULT NULL,
 "published" INTEGERNOT NULL DEFAULT '0',
 PRIMARY KEY ("id")
);
Powered by Datasette · Queries took 16.504ms