2  Own Source Revenue

Code
library(tidyverse)
library(haven)
library(formatR)
library(lubridate)
library(smooth)
library(forecast)
library(scales)
library(kableExtra)
library(ggplot2)
library(readxl)
library(tidyverse)
library(data.table)
library(quantmod)
library(geofacet)
library(janitor)
library(cmapplot)
library(ggrepel)

theme_set(theme_classic())


knitr::opts_chunk$set(warning = FALSE, message = FALSE)

exp_temp <- read_csv("./data/exp_temp.csv") %>% 
  filter(agency != "799") 

rev_temp <- read_csv("./data/rev_temp.csv") %>% 
  filter(agency != "799")

2.1 Income Taxes

Income taxes include Individual income taxes and corporate income taxes.

Code
rev_temp  %>% 
  filter(rev_type == "03" | rev_type == "02") %>%
  mutate(label = if_else(fy == max(fy), as.character(source_name_AWM), NA_character_)) %>%
  group_by(fy, source, source_name_AWM, label) %>% 
  summarize(receipts = sum(receipts)) %>%
  ggplot(aes(x=fy, y=receipts/1000000000, color = source_name_AWM)) + 
  geom_line() + 
  geom_text(aes(label = label)) +
  theme_classic() +
    theme(legend.position = "bottom" ,
                   plot.margin = margin(0, 4, 0, 0, "cm")) +

  scale_x_continuous(expand = c(0,0)) +
  scale_y_continuous(labels = comma) +
  labs(title = "All Income Tax by Revenue Source", 
       y = "Billions of Nominal Dollars")  +
    coord_cartesian(clip = 'off', expand = TRUE)


rev_temp  %>% 
  filter(rev_type == "03") %>%
  mutate(label = if_else(fy == max(fy), as.character(fund_name_ab), NA_character_)) %>%
  group_by(fy, fund_name_ab, label) %>% 
  summarize(receipts = sum(receipts)) %>%
  ggplot(aes(x=fy, y=receipts/1000000000, color = fund_name_ab)) +
  geom_line() + 
    geom_text_repel(aes(label = label),   
              hjust = 0, 
            direction = "y",
              segment.linetype = "dotted",
            # nudge_x = 0.1,
            # nudge_y = 0.1,
            # size = 
            xlim = c(2023.5, NA)
              ) +
  theme_classic() +
  
  theme(legend.position = "none",
                   plot.margin = margin(0, 3, 0, 0, "cm")
        ) +
    coord_cartesian(clip = 'off') +
  
  scale_x_continuous(expand = c(0,0), limits = c(1998, 2023.5), breaks = c(1998, 2005, 2010, 2015, 2020, 2023)) +
  scale_y_continuous(labels = comma) +

  labs(title = "All Income Tax Money by Receiving Fund", 
       y = "Billions of Nominal Dollars") 
Figure 2.1: Break down of ALL Income Tax
Figure 2.2: Break down of ALL Income Tax

2.1.0.1 Individual Income Tax

Code
rev_temp  %>% 
  filter(rev_type == "02") %>%
  group_by(fy, source, source_name_AWM) %>% 
  summarize(receipts = sum(receipts)) %>%
  ggplot() + 
  geom_line(aes(x=fy, y=receipts/1000000000, color = source_name_AWM)) + 
  theme_classic() +
  scale_x_continuous(expand = c(0,0)) +
  scale_y_continuous(labels = comma) +
  labs(title = "Individual Income Tax  Breakdown", subtitle = "Revenue sources for rev_type == 02",
       y = "Billions of Nominal Dollars") 


rev_temp  %>% 
  filter(rev_type == "02") %>%
  group_by(fy, fund_name_ab) %>% 
  summarize(receipts = sum(receipts)) %>%
  ggplot() + 
  geom_line(aes(x=fy, y=receipts/1000000000, color = fund_name_ab)) + 
  theme_classic() +
  scale_x_continuous(expand = c(0,0)) +
  scale_y_continuous(labels = comma) +
  labs(title = "Individual Income Tax  Breakdown", 
       subtitle = "Funds receiving rev_type == 02",
       y = "Billions of Nominal Dollars")
