@things-factory/accounting 7.0.2 → 8.0.0-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/client/activities/activity-book-edit.ts +1 -1
- package/client/activities/activity-book-view.ts +1 -1
- package/client/activities/activity-expense-edit.ts +1 -1
- package/client/activities/activity-expense-view.ts +1 -1
- package/client/pages/account/account-importer.ts +19 -8
- package/client/pages/account/account-list-page.ts +5 -6
- package/client/pages/accounting-category/accounting-category-importer.ts +19 -8
- package/client/pages/accounting-category/accounting-category-list-page.ts +5 -5
- package/client/pages/financial-statement/financial-statement-importer.ts +19 -8
- package/client/pages/financial-statement/financial-statement-list-page.ts +5 -6
- package/client/pages/fiscal-month/fiscal-month-importer.ts +90 -0
- package/client/pages/fiscal-month/fiscal-month-list-page.ts +398 -0
- package/client/pages/fiscal-quarter/fiscal-quarter-importer.ts +90 -0
- package/client/pages/fiscal-quarter/fiscal-quarter-list-page.ts +398 -0
- package/client/pages/fiscal-year/fiscal-year-importer.ts +90 -0
- package/client/pages/fiscal-year/fiscal-year-list-page.ts +398 -0
- package/client/pages/income-statement/income-statement-importer.ts +19 -8
- package/client/pages/income-statement/income-statement-list-page.ts +5 -6
- package/client/pages/ledger/ledger-importer.ts +19 -8
- package/client/pages/ledger/ledger-list-page.ts +5 -6
- package/client/pages/transaction/transaction-importer.ts +19 -8
- package/client/pages/transaction/transaction-list-page.ts +5 -6
- package/client/route.ts +17 -5
- package/dist-client/activities/activity-book-edit.js +1 -1
- package/dist-client/activities/activity-book-edit.js.map +1 -1
- package/dist-client/activities/activity-book-view.js +1 -1
- package/dist-client/activities/activity-book-view.js.map +1 -1
- package/dist-client/activities/activity-expense-edit.js +1 -1
- package/dist-client/activities/activity-expense-edit.js.map +1 -1
- package/dist-client/activities/activity-expense-view.js +1 -1
- package/dist-client/activities/activity-expense-view.js.map +1 -1
- package/dist-client/pages/account/account-importer.d.ts +0 -1
- package/dist-client/pages/account/account-importer.js +12 -5
- package/dist-client/pages/account/account-importer.js.map +1 -1
- package/dist-client/pages/account/account-list-page.js +5 -6
- package/dist-client/pages/account/account-list-page.js.map +1 -1
- package/dist-client/pages/accounting-category/accounting-category-importer.d.ts +0 -1
- package/dist-client/pages/accounting-category/accounting-category-importer.js +12 -5
- package/dist-client/pages/accounting-category/accounting-category-importer.js.map +1 -1
- package/dist-client/pages/accounting-category/accounting-category-list-page.js +5 -5
- package/dist-client/pages/accounting-category/accounting-category-list-page.js.map +1 -1
- package/dist-client/pages/financial-statement/financial-statement-importer.d.ts +0 -1
- package/dist-client/pages/financial-statement/financial-statement-importer.js +12 -5
- package/dist-client/pages/financial-statement/financial-statement-importer.js.map +1 -1
- package/dist-client/pages/financial-statement/financial-statement-list-page.js +5 -6
- package/dist-client/pages/financial-statement/financial-statement-list-page.js.map +1 -1
- package/dist-client/pages/fiscal-month/fiscal-month-importer.d.ts +23 -0
- package/dist-client/pages/fiscal-month/fiscal-month-importer.js +93 -0
- package/dist-client/pages/fiscal-month/fiscal-month-importer.js.map +1 -0
- package/dist-client/pages/fiscal-month/fiscal-month-list-page.d.ts +66 -0
- package/dist-client/pages/fiscal-month/fiscal-month-list-page.js +370 -0
- package/dist-client/pages/fiscal-month/fiscal-month-list-page.js.map +1 -0
- package/dist-client/pages/fiscal-quarter/fiscal-quarter-importer.d.ts +23 -0
- package/dist-client/pages/fiscal-quarter/fiscal-quarter-importer.js +93 -0
- package/dist-client/pages/fiscal-quarter/fiscal-quarter-importer.js.map +1 -0
- package/dist-client/pages/fiscal-quarter/fiscal-quarter-list-page.d.ts +66 -0
- package/dist-client/pages/fiscal-quarter/fiscal-quarter-list-page.js +370 -0
- package/dist-client/pages/fiscal-quarter/fiscal-quarter-list-page.js.map +1 -0
- package/dist-client/pages/fiscal-year/fiscal-year-importer.d.ts +23 -0
- package/dist-client/pages/fiscal-year/fiscal-year-importer.js +93 -0
- package/dist-client/pages/fiscal-year/fiscal-year-importer.js.map +1 -0
- package/dist-client/pages/fiscal-year/fiscal-year-list-page.d.ts +66 -0
- package/dist-client/pages/fiscal-year/fiscal-year-list-page.js +370 -0
- package/dist-client/pages/fiscal-year/fiscal-year-list-page.js.map +1 -0
- package/dist-client/pages/income-statement/income-statement-importer.d.ts +0 -1
- package/dist-client/pages/income-statement/income-statement-importer.js +12 -5
- package/dist-client/pages/income-statement/income-statement-importer.js.map +1 -1
- package/dist-client/pages/income-statement/income-statement-list-page.js +5 -6
- package/dist-client/pages/income-statement/income-statement-list-page.js.map +1 -1
- package/dist-client/pages/ledger/ledger-importer.d.ts +0 -1
- package/dist-client/pages/ledger/ledger-importer.js +12 -5
- package/dist-client/pages/ledger/ledger-importer.js.map +1 -1
- package/dist-client/pages/ledger/ledger-list-page.js +5 -6
- package/dist-client/pages/ledger/ledger-list-page.js.map +1 -1
- package/dist-client/pages/transaction/transaction-importer.d.ts +0 -1
- package/dist-client/pages/transaction/transaction-importer.js +12 -5
- package/dist-client/pages/transaction/transaction-importer.js.map +1 -1
- package/dist-client/pages/transaction/transaction-list-page.js +5 -6
- package/dist-client/pages/transaction/transaction-list-page.js.map +1 -1
- package/dist-client/route.d.ts +1 -1
- package/dist-client/route.js +9 -0
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/controllers/index.d.ts +1 -0
- package/dist-server/controllers/index.js +4 -0
- package/dist-server/controllers/index.js.map +1 -1
- package/dist-server/controllers/summary-statements.d.ts +4 -0
- package/dist-server/controllers/summary-statements.js +143 -0
- package/dist-server/controllers/summary-statements.js.map +1 -0
- package/dist-server/index.d.ts +1 -0
- package/dist-server/index.js +1 -0
- package/dist-server/index.js.map +1 -1
- package/dist-server/migrations/1725200507196-seed-fiscal-entities.d.ts +5 -0
- package/dist-server/migrations/1725200507196-seed-fiscal-entities.js +95 -0
- package/dist-server/migrations/1725200507196-seed-fiscal-entities.js.map +1 -0
- package/dist-server/migrations/1725201467183-seed-accounts.d.ts +5 -0
- package/dist-server/migrations/1725201467183-seed-accounts.js +318 -0
- package/dist-server/migrations/1725201467183-seed-accounts.js.map +1 -0
- package/dist-server/routes.d.ts +1 -0
- package/dist-server/routes.js +1 -0
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/account/account-history.js +3 -3
- package/dist-server/service/account/account-history.js.map +1 -1
- package/dist-server/service/account/account-query.js +1 -1
- package/dist-server/service/account/account-query.js.map +1 -1
- package/dist-server/service/account/account.js +1 -1
- package/dist-server/service/account/account.js.map +1 -1
- package/dist-server/service/accounting-category/accounting-category-query.js +1 -1
- package/dist-server/service/accounting-category/accounting-category-query.js.map +1 -1
- package/dist-server/service/accounting-category/accounting-category-type.d.ts +2 -0
- package/dist-server/service/accounting-category/accounting-category-type.js +8 -0
- package/dist-server/service/accounting-category/accounting-category-type.js.map +1 -1
- package/dist-server/service/accounting-category/accounting-category.d.ts +1 -0
- package/dist-server/service/accounting-category/accounting-category.js +7 -1
- package/dist-server/service/accounting-category/accounting-category.js.map +1 -1
- package/dist-server/service/common-type.d.ts +5 -0
- package/dist-server/service/common-type.js +15 -0
- package/dist-server/service/common-type.js.map +1 -0
- package/dist-server/service/financial-statement/financial-statement-history.js +3 -3
- package/dist-server/service/financial-statement/financial-statement-history.js.map +1 -1
- package/dist-server/service/financial-statement/financial-statement-query.js +1 -1
- package/dist-server/service/financial-statement/financial-statement-query.js.map +1 -1
- package/dist-server/service/financial-statement/financial-statement.js +1 -1
- package/dist-server/service/financial-statement/financial-statement.js.map +1 -1
- package/dist-server/service/fiscal-month/fiscal-month-mutation.d.ts +10 -0
- package/dist-server/service/fiscal-month/fiscal-month-mutation.js +128 -0
- package/dist-server/service/fiscal-month/fiscal-month-mutation.js.map +1 -0
- package/dist-server/service/fiscal-month/fiscal-month-query.d.ts +11 -0
- package/dist-server/service/fiscal-month/fiscal-month-query.js +81 -0
- package/dist-server/service/fiscal-month/fiscal-month-query.js.map +1 -0
- package/dist-server/service/fiscal-month/fiscal-month-type.d.ts +26 -0
- package/dist-server/service/fiscal-month/fiscal-month-type.js +98 -0
- package/dist-server/service/fiscal-month/fiscal-month-type.js.map +1 -0
- package/dist-server/service/fiscal-month/fiscal-month.d.ts +22 -0
- package/dist-server/service/fiscal-month/fiscal-month.js +99 -0
- package/dist-server/service/fiscal-month/fiscal-month.js.map +1 -0
- package/dist-server/service/fiscal-month/index.d.ts +6 -0
- package/dist-server/service/fiscal-month/index.js +10 -0
- package/dist-server/service/fiscal-month/index.js.map +1 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.d.ts +10 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js +128 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js.map +1 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-query.d.ts +11 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js +83 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js.map +1 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-type.d.ts +24 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-type.js +90 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter-type.js.map +1 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter.d.ts +21 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter.js +94 -0
- package/dist-server/service/fiscal-quarter/fiscal-quarter.js.map +1 -0
- package/dist-server/service/fiscal-quarter/index.d.ts +6 -0
- package/dist-server/service/fiscal-quarter/index.js +10 -0
- package/dist-server/service/fiscal-quarter/index.js.map +1 -0
- package/dist-server/service/fiscal-year/fiscal-year-mutation.d.ts +10 -0
- package/dist-server/service/fiscal-year/fiscal-year-mutation.js +128 -0
- package/dist-server/service/fiscal-year/fiscal-year-mutation.js.map +1 -0
- package/dist-server/service/fiscal-year/fiscal-year-query.d.ts +11 -0
- package/dist-server/service/fiscal-year/fiscal-year-query.js +79 -0
- package/dist-server/service/fiscal-year/fiscal-year-query.js.map +1 -0
- package/dist-server/service/fiscal-year/fiscal-year-type.d.ts +22 -0
- package/dist-server/service/fiscal-year/fiscal-year-type.js +82 -0
- package/dist-server/service/fiscal-year/fiscal-year-type.js.map +1 -0
- package/dist-server/service/fiscal-year/fiscal-year.d.ts +20 -0
- package/dist-server/service/fiscal-year/fiscal-year.js +89 -0
- package/dist-server/service/fiscal-year/fiscal-year.js.map +1 -0
- package/dist-server/service/fiscal-year/index.d.ts +6 -0
- package/dist-server/service/fiscal-year/index.js +10 -0
- package/dist-server/service/fiscal-year/index.js.map +1 -0
- package/dist-server/service/income-statement/income-statement-history.js +3 -3
- package/dist-server/service/income-statement/income-statement-history.js.map +1 -1
- package/dist-server/service/income-statement/income-statement-query.js +1 -1
- package/dist-server/service/income-statement/income-statement-query.js.map +1 -1
- package/dist-server/service/income-statement/income-statement.js +3 -3
- package/dist-server/service/income-statement/income-statement.js.map +1 -1
- package/dist-server/service/index.d.ts +5 -2
- package/dist-server/service/index.js +19 -3
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/transaction/index.d.ts +1 -2
- package/dist-server/service/transaction/transaction-history.d.ts +10 -2
- package/dist-server/service/transaction/transaction-history.js +43 -6
- package/dist-server/service/transaction/transaction-history.js.map +1 -1
- package/dist-server/service/transaction/transaction-query.js +1 -1
- package/dist-server/service/transaction/transaction-query.js.map +1 -1
- package/dist-server/service/transaction/transaction.d.ts +8 -5
- package/dist-server/service/transaction/transaction.js +33 -10
- package/dist-server/service/transaction/transaction.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/accounting/fiscal-month.md +160 -0
- package/helps/accounting/fiscal-quarter.md +160 -0
- package/helps/accounting/fiscal-year.md +160 -0
- package/package.json +9 -8
- package/server/controllers/index.ts +1 -0
- package/server/controllers/summary-statements.ts +160 -0
- package/server/index.ts +1 -0
- package/server/migrations/1725200507196-seed-fiscal-entities.ts +106 -0
- package/server/migrations/1725201467183-seed-accounts.ts +339 -0
- package/server/routes.ts +2 -0
- package/server/service/account/account-history.ts +5 -5
- package/server/service/account/account-query.ts +1 -1
- package/server/service/account/account.ts +1 -1
- package/server/service/accounting-category/accounting-category-query.ts +1 -1
- package/server/service/accounting-category/accounting-category-type.ts +6 -0
- package/server/service/accounting-category/accounting-category.ts +10 -1
- package/server/service/common-type.ts +12 -0
- package/server/service/financial-statement/financial-statement-history.ts +5 -5
- package/server/service/financial-statement/financial-statement-query.ts +1 -1
- package/server/service/financial-statement/financial-statement.ts +1 -1
- package/server/service/fiscal-month/fiscal-month-mutation.ts +137 -0
- package/server/service/fiscal-month/fiscal-month-query.ts +56 -0
- package/server/service/fiscal-month/fiscal-month-type.ts +66 -0
- package/server/service/fiscal-month/fiscal-month.ts +84 -0
- package/server/service/fiscal-month/index.ts +7 -0
- package/server/service/fiscal-quarter/fiscal-quarter-mutation.ts +137 -0
- package/server/service/fiscal-quarter/fiscal-quarter-query.ts +58 -0
- package/server/service/fiscal-quarter/fiscal-quarter-type.ts +60 -0
- package/server/service/fiscal-quarter/fiscal-quarter.ts +80 -0
- package/server/service/fiscal-quarter/index.ts +7 -0
- package/server/service/fiscal-year/fiscal-year-mutation.ts +137 -0
- package/server/service/fiscal-year/fiscal-year-query.ts +51 -0
- package/server/service/fiscal-year/fiscal-year-type.ts +54 -0
- package/server/service/fiscal-year/fiscal-year.ts +76 -0
- package/server/service/fiscal-year/index.ts +7 -0
- package/server/service/income-statement/income-statement-history.ts +5 -5
- package/server/service/income-statement/income-statement-query.ts +1 -4
- package/server/service/income-statement/income-statement.ts +3 -3
- package/server/service/index.ts +31 -3
- package/server/service/transaction/transaction-history.ts +35 -7
- package/server/service/transaction/transaction-query.ts +1 -4
- package/server/service/transaction/transaction.ts +34 -15
- package/things-factory.config.js +3 -1
@@ -0,0 +1,160 @@
|
|
1
|
+
# FiscalMonth
|
2
|
+
|
3
|
+
Paragraphs are separated by a blank line.
|
4
|
+
|
5
|
+
2nd paragraph. _Italic_, **bold**, and `monospace`. Itemized lists
|
6
|
+
look like:
|
7
|
+
|
8
|
+
- this one
|
9
|
+
- that one
|
10
|
+
- the other one
|
11
|
+
|
12
|
+
Note that --- not considering the asterisk --- the actual text
|
13
|
+
content starts at 4-columns in.
|
14
|
+
|
15
|
+
> Block quotes are
|
16
|
+
> written like so.
|
17
|
+
>
|
18
|
+
> They can span multiple paragraphs,
|
19
|
+
> if you like.
|
20
|
+
|
21
|
+
Use 3 dashes for an em-dash. Use 2 dashes for ranges (ex., "it's all
|
22
|
+
in chapters 12--14"). Three dots ... will be converted to an ellipsis.
|
23
|
+
Unicode is supported. ☺
|
24
|
+
|
25
|
+
## An h2 header
|
26
|
+
|
27
|
+
Here's a numbered list:
|
28
|
+
|
29
|
+
1. first item
|
30
|
+
2. second item
|
31
|
+
3. third item
|
32
|
+
|
33
|
+
Note again how the actual text starts at 4 columns in (4 characters
|
34
|
+
from the left side). Here's a code sample:
|
35
|
+
|
36
|
+
# Let me re-iterate ...
|
37
|
+
|
38
|
+
for i in 1 .. 10 { do-something(i) }
|
39
|
+
|
40
|
+
As you probably guessed, indented 4 spaces. By the way, instead of
|
41
|
+
indenting the block, you can use delimited blocks, if you like:
|
42
|
+
|
43
|
+
```
|
44
|
+
define foobar() {
|
45
|
+
print "Welcome to flavor country!";
|
46
|
+
}
|
47
|
+
```
|
48
|
+
|
49
|
+
(which makes copying & pasting easier). You can optionally mark the
|
50
|
+
delimited block for Pandoc to syntax highlight it:
|
51
|
+
|
52
|
+
```python
|
53
|
+
import time
|
54
|
+
# Quick, count to ten!
|
55
|
+
for i in range(10):
|
56
|
+
# (but not *too* quick)
|
57
|
+
time.sleep(0.5)
|
58
|
+
print(i)
|
59
|
+
```
|
60
|
+
|
61
|
+
### An h3 header
|
62
|
+
|
63
|
+
Now a nested list:
|
64
|
+
|
65
|
+
1. First, get these ingredients:
|
66
|
+
|
67
|
+
- carrots
|
68
|
+
- celery
|
69
|
+
- lentils
|
70
|
+
|
71
|
+
2. Boil some water.
|
72
|
+
|
73
|
+
3. Dump everything in the pot and follow
|
74
|
+
this algorithm:
|
75
|
+
|
76
|
+
find wooden spoon
|
77
|
+
uncover pot
|
78
|
+
stir
|
79
|
+
cover pot
|
80
|
+
balance wooden spoon precariously on pot handle
|
81
|
+
wait 10 minutes
|
82
|
+
goto first step (or shut off burner when done)
|
83
|
+
|
84
|
+
Do not bump wooden spoon or it will fall.
|
85
|
+
|
86
|
+
Notice again how text always lines up on 4-space indents (including
|
87
|
+
that last line which continues item 3 above).
|
88
|
+
|
89
|
+
Here's a link to [a website](http://foo.bar), to a [local
|
90
|
+
doc](local-doc.html), and to a [section heading in the current
|
91
|
+
doc](#an-h2-header). Here's a footnote [^1].
|
92
|
+
|
93
|
+
[^1]: Some footnote text.
|
94
|
+
|
95
|
+
Tables can look like this:
|
96
|
+
|
97
|
+
Name Size Material Color
|
98
|
+
|
99
|
+
---
|
100
|
+
|
101
|
+
All Business 9 leather brown
|
102
|
+
Roundabout 10 hemp canvas natural
|
103
|
+
Cinderella 11 glass transparent
|
104
|
+
|
105
|
+
Table: Shoes sizes, materials, and colors.
|
106
|
+
|
107
|
+
(The above is the caption for the table.) Pandoc also supports
|
108
|
+
multi-line tables:
|
109
|
+
|
110
|
+
---
|
111
|
+
|
112
|
+
Keyword Text
|
113
|
+
|
114
|
+
---
|
115
|
+
|
116
|
+
red Sunsets, apples, and
|
117
|
+
other red or reddish
|
118
|
+
things.
|
119
|
+
|
120
|
+
green Leaves, grass, frogs
|
121
|
+
and other things it's
|
122
|
+
not easy being.
|
123
|
+
|
124
|
+
---
|
125
|
+
|
126
|
+
A horizontal rule follows.
|
127
|
+
|
128
|
+
---
|
129
|
+
|
130
|
+
Here's a definition list:
|
131
|
+
|
132
|
+
apples
|
133
|
+
: Good for making applesauce.
|
134
|
+
|
135
|
+
oranges
|
136
|
+
: Citrus!
|
137
|
+
|
138
|
+
tomatoes
|
139
|
+
: There's no "e" in tomatoe.
|
140
|
+
|
141
|
+
Again, text is indented 4 spaces. (Put a blank line between each
|
142
|
+
term and its definition to spread things out more.)
|
143
|
+
|
144
|
+
Here's a "line block" (note how whitespace is honored):
|
145
|
+
|
146
|
+
| Line one
|
147
|
+
| Line too
|
148
|
+
| Line tree
|
149
|
+
|
150
|
+
and images can be specified like so:
|
151
|
+
|
152
|
+
![example image](example-image.jpg 'An exemplary image')
|
153
|
+
|
154
|
+
Inline math equation: $\omega = d\phi / dt$. Display
|
155
|
+
math should get its own line like so:
|
156
|
+
|
157
|
+
$$I = \int \rho R^{2} dV$$
|
158
|
+
|
159
|
+
And note that you can backslash-escape any punctuation characters
|
160
|
+
which you wish to be displayed literally, ex.: \`foo\`, \*bar\*, etc.
|
@@ -0,0 +1,160 @@
|
|
1
|
+
# FiscalQuarter
|
2
|
+
|
3
|
+
Paragraphs are separated by a blank line.
|
4
|
+
|
5
|
+
2nd paragraph. _Italic_, **bold**, and `monospace`. Itemized lists
|
6
|
+
look like:
|
7
|
+
|
8
|
+
- this one
|
9
|
+
- that one
|
10
|
+
- the other one
|
11
|
+
|
12
|
+
Note that --- not considering the asterisk --- the actual text
|
13
|
+
content starts at 4-columns in.
|
14
|
+
|
15
|
+
> Block quotes are
|
16
|
+
> written like so.
|
17
|
+
>
|
18
|
+
> They can span multiple paragraphs,
|
19
|
+
> if you like.
|
20
|
+
|
21
|
+
Use 3 dashes for an em-dash. Use 2 dashes for ranges (ex., "it's all
|
22
|
+
in chapters 12--14"). Three dots ... will be converted to an ellipsis.
|
23
|
+
Unicode is supported. ☺
|
24
|
+
|
25
|
+
## An h2 header
|
26
|
+
|
27
|
+
Here's a numbered list:
|
28
|
+
|
29
|
+
1. first item
|
30
|
+
2. second item
|
31
|
+
3. third item
|
32
|
+
|
33
|
+
Note again how the actual text starts at 4 columns in (4 characters
|
34
|
+
from the left side). Here's a code sample:
|
35
|
+
|
36
|
+
# Let me re-iterate ...
|
37
|
+
|
38
|
+
for i in 1 .. 10 { do-something(i) }
|
39
|
+
|
40
|
+
As you probably guessed, indented 4 spaces. By the way, instead of
|
41
|
+
indenting the block, you can use delimited blocks, if you like:
|
42
|
+
|
43
|
+
```
|
44
|
+
define foobar() {
|
45
|
+
print "Welcome to flavor country!";
|
46
|
+
}
|
47
|
+
```
|
48
|
+
|
49
|
+
(which makes copying & pasting easier). You can optionally mark the
|
50
|
+
delimited block for Pandoc to syntax highlight it:
|
51
|
+
|
52
|
+
```python
|
53
|
+
import time
|
54
|
+
# Quick, count to ten!
|
55
|
+
for i in range(10):
|
56
|
+
# (but not *too* quick)
|
57
|
+
time.sleep(0.5)
|
58
|
+
print(i)
|
59
|
+
```
|
60
|
+
|
61
|
+
### An h3 header
|
62
|
+
|
63
|
+
Now a nested list:
|
64
|
+
|
65
|
+
1. First, get these ingredients:
|
66
|
+
|
67
|
+
- carrots
|
68
|
+
- celery
|
69
|
+
- lentils
|
70
|
+
|
71
|
+
2. Boil some water.
|
72
|
+
|
73
|
+
3. Dump everything in the pot and follow
|
74
|
+
this algorithm:
|
75
|
+
|
76
|
+
find wooden spoon
|
77
|
+
uncover pot
|
78
|
+
stir
|
79
|
+
cover pot
|
80
|
+
balance wooden spoon precariously on pot handle
|
81
|
+
wait 10 minutes
|
82
|
+
goto first step (or shut off burner when done)
|
83
|
+
|
84
|
+
Do not bump wooden spoon or it will fall.
|
85
|
+
|
86
|
+
Notice again how text always lines up on 4-space indents (including
|
87
|
+
that last line which continues item 3 above).
|
88
|
+
|
89
|
+
Here's a link to [a website](http://foo.bar), to a [local
|
90
|
+
doc](local-doc.html), and to a [section heading in the current
|
91
|
+
doc](#an-h2-header). Here's a footnote [^1].
|
92
|
+
|
93
|
+
[^1]: Some footnote text.
|
94
|
+
|
95
|
+
Tables can look like this:
|
96
|
+
|
97
|
+
Name Size Material Color
|
98
|
+
|
99
|
+
---
|
100
|
+
|
101
|
+
All Business 9 leather brown
|
102
|
+
Roundabout 10 hemp canvas natural
|
103
|
+
Cinderella 11 glass transparent
|
104
|
+
|
105
|
+
Table: Shoes sizes, materials, and colors.
|
106
|
+
|
107
|
+
(The above is the caption for the table.) Pandoc also supports
|
108
|
+
multi-line tables:
|
109
|
+
|
110
|
+
---
|
111
|
+
|
112
|
+
Keyword Text
|
113
|
+
|
114
|
+
---
|
115
|
+
|
116
|
+
red Sunsets, apples, and
|
117
|
+
other red or reddish
|
118
|
+
things.
|
119
|
+
|
120
|
+
green Leaves, grass, frogs
|
121
|
+
and other things it's
|
122
|
+
not easy being.
|
123
|
+
|
124
|
+
---
|
125
|
+
|
126
|
+
A horizontal rule follows.
|
127
|
+
|
128
|
+
---
|
129
|
+
|
130
|
+
Here's a definition list:
|
131
|
+
|
132
|
+
apples
|
133
|
+
: Good for making applesauce.
|
134
|
+
|
135
|
+
oranges
|
136
|
+
: Citrus!
|
137
|
+
|
138
|
+
tomatoes
|
139
|
+
: There's no "e" in tomatoe.
|
140
|
+
|
141
|
+
Again, text is indented 4 spaces. (Put a blank line between each
|
142
|
+
term and its definition to spread things out more.)
|
143
|
+
|
144
|
+
Here's a "line block" (note how whitespace is honored):
|
145
|
+
|
146
|
+
| Line one
|
147
|
+
| Line too
|
148
|
+
| Line tree
|
149
|
+
|
150
|
+
and images can be specified like so:
|
151
|
+
|
152
|
+
![example image](example-image.jpg 'An exemplary image')
|
153
|
+
|
154
|
+
Inline math equation: $\omega = d\phi / dt$. Display
|
155
|
+
math should get its own line like so:
|
156
|
+
|
157
|
+
$$I = \int \rho R^{2} dV$$
|
158
|
+
|
159
|
+
And note that you can backslash-escape any punctuation characters
|
160
|
+
which you wish to be displayed literally, ex.: \`foo\`, \*bar\*, etc.
|
@@ -0,0 +1,160 @@
|
|
1
|
+
# FiscalYear
|
2
|
+
|
3
|
+
Paragraphs are separated by a blank line.
|
4
|
+
|
5
|
+
2nd paragraph. _Italic_, **bold**, and `monospace`. Itemized lists
|
6
|
+
look like:
|
7
|
+
|
8
|
+
- this one
|
9
|
+
- that one
|
10
|
+
- the other one
|
11
|
+
|
12
|
+
Note that --- not considering the asterisk --- the actual text
|
13
|
+
content starts at 4-columns in.
|
14
|
+
|
15
|
+
> Block quotes are
|
16
|
+
> written like so.
|
17
|
+
>
|
18
|
+
> They can span multiple paragraphs,
|
19
|
+
> if you like.
|
20
|
+
|
21
|
+
Use 3 dashes for an em-dash. Use 2 dashes for ranges (ex., "it's all
|
22
|
+
in chapters 12--14"). Three dots ... will be converted to an ellipsis.
|
23
|
+
Unicode is supported. ☺
|
24
|
+
|
25
|
+
## An h2 header
|
26
|
+
|
27
|
+
Here's a numbered list:
|
28
|
+
|
29
|
+
1. first item
|
30
|
+
2. second item
|
31
|
+
3. third item
|
32
|
+
|
33
|
+
Note again how the actual text starts at 4 columns in (4 characters
|
34
|
+
from the left side). Here's a code sample:
|
35
|
+
|
36
|
+
# Let me re-iterate ...
|
37
|
+
|
38
|
+
for i in 1 .. 10 { do-something(i) }
|
39
|
+
|
40
|
+
As you probably guessed, indented 4 spaces. By the way, instead of
|
41
|
+
indenting the block, you can use delimited blocks, if you like:
|
42
|
+
|
43
|
+
```
|
44
|
+
define foobar() {
|
45
|
+
print "Welcome to flavor country!";
|
46
|
+
}
|
47
|
+
```
|
48
|
+
|
49
|
+
(which makes copying & pasting easier). You can optionally mark the
|
50
|
+
delimited block for Pandoc to syntax highlight it:
|
51
|
+
|
52
|
+
```python
|
53
|
+
import time
|
54
|
+
# Quick, count to ten!
|
55
|
+
for i in range(10):
|
56
|
+
# (but not *too* quick)
|
57
|
+
time.sleep(0.5)
|
58
|
+
print(i)
|
59
|
+
```
|
60
|
+
|
61
|
+
### An h3 header
|
62
|
+
|
63
|
+
Now a nested list:
|
64
|
+
|
65
|
+
1. First, get these ingredients:
|
66
|
+
|
67
|
+
- carrots
|
68
|
+
- celery
|
69
|
+
- lentils
|
70
|
+
|
71
|
+
2. Boil some water.
|
72
|
+
|
73
|
+
3. Dump everything in the pot and follow
|
74
|
+
this algorithm:
|
75
|
+
|
76
|
+
find wooden spoon
|
77
|
+
uncover pot
|
78
|
+
stir
|
79
|
+
cover pot
|
80
|
+
balance wooden spoon precariously on pot handle
|
81
|
+
wait 10 minutes
|
82
|
+
goto first step (or shut off burner when done)
|
83
|
+
|
84
|
+
Do not bump wooden spoon or it will fall.
|
85
|
+
|
86
|
+
Notice again how text always lines up on 4-space indents (including
|
87
|
+
that last line which continues item 3 above).
|
88
|
+
|
89
|
+
Here's a link to [a website](http://foo.bar), to a [local
|
90
|
+
doc](local-doc.html), and to a [section heading in the current
|
91
|
+
doc](#an-h2-header). Here's a footnote [^1].
|
92
|
+
|
93
|
+
[^1]: Some footnote text.
|
94
|
+
|
95
|
+
Tables can look like this:
|
96
|
+
|
97
|
+
Name Size Material Color
|
98
|
+
|
99
|
+
---
|
100
|
+
|
101
|
+
All Business 9 leather brown
|
102
|
+
Roundabout 10 hemp canvas natural
|
103
|
+
Cinderella 11 glass transparent
|
104
|
+
|
105
|
+
Table: Shoes sizes, materials, and colors.
|
106
|
+
|
107
|
+
(The above is the caption for the table.) Pandoc also supports
|
108
|
+
multi-line tables:
|
109
|
+
|
110
|
+
---
|
111
|
+
|
112
|
+
Keyword Text
|
113
|
+
|
114
|
+
---
|
115
|
+
|
116
|
+
red Sunsets, apples, and
|
117
|
+
other red or reddish
|
118
|
+
things.
|
119
|
+
|
120
|
+
green Leaves, grass, frogs
|
121
|
+
and other things it's
|
122
|
+
not easy being.
|
123
|
+
|
124
|
+
---
|
125
|
+
|
126
|
+
A horizontal rule follows.
|
127
|
+
|
128
|
+
---
|
129
|
+
|
130
|
+
Here's a definition list:
|
131
|
+
|
132
|
+
apples
|
133
|
+
: Good for making applesauce.
|
134
|
+
|
135
|
+
oranges
|
136
|
+
: Citrus!
|
137
|
+
|
138
|
+
tomatoes
|
139
|
+
: There's no "e" in tomatoe.
|
140
|
+
|
141
|
+
Again, text is indented 4 spaces. (Put a blank line between each
|
142
|
+
term and its definition to spread things out more.)
|
143
|
+
|
144
|
+
Here's a "line block" (note how whitespace is honored):
|
145
|
+
|
146
|
+
| Line one
|
147
|
+
| Line too
|
148
|
+
| Line tree
|
149
|
+
|
150
|
+
and images can be specified like so:
|
151
|
+
|
152
|
+
![example image](example-image.jpg 'An exemplary image')
|
153
|
+
|
154
|
+
Inline math equation: $\omega = d\phi / dt$. Display
|
155
|
+
math should get its own line like so:
|
156
|
+
|
157
|
+
$$I = \int \rho R^{2} dV$$
|
158
|
+
|
159
|
+
And note that you can backslash-escape any punctuation characters
|
160
|
+
which you wish to be displayed literally, ex.: \`foo\`, \*bar\*, etc.
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/accounting",
|
3
|
-
"version": "
|
3
|
+
"version": "8.0.0-alpha.1",
|
4
4
|
"main": "dist-server/index.js",
|
5
5
|
"browser": "dist-client/index.js",
|
6
6
|
"things-factory": true,
|
@@ -24,14 +24,15 @@
|
|
24
24
|
"clean:client": "npx rimraf dist-client",
|
25
25
|
"clean:server": "npx rimraf dist-server",
|
26
26
|
"clean": "npm run clean:server && npm run clean:client",
|
27
|
-
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create
|
27
|
+
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create ./server/migrations/migration"
|
28
28
|
},
|
29
29
|
"dependencies": {
|
30
|
-
"@
|
31
|
-
"@operato/
|
32
|
-
"@
|
33
|
-
"@things-factory/
|
34
|
-
"@things-factory/
|
30
|
+
"@material/web": "^2.0.0",
|
31
|
+
"@operato/graphql": "^8.0.0-alpha",
|
32
|
+
"@operato/shell": "^8.0.0-alpha",
|
33
|
+
"@things-factory/auth-base": "^8.0.0-alpha.1",
|
34
|
+
"@things-factory/shell": "^8.0.0-alpha.1",
|
35
|
+
"@things-factory/worklist": "^8.0.0-alpha.1"
|
35
36
|
},
|
36
|
-
"gitHead": "
|
37
|
+
"gitHead": "fda153ff6e86ef5ee7ace788739a100f3f413f08"
|
37
38
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './summary-statements'
|
@@ -0,0 +1,160 @@
|
|
1
|
+
import { getRepository } from '@things-factory/shell'
|
2
|
+
|
3
|
+
import { FinancialStatement } from '../service/financial-statement/financial-statement'
|
4
|
+
import { IncomeStatement } from '../service/income-statement/income-statement'
|
5
|
+
import { Transaction, TransactionType } from '../service/transaction/transaction'
|
6
|
+
|
7
|
+
export async function calculateMonthlyStatements(year: number, month: number): Promise<void> {
|
8
|
+
const transactionRepository = getRepository(Transaction)
|
9
|
+
const financialStatementRepository = getRepository(FinancialStatement)
|
10
|
+
const incomeStatementRepository = getRepository(IncomeStatement)
|
11
|
+
|
12
|
+
// 재무제표 계산
|
13
|
+
const financialResult = await transactionRepository
|
14
|
+
.createQueryBuilder('transaction')
|
15
|
+
.select([
|
16
|
+
'SUM(CASE WHEN transaction.type = :asset THEN transaction.amount ELSE 0 END) AS asset',
|
17
|
+
'SUM(CASE WHEN transaction.type = :liability THEN transaction.amount ELSE 0 END) AS liability',
|
18
|
+
'SUM(CASE WHEN transaction.type = :equity THEN transaction.amount ELSE 0 END) AS equity'
|
19
|
+
])
|
20
|
+
.where('transaction.year = :year', { year })
|
21
|
+
.andWhere('transaction.month = :month', { month })
|
22
|
+
.setParameters({
|
23
|
+
asset: TransactionType.Asset,
|
24
|
+
liability: TransactionType.Liability,
|
25
|
+
equity: TransactionType.Equity
|
26
|
+
})
|
27
|
+
.getRawOne()
|
28
|
+
|
29
|
+
const financialStatement = new FinancialStatement()
|
30
|
+
financialStatement.year = year
|
31
|
+
financialStatement.month = month
|
32
|
+
financialStatement.asset = financialResult.asset || 0
|
33
|
+
financialStatement.liability = financialResult.liability || 0
|
34
|
+
financialStatement.equity = financialResult.equity || 0
|
35
|
+
|
36
|
+
await financialStatementRepository.save(financialStatement)
|
37
|
+
|
38
|
+
// 손익계산서 계산
|
39
|
+
const incomeResult = await transactionRepository
|
40
|
+
.createQueryBuilder('transaction')
|
41
|
+
.select([
|
42
|
+
'SUM(CASE WHEN transaction.type = :income THEN transaction.amount ELSE 0 END) AS revenue',
|
43
|
+
'SUM(CASE WHEN transaction.type = :expense THEN transaction.amount ELSE 0 END) AS expense'
|
44
|
+
])
|
45
|
+
.where('transaction.year = :year', { year })
|
46
|
+
.andWhere('transaction.month = :month', { month })
|
47
|
+
.setParameters({
|
48
|
+
income: TransactionType.Income,
|
49
|
+
expense: TransactionType.Expense
|
50
|
+
})
|
51
|
+
.getRawOne()
|
52
|
+
|
53
|
+
const incomeStatement = new IncomeStatement()
|
54
|
+
incomeStatement.year = year
|
55
|
+
incomeStatement.month = month
|
56
|
+
incomeStatement.revenue = incomeResult.revenue || 0
|
57
|
+
incomeStatement.expense = incomeResult.expense || 0
|
58
|
+
incomeStatement.netIncome = (incomeResult.revenue || 0) - (incomeResult.expense || 0)
|
59
|
+
|
60
|
+
await incomeStatementRepository.save(incomeStatement)
|
61
|
+
}
|
62
|
+
|
63
|
+
export async function calculateQuarterlyStatements(year: number, quarter: number): Promise<void> {
|
64
|
+
const financialStatementRepository = getRepository(FinancialStatement)
|
65
|
+
const incomeStatementRepository = getRepository(IncomeStatement)
|
66
|
+
|
67
|
+
const months = getMonthsInQuarter(quarter)
|
68
|
+
|
69
|
+
// 재무제표 분기 합계 계산
|
70
|
+
const financialResult = await financialStatementRepository
|
71
|
+
.createQueryBuilder('financialStatement')
|
72
|
+
.select([
|
73
|
+
'SUM(financialStatement.asset) AS asset',
|
74
|
+
'SUM(financialStatement.liability) AS liability',
|
75
|
+
'SUM(financialStatement.equity) AS equity'
|
76
|
+
])
|
77
|
+
.where('financialStatement.year = :year', { year })
|
78
|
+
.andWhere('financialStatement.month IN (:...months)', { months })
|
79
|
+
.getRawOne()
|
80
|
+
|
81
|
+
const financialStatement = new FinancialStatement()
|
82
|
+
financialStatement.year = year
|
83
|
+
financialStatement.quarter = quarter
|
84
|
+
financialStatement.asset = financialResult.asset || 0
|
85
|
+
financialStatement.liability = financialResult.liability || 0
|
86
|
+
financialStatement.equity = financialResult.equity || 0
|
87
|
+
|
88
|
+
await financialStatementRepository.save(financialStatement)
|
89
|
+
|
90
|
+
// 손익계산서 분기 합계 계산
|
91
|
+
const incomeResult = await incomeStatementRepository
|
92
|
+
.createQueryBuilder('incomeStatement')
|
93
|
+
.select(['SUM(incomeStatement.revenue) AS revenue', 'SUM(incomeStatement.expense) AS expense'])
|
94
|
+
.where('incomeStatement.year = :year', { year })
|
95
|
+
.andWhere('incomeStatement.month IN (:...months)', { months })
|
96
|
+
.getRawOne()
|
97
|
+
|
98
|
+
const incomeStatement = new IncomeStatement()
|
99
|
+
incomeStatement.year = year
|
100
|
+
incomeStatement.quarter = quarter
|
101
|
+
incomeStatement.revenue = incomeResult.revenue || 0
|
102
|
+
incomeStatement.expense = incomeResult.expense || 0
|
103
|
+
incomeStatement.netIncome = (incomeResult.revenue || 0) - (incomeResult.expense || 0)
|
104
|
+
|
105
|
+
await incomeStatementRepository.save(incomeStatement)
|
106
|
+
}
|
107
|
+
|
108
|
+
export async function calculateYearlyStatements(year: number): Promise<void> {
|
109
|
+
const financialStatementRepository = getRepository(FinancialStatement)
|
110
|
+
const incomeStatementRepository = getRepository(IncomeStatement)
|
111
|
+
|
112
|
+
// 재무제표 연간 합계 계산
|
113
|
+
const financialResult = await financialStatementRepository
|
114
|
+
.createQueryBuilder('financialStatement')
|
115
|
+
.select([
|
116
|
+
'SUM(financialStatement.asset) AS asset',
|
117
|
+
'SUM(financialStatement.liability) AS liability',
|
118
|
+
'SUM(financialStatement.equity) AS equity'
|
119
|
+
])
|
120
|
+
.where('financialStatement.year = :year', { year })
|
121
|
+
.getRawOne()
|
122
|
+
|
123
|
+
const financialStatement = new FinancialStatement()
|
124
|
+
financialStatement.year = year
|
125
|
+
financialStatement.asset = financialResult.asset || 0
|
126
|
+
financialStatement.liability = financialResult.liability || 0
|
127
|
+
financialStatement.equity = financialResult.equity || 0
|
128
|
+
|
129
|
+
await financialStatementRepository.save(financialStatement)
|
130
|
+
|
131
|
+
// 손익계산서 연간 합계 계산
|
132
|
+
const incomeResult = await incomeStatementRepository
|
133
|
+
.createQueryBuilder('incomeStatement')
|
134
|
+
.select(['SUM(incomeStatement.revenue) AS revenue', 'SUM(incomeStatement.expense) AS expense'])
|
135
|
+
.where('incomeStatement.year = :year', { year })
|
136
|
+
.getRawOne()
|
137
|
+
|
138
|
+
const incomeStatement = new IncomeStatement()
|
139
|
+
incomeStatement.year = year
|
140
|
+
incomeStatement.revenue = incomeResult.revenue || 0
|
141
|
+
incomeStatement.expense = incomeResult.expense || 0
|
142
|
+
incomeStatement.netIncome = (incomeResult.revenue || 0) - (incomeResult.expense || 0)
|
143
|
+
|
144
|
+
await incomeStatementRepository.save(incomeStatement)
|
145
|
+
}
|
146
|
+
|
147
|
+
export function getMonthsInQuarter(quarter: number): number[] {
|
148
|
+
switch (quarter) {
|
149
|
+
case 1:
|
150
|
+
return [1, 2, 3]
|
151
|
+
case 2:
|
152
|
+
return [4, 5, 6]
|
153
|
+
case 3:
|
154
|
+
return [7, 8, 9]
|
155
|
+
case 4:
|
156
|
+
return [10, 11, 12]
|
157
|
+
default:
|
158
|
+
throw new Error('Invalid quarter number')
|
159
|
+
}
|
160
|
+
}
|
package/server/index.ts
CHANGED