-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4675955
commit 659d381
Showing
7 changed files
with
109 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from playground.ui import Book | ||
|
||
# Start company | ||
book = Book(company_name="Pied Piper") | ||
|
||
# Create chart of accounts | ||
book.add_assets("cash", "inventory", "ar") | ||
book.add_capital("equity") | ||
book.add_income("sales", offsets=["refunds"]) | ||
book.add_expense("cogs") | ||
book.add_liability("dividend") | ||
book.set_retained_earnings("re") | ||
|
||
# Open ledger and post entries | ||
book.open() | ||
book.entry("Shareholder investment").amount(300).debit("cash").credit("equity").commit() | ||
book.entry("Bought inventory").amount(200).debit("inventory").credit("cash").commit() | ||
book.entry("Invoiced sales").debit("ar", 380).debit("refunds", 20).credit("sales", 400).commit() | ||
book.entry("Shippled goods").amount(200).debit("cogs").credit("inventory").commit() | ||
|
||
# Close ledger and make post-close entries | ||
book.close() | ||
book.entry("Accrue dividend").amount(90).debit("re").credit("dividend").commit() | ||
|
||
# Show reports | ||
print(book.balance_sheet.json()) | ||
print(book.income_statement.json()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters