-
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
fe4bde1
commit 9f36b04
Showing
17 changed files
with
71 additions
and
72 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,33 @@ | ||
from json import dumps | ||
from pathlib import Path | ||
from typing import Optional | ||
|
||
import typer | ||
from typing_extensions import Annotated | ||
|
||
from abacus.typer_cli.base import get_ledger | ||
|
||
A = Annotated[list[str], typer.Option()] | ||
|
||
show = typer.Typer(help="Show chart and account information.", add_completion=False) | ||
|
||
|
||
@show.command() | ||
def chart(json: bool = False): | ||
"""Show chart of accounts.""" | ||
|
||
|
||
@show.command() | ||
def account(name: str, json: bool = False): | ||
def account(name: str): | ||
"""Show account information.""" | ||
|
||
|
||
@show.command() | ||
def trial_balance(json: bool = False): | ||
"""Show trial-balance.""" | ||
|
||
|
||
@show.command() | ||
def balances(all: bool = False, json: bool = True): | ||
def balances( | ||
json: bool = True, | ||
nonzero: bool = False, | ||
chart_file: Optional[Path] = None, | ||
store_file: Optional[Path] = None, | ||
): | ||
"""Show account balances.""" | ||
ledger = get_ledger(chart_file, store_file) | ||
if nonzero: | ||
data = ledger.balances.nonzero().data | ||
else: | ||
data = ledger.balances.data | ||
print(dumps(data)) |
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,8 @@ | ||
bash -ex chart.bat | ||
bash -ex post.bat | ||
bash -ex report.bat | ||
bash -ex set_re.bat | ||
bash -ex vat.bat | ||
bash -ex readme.bat | ||
bash -ex clean.bat | ||
|
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,4 @@ | ||
bx chart unlink --yes | ||
bx ledger unlink --yes | ||
rm -f starting_balances.json | ||
rm -f start.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
bx unlink --yes | ||
bx init | ||
bx post --entry asset:cash capital:common_stock 20000 --title "Initial investment" | ||
bx report --balance-sheet | ||
bx show balances --nonzero > start.json | ||
bx ledger unlink --yes | ||
bx ledger init | ||
bx assert cash 0 | ||
bx post --starting-balances-file start.json | ||
bx assert cash 20000 |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
bx unlink --yes | ||
bx init | ||
bx chart set --retained-earnings-account НераспПрибыль | ||
bx assert НераспПрибыль 0 |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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