#
# This is the server logic of a Shiny web application. You can run the
# application by clicking 'Run App' above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
path <- getwd()
isRunningInShiny <- Sys.getenv('SHINY_PORT') != ""
if(endsWith(path,'R') | isRunningInShiny){
source('Classes/GenericFunctions.R')
source('Classes/ExpensesClass.R')
source('Classes/MintClass.R')
source('Classes/ReconClass.R')
source('Classes/InsightsClass.R')
} else {
source('R/Classes/GenericFunctions.R')
source('R/Classes/ExpensesClass.R')
source('R/Classes/MintClass.R')
source('R/Classes/ReconClass.R')
source('R/Classes/InsightsClass.R')
}
curDate <- Sys.Date()
# Define server logic required to draw a histogram
shinyServer(function(input, output) {
# observeEvent(input$refresh, {
# expenses <<- {refresh(expenses))
# })
mint <- Mint(curDate = curDate)
expenses <- Expenses(curDate = curDate)
recon <- Recon(mint,expenses)
insights <- Insights(mint,expenses)
output$dqMint <- renderTable(validate(mint,input$mintShowErrors))
output$dqTran <- renderTable({
validate(expenses, input$tranShowErrors)})
output$reconTran <- renderTable(reconExpenses(recon,tranWeek=input$rcnTabTr_tranwk,
mintWeek=input$rcnTabTr_mintWeek,
showReconciled = input$rcnTabTr_showRecon))
output$reconMint <- renderTable(reconMint(recon,tranWeek=input$rcnTabMn_tranwk,
mintWeek=input$rcnTabMn_mintWeek,
showReconciled = input$rcnTabMn_showRecon))
output$catExpenseTab_CategoryTransactions <- renderTable(categoryExpenses(insights,inpBeneficiary=input$catExpenseTab_Beneficiary))
output$catExpenseTab_CategoryBeneficiaryTransactions <- renderTable(categoryBeneficiaryExpenses(insights,inpBeneficiary=input$catExpenseTab_Beneficiary))
output$catExpenseTab_TotalTransactions <- renderTable(categoryTotalExpenseOutput(insights))
output$catExpenseTab_BeneficiaryTransactions <- renderTable(BeneficiaryExpenses(insights,inpBeneficiary=input$catExpenseTab_Beneficiary))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.