Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ If you haven't already installed Python 3 and Jupyter, the easiest way to instal
TODO: Write usage instructions
1. [How to reshape SAP Data for your
audit](https://github.com/AICPA-AuditDataAnalytics2018/ADS---Python-Example-/blob/master/samples/reshape_rename_sap_data.ipynb)
2. [How to reshape Quickbooks General Ledger Data for your audit](https://github.com/AICPA-AuditDataAnalytics2018/ADS---Python-Example-/tree/master/samples)
2. [How to reshape Quickbooks General Ledger Data for your audit](https://github.com/AICPA-AuditDataAnalytics2018/ADS---Python-Example-/blob/master/samples/quickbooksGLtoDatabase.py)
3. [How to split a DataFrame (csv, xlsx, other) using pandas and
groupby](https://github.com/AICPA-AuditDataAnalytics2018/ADS---Python-Example-/blob/master/samples/Split%20Dataframe%20with%20Groupby.ipynb)

Expand All @@ -22,23 +22,12 @@ TODO: Write usage instructions
3. Add your changes: `git add *`
4. Commit your changes: `git commit -am 'Add some feature'`
5. Push to the branch: `git push origin my-new-feature`
6. Submit a pull request :D
6. Submit a pull request :smile:

## History

TODO: Write history

** Consider adding an __init__ method to Test_Procedures, to reduce data entry:
```python
def __init__(self, GL_Detail, Log_File=None, JE_Column=None, Output=None):
# Checks to make sure data is valid
assert JE_Column in GL_Detail.columns
self.GL_Detail = GL_Detail
...
def run():
# Execute all procedures in module
```

## Credits

TODO: Write credits
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pandas
numpy
xlrd
xlsxwriter
pytest
317 changes: 196 additions & 121 deletions samples/Test_Procedures.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions samples/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import Test_Procedures
Binary file modified samples/__pycache__/Test_Procedures.cpython-38.pyc
Binary file not shown.
Binary file added samples/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions samples/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file added samples/data/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added samples/data/__pycache__/load_files.cpython-38.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import samples
Binary file added tests/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file not shown.
71 changes: 71 additions & 0 deletions tests/test_JE_procedures.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import pandas as pd
import pytest
from samples.Test_Procedures import Test_1_Procedures, Test_2_Procedures


df_log_sample = pd.read_csv("../samples/data/log_file.csv")
df_gl_sample = pd.read_csv("../samples/data/"+
"GL_Detail_YYYYMMDD_YYYYMMDD.csv")

df_gl_sample['Net'] = df_gl_sample.apply(lambda x: x['Amount'] * -1 if
x['Amount_Credit_Debit_Indicator']=='H' else x['Amount'], axis=1)

class Test_Procedure_1:

def test_check_gl_entries(self):

assert 12 == Test_1_Procedures.check_for_gaps_in_JE_ID(df_gl_sample,
Journal_ID_Column = "Journal_ID", output_file = None)

def test_comparison_of_entries_of_GL_and_log_files(self):

assert 0 == Test_1_Procedures.comparison_of_entries_of_GL_and_log_file(
GL_Detail = df_gl_sample, Log_File = df_log_sample,
output_file = None)

def test_comparison_of_amounts_of_GL_and_log_files(self):

assert 2 == Test_1_Procedures.comparison_of_amounts_of_GL_and_log_file(
GL_Detail=df_gl_sample, Log_File=df_log_sample,
output_file = None)

def test_check_for_incomplete_entries(self):

assert 4 == Test_2_Procedures.check_for_incomplete_entries(
GL_Detail = df_gl_sample, output_file = None)

def test_check_for_duplicate_entries(self):

assert 6919 == Test_2_Procedures.check_for_duplicate_entries(
GL_Detail = df_gl_sample, output_file = None)

def test_check_for_round_dollar_entries(self):

assert 226 == Test_2_Procedures.check_for_round_dollar_entries(
GL_Detail = df_gl_sample, output_file = None)

def test_check_for_post_date_entries(self):

assert 149 == Test_2_Procedures.check_for_post_date_entries(
GL_Detail = df_gl_sample, output_file = None)

def test_check_for_weekend_entries(self):

assert 0 == Test_2_Procedures.check_for_weekend_entries(
GL_Detail = df_gl_sample, output_file = None)

def test_check_for_nights_entries(self):

assert 190 == Test_2_Procedures.check_for_nights_entries(
GL_Detail = df_gl_sample, output_file = None)

def test_check_for_rare_users(self):

assert 52 == Test_2_Procedures.check_for_rare_users(
GL_Detail = df_gl_sample, output_file = None)

def test_check_for_rare_accounts(self):

assert 32 == Test_2_Procedures.check_for_rare_accounts(
GL_Detail = df_gl_sample, output_file = None)