Figure 2.3: Break down of Individual Income Tax
Figure 2.4: Break down of Individual Income Tax

2.1.0.2 Corporate Income Tax

Code
rev_temp  %>% 
  filter(rev_type == "03" ) %>%
  group_by(fy, source, source_name_AWM) %>% 
  summarize(receipts = sum(receipts)) %>%
  ggplot() + 
  geom_line(aes(x=fy, y=receipts/1000000000, color = source_name_AWM)) + 
  theme_classic() +
  scale_x_continuous(expand = c(0,0)) +
  scale_y_continuous(labels = comma) +
  labs(title = "Corporate Income Tax  Breakdown", 
       subtitle = "Corporate Income Taxes include money transfered straight to local governments and funds saved for tax refunds.",
       y = "Billions of Nominal Dollars") 

rev_temp  %>% 
  filter(rev_type == "03") %>%
  group_by(fy, fund_name_ab) %>% 
  summarize(receipts = sum(receipts)) %>%
  ggplot() + 
  geom_line(aes(x=fy, y=receipts/1000000000, color = fund_name_ab)) + 
  theme_classic() +
  scale_x_continuous(expand = c(0,0)) +
  scale_y_continuous(labels = comma) +

  labs(title = "Corporate Income Tax Breakdown", 
       subtitle = "Corporate Income Taxes include money transfered straight to local governments and funds saved for tax refunds.",
       y = "Billions of Nominal Dollars")
Figure 2.5: Break down of Corporte Income Tax
Figure 2.6: Break down of Corporte Income Tax

2.1.1 Sales Tax

Code
rev_temp  %>% 
  filter(rev_type == "06" ) %>%
  group_by(fy, source, source_name_AWM) %>% 
  summarize(receipts = round(sum(receipts))) %>% 
  pivot_wider(names_from = "fy", values_from = "receipts")
rev_temp  %>% 
  filter(rev_type == "06" ) %>%
  group_by(fy, source, source_name_AWM) %>% 
  summarize(receipts = sum(receipts)) %>%
  ggplot() + 
  geom_line(aes(x=fy, y=receipts/1000000000, color = source_name_AWM)) + 
  theme_classic() +
  scale_x_continuous(expand = c(0,0)) +
  scale_y_continuous(labels = comma) +
  theme(legend.position = "bottom") +
  labs(title = "Sales Tax Breakdown", 
       y = "Billions of Nominal Dollars") 

rev_temp  %>% 
  filter(rev_type == "06" & fy > 2015) %>%
  group_by(fy, fund_name_ab) %>% 
  summarize(receipts = sum(receipts)) %>%
  ggplot() + 
  geom_line(aes(x=fy, y=receipts/1000000000, color = fund_name_ab)) + 
  #geom_text(data = annotation, aes(x=x, y=y, label=label)) +
  theme_classic() +
  scale_x_continuous(expand = c(0,0)) +
  scale_y_continuous(labels = comma) +
 # scale_linetype_manual(values = c("dotted", "dashed", "solid")) +
  theme(legend.position = "bottom") +
  labs(title = "Sales Tax Breakdown", 
       #subtitle = "Sales Taxes include money transfered straight to local governments and funds saved for tax refunds.",
       y = "Billions of Nominal Dollars")
Figure 2.7: Break down of Sales Tax. Sales Taxes include money transfered straight to local governments and funds saved for tax refunds.
Figure 2.8: Break down of Sales Tax. Sales Taxes include money transfered straight to local governments and funds saved for tax refunds.
Figure 2.9: Break down of Sales Tax. Sales Taxes include money transfered straight to local governments and funds saved for tax refunds.

2.1.2 Online retailers

Warning

Online Retailer Warning

Not edited or double checked. Randomly looked into online retailers recently and didn’t finish thoughts on it. Just general notes pulled together while looking into online sales tax.

Law was passed in 2018 that required out of state retailers to pay the 6.25% state sales tax. The Rebuild Illinois law expanded the law to require remote retailers to charge all state and local retailers occupation taxes beginning in July 1, 2020. Before Jan. 1 2021, only state sales taxes were required to be collected (related to South Dakota v Wayfair court decision). Now required to pay state and local tax based on where product is delivered.

