---
title: "ACCT 101, Session 4: Control systems"
author: 
  - name: Dr. Richard M. Crowley
    email: rcrowley@smu.edu.sg
    affiliation: https://rmc.link/
title-slide-attributes:
  data-background-video: "../Backgrounds/title.mp4"
  data-background-video-loop: "true"
  data-background-size: stretch
format:
  revealjs:
    theme: default
    css: quarto_white.css
    navigation-mode: vertical
    controls: true
    transition: slide
    background-transition: fade
    transition-speed: default
    width: 1536
    height: 864
    logo: ../Logos/logo2.png
    code-link: true
    code-line-numbers: false
    chalkboard:
      theme: whiteboard
    auto-stretch: false
    verticator:
      color: rgb(42, 118, 221)
revealjs-plugins:
  - attribution
  - verticator
execute:
  echo: true
  warning: false
  message: false
editor: source
---

# Front matter {data-background-video="../Backgrounds/section.mp4" data-background-video-loop="true"}


<!--# Note that the downlit and xml2 pacakges are required to compile -->
<!--# Installed extensions include `attribution`, `qrcode`, and `material-icons` -->

```{r helpers, echo=FALSE, warning=FALSE, message=F}
library(knitr)
library(kableExtra)

#' Pretty formatted HTML tables
#' 
#' @param df The dataframe to format as a table
#' @param names Names to use for columns if not using the df column names. Vector
#' @param highlight_cols Columns to highlight. Default is c(1) for highlighting the first row. Use c() to remove.
#' @param highlight_rows Rows to highlight. Default is c() to not highlight any rows.
#' @param color_rows Rows to highlight in color. Default is c() to not highlight any rows.
#' @param highlight_end_rows Rows to highlight. Uses a reverse indexing where 1 is the last row, 2 is second to last, etc.
#' @param full Use to span the full width of a slide. FALSE by default.
#' @param fixed_header Whether the first row should be treated as a header row. TRUE by default.
html_df <- function(df, names=NULL, highlight_cols=c(1), highlight_rows=c(), color_rows=c(), highlight_end_rows=c(), full=F, fixed_header=T) {
  if(!length(names)) {
    names=colnames(df)
  }
  kbl(df,"html", col.names = names, align = c("l",rep('c',length(cols)-1))) %>%
    kable_paper(c("striped","hover"), full_width=full, fixed_thead=F, html_font = "\"Source Sans Pro\", Helvetica, sans-serif") %>%
    {if(length(highlight_cols)) column_spec(., highlight_cols,bold=T, background = "#ffffff99") else .} %>%
    {if(length(highlight_rows)) row_spec(., highlight_rows,bold=T, background = "#ffffff99") else .} %>%
    {if(length(color_rows)) row_spec(., color_rows,bold=T, background = "#aaaaff99") else .} %>%
    {if(length(highlight_end_rows)) row_spec(., nrow(df) + 1 - highlight_end_rows,bold=T, background = "#ffffff99") else .}
}

library(tidyverse)
```

<!--# List packages here that are not being correctly highlighted -->
<!--# The usual cause is calling the library from a echo=FALSE cell -->

```{r}
#| include: false
options(downlit.attached = c("knitr", "kableExtra", "tidyverse"))
```

<!-- "reveal_plugins:..." and "chalkboard:" are handled by prep.py -->
```{r setup, include=FALSE}
library(reticulate)  # To use python in R Markdown
# Python to use is specified in the .Renviron file
```

## Homework 1 review {data-background="../Backgrounds/reference.jpg" class="exclude"}

- Closing entries: Revenues, Expenses, *Gains*, *Losses*, Dividends
- Depreciation
    - (Price paid - salvage value) / [life length from purchase]
    - In homework: (200,000 - 40,000) / 5 = 32,000
- Accrual entries:
    1. Bring an expense or revenue forward
    2. Create a payable or receivable as well
    3. Payable or receivable reversed upon payment

![](../Diagrams/JE_4-0.png){width="800px" fig-align="center"}


