fnschool 20250109.80531.837__py3-none-any.whl → 20251011.81638.854__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of fnschool might be problematic. Click here for more details.

Files changed (278) hide show
  1. fnschoo1/__init__.py +53 -0
  2. fnschoo1/canteen/admin.py +3 -0
  3. fnschoo1/canteen/apps.py +6 -0
  4. fnschoo1/canteen/forms.py +84 -0
  5. fnschoo1/canteen/migrations/0001_initial.py +119 -0
  6. fnschoo1/canteen/migrations/0002_ingredient_is_disabled.py +20 -0
  7. fnschoo1/canteen/migrations/0003_consumption_is_disabled_alter_ingredient_is_disabled.py +23 -0
  8. fnschoo1/canteen/migrations/0004_alter_ingredient_name_category_and_more.py +66 -0
  9. fnschoo1/canteen/migrations/0005_alter_category_created_at_alter_category_name_and_more.py +41 -0
  10. fnschoo1/canteen/migrations/0006_category_is_disabled_alter_category_user_and_more.py +49 -0
  11. fnschoo1/canteen/migrations/0007_alter_consumption_amount_used_and_more.py +30 -0
  12. fnschoo1/canteen/migrations/0008_category_abbreviation_mealtype.py +67 -0
  13. fnschoo1/canteen/migrations/0009_alter_category_abbreviation_and_more.py +55 -0
  14. fnschoo1/canteen/migrations/0010_alter_consumption_options_alter_ingredient_options_and_more.py +215 -0
  15. fnschoo1/canteen/migrations/0011_category_pin_to_consumptions_top.py +23 -0
  16. fnschoo1/canteen/migrations/0012_alter_ingredient_storage_date.py +18 -0
  17. fnschoo1/canteen/models.py +179 -0
  18. fnschoo1/canteen/templates/canteen/category/create.html +17 -0
  19. fnschoo1/canteen/templates/canteen/category/delete.html +61 -0
  20. fnschoo1/canteen/templates/canteen/category/list.html +63 -0
  21. fnschoo1/canteen/templates/canteen/category/update.html +23 -0
  22. fnschoo1/canteen/templates/canteen/close.html +11 -0
  23. fnschoo1/canteen/templates/canteen/consumption/_create.html +19 -0
  24. fnschoo1/canteen/templates/canteen/consumption/create.html +456 -0
  25. fnschoo1/canteen/templates/canteen/ingredient/close.html +11 -0
  26. fnschoo1/canteen/templates/canteen/ingredient/create.html +19 -0
  27. fnschoo1/canteen/templates/canteen/ingredient/create_one.html +17 -0
  28. fnschoo1/canteen/templates/canteen/ingredient/delete.html +41 -0
  29. fnschoo1/canteen/templates/canteen/ingredient/list.html +128 -0
  30. fnschoo1/canteen/templates/canteen/ingredient/update.html +23 -0
  31. fnschoo1/canteen/templates/canteen/meal_type/create.html +17 -0
  32. fnschoo1/canteen/templates/canteen/meal_type/delete.html +56 -0
  33. fnschoo1/canteen/templates/canteen/meal_type/list.html +59 -0
  34. fnschoo1/canteen/templates/canteen/meal_type/update.html +23 -0
  35. fnschoo1/canteen/tests.py +3 -0
  36. fnschoo1/canteen/urls.py +116 -0
  37. fnschoo1/canteen/views.py +814 -0
  38. fnschoo1/canteen/workbook/generate.py +2098 -0
  39. fnschoo1/db.sqlite3 +0 -0
  40. fnschoo1/fnschool/__init__.py +13 -0
  41. fnschoo1/fnschool/asgi.py +16 -0
  42. fnschoo1/fnschool/settings.py +167 -0
  43. fnschoo1/fnschool/templatetags/fnschool_tags.py +27 -0
  44. fnschoo1/fnschool/urls.py +30 -0
  45. fnschoo1/fnschool/views.py +9 -0
  46. fnschoo1/fnschool/wsgi.py +16 -0
  47. fnschoo1/locale/en/LC_MESSAGES/django.mo +0 -0
  48. fnschoo1/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
  49. fnschoo1/manage.py +25 -0
  50. fnschoo1/profiles/admin.py +27 -0
  51. fnschoo1/profiles/apps.py +12 -0
  52. fnschoo1/profiles/forms.py +67 -0
  53. fnschoo1/profiles/migrations/0001_initial.py +192 -0
  54. fnschoo1/profiles/migrations/0002_alter_profile_bio.py +20 -0
  55. fnschoo1/profiles/migrations/0003_alter_profile_options_alter_profile_address_and_more.py +67 -0
  56. fnschoo1/profiles/migrations/0004_profile_gender.py +26 -0
  57. fnschoo1/profiles/migrations/0005_alter_profile_gender.py +23 -0
  58. fnschoo1/profiles/models.py +60 -0
  59. fnschoo1/profiles/signals.py +20 -0
  60. fnschoo1/profiles/templates/profiles/create.html +16 -0
  61. fnschoo1/profiles/templates/profiles/detail.html +14 -0
  62. fnschoo1/profiles/templates/profiles/edit.html +12 -0
  63. fnschoo1/profiles/templates/profiles/log_in.html +20 -0
  64. fnschoo1/profiles/templates/profiles/log_out.html +12 -0
  65. fnschoo1/profiles/tests.py +3 -0
  66. fnschoo1/profiles/urls.py +15 -0
  67. fnschoo1/profiles/views.py +63 -0
  68. fnschoo1/static/css/bootstrap.min.css +11776 -0
  69. fnschoo1/static/css/fnschool.css +26 -0
  70. fnschoo1/static/images/favicon.ico +0 -0
  71. fnschoo1/static/js/bootstrap.bundle.min.js +4223 -0
  72. fnschoo1/static/js/bootstrap.min.js +2919 -0
  73. fnschoo1/static/js/fnschool.js +84 -0
  74. fnschoo1/static/js/jquery.min.js +5413 -0
  75. fnschoo1/static/js/jquery.slim.min.js +4331 -0
  76. fnschoo1/static/js/popper.min.js +1306 -0
  77. fnschoo1/static_collected/admin/css/autocomplete.css +377 -0
  78. fnschoo1/static_collected/admin/css/base.css +1224 -0
  79. fnschoo1/static_collected/admin/css/changelists.css +334 -0
  80. fnschoo1/static_collected/admin/css/dark_mode.css +136 -0
  81. fnschoo1/static_collected/admin/css/dashboard.css +30 -0
  82. fnschoo1/static_collected/admin/css/forms.css +546 -0
  83. fnschoo1/static_collected/admin/css/login.css +62 -0
  84. fnschoo1/static_collected/admin/css/nav_sidebar.css +145 -0
  85. fnschoo1/static_collected/admin/css/responsive.css +1043 -0
  86. fnschoo1/static_collected/admin/css/responsive_rtl.css +84 -0
  87. fnschoo1/static_collected/admin/css/rtl.css +311 -0
  88. fnschoo1/static_collected/admin/css/vendor/select2/select2.css +708 -0
  89. fnschoo1/static_collected/admin/css/vendor/select2/select2.min.css +1 -0
  90. fnschoo1/static_collected/admin/css/widgets.css +639 -0
  91. fnschoo1/static_collected/admin/js/SelectBox.js +128 -0
  92. fnschoo1/static_collected/admin/js/SelectFilter2.js +503 -0
  93. fnschoo1/static_collected/admin/js/actions.js +232 -0
  94. fnschoo1/static_collected/admin/js/admin/DateTimeShortcuts.js +496 -0
  95. fnschoo1/static_collected/admin/js/admin/RelatedObjectLookups.js +276 -0
  96. fnschoo1/static_collected/admin/js/autocomplete.js +33 -0
  97. fnschoo1/static_collected/admin/js/calendar.js +251 -0
  98. fnschoo1/static_collected/admin/js/cancel.js +29 -0
  99. fnschoo1/static_collected/admin/js/change_form.js +21 -0
  100. fnschoo1/static_collected/admin/js/collapse.js +43 -0
  101. fnschoo1/static_collected/admin/js/core.js +174 -0
  102. fnschoo1/static_collected/admin/js/filters.js +37 -0
  103. fnschoo1/static_collected/admin/js/inlines.js +439 -0
  104. fnschoo1/static_collected/admin/js/jquery.init.js +8 -0
  105. fnschoo1/static_collected/admin/js/nav_sidebar.js +81 -0
  106. fnschoo1/static_collected/admin/js/popup_response.js +24 -0
  107. fnschoo1/static_collected/admin/js/prepopulate.js +43 -0
  108. fnschoo1/static_collected/admin/js/prepopulate_init.js +20 -0
  109. fnschoo1/static_collected/admin/js/theme.js +57 -0
  110. fnschoo1/static_collected/admin/js/urlify.js +529 -0
  111. fnschoo1/static_collected/admin/js/vendor/jquery/jquery.js +10913 -0
  112. fnschoo1/static_collected/admin/js/vendor/jquery/jquery.min.js +2 -0
  113. fnschoo1/static_collected/admin/js/vendor/select2/i18n/af.js +43 -0
  114. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ar.js +36 -0
  115. fnschoo1/static_collected/admin/js/vendor/select2/i18n/az.js +33 -0
  116. fnschoo1/static_collected/admin/js/vendor/select2/i18n/bg.js +38 -0
  117. fnschoo1/static_collected/admin/js/vendor/select2/i18n/bn.js +39 -0
  118. fnschoo1/static_collected/admin/js/vendor/select2/i18n/bs.js +48 -0
  119. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ca.js +41 -0
  120. fnschoo1/static_collected/admin/js/vendor/select2/i18n/cs.js +62 -0
  121. fnschoo1/static_collected/admin/js/vendor/select2/i18n/da.js +37 -0
  122. fnschoo1/static_collected/admin/js/vendor/select2/i18n/de.js +41 -0
  123. fnschoo1/static_collected/admin/js/vendor/select2/i18n/dsb.js +51 -0
  124. fnschoo1/static_collected/admin/js/vendor/select2/i18n/el.js +43 -0
  125. fnschoo1/static_collected/admin/js/vendor/select2/i18n/en.js +41 -0
  126. fnschoo1/static_collected/admin/js/vendor/select2/i18n/es.js +41 -0
  127. fnschoo1/static_collected/admin/js/vendor/select2/i18n/et.js +38 -0
  128. fnschoo1/static_collected/admin/js/vendor/select2/i18n/eu.js +45 -0
  129. fnschoo1/static_collected/admin/js/vendor/select2/i18n/fa.js +42 -0
  130. fnschoo1/static_collected/admin/js/vendor/select2/i18n/fi.js +42 -0
  131. fnschoo1/static_collected/admin/js/vendor/select2/i18n/fr.js +43 -0
  132. fnschoo1/static_collected/admin/js/vendor/select2/i18n/gl.js +40 -0
  133. fnschoo1/static_collected/admin/js/vendor/select2/i18n/he.js +44 -0
  134. fnschoo1/static_collected/admin/js/vendor/select2/i18n/hi.js +40 -0
  135. fnschoo1/static_collected/admin/js/vendor/select2/i18n/hr.js +45 -0
  136. fnschoo1/static_collected/admin/js/vendor/select2/i18n/hsb.js +51 -0
  137. fnschoo1/static_collected/admin/js/vendor/select2/i18n/hu.js +44 -0
  138. fnschoo1/static_collected/admin/js/vendor/select2/i18n/hy.js +40 -0
  139. fnschoo1/static_collected/admin/js/vendor/select2/i18n/id.js +36 -0
  140. fnschoo1/static_collected/admin/js/vendor/select2/i18n/is.js +37 -0
  141. fnschoo1/static_collected/admin/js/vendor/select2/i18n/it.js +43 -0
  142. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ja.js +40 -0
  143. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ka.js +42 -0
  144. fnschoo1/static_collected/admin/js/vendor/select2/i18n/km.js +38 -0
  145. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ko.js +42 -0
  146. fnschoo1/static_collected/admin/js/vendor/select2/i18n/lt.js +45 -0
  147. fnschoo1/static_collected/admin/js/vendor/select2/i18n/lv.js +41 -0
  148. fnschoo1/static_collected/admin/js/vendor/select2/i18n/mk.js +42 -0
  149. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ms.js +38 -0
  150. fnschoo1/static_collected/admin/js/vendor/select2/i18n/nb.js +38 -0
  151. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ne.js +44 -0
  152. fnschoo1/static_collected/admin/js/vendor/select2/i18n/nl.js +46 -0
  153. fnschoo1/static_collected/admin/js/vendor/select2/i18n/pl.js +43 -0
  154. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ps.js +41 -0
  155. fnschoo1/static_collected/admin/js/vendor/select2/i18n/pt-BR.js +39 -0
  156. fnschoo1/static_collected/admin/js/vendor/select2/i18n/pt.js +41 -0
  157. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ro.js +43 -0
  158. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ru.js +48 -0
  159. fnschoo1/static_collected/admin/js/vendor/select2/i18n/sk.js +61 -0
  160. fnschoo1/static_collected/admin/js/vendor/select2/i18n/sl.js +41 -0
  161. fnschoo1/static_collected/admin/js/vendor/select2/i18n/sq.js +43 -0
  162. fnschoo1/static_collected/admin/js/vendor/select2/i18n/sr-Cyrl.js +48 -0
  163. fnschoo1/static_collected/admin/js/vendor/select2/i18n/sr.js +48 -0
  164. fnschoo1/static_collected/admin/js/vendor/select2/i18n/sv.js +40 -0
  165. fnschoo1/static_collected/admin/js/vendor/select2/i18n/th.js +36 -0
  166. fnschoo1/static_collected/admin/js/vendor/select2/i18n/tk.js +36 -0
  167. fnschoo1/static_collected/admin/js/vendor/select2/i18n/tr.js +40 -0
  168. fnschoo1/static_collected/admin/js/vendor/select2/i18n/uk.js +59 -0
  169. fnschoo1/static_collected/admin/js/vendor/select2/i18n/vi.js +37 -0
  170. fnschoo1/static_collected/admin/js/vendor/select2/i18n/zh-CN.js +36 -0
  171. fnschoo1/static_collected/admin/js/vendor/select2/i18n/zh-TW.js +33 -0
  172. fnschoo1/static_collected/admin/js/vendor/select2/select2.full.js +7115 -0
  173. fnschoo1/static_collected/admin/js/vendor/select2/select2.full.min.js +2 -0
  174. fnschoo1/static_collected/admin/js/vendor/xregexp/xregexp.js +4993 -0
  175. fnschoo1/static_collected/admin/js/vendor/xregexp/xregexp.min.js +160 -0
  176. fnschoo1/static_collected/css/bootstrap.min.css +11776 -0
  177. fnschoo1/static_collected/css/fnschool.css +26 -0
  178. fnschoo1/static_collected/images/favicon.ico +0 -0
  179. fnschoo1/static_collected/js/bootstrap.bundle.min.js +4223 -0
  180. fnschoo1/static_collected/js/bootstrap.min.js +2919 -0
  181. fnschoo1/static_collected/js/fnschool.js +84 -0
  182. fnschoo1/static_collected/js/jquery.min.js +5413 -0
  183. fnschoo1/static_collected/js/jquery.slim.min.js +4331 -0
  184. fnschoo1/static_collected/js/popper.min.js +1306 -0
  185. fnschoo1/templates/base/_css.html +1 -0
  186. fnschoo1/templates/base/_js.html +15 -0
  187. fnschoo1/templates/base/content.html +30 -0
  188. fnschoo1/templates/base/header_content_footer.html +35 -0
  189. fnschoo1/templates/close.html +11 -0
  190. fnschoo1/templates/home.html +51 -0
  191. fnschoo1/templates/includes/_footer.html +39 -0
  192. fnschoo1/templates/includes/_header.html +77 -0
  193. fnschoo1/templates/includes/_navigation.html +0 -0
  194. fnschoo1/templates/includes/_paginator.html +27 -0
  195. fnschoo1/templates/registration/logged_out.html +0 -0
  196. fnschoo1/templates/registration/login.html +0 -0
  197. fnschool-20251011.81638.854.dist-info/METADATA +179 -0
  198. fnschool-20251011.81638.854.dist-info/RECORD +209 -0
  199. {fnschool-20250109.80531.837.dist-info → fnschool-20251011.81638.854.dist-info}/WHEEL +1 -1
  200. fnschool-20251011.81638.854.dist-info/entry_points.txt +2 -0
  201. fnschool-20251011.81638.854.dist-info/top_level.txt +1 -0
  202. fnschool/__init__.py +0 -35
  203. fnschool/__main__.py +0 -16
  204. fnschool/app.py +0 -103
  205. fnschool/canteen/__init__.py +0 -3
  206. fnschool/canteen/__main__.py +0 -3
  207. fnschool/canteen/bill.py +0 -253
  208. fnschool/canteen/canteen.py +0 -1
  209. fnschool/canteen/canteen.toml +0 -61
  210. fnschool/canteen/config.py +0 -10
  211. fnschool/canteen/consuming.py +0 -53
  212. fnschool/canteen/currency.py +0 -17
  213. fnschool/canteen/data/bill.i18n.xlsx +0 -0
  214. fnschool/canteen/data/bill.xlsx +0 -0
  215. fnschool/canteen/data/consuming.xlsx +0 -0
  216. fnschool/canteen/data/purchase_list.xlsx +0 -0
  217. fnschool/canteen/entry.py +0 -40
  218. fnschool/canteen/food.py +0 -206
  219. fnschool/canteen/food_classes.py +0 -33
  220. fnschool/canteen/food_classes.toml +0 -64
  221. fnschool/canteen/operator.py +0 -91
  222. fnschool/canteen/path.py +0 -28
  223. fnschool/canteen/spreadsheet/base.py +0 -213
  224. fnschool/canteen/spreadsheet/consuming.py +0 -310
  225. fnschool/canteen/spreadsheet/consumingsum.py +0 -76
  226. fnschool/canteen/spreadsheet/cover.py +0 -64
  227. fnschool/canteen/spreadsheet/ctspreadsheet.py +0 -351
  228. fnschool/canteen/spreadsheet/food.py +0 -680
  229. fnschool/canteen/spreadsheet/inventory.py +0 -375
  230. fnschool/canteen/spreadsheet/merging.py +0 -340
  231. fnschool/canteen/spreadsheet/preconsuming.py +0 -329
  232. fnschool/canteen/spreadsheet/purchasing.py +0 -885
  233. fnschool/canteen/spreadsheet/purchasingsum.py +0 -110
  234. fnschool/canteen/spreadsheet/spreadsheet.py +0 -363
  235. fnschool/canteen/spreadsheet/translating.py +0 -12
  236. fnschool/canteen/spreadsheet/unwarehousing.py +0 -178
  237. fnschool/canteen/spreadsheet/unwarehousingsum.py +0 -11
  238. fnschool/canteen/spreadsheet/warehousing.py +0 -360
  239. fnschool/canteen/spreadsheet/workbook.py +0 -17
  240. fnschool/canteen/test.py +0 -97
  241. fnschool/config.py +0 -48
  242. fnschool/entry.py +0 -67
  243. fnschool/exam/__init__.py +0 -8
  244. fnschool/exam/data/parental_emails.xlsx +0 -0
  245. fnschool/exam/data/score.xlsx +0 -0
  246. fnschool/exam/email.py +0 -349
  247. fnschool/exam/entry.py +0 -36
  248. fnschool/exam/language.py +0 -19
  249. fnschool/exam/path.py +0 -24
  250. fnschool/exam/score.py +0 -1191
  251. fnschool/exam/subject.py +0 -20
  252. fnschool/exam/teacher.py +0 -54
  253. fnschool/external.py +0 -89
  254. fnschool/games/__init__.py +0 -1
  255. fnschool/games/__main__.py +0 -1
  256. fnschool/games/games.py +0 -1
  257. fnschool/inoutput.py +0 -97
  258. fnschool/language.py +0 -40
  259. fnschool/locales/en_US/LC_MESSAGES/fnschool.mo +0 -0
  260. fnschool/locales/zh_CN/LC_MESSAGES/fnschool.mo +0 -0
  261. fnschool/locales/zh_HK/LC_MESSAGES/fnschool.mo +0 -0
  262. fnschool/locales/zh_SG/LC_MESSAGES/fnschool.mo +0 -0
  263. fnschool/locales/zh_TW/LC_MESSAGES/fnschool.mo +0 -0
  264. fnschool/path.py +0 -45
  265. fnschool/test.py +0 -24
  266. fnschool/user.py +0 -262
  267. fnschool-20250109.80531.837.dist-info/METADATA +0 -342
  268. fnschool-20250109.80531.837.dist-info/RECORD +0 -78
  269. fnschool-20250109.80531.837.dist-info/entry_points.txt +0 -5
  270. fnschool-20250109.80531.837.dist-info/top_level.txt +0 -1
  271. /fnschool/canteen/consume.py → /fnschoo1/canteen/__init__.py +0 -0
  272. /fnschool/canteen/food_recount.toml → /fnschoo1/canteen/migrations/__init__.py +0 -0
  273. {fnschool/canteen/spreadsheet → fnschoo1/canteen/workbook}/__init__.py +0 -0
  274. /fnschool/exam/__main__.py → /fnschoo1/fnschool/templatetags/__init__.py +0 -0
  275. /fnschool/canteen/food_recounts.toml → /fnschoo1/profiles/__init__.py +0 -0
  276. /fnschool/canteen/warehouse.py → /fnschoo1/profiles/migrations/__init__.py +0 -0
  277. /fnschool/canteen/workbook.toml → /fnschoo1/templates/base/_content.html +0 -0
  278. {fnschool-20250109.80531.837.dist-info → fnschool-20251011.81638.854.dist-info/licenses}/LICENSE +0 -0
