@things-factory/accounting 7.0.6 → 8.0.0-alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (231) hide show
  1. package/client/activities/activity-book-edit.ts +1 -1
  2. package/client/activities/activity-book-view.ts +1 -1
  3. package/client/activities/activity-expense-edit.ts +1 -1
  4. package/client/activities/activity-expense-view.ts +1 -1
  5. package/client/pages/account/account-importer.ts +19 -8
  6. package/client/pages/account/account-list-page.ts +5 -6
  7. package/client/pages/accounting-category/accounting-category-importer.ts +19 -8
  8. package/client/pages/accounting-category/accounting-category-list-page.ts +5 -5
  9. package/client/pages/financial-statement/financial-statement-importer.ts +19 -8
  10. package/client/pages/financial-statement/financial-statement-list-page.ts +5 -6
  11. package/client/pages/fiscal-month/fiscal-month-importer.ts +90 -0
  12. package/client/pages/fiscal-month/fiscal-month-list-page.ts +398 -0
  13. package/client/pages/fiscal-quarter/fiscal-quarter-importer.ts +90 -0
  14. package/client/pages/fiscal-quarter/fiscal-quarter-list-page.ts +398 -0
  15. package/client/pages/fiscal-year/fiscal-year-importer.ts +90 -0
  16. package/client/pages/fiscal-year/fiscal-year-list-page.ts +398 -0
  17. package/client/pages/income-statement/income-statement-importer.ts +19 -8
  18. package/client/pages/income-statement/income-statement-list-page.ts +5 -6
  19. package/client/pages/ledger/ledger-importer.ts +19 -8
  20. package/client/pages/ledger/ledger-list-page.ts +5 -6
  21. package/client/pages/transaction/transaction-importer.ts +19 -8
  22. package/client/pages/transaction/transaction-list-page.ts +5 -6
  23. package/client/route.ts +17 -5
  24. package/dist-client/activities/activity-book-edit.js +1 -1
  25. package/dist-client/activities/activity-book-edit.js.map +1 -1
  26. package/dist-client/activities/activity-book-view.js +1 -1
  27. package/dist-client/activities/activity-book-view.js.map +1 -1
  28. package/dist-client/activities/activity-expense-edit.js +1 -1
  29. package/dist-client/activities/activity-expense-edit.js.map +1 -1
  30. package/dist-client/activities/activity-expense-view.js +1 -1
  31. package/dist-client/activities/activity-expense-view.js.map +1 -1
  32. package/dist-client/pages/account/account-importer.d.ts +0 -1
  33. package/dist-client/pages/account/account-importer.js +12 -5
  34. package/dist-client/pages/account/account-importer.js.map +1 -1
  35. package/dist-client/pages/account/account-list-page.js +5 -6
  36. package/dist-client/pages/account/account-list-page.js.map +1 -1
  37. package/dist-client/pages/accounting-category/accounting-category-importer.d.ts +0 -1
  38. package/dist-client/pages/accounting-category/accounting-category-importer.js +12 -5
  39. package/dist-client/pages/accounting-category/accounting-category-importer.js.map +1 -1
  40. package/dist-client/pages/accounting-category/accounting-category-list-page.js +5 -5
  41. package/dist-client/pages/accounting-category/accounting-category-list-page.js.map +1 -1
  42. package/dist-client/pages/financial-statement/financial-statement-importer.d.ts +0 -1
  43. package/dist-client/pages/financial-statement/financial-statement-importer.js +12 -5
  44. package/dist-client/pages/financial-statement/financial-statement-importer.js.map +1 -1
  45. package/dist-client/pages/financial-statement/financial-statement-list-page.js +5 -6
  46. package/dist-client/pages/financial-statement/financial-statement-list-page.js.map +1 -1
  47. package/dist-client/pages/fiscal-month/fiscal-month-importer.d.ts +23 -0
  48. package/dist-client/pages/fiscal-month/fiscal-month-importer.js +93 -0
  49. package/dist-client/pages/fiscal-month/fiscal-month-importer.js.map +1 -0
  50. package/dist-client/pages/fiscal-month/fiscal-month-list-page.d.ts +66 -0
  51. package/dist-client/pages/fiscal-month/fiscal-month-list-page.js +370 -0
  52. package/dist-client/pages/fiscal-month/fiscal-month-list-page.js.map +1 -0
  53. package/dist-client/pages/fiscal-quarter/fiscal-quarter-importer.d.ts +23 -0
  54. package/dist-client/pages/fiscal-quarter/fiscal-quarter-importer.js +93 -0
  55. package/dist-client/pages/fiscal-quarter/fiscal-quarter-importer.js.map +1 -0
  56. package/dist-client/pages/fiscal-quarter/fiscal-quarter-list-page.d.ts +66 -0
  57. package/dist-client/pages/fiscal-quarter/fiscal-quarter-list-page.js +370 -0
  58. package/dist-client/pages/fiscal-quarter/fiscal-quarter-list-page.js.map +1 -0
  59. package/dist-client/pages/fiscal-year/fiscal-year-importer.d.ts +23 -0
  60. package/dist-client/pages/fiscal-year/fiscal-year-importer.js +93 -0
  61. package/dist-client/pages/fiscal-year/fiscal-year-importer.js.map +1 -0
  62. package/dist-client/pages/fiscal-year/fiscal-year-list-page.d.ts +66 -0
  63. package/dist-client/pages/fiscal-year/fiscal-year-list-page.js +370 -0
  64. package/dist-client/pages/fiscal-year/fiscal-year-list-page.js.map +1 -0
  65. package/dist-client/pages/income-statement/income-statement-importer.d.ts +0 -1
  66. package/dist-client/pages/income-statement/income-statement-importer.js +12 -5
  67. package/dist-client/pages/income-statement/income-statement-importer.js.map +1 -1
  68. package/dist-client/pages/income-statement/income-statement-list-page.js +5 -6
  69. package/dist-client/pages/income-statement/income-statement-list-page.js.map +1 -1
  70. package/dist-client/pages/ledger/ledger-importer.d.ts +0 -1
  71. package/dist-client/pages/ledger/ledger-importer.js +12 -5
  72. package/dist-client/pages/ledger/ledger-importer.js.map +1 -1
  73. package/dist-client/pages/ledger/ledger-list-page.js +5 -6
  74. package/dist-client/pages/ledger/ledger-list-page.js.map +1 -1
  75. package/dist-client/pages/transaction/transaction-importer.d.ts +0 -1
  76. package/dist-client/pages/transaction/transaction-importer.js +12 -5
  77. package/dist-client/pages/transaction/transaction-importer.js.map +1 -1
  78. package/dist-client/pages/transaction/transaction-list-page.js +5 -6
  79. package/dist-client/pages/transaction/transaction-list-page.js.map +1 -1
  80. package/dist-client/route.d.ts +1 -1
  81. package/dist-client/route.js +9 -0
  82. package/dist-client/route.js.map +1 -1
  83. package/dist-client/tsconfig.tsbuildinfo +1 -1
  84. package/dist-server/controllers/index.d.ts +1 -0
  85. package/dist-server/controllers/index.js +4 -0
  86. package/dist-server/controllers/index.js.map +1 -1
  87. package/dist-server/controllers/summary-statements.d.ts +4 -0
  88. package/dist-server/controllers/summary-statements.js +143 -0
  89. package/dist-server/controllers/summary-statements.js.map +1 -0
  90. package/dist-server/index.d.ts +1 -0
  91. package/dist-server/index.js +1 -0
  92. package/dist-server/index.js.map +1 -1
  93. package/dist-server/migrations/1725200507196-seed-fiscal-entities.d.ts +5 -0
  94. package/dist-server/migrations/1725200507196-seed-fiscal-entities.js +95 -0
  95. package/dist-server/migrations/1725200507196-seed-fiscal-entities.js.map +1 -0
  96. package/dist-server/migrations/1725201467183-seed-accounts.d.ts +5 -0
  97. package/dist-server/migrations/1725201467183-seed-accounts.js +318 -0
  98. package/dist-server/migrations/1725201467183-seed-accounts.js.map +1 -0
  99. package/dist-server/routes.d.ts +1 -0
  100. package/dist-server/routes.js +1 -0
  101. package/dist-server/routes.js.map +1 -1
  102. package/dist-server/service/account/account-history.js +3 -3
  103. package/dist-server/service/account/account-history.js.map +1 -1
  104. package/dist-server/service/account/account-query.js +1 -1
  105. package/dist-server/service/account/account-query.js.map +1 -1
  106. package/dist-server/service/account/account.js +1 -1
  107. package/dist-server/service/account/account.js.map +1 -1
  108. package/dist-server/service/accounting-category/accounting-category-query.js +1 -1
  109. package/dist-server/service/accounting-category/accounting-category-query.js.map +1 -1
  110. package/dist-server/service/accounting-category/accounting-category-type.d.ts +2 -0
  111. package/dist-server/service/accounting-category/accounting-category-type.js +8 -0
  112. package/dist-server/service/accounting-category/accounting-category-type.js.map +1 -1
  113. package/dist-server/service/accounting-category/accounting-category.d.ts +1 -0
  114. package/dist-server/service/accounting-category/accounting-category.js +7 -1
  115. package/dist-server/service/accounting-category/accounting-category.js.map +1 -1
  116. package/dist-server/service/common-type.d.ts +5 -0
  117. package/dist-server/service/common-type.js +15 -0
  118. package/dist-server/service/common-type.js.map +1 -0
  119. package/dist-server/service/financial-statement/financial-statement-history.js +3 -3
  120. package/dist-server/service/financial-statement/financial-statement-history.js.map +1 -1
  121. package/dist-server/service/financial-statement/financial-statement-query.js +1 -1
  122. package/dist-server/service/financial-statement/financial-statement-query.js.map +1 -1
  123. package/dist-server/service/financial-statement/financial-statement.js +1 -1
  124. package/dist-server/service/financial-statement/financial-statement.js.map +1 -1
  125. package/dist-server/service/fiscal-month/fiscal-month-mutation.d.ts +10 -0
  126. package/dist-server/service/fiscal-month/fiscal-month-mutation.js +128 -0
  127. package/dist-server/service/fiscal-month/fiscal-month-mutation.js.map +1 -0
  128. package/dist-server/service/fiscal-month/fiscal-month-query.d.ts +11 -0
  129. package/dist-server/service/fiscal-month/fiscal-month-query.js +81 -0
  130. package/dist-server/service/fiscal-month/fiscal-month-query.js.map +1 -0
  131. package/dist-server/service/fiscal-month/fiscal-month-type.d.ts +26 -0
  132. package/dist-server/service/fiscal-month/fiscal-month-type.js +98 -0
  133. package/dist-server/service/fiscal-month/fiscal-month-type.js.map +1 -0
  134. package/dist-server/service/fiscal-month/fiscal-month.d.ts +22 -0
  135. package/dist-server/service/fiscal-month/fiscal-month.js +99 -0
  136. package/dist-server/service/fiscal-month/fiscal-month.js.map +1 -0
  137. package/dist-server/service/fiscal-month/index.d.ts +6 -0
  138. package/dist-server/service/fiscal-month/index.js +10 -0
  139. package/dist-server/service/fiscal-month/index.js.map +1 -0
  140. package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.d.ts +10 -0
  141. package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js +128 -0
  142. package/dist-server/service/fiscal-quarter/fiscal-quarter-mutation.js.map +1 -0
  143. package/dist-server/service/fiscal-quarter/fiscal-quarter-query.d.ts +11 -0
  144. package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js +83 -0
  145. package/dist-server/service/fiscal-quarter/fiscal-quarter-query.js.map +1 -0
  146. package/dist-server/service/fiscal-quarter/fiscal-quarter-type.d.ts +24 -0
  147. package/dist-server/service/fiscal-quarter/fiscal-quarter-type.js +90 -0
  148. package/dist-server/service/fiscal-quarter/fiscal-quarter-type.js.map +1 -0
  149. package/dist-server/service/fiscal-quarter/fiscal-quarter.d.ts +21 -0
  150. package/dist-server/service/fiscal-quarter/fiscal-quarter.js +94 -0
  151. package/dist-server/service/fiscal-quarter/fiscal-quarter.js.map +1 -0
  152. package/dist-server/service/fiscal-quarter/index.d.ts +6 -0
  153. package/dist-server/service/fiscal-quarter/index.js +10 -0
  154. package/dist-server/service/fiscal-quarter/index.js.map +1 -0
  155. package/dist-server/service/fiscal-year/fiscal-year-mutation.d.ts +10 -0
  156. package/dist-server/service/fiscal-year/fiscal-year-mutation.js +128 -0
  157. package/dist-server/service/fiscal-year/fiscal-year-mutation.js.map +1 -0
  158. package/dist-server/service/fiscal-year/fiscal-year-query.d.ts +11 -0
  159. package/dist-server/service/fiscal-year/fiscal-year-query.js +79 -0
  160. package/dist-server/service/fiscal-year/fiscal-year-query.js.map +1 -0
  161. package/dist-server/service/fiscal-year/fiscal-year-type.d.ts +22 -0
  162. package/dist-server/service/fiscal-year/fiscal-year-type.js +82 -0
  163. package/dist-server/service/fiscal-year/fiscal-year-type.js.map +1 -0
  164. package/dist-server/service/fiscal-year/fiscal-year.d.ts +20 -0
  165. package/dist-server/service/fiscal-year/fiscal-year.js +89 -0
  166. package/dist-server/service/fiscal-year/fiscal-year.js.map +1 -0
  167. package/dist-server/service/fiscal-year/index.d.ts +6 -0
  168. package/dist-server/service/fiscal-year/index.js +10 -0
  169. package/dist-server/service/fiscal-year/index.js.map +1 -0
  170. package/dist-server/service/income-statement/income-statement-history.js +3 -3
  171. package/dist-server/service/income-statement/income-statement-history.js.map +1 -1
  172. package/dist-server/service/income-statement/income-statement-query.js +1 -1
  173. package/dist-server/service/income-statement/income-statement-query.js.map +1 -1
  174. package/dist-server/service/income-statement/income-statement.js +3 -3
  175. package/dist-server/service/income-statement/income-statement.js.map +1 -1
  176. package/dist-server/service/index.d.ts +5 -2
  177. package/dist-server/service/index.js +19 -3
  178. package/dist-server/service/index.js.map +1 -1
  179. package/dist-server/service/transaction/index.d.ts +1 -2
  180. package/dist-server/service/transaction/transaction-history.d.ts +10 -2
  181. package/dist-server/service/transaction/transaction-history.js +43 -6
  182. package/dist-server/service/transaction/transaction-history.js.map +1 -1
  183. package/dist-server/service/transaction/transaction-query.js +1 -1
  184. package/dist-server/service/transaction/transaction-query.js.map +1 -1
  185. package/dist-server/service/transaction/transaction.d.ts +8 -5
  186. package/dist-server/service/transaction/transaction.js +33 -10
  187. package/dist-server/service/transaction/transaction.js.map +1 -1
  188. package/dist-server/tsconfig.tsbuildinfo +1 -1
  189. package/helps/accounting/fiscal-month.md +160 -0
  190. package/helps/accounting/fiscal-quarter.md +160 -0
  191. package/helps/accounting/fiscal-year.md +160 -0
  192. package/package.json +9 -8
  193. package/server/controllers/index.ts +1 -0
  194. package/server/controllers/summary-statements.ts +160 -0
  195. package/server/index.ts +1 -0
  196. package/server/migrations/1725200507196-seed-fiscal-entities.ts +106 -0
  197. package/server/migrations/1725201467183-seed-accounts.ts +339 -0
  198. package/server/routes.ts +2 -0
  199. package/server/service/account/account-history.ts +5 -5
  200. package/server/service/account/account-query.ts +1 -1
  201. package/server/service/account/account.ts +1 -1
  202. package/server/service/accounting-category/accounting-category-query.ts +1 -1
  203. package/server/service/accounting-category/accounting-category-type.ts +6 -0
  204. package/server/service/accounting-category/accounting-category.ts +10 -1
  205. package/server/service/common-type.ts +12 -0
  206. package/server/service/financial-statement/financial-statement-history.ts +5 -5
  207. package/server/service/financial-statement/financial-statement-query.ts +1 -1
  208. package/server/service/financial-statement/financial-statement.ts +1 -1
  209. package/server/service/fiscal-month/fiscal-month-mutation.ts +137 -0
  210. package/server/service/fiscal-month/fiscal-month-query.ts +56 -0
  211. package/server/service/fiscal-month/fiscal-month-type.ts +66 -0
  212. package/server/service/fiscal-month/fiscal-month.ts +84 -0
  213. package/server/service/fiscal-month/index.ts +7 -0
  214. package/server/service/fiscal-quarter/fiscal-quarter-mutation.ts +137 -0
  215. package/server/service/fiscal-quarter/fiscal-quarter-query.ts +58 -0
  216. package/server/service/fiscal-quarter/fiscal-quarter-type.ts +60 -0
  217. package/server/service/fiscal-quarter/fiscal-quarter.ts +80 -0
  218. package/server/service/fiscal-quarter/index.ts +7 -0
  219. package/server/service/fiscal-year/fiscal-year-mutation.ts +137 -0
  220. package/server/service/fiscal-year/fiscal-year-query.ts +51 -0
  221. package/server/service/fiscal-year/fiscal-year-type.ts +54 -0
  222. package/server/service/fiscal-year/fiscal-year.ts +76 -0
  223. package/server/service/fiscal-year/index.ts +7 -0
  224. package/server/service/income-statement/income-statement-history.ts +5 -5
  225. package/server/service/income-statement/income-statement-query.ts +1 -4
  226. package/server/service/income-statement/income-statement.ts +3 -3
  227. package/server/service/index.ts +31 -3
  228. package/server/service/transaction/transaction-history.ts +35 -7
  229. package/server/service/transaction/transaction-query.ts +1 -4
  230. package/server/service/transaction/transaction.ts +34 -15
  231. 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": "7.0.6",
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 -d ./server/migrations"
27
+ "migration:create": "node ../../node_modules/typeorm/cli.js migration:create ./server/migrations/migration"
28
28
  },
29
29
  "dependencies": {
30
- "@operato/graphql": "^7.0.0",
31
- "@operato/shell": "^7.0.0",
32
- "@things-factory/auth-base": "^7.0.6",
33
- "@things-factory/shell": "^7.0.6",
34
- "@things-factory/worklist": "^7.0.6"
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": "9fbd670e3b446fe51c264d7f43c61daf3b75d5cc"
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
@@ -1,3 +1,4 @@
1
+ export * from './controllers'
1
2
  export * from './migrations'
2
3
  export * from './middlewares'
3
4