“On June 28, 2019, Public Act 101-0031, the”Leveling the Playing Field for Illinois Retail Act,” was signed into Illinois law and on December 13, 2019 an amendment to the Act was signed into law in Public Act 101-0604. In an effort to create more equity between remote sellers and local brick-and-mortar retailers, the new law requires remote sellers without a physical presence in the state and marketplace facilitators (e.g., Amazon and Walmart) to collect both state and local sales taxes effective January 1, 2021.” CivicFed.org

Requires remote sellers and marketplace facilitators to collect and remit the state and locally-imposed Retailers’ Occupation Tax (ROT) for the jurisdictions where the product is delivered (destination sourcing) rather than collecting and remitting solely the state use tax. 

Illinois’ State sales tax rate is 6.25%, of which 5.0% of the sales tax revenue goes to the State, 1.0% goes to all municipalities, including Chicago, and the remaining 0.25% goes to the counties. However, Cook County’s 0.25% share of the State sales tax is distributed to the Regional Transportation Authority.

“The amended”Leveling the Playing Field for Illinois Retail Act” was passed by the General Assembly on November 14, 2019, to require both Remote Retailers and Marketplace Facilitators to collect and remit the state and locally-imposed Retailers’ Occupation Tax (ROT, aka sales tax) for the jurisdictions where the product is delivered (its destination) starting January 1, 2021.”- Illinois Municipal League

  • Marketplace Facilitators, like Amazon, were required to collect Use Tax on sales starting January 1, 2020

  • Other sellers required to collect state and local sales tax on sales on January 2021.

  • There is a state tax rate of 6.25% and Illinois municipalities may impose an additional local sales tax called the Retailer’s Occupation Tax.

    • For remote sellers, the state tax rate is referred to as “use tax” and for intrastate sellers, “ROT” simply means sales tax.  

    • The ROT is measured upon the seller’s gross receipts and the seller is statutorily required to collect the use tax from their customers.

  • source 0482 is State ROT-2.2%

ILGA info - leveling the playing field went into effect on July 1 2020 which is the beginning of FY21

Code
## State Retailers Occupation Tax. 
rev_temp %>% filter(source == "0481") %>%
  group_by(fy, source_name_AWM) %>% summarize(revenue=sum(receipts))
Figure 2.10: Leveling the Playing Field went into effect for Amazon on January 1, 2020(mid-FY21) and for other remote retailers starting January 1, 2021 (mid-FY22)
Code
rev_temp %>% 
  filter(source == "0481") %>%
  group_by(fy, source_name_AWM, fund_name_ab) %>% 
  summarize(revenue=sum(receipts))%>%
  arrange(-fy, -revenue)%>%
  pivot_wider(names_from = "fy", values_from="revenue")
Figure 2.11: Leveling the Playing Field went into effect for Amazon on January 1, 2020(mid-FY21) and for other remote retailers starting January 1, 2021 (mid-FY22)
Code
rev_temp %>% 
  filter(source == "0481") %>%
  ggplot(aes(x=fy, y=receipts))+
  geom_recessions()+
  geom_line(aes(color=fund_name_ab))+
  geom_vline(xintercept = 2018)+
  geom_vline(xintercept = 2021)+
  theme_classic()+
  scale_x_continuous(expand = c(0,0))
  labs(title="State Retailers' Occupation Tax, Source 0481")
$title
[1] "State Retailers' Occupation Tax, Source 0481"

attr(,"class")
[1] "labels"
Figure 2.12: Leveling the Playing Field went into effect for Amazon on January 1, 2020(mid-FY21) and for other remote retailers starting January 1, 2021 (mid-FY22)

State tax began being collected for remote retailers based on destination beginning in Leveling the Playing Field went into effect for Amazon on January 1, 2020 (mid-FY21) and for other remote retailers starting January 1, 2021 (mid-FY22).

Code
### Remote Occupation Tax
# STATE ROT-2.2%
rev_temp %>% 
  filter(source == "0482") %>%
  group_by(fy, source_name_AWM) %>% 
  summarize(revenue=sum(receipts))
rev_temp %>% 
  filter(source == "0482") %>%
  group_by(fy, source_name_AWM, fund_name_ab) %>% 
  summarize(revenue=sum(receipts))%>%
  arrange(-fy, -revenue)%>%
  pivot_wider(names_from = "fy", values_from="revenue")