## Quiz details {data-background="../Backgrounds/studying.jpg"}

- 60 minutes long, mostly calculation based
- What can be covered:
    - Everything in the Session 1 to 4 slides

:::: {.columns}

::: {.column width="50%"}

**Not on the quiz**

- Par value accounting
- Concept names and definitions
    - Matching principle, periodicity, etc.

:::

::: {.column width="50%"}

**Potentially on the final**

- Par value accounting for equity

:::

::::

> The quiz is to makes sure you have the fundamentals down

## Quiz resources {data-background="../Backgrounds/studying.jpg"}

- Practices provided on eLearn:
    - A full practice Quiz 1 (paper version)
    - A set of extra Quiz 1 practice questions
    - Select textbook problems (with answers)
- There is an account glossary on eLearn
    - It lists and defines every account we've seen so far


## Learning objectives {data-background="../Backgrounds/default.jpg"}

:::: {.columns}

::: {.column width="50%"}
![](../Course_Diagrams/ACCT_101_course_map_4.png){width="450px" fig-align="center"}
:::

::: {.column width="50%"}

**Control Systems (Chapter 4)**

1. Understand the drivers of fraud
2. Be able to identify weaknesses in firms' systems and suggest improvements
3. Be able to reconcile book and bank cash

**A/R (Chapter 5)**

1. Understand how to write off uncollectible A/R


:::

::::


# Fraud {data-background-video="../Backgrounds/section.mp4" data-background-video-loop="true"}

## Misreporting: A simple definition {data-background="../Backgrounds/default.jpg"}

> Errors that affect firms' accounting statements or disclosures which were done seemingly *intentionally* by management or other employees at the firm.

![](../Figures/johnny-automatic-bag-of-money.png){width="200px" fig-align="center"}

## Traditional accounting fraud {data-background="../Backgrounds/fraud.jpg"}

1. A company is underperforming
2. Management cooks up some scheme to increase earnings
    - Wells Fargo (2011-2018?)
        - Fake/duplicate customers and transactions
3. Create accounting statements using the fake information

## Other accounting fraud types {data-background="../Backgrounds/fraud.jpg" .small}

- <a href="https://www.economist.com/newsbook/2010/07/23/taking-away-dells-cookie-jar">Dell (2002-2007)</a>
    - *Cookie jar reserve* (secret payments by Intel of up to **76%** of quarterly income)
        1. The company is overperforming
        2. "Save up" excess performance for a rainy day
        3. Recognize revenue/earnings when needed to hit future targets
- <a href="https://www.sec.gov/news/press/2007/2007-70.htm"> Apple (2001)</a>
    - *Options backdating*
- <a href="https://www.sec.gov/litigation/litreleases/2012/lr22552.htm">China North East Petroleum Holdings Limited</a>
    - *Related party transactions* (transferring 59M USD from the firm to family members over 176 transactions)

<div class="fragment">

- <a href="https://www.sec.gov/litigation/admin/2007/33-8815.pdf">CVS (2000)</a>
    - *Improper accounting treatments* (Not using mark-to-market accounting to fair value stuffed animal inventories)
- <a href="https://www.sec.gov/litigation/litreleases/lr16732.htm">Countryland Wellness Resorts, Inc. (1997-2000)</a>
    - Gold reserves were actually... <span class="fragment exclude">dirt</span>

</div>

## Fraud in Singapore {data-background="../Backgrounds/fraud.jpg"}

- <a href="http://www.straitstimes.com/business/companies-markets/keppel-acts-against-staff-in-bribery-scandal">Keppel O&M</a>
    - \$55M USD bribery in Brazil for contracts
    - Highly profitable, until fines rolled in
        - Profit of $351.8M USD
        - Fines of $422M USD (to US, Brazil, Singapore) [so far]
    - 6 employees implicated
    - 1 Keppel lawyer pleaded guilty in USA for drafting bribery contracts
- <a href="http://www.straitstimes.com/singapore/courts-crime/keppel-club-duo-convicted-for-37m-membership-scam">Keppel Club</a>
    - Employees created 1,280 fake memberships, sold them, and retained all profits
    - $37.5M from June 1 to August 1, 2014
- <a href="http://eresources.nlb.gov.sg/infopedia/articles/SIP_422_2005-01-25.html">Asia Pacific Breweries (Chia Teck Leng)</a>
    - Forged documents from 1999 to 2003 to obtain $117M from 4 banks
        - To fund gambling addiction
    - 42 year jail sentence

## Fraud triangle  {data-background="../Backgrounds/default.jpg"}

:::: {.columns}

::: {.column width="50%"}

- Opportunity
    - Hole in the control system
    - Profitably exploitable
- Rationalization
    - Resentment of corporation
    - Poor culture
    - "Borrowing"
- Motivation
    - Family needs
    - Maintaining lifestyle
    - Maintaining performance

:::

::: {.column width="50%"}

![](../Figures/3legs_fraud.png){width="400px" fig-align="center"}

:::

::::

::: {.callout-tip appearance="simple"}

Need all 3 for fraud to happen

:::

# Control systems {data-background-video="../Backgrounds/section.mp4" data-background-video-loop="true"}

## Systems {data-background="../Backgrounds/neural-net.jpg"}

- Each part of the company is dependent on other parts
- Consider how all parts work together


> Simplest case is a linear assembly line

> - Pass the product from one stop to the next until it's done
> - Except for...
>     - Maintenance
>     - Input selection
>     - Product mix
>     - Quality control
>     - ...
> - Where does information flow?

## Basic goals of control systems {data-background="../Backgrounds/default.jpg"}

- Prevention
    + Make sure something doesn't go wrong
        + Ex.: Inspect raw materials before assembly
- Detection
    + Check if something went wrong
        + Ex.: Check products randomly after assembly
- Correction
    + Something went wrong, so we need to fix it
        + Ex.: Determine cause of defects & learn from problems

## Basic mechanisms/solutions {data-background="../Backgrounds/default.jpg"}

- Separation of duties
    + Different parts of a system are handled by different employees
        * Ex.: Inspection not done by assembly line worker
- Monitoring
    + Check if things are normal
        * Ex.: Boss stops by every now and then
- Limited access
    + Employees only have access to what they need
        * Ex.: Line workers can't access inventory records
        * Ex.: Raw material purchasers can't access salary records
- Approvals
    + Require oversight for some actions
        * Ex.: Buying from a new vendor may require boss's signature

## Limitations {data-background="../Backgrounds/default.jpg"}

- Collusion
    + Multiple people can jointly subvert systems
- Fatigue
    + People are not perfect
- Negligence
    + Not every employee does what they are supposed to

## Brainstorming... {data-background="../Backgrounds/rain.jpg" class="default present-only"}

::: {.callout-tip}
## Question

How would we control car quality (Prevention, Detection, Correction)?

:::

## Example: Car manufacturer {data-background="../Backgrounds/answer.jpg" class="default exclude"}

> - How would we control car quality?
>     - Prevention
>         - <span class="exclude">Purchase materials from trustworthy suppliers</span>
>     - Detection
>         - <span class="exclude">Point inspections on finished cars</span>
>     - Correction
>         - <span class="exclude">Recalls</span>



## Champaign Parking Enforcement {data-background-image="../Backgrounds/case.jpg"}

:::: {.columns}

::: {.column width="50%"}

**Their Objectives**

1. *Validity*: All recorded transactions ocurred
2. *Completeness*: All valid transactions have been recorded 
3. *Valuation*: Amounts measured properly
4. *Security*: Information system protected from unauthorized access or destruction

:::

::: {.column width="50%"}

**Discussion questions**

- What are some risks that threaten these objectives?
    - How frequent is the risk?
    - How serious is the risk?
- How could they be addressed?

![](../Figures/Parking_Meter.jpg){width="200px" fig-align="center"}

:::

::::

# Cash reconciliation {data-background-video="../Backgrounds/section.mp4" data-background-video-loop="true"}

## Cash on companies' books {data-background-image="../Backgrounds/coins.jpg"}