@@ -1,61 +0,0 @@
1
-
2
- [food_classes]
3
- "肉食类"=[
4
- "*肉*!*面*",
5
- "*鸡*!*蛋*!*精*",
6
- "*鸭*!*蛋*",
7
- "*牛*!*面*",
8
- "*羊*",
9
- "*猪*"
10
- ]
11
- "粮食类"=[
12
- "*蛋黄派",
13
- "*米",
14
- "*町*",
15
- "*面*!*辣椒*",
16
- "*玉米棒*",
17
- "*馒*",
18
- "*包",
19
- "*米线",
20
- "*卷粉",
21
- "*圆粉",
22
- "*扁粉"
23
- ]
24
- "蛋奶及糕点类"=[
25
- "*蛋*!*蛋黄派*",
26
- "*奶*!*奶香*",
27
- ]
28
- "油类"=[
29
- "*油*!*蚝油*!*花椒油*!*酱油*!*油麦菜*!*老干妈*",
30
- ]
31
- "调味类"=[
32
- "*葱*",
33
- "*姜*",
34
- "*蒜*!*蒜苔*",
35
- "*辣*",
36
- "*香菜*",
37
- "*糖*",
38
- "*八角*",
39
- "*草果*",
40
- "*花椒*",
41
- "*老干妈*",
42
- "*醋*",
43
- "*蘸*",
44
- "*酒*",
45
- "*盐*",
46
- "*蚝油*",
47
- "*味精*",
48
- "*鸡精*",
49
- "*生抽*",
50
- "*折耳根*",
51
- "*芹*",
52
- "*老抽*",
53
- "*酱油*",
54
- ]
55
- "水果类"=[
56
- "*蕉*",
57
- "*苹果*",
58
- "*梨*",
59
- ]
60
-
61
- # The end.
@@ -1,10 +0,0 @@
1
- import os
2
- import sys
3
-
4
- from fnschool import *
5
- from fnschool.canteen.path import *
6
-
7
-
8
- class CtConfig(Config):
9
- def __init__(self, config_fpath):
10
- super().__init__(config_fpath)
@@ -1,53 +0,0 @@
1
- import os
2
- import sys
3
- from datetime import datetime
4
- from fnschool import *
5
-
6
-
7
- class Consuming:
8
- def __init__(self, bill):
9
- self.bill = bill
10
- self._year = None
11
- self._month = None
12
- self._day_m1 = None
13
-
14
- @property
15
- def year(self):
16
- if not self._year:
17
- foods = self.bill.foods
18
- foods = sorted(foods, key=lambda f: f.xdate)
19
- self._year = foods[-1].xdate.year
20
- return self._year
21
-
22
- @property
23
- def month(self):
24
- if not self._month:
25
- foods = self.bill.foods
26
- foods = sorted(foods, key=lambda f: f.xdate)
27
- self._month = foods[-1].xdate.month
28
- return self._month
29
-
30
- @property
31
- def date_m1(self):
32
- date_m1 = datetime(self.year, self.month, self.day_m1)
33
- return date_m1
34
-
35
- @property
36
- def day_m1(self):
37
- if not self._day_m1:
38
- self._day_m1 = 0
39
- foods = self.bill.foods
40
- for f in foods:
41
- self._day_m1 = max(
42
- [d.day for d, __ in f.consumptions] + [self._day_m1]
43
- )
44
- if self._day_m1 < 1:
45
- print_error(
46
- _(
47
- "It seems you didn't design the consumptions, "
48
- + "please restart {0} and design "
49
- + "the consumptions."
50
- ).format(app_name)
51
- )
52
- exit()
53
- return self._day_m1
@@ -1,17 +0,0 @@
1
- import os
2
- import sys
3
-
4
- from fnschool import *
5
-
6
-
7
- class Currency:
8
- def __init__(self, name=None, unit=None, mark=None):
9
- self.name = name
10
- self.unit = unit
11
- self.mark = mark
12
-
13
- @property
14
- def CNY(self):
15
- CNY = Currency("CNY", _("CNY"), "\u00a5")
16
-
17
- return CNY
Binary file
Binary file
Binary file
Binary file
fnschool/canteen/entry.py DELETED
@@ -1,40 +0,0 @@
1
- import os
2
- import sys
3
- from fnschool import *
4
-
5
-
6
- def set_canteen(args):
7
- from fnschool.canteen.bill import Bill
8
-
9
- print_app()
10
-
11
- bill = Bill()
12
- if args.action in "mk_bill":
13
- bill.make_spreadsheets()
14
-
15
- elif args.action in "merge_foodsheets":
16
- bill.merge_foodsheets()
17
-
18
- else:
19
- print_info(_("Function is not found."))
20
-
21
-
22
- def parse_canteen(subparsers):
23
- parser_canteen = subparsers.add_parser(
24
- "canteen", help=_("Canteen related functions.")
25
- )
26
- parser_canteen.add_argument(
27
- "action",
28
- choices=[
29
- "mk_bill",
30
- "merge_foodsheets",
31
- ],
32
- help=_(
33
- 'The functions of canteen. "mk_bill": Make bill. '
34
- + '"merge_foodsheets": Merge food sheets.'
35
- ),
36
- )
37
- parser_canteen.set_defaults(func=set_canteen)
38
-
39
-
40
- # The end.
fnschool/canteen/food.py DELETED
@@ -1,206 +0,0 @@
1
- import os
2
- import sys
3
- from datetime import datetime, timedelta
4
-
5
- import pandas as pd
6
- import numpy as np
7
-
8
- from fnschool import *
9
-
10
-
11
- class Food:
12
- def __init__(
13
- self,
14
- bill,
15
- name,
16
- unit_name,
17
- count,
18
- total_price,
19
- xdate,
20
- purchaser,
21
- fclass,
22
- meal_type=None,
23
- is_abandoned=False,
24
- is_inventory=False,
25
- ):
26
- self.bill = bill
27
- self.sd = self.bill.significant_digits
28
- self.name = name
29
- self.unit_name = unit_name
30
- self.count = round(float(count), self.sd + 1)
31
- self.fclass = fclass
32
- self.total_price = round(float(total_price), self.sd + 1)
33
- self.xdate = self.datefstr(xdate)
34
- self.purchaser = purchaser
35
- self.is_abandoned = is_abandoned
36
- self.is_inventory = is_inventory
37
- self.consumptions = []
38
- self.meal_type = meal_type or ""
39
- self._count_threshold = None
40
- pass
41
-
42
- def get_display_name(self, is_residual=False, time_node0=None):
43
- is_residual = is_residual or (time_node0 and self.xdate < time_node0)
44
-
45
- name = self.name + (
46
- (
47
- _("({0})").format(
48
- ((_("Remaining") + "|") if is_residual else "")
49
- + (self.meal_type if self.meal_type else "")
50
- )
51
- )
52
- if (is_residual or self.meal_type)
53
- else ""
54
- )
55
-
56
- return name
57
-
58
- @property
59
- def count_threshold(self):
60
- if not self.count:
61
- print_error(
62
- _('The count of "{0}" is 0, you need to delete it maybe.')
63
- )
64
- return [0, 0, 0]
65
-
66
- if not self._count_threshold:
67
- sd = self.bill.significant_digits or 2
68
- total_price = self.total_price
69
- count = self.count
70
-
71
- dot_0_r = r"[.|0]+$"
72
-
73
- count_s = str(count)
74
- count_s = re.sub(dot_0_r, "", count_s)
75
- count_sd = len(count_s.split(".")[1]) if "." in count_s else 0
76
- count_scale = 10**count_sd
77
-
78
- total_price_s = str(total_price)
79
- total_price_s = re.sub(dot_0_r, "", total_price_s)
80
- total_price_sd = (
81
- len(total_price_s.split(".")[1]) if "." in total_price_s else 0
82
- )
83
-
84
- sd = max(sd, count_sd, total_price_sd)
85
- scale = 10**sd
86
-
87
- unit_price = total_price / count
88
- total_price0 = int(total_price * scale)
89
- count0 = int(count * scale)
90
-
91
- unit_price_sd = sd - count_sd
92
- unit_price_scale = 10**unit_price_sd
93
- unit_price0 = (
94
- math.floor((total_price0 / count0) * unit_price_scale)
95
- / unit_price_scale
96
- )
97
-
98
- total_price1 = unit_price0 * count
99
- total_price1 = (
100
- int(total_price1)
101
- if re.search(dot_0_r, str(total_price1))
102
- else total_price1
103
- )
104
-
105
- count1 = count0 / scale
106
- count1 = int(count1) if re.search(dot_0_r, str(count1)) else count1
107
- count1_s = str(count1)
108
- count1_sd = len(count1_s.split(".")[1]) if "." in count1_s else 0
109
- count1_scale = 10**count1_sd
110
-
111
- count2 = count1
112
- if count1_sd > 0:
113
- count2 = math.floor(count1 * count1_scale)
114
-
115
- unit_price1 = unit_price0
116
- unit_price1 = (
117
- int(unit_price1)
118
- if re.search(dot_0_r, str(unit_price1))
119
- else unit_price1
120
- )
121
-
122
- total_price_diff = round(total_price - total_price1, sd + 1)
123
-
124
- if not total_price_diff:
125
- self._count_threshold = (self.unit_price, self.unit_price, 0)
126
- else:
127
- total_price_d_s = str(total_price_diff)
128
-
129
- total_price_d_sd = (
130
- len(total_price_d_s.split(".")[1])
131
- if "." in total_price_d_s
132
- else 0
133
- )
134
-
135
- total_price_diff2 = total_price_diff
136
- total_price_diff2_scale = 10 ** (total_price_d_sd - count_sd)
137
- total_price_diff2_p = 1 / (total_price_diff2_scale)
138
- if total_price_diff2 > 0.0:
139
- total_price_diff2 = math.floor(
140
- total_price_diff * 10**total_price_d_sd
141
- )
142
- unit_price3_scale = 10 ** (count1_sd - count_sd)
143
- unit_price3 = round(unit_price1 / unit_price3_scale, sd + 1)
144
-
145
- unit_price4 = round(unit_price3 + total_price_diff2_p, sd + 1)
146
- count_threshold = round(total_price_diff2 / count_scale, sd + 1)
147
-
148
- self._count_threshold = (
149
- unit_price3,
150
- unit_price4,
151
- count_threshold,
152
- )
153
-
154
- return self._count_threshold
155
-
156
- def datefstr(self, value):
157
- if isinstance(value, datetime):
158
- return value
159
- if isinstance(value, str):
160
- if "'" in value:
161
- value = value.replace("'", "")
162
- if "=" in value:
163
- value = value.replace("=", "")
164
-
165
- value = (
166
- value.split("-")
167
- if "-" in value
168
- else (
169
- value.split(".")
170
- if "." in value
171
- else (
172
- value.split("/")
173
- if "/" in value
174
- else [value[:4], value[4:6], value[6:]]
175
- )
176
- )
177
- )
178
- value = datetime(int(value[0]), int(value[1]), int(value[2]))
179
- return value
180
-
181
- @property
182
- def unit_price(self):
183
- value = 0 if not self.count else (self.total_price / self.count)
184
- value = round(value, self.sd + 1)
185
- return value
186
-
187
- def get_remainder(self, cdate):
188
- value = None
189
- if self.xdate < cdate:
190
- value = self.count - sum(
191
- [c for d, c in self.consumptions if d <= cdate]
192
- )
193
- if self.xdate == cdate:
194
- value = self.count
195
- if self.xdate > cdate:
196
- value = 0
197
- value = round(value, self.sd + 1)
198
- return value
199
-
200
- def get_consuming_count(self, cdate):
201
- consuming_count = self.count - self.get_remainder(cdate)
202
- consuming_count = round(consuming_count, self.sd + 1)
203
- return consuming_count
204
-
205
-
206
- # The end.
@@ -1,33 +0,0 @@
1
- import os
2
- import sys
3
- from openpyxl.utils.cell import get_column_letter
4
- import tomllib
5
- from tkinter import filedialog, ttk
6
- import tkinter as tk
7
-
8
- from fnschool import *
9
- from fnschool.canteen.path import *
10
- from fnschool.canteen.food import *
11
- from fnschool.canteen.spreadsheet.base import *
12
- from openpyxl.worksheet.datavalidation import DataValidation
13
-
14
-
15
- class FoodClass:
16
- def __init__(self, name, likes):
17
- self.name = name
18
- self.likes = likes
19
- pass
20
-
21
-
22
- class FoodClasses:
23
- def __init__(self):
24
- pass
25
-
26
- @property
27
- def value(self):
28
- value0 = []
29
- value1 = value0 if is_zh_CN else value0
30
- return value1
31
-
32
-
33
- # The end.
@@ -1,64 +0,0 @@
1
-
2
- "肉食类"=[
3
- "*肉*!*面*",
4
- "*鸡*!*蛋*!*精*",
5
- "*鸭*!*蛋*",
6
- "*牛*!*面*",
7
- "*羊*",
8
- "*猪*"
9
- ]
10
- "粮食类"=[
11
- "*蛋黄派",
12
- "*米!*黄豆米*",
13
- "*町*",
14
- "*面*!*辣椒*",
15
- # "*玉米棒*",
16
- # "*玉米粒*",
17
- "*馒*",
18
- "*包",
19
- "*米线",
20
- "*卷粉",
21
- "*圆粉",
22
- "*扁粉"
23
- ]
24
- "蛋奶及糕点类"=[
25
- "*蛋*!*蛋黄派*",
26
- "*奶*!*馒*",
27
- ]
28
- "油类"=[
29
- "*油*!*蚝油*!*花椒油*!*酱油*!*油麦菜*!*老干妈*",
30
- ]
31
- "调味类"=[
32
- "*葱*",
33
- "*姜*",
34
- "*蒜*!*蒜苔*",
35
- "*辣*",
36
- "*香菜*",
37
- "*糖*",
38
- "*八角*",
39
- "*草果*",
40
- "*花椒*",
41
- "*老干妈*",
42
- "*醋*",
43
- "*蘸*",
44
- "*酒*",
45
- "*盐*",
46
- "*蚝油*",
47
- "*酱油*",
48
- "*豆瓣酱*",
49
- "*味精*",
50
- "*鸡精*",
51
- "*生抽*",
52
- "*折耳根*",
53
- "*芹*",
54
- "*桂皮*",
55
- "*胡椒粉*",
56
- "*韭*",
57
- ]
58
- "水果类"=[
59
- "*蕉*",
60
- "*苹果*",
61
- "*梨*",
62
- ]
63
-
64
- # The end.
@@ -1,91 +0,0 @@
1
- import os
2
- import sys
3
- import uuid
4
- import tomllib
5
-
6
- from fnschool import *
7
- from fnschool.canteen.path import *
8
- from fnschool.canteen.config import *
9
-
10
-
11
- class Operator(User):
12
- def __init__(self, bill):
13
- super().__init__(user_canteen_dpath, operator_name_fpath)
14
- self.bill = bill
15
- self.workbook_ext = ".xlsx"
16
- pass
17
-
18
- @property
19
- def preconsuming_dpath(self):
20
- dpath = self.dpath / _("preconsuming")
21
- if not dpath.exists():
22
- os.makedirs(dpath, exist_ok=True)
23
- return dpath
24
-
25
- @property
26
- def food_classes_fpath(self):
27
- fpath = self.config_dpath / (_("food_classes") + ".toml")
28
- if not fpath.exists():
29
- shutil.copy(food_classes_config0_fpath, fpath)
30
- return fpath
31
-
32
- @property
33
- def superior_department(self):
34
- info = _(
35
- "Please tell {0} the alias of your "
36
- + "superior department, "
37
- + "{0} will use it as the form title ("
38
- + '"purchasing summary" form, '
39
- + '"consuming summary" form, etc). '
40
- + 'e.g: "富宁县那能乡中小学". '
41
- + "If you haven't noticed it, "
42
- + "you can check the previous bill "
43
- + "first and then let {0} know."
44
- ).format(app_name)
45
- superior_department0 = self.get_profile(
46
- key=_("superior department"), info=info
47
- )
48
- return superior_department0
49
-
50
- @property
51
- def bill_dpath(self):
52
- dpath = self.dpath / _("bill")
53
- if not dpath.exists():
54
- os.makedirs(dpath, exist_ok=True)
55
- return dpath
56
-
57
- @property
58
- def bill_fpath(self):
59
- fpath = self.get_bill_fpath()
60
- return fpath
61
-
62
- def get_bill_fpath(self, mtype=None):
63
- fpath = self.bill_dpath / (
64
- _("bill")
65
- + (
66
- (
67
- _("({0})").format(self.bill.meal_type)
68
- if self.bill.meal_type
69
- else ""
70
- )
71
- if not mtype
72
- else _("({0})").format(mtype)
73
- )
74
- + self.workbook_ext
75
- )
76
- if not fpath.exists():
77
- shutil.copy(bill0_fpath, fpath)
78
- return fpath
79
-
80
- @property
81
- def bill_fpath_uuid(self):
82
- fpath = (
83
- str(self.bill_fpath).rpartition(".")[0]
84
- + "."
85
- + str(uuid.uuid4())
86
- + self.bill_fpath.suffix
87
- )
88
- return fpath
89
-
90
-
91
- # The end.
fnschool/canteen/path.py DELETED
@@ -1,28 +0,0 @@
1
- import os
2
- import sys
3
- import tomllib
4
- import shutil
5
- from fnschool import *
6
- from fnschool.external import *
7
-
8
-
9
- food_classes_config0_fpath = Path(__file__).parent / "food_classes.toml"
10
- canteen_data_dpath = Path(__file__).parent / "data"
11
- bill0_fpath = canteen_data_dpath / "bill.xlsx"
12
- pre_consuming0_fpath = canteen_data_dpath / "consuming.xlsx"
13
- user_canteen_dpath = user_data_dir / _("canteen")
14
- operator_name_fpath = user_canteen_dpath / (_("operator_name") + ".txt")
15
- documents_dpath = Path.home() / "Documents"
16
-
17
- for d in [
18
- user_canteen_dpath,
19
- ]:
20
- if not d.exists():
21
- os.makedirs(d, exist_ok=True)
22
-
23
- if not operator_name_fpath.exists():
24
- with open(operator_name_fpath, "w", encoding="utf-8") as f:
25
- f.write("")
26
-
27
-
28
- # The end.