Table 2.1: Remote Occupation Tax: State ROT
Code
rev_temp %>% 
  filter(source == "0482") %>%
  ggplot(aes(x=fy, y=receipts))+
  geom_line(aes(color=fund_name_ab))+
  geom_recessions()+
  geom_vline(xintercept = 2018)+
  geom_vline(xintercept = 2020)+
  theme_classic() +
  scale_x_continuous(expand = c(0,0)) +
  labs(title="State Retailers' Occupation Tax")
rev_temp %>% 
  filter(source == "0482") %>%
  group_by(fy, source_name_AWM, fund_name_ab) %>% 
  summarize(revenue=sum(receipts))  %>% 
  ggplot()+
  geom_line(aes(x=fy, y=revenue, color=fund_name_ab))+
  geom_vline(xintercept = 2018) +
  geom_vline(xintercept = 2021) +
  theme_classic()+
  scale_x_continuous(expand = c(0,0)) +
  labs(title="State ROT - 2.2%")

Code
rev_temp %>% 
  filter(source == "0482" | source == "0481") %>%
  group_by(fy, source_name_AWM) %>% 
  summarize(revenue=sum(receipts))  %>% 
  ggplot()+
  geom_line(aes(x=fy, y=revenue, color=source_name_AWM))+
  geom_vline(xintercept = 2018)+
  geom_vline(xintercept = 2021)+
  theme_classic()+
  scale_x_continuous(expand = c(0,0)) + 
  labs(title="State ROT - 2.2% & ",
       subtitle = "Large increases due to Leveling the Playing Field Act & Online shopping during pandemic??")
Figure 2.13: Large increases due to Leveling the Playing Field Act & Online shopping during pandemic. Leveling the Playing Field went into effect for Amazon on January 1, 2020(mid-FY21) and for other remote retailers starting January 1, 2021 (mid-FY22)

As of Feb. 6 2023, Source 481 Retailers Occupation Tax has collected $9.3 billion already. FY22 had $14.7 million. Around half goes to the General Revenue Fund.

Code
rev_temp  %>% 
  filter(rev_type == "03" | 
          rev_type == "02" | 
           rev_type == "06") %>%
  filter(!str_detect(source_name_AWM, "PPRT") & !str_detect(fund, "REFUND")) %>%

  group_by(fy, source, source_name_AWM) %>% 
  summarize(receipts = sum(receipts)) %>%
  ggplot() + # aes(x=fy, y=receipts/1000, group = source))+
     # geom_recessions(text = FALSE)+
  geom_line(aes(x=fy, y=receipts/1000000000, color = source_name_AWM)) + 
  #geom_text(data = annotation, aes(x=x, y=y, label=label)) +
  theme_classic() +
  scale_x_continuous(expand = c(0,0)) +
  scale_y_continuous(labels = comma) +
 scale_linetype_manual(values = c("dotted", "dashed", "solid")) +
  theme(legend.position = "none") +
  labs(title = "What the State Actually Gets to Keep", 
       subtitle = "Tax Revenue collected by the State - (refund fund $ & Local Transfers)",
       y = "Billions of Nominal Dollars") 

Code
rev_temp  %>% 
  filter(rev_type == "03" | 
           rev_type == "02" | 
           rev_type == "06") %>%
  filter(!str_detect(source_name_AWM, "PPRT") & !str_detect(fund, "REFUND")) %>%

  group_by(fy,
           rev_type
           # source, source_name_AWM
           ) %>% 
  summarize(receipts = sum(receipts)) %>%
  ggplot() + # aes(x=fy, y=receipts/1000, group = source))+
  geom_line(aes(x=fy, y=receipts/1000000000,
                group = rev_type, color=rev_type
                ) )+ 
  theme_classic() +
  scale_x_continuous(expand = c(0,0)) +
  scale_y_continuous(labels = comma) +

  theme(legend.position = "none") +
  labs(title = "What the State Actually Gets to Keep", 
       subtitle = "Tax Revenue collected by the State - (refund fund $ & Local Transfers)",
       y = "Billions of Nominal Dollars")