:::: {.columns}

::: {.column width="50%"}

Documents:

- Purchase orders
- Invoices for purchases/sales
- Checks
- Payment records
- Petty cash
    - Small amount set aside for **small** purchases

:::

::: {.column width="50%"}

![](../Diagrams/Cash_post.png){width="420px" fig-align="center"}

:::

::::


## Cash in the bank {data-background-image="../Backgrounds/coins.jpg"}

:::: {.columns}

::: {.column width="50%"}

Documents:

- Cash deposits, withdrawals
- Checks
- Electronic checks
    - EFT, ACH, GIRO, etc.
- Bank interest and fees
- Nonsufficient funds
    - Customer's check is rejected
    - Check writer didn't have enough cash in the bank

:::

::: {.column width="50%"}

![](../Diagrams/Cash_bank.png){width="420px" fig-align="center"}

:::

::::


## Inconsistencies between cash records {data-background-image="../Backgrounds/default.jpg"}

- The two records come from different sources
    - We can use this to verify the records!...
        - But they likely won't be exactly the same
- Why are the records different?
    - Time lags
         - We receive cash and checks first
             - These may still be *in transit* to the bank
         - Banks receive electronic checks first
         - Banks know about fees and interest first
- Time lags are shorter these days with internet banking

## Reconciliation process {data-background-image="../Backgrounds/reference.jpg"}

![](../Diagrams/Bank_rec.png){width="800px" fig-align="center" .lightbox}

## Journal entries to record {data-background-image="../Backgrounds/reference.jpg"}

:::: {.columns}

::: {.column width="50%"}

**Cash up**: DR cash, CR...

- Dividends received:
    - *Dividend revenue*
- EFT from customer:
    - *A/R*
- Interest from bank:
    - *Interest revenue*
- Prepayment:
    - *Unearned revenue*

:::

::: {.column width="50%"}

**Cash down**: CR cash, DR...

- Charges from the bank:
    - *Bank service charges*
       - This is an expense account
- Check failed (NSF):
    - Receivable the check was for (*A/R*)
- Charged expenses:
    - The expense

:::

::::

## Reconciliation example {data-background-image="../Backgrounds/default.jpg"}

![](../Diagrams/Bank_rec_ex.png){width="800px" fig-align="center" .lightbox}

## Practice bank reconciliation {data-background-image="../Backgrounds/group.jpg"}

1. Get the in class activity spreadsheet
    - Session_4_Activity_Cash.xlsx
2. Do the bank reconciliation
     1. Figure out what needs to be reconciled from bank and book
     2. Record these in the reconciliation tab
     3. Make sure cash reconciles (it will in this case)
     4. Record the needed journal entries (3)

# A/R tracking {data-background-video="../Backgrounds/section.mp4" data-background-video-loop="true"}

## Why have uncollectible accounts? {data-background-image="../Backgrounds/case.jpg"}

- Case: Hanjin shipping
- Read: [rmc.link/101class4](https://www.theguardian.com/business/2016/sep/02/hanjin-shipping-bankruptcy-causes-turmoil-in-global-sea-freight)

![](../Figures/Hanjin.png){width="600px" fig-align="center"}

## Takeaways {data-background="../Backgrounds/review.jpg" class="default present-only"}

::: {.callout-tip}
## Question

From a business perspective, what does the Hanjin case tell us about the world?

:::

## What happened at Hanjin Shipping? {data-background-image="../Backgrounds/case.jpg" class="default exclude"}

- Low on cash
- Ports didn't think they would get paid back by Hanjin
- *Tons of products stuck in ports...*
    - Such as the School of Law's writing boards for class rooms when it opened
- <a href="http://arstechnica.com/gadgets/2016/09/hanjin-bankruptcy-could-mean-price-spikes-for-tvs-cars-other-large-products/" data-preview-link>Shipping rates went up 55%</a>

> In other words, unexpected events happen

## Accounting for unexpected events {data-background-image="../Backgrounds/default.jpg"}
- Companies can go bankrupt, forget to pay, or breach contracts
- Two approaches:

:::: {.columns}

::: {.column width="50%"}

**Allowance method**

- Estimate decrease in asset values beforehand
- *Allowance for uncollectible accounts*
    - Contra asset
- *Bad debt expense*

:::

::: {.column width="50%"}

**Direct write-off method**

- Write-off when the loss is guaranteed
- Violates the matching principal

:::

::::

> We will use the allowance method (as does IFRS)

## A/R allowance process {data-background-image="../Backgrounds/reference.jpg"}

![](../Diagrams/AR_Allow.png){width="900px" fig-align="center" .lightbox}

## A/R allowances example {data-background-image="../Backgrounds/default.jpg"}

- Suppose we have the following allowance schedule and accounts receivables outstanding at year end

![](../Diagrams/AR_Example_1.png){width="800px" fig-align="center" .lightbox}

- What should our allowance be?

## A/R allowances example {data-background-image="../Backgrounds/default.jpg"}

![](../Diagrams/AR_Example_1-Sol.png){width="650px" fig-align="center" .lightbox}

## A/R allowances example: Going concern {data-background-image="../Backgrounds/default.jpg"}

- What about GC Corp?
    + The auditor issued a going concern opinion
    + High chance of bankruptcy
    + Let's update the allowance schedule for that:

![](../Diagrams/AR_Example_2.png){width="600px" fig-align="center"}

## A/R allowances example: Going concern {data-background-image="../Backgrounds/default.jpg"}

![](../Diagrams/AR_Example_2-Sol.png){width="600px" fig-align="center"}

## A/R allowances example: Journal entries {data-background-image="../Backgrounds/default.jpg"}

![](../Diagrams/JE_4-1.png){width="800px" fig-align="center" .lightbox}

![](../Diagrams/JE_4-2.png){width="800px" fig-align="center" .lightbox}

![](../Diagrams/JE_4-3.png){width="800px" fig-align="center" .lightbox}


## A/R allowances example: Bankruptcy {data-background-image="../Backgrounds/default.jpg"}

- *Bankruptcy follows the direct write-off method*
    - We record it when it happens
    - Use up some of the allowance (DR), decrease our A/R (CR)
- If the firm recovers, we reverse this transaction
- Example: PGUS goes bankrupt.  During bankruptcy they pay us \$300, and we expect no further payments from them.

![](../Diagrams/JE_4-4.png){width="740px" fig-align="center" .lightbox}

## Practice for A/R {data-background-image="../Backgrounds/group.jpg"}

1. Get the in class activity spreadsheet
    - Session_4_Activity_AR.xlsx
2. Complete the activity in groups
     1. Use the allowance schedule to determine the amount of uncollectible A/R needed
     2. Use the T-account to determine the adjustment needed
     3. Record the adjustment in the journal






# End matter {data-background-video="../Backgrounds/section.mp4" data-background-video-loop="true"}

## Wrap up {data-background="../Backgrounds/ending.jpg"}

- For next week
    1) Recap the reading for this week
    2) Read the pages for next week
        - Chapter 5 (Part A)
        - Chapter 6 (Inventory)
    3) No homework
    4) Practice on eLearn
        - Practice on bank reconciliation and A/R
        - Automatic feedback provided
- Survey on the class session at [rmc.link/101survey4](https://docs.google.com/forms/d/e/1FAIpQLSdzyohx5MTN40nrDxCWRfuyapH7b1N6NG6MQqV6-lMMNT9z2Q/viewform?usp=sf_link)

## Packages used for these slides {data-background="../Backgrounds/code.jpg"}

- `{kableExtra}`
- `{knitr}`
- `{revealjs}`




## References {data-background="../Backgrounds/books.jpg" .never .small}

## Custom code {data-background="../Backgrounds/code.jpg" .never .small}


## NOTES {class="never"}

- Wooclap enabled lesson: www.wooclap.com/101W4
- Might need to modernize the Champaign case
- Need to modernize the Hanjin case
- Add a graph + list for risks to slides (magnitude vs frequency of risks for case) draw.io
