fnschool 20250109.80531.837__py3-none-any.whl → 20251011.80531.840__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 (276) hide show
  1. fnschoo1/__init__.py +52 -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/js/bootstrap.bundle.min.js +4223 -0
  71. fnschoo1/static/js/bootstrap.min.js +2919 -0
  72. fnschoo1/static/js/fnschool.js +84 -0
  73. fnschoo1/static/js/jquery.min.js +5413 -0
  74. fnschoo1/static/js/jquery.slim.min.js +4331 -0
  75. fnschoo1/static/js/popper.min.js +1306 -0
  76. fnschoo1/static_collected/admin/css/autocomplete.css +377 -0
  77. fnschoo1/static_collected/admin/css/base.css +1224 -0
  78. fnschoo1/static_collected/admin/css/changelists.css +334 -0
  79. fnschoo1/static_collected/admin/css/dark_mode.css +136 -0
  80. fnschoo1/static_collected/admin/css/dashboard.css +30 -0
  81. fnschoo1/static_collected/admin/css/forms.css +546 -0
  82. fnschoo1/static_collected/admin/css/login.css +62 -0
  83. fnschoo1/static_collected/admin/css/nav_sidebar.css +145 -0
  84. fnschoo1/static_collected/admin/css/responsive.css +1043 -0
  85. fnschoo1/static_collected/admin/css/responsive_rtl.css +84 -0
  86. fnschoo1/static_collected/admin/css/rtl.css +311 -0
  87. fnschoo1/static_collected/admin/css/vendor/select2/select2.css +708 -0
  88. fnschoo1/static_collected/admin/css/vendor/select2/select2.min.css +1 -0
  89. fnschoo1/static_collected/admin/css/widgets.css +639 -0
  90. fnschoo1/static_collected/admin/js/SelectBox.js +128 -0
  91. fnschoo1/static_collected/admin/js/SelectFilter2.js +503 -0
  92. fnschoo1/static_collected/admin/js/actions.js +232 -0
  93. fnschoo1/static_collected/admin/js/admin/DateTimeShortcuts.js +496 -0
  94. fnschoo1/static_collected/admin/js/admin/RelatedObjectLookups.js +276 -0
  95. fnschoo1/static_collected/admin/js/autocomplete.js +33 -0
  96. fnschoo1/static_collected/admin/js/calendar.js +251 -0
  97. fnschoo1/static_collected/admin/js/cancel.js +29 -0
  98. fnschoo1/static_collected/admin/js/change_form.js +21 -0
  99. fnschoo1/static_collected/admin/js/collapse.js +43 -0
  100. fnschoo1/static_collected/admin/js/core.js +174 -0
  101. fnschoo1/static_collected/admin/js/filters.js +37 -0
  102. fnschoo1/static_collected/admin/js/inlines.js +439 -0
  103. fnschoo1/static_collected/admin/js/jquery.init.js +8 -0
  104. fnschoo1/static_collected/admin/js/nav_sidebar.js +81 -0
  105. fnschoo1/static_collected/admin/js/popup_response.js +24 -0
  106. fnschoo1/static_collected/admin/js/prepopulate.js +43 -0
  107. fnschoo1/static_collected/admin/js/prepopulate_init.js +20 -0
  108. fnschoo1/static_collected/admin/js/theme.js +57 -0
  109. fnschoo1/static_collected/admin/js/urlify.js +529 -0
  110. fnschoo1/static_collected/admin/js/vendor/jquery/jquery.js +10913 -0
  111. fnschoo1/static_collected/admin/js/vendor/jquery/jquery.min.js +2 -0
  112. fnschoo1/static_collected/admin/js/vendor/select2/i18n/af.js +43 -0
  113. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ar.js +36 -0
  114. fnschoo1/static_collected/admin/js/vendor/select2/i18n/az.js +33 -0
  115. fnschoo1/static_collected/admin/js/vendor/select2/i18n/bg.js +38 -0
  116. fnschoo1/static_collected/admin/js/vendor/select2/i18n/bn.js +39 -0
  117. fnschoo1/static_collected/admin/js/vendor/select2/i18n/bs.js +48 -0
  118. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ca.js +41 -0
  119. fnschoo1/static_collected/admin/js/vendor/select2/i18n/cs.js +62 -0
  120. fnschoo1/static_collected/admin/js/vendor/select2/i18n/da.js +37 -0
  121. fnschoo1/static_collected/admin/js/vendor/select2/i18n/de.js +41 -0
  122. fnschoo1/static_collected/admin/js/vendor/select2/i18n/dsb.js +51 -0
  123. fnschoo1/static_collected/admin/js/vendor/select2/i18n/el.js +43 -0
  124. fnschoo1/static_collected/admin/js/vendor/select2/i18n/en.js +41 -0
  125. fnschoo1/static_collected/admin/js/vendor/select2/i18n/es.js +41 -0
  126. fnschoo1/static_collected/admin/js/vendor/select2/i18n/et.js +38 -0
  127. fnschoo1/static_collected/admin/js/vendor/select2/i18n/eu.js +45 -0
  128. fnschoo1/static_collected/admin/js/vendor/select2/i18n/fa.js +42 -0
  129. fnschoo1/static_collected/admin/js/vendor/select2/i18n/fi.js +42 -0
  130. fnschoo1/static_collected/admin/js/vendor/select2/i18n/fr.js +43 -0
  131. fnschoo1/static_collected/admin/js/vendor/select2/i18n/gl.js +40 -0
  132. fnschoo1/static_collected/admin/js/vendor/select2/i18n/he.js +44 -0
  133. fnschoo1/static_collected/admin/js/vendor/select2/i18n/hi.js +40 -0
  134. fnschoo1/static_collected/admin/js/vendor/select2/i18n/hr.js +45 -0
  135. fnschoo1/static_collected/admin/js/vendor/select2/i18n/hsb.js +51 -0
  136. fnschoo1/static_collected/admin/js/vendor/select2/i18n/hu.js +44 -0
  137. fnschoo1/static_collected/admin/js/vendor/select2/i18n/hy.js +40 -0
  138. fnschoo1/static_collected/admin/js/vendor/select2/i18n/id.js +36 -0
  139. fnschoo1/static_collected/admin/js/vendor/select2/i18n/is.js +37 -0
  140. fnschoo1/static_collected/admin/js/vendor/select2/i18n/it.js +43 -0
  141. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ja.js +40 -0
  142. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ka.js +42 -0
  143. fnschoo1/static_collected/admin/js/vendor/select2/i18n/km.js +38 -0
  144. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ko.js +42 -0
  145. fnschoo1/static_collected/admin/js/vendor/select2/i18n/lt.js +45 -0
  146. fnschoo1/static_collected/admin/js/vendor/select2/i18n/lv.js +41 -0
  147. fnschoo1/static_collected/admin/js/vendor/select2/i18n/mk.js +42 -0
  148. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ms.js +38 -0
  149. fnschoo1/static_collected/admin/js/vendor/select2/i18n/nb.js +38 -0
  150. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ne.js +44 -0
  151. fnschoo1/static_collected/admin/js/vendor/select2/i18n/nl.js +46 -0
  152. fnschoo1/static_collected/admin/js/vendor/select2/i18n/pl.js +43 -0
  153. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ps.js +41 -0
  154. fnschoo1/static_collected/admin/js/vendor/select2/i18n/pt-BR.js +39 -0
  155. fnschoo1/static_collected/admin/js/vendor/select2/i18n/pt.js +41 -0
  156. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ro.js +43 -0
  157. fnschoo1/static_collected/admin/js/vendor/select2/i18n/ru.js +48 -0
  158. fnschoo1/static_collected/admin/js/vendor/select2/i18n/sk.js +61 -0
  159. fnschoo1/static_collected/admin/js/vendor/select2/i18n/sl.js +41 -0
  160. fnschoo1/static_collected/admin/js/vendor/select2/i18n/sq.js +43 -0
  161. fnschoo1/static_collected/admin/js/vendor/select2/i18n/sr-Cyrl.js +48 -0
  162. fnschoo1/static_collected/admin/js/vendor/select2/i18n/sr.js +48 -0
  163. fnschoo1/static_collected/admin/js/vendor/select2/i18n/sv.js +40 -0
  164. fnschoo1/static_collected/admin/js/vendor/select2/i18n/th.js +36 -0
  165. fnschoo1/static_collected/admin/js/vendor/select2/i18n/tk.js +36 -0
  166. fnschoo1/static_collected/admin/js/vendor/select2/i18n/tr.js +40 -0
  167. fnschoo1/static_collected/admin/js/vendor/select2/i18n/uk.js +59 -0
  168. fnschoo1/static_collected/admin/js/vendor/select2/i18n/vi.js +37 -0
  169. fnschoo1/static_collected/admin/js/vendor/select2/i18n/zh-CN.js +36 -0
  170. fnschoo1/static_collected/admin/js/vendor/select2/i18n/zh-TW.js +33 -0
  171. fnschoo1/static_collected/admin/js/vendor/select2/select2.full.js +7115 -0
  172. fnschoo1/static_collected/admin/js/vendor/select2/select2.full.min.js +2 -0
  173. fnschoo1/static_collected/admin/js/vendor/xregexp/xregexp.js +4993 -0
  174. fnschoo1/static_collected/admin/js/vendor/xregexp/xregexp.min.js +160 -0
  175. fnschoo1/static_collected/css/bootstrap.min.css +11776 -0
  176. fnschoo1/static_collected/css/fnschool.css +26 -0
  177. fnschoo1/static_collected/js/bootstrap.bundle.min.js +4223 -0
  178. fnschoo1/static_collected/js/bootstrap.min.js +2919 -0
  179. fnschoo1/static_collected/js/fnschool.js +84 -0
  180. fnschoo1/static_collected/js/jquery.min.js +5413 -0
  181. fnschoo1/static_collected/js/jquery.slim.min.js +4331 -0
  182. fnschoo1/static_collected/js/popper.min.js +1306 -0
  183. fnschoo1/templates/base/_css.html +1 -0
  184. fnschoo1/templates/base/_js.html +15 -0
  185. fnschoo1/templates/base/content.html +30 -0
  186. fnschoo1/templates/base/header_content_footer.html +35 -0
  187. fnschoo1/templates/close.html +11 -0
  188. fnschoo1/templates/home.html +51 -0
  189. fnschoo1/templates/includes/_footer.html +39 -0
  190. fnschoo1/templates/includes/_header.html +77 -0
  191. fnschoo1/templates/includes/_navigation.html +0 -0
  192. fnschoo1/templates/includes/_paginator.html +27 -0
  193. fnschoo1/templates/registration/logged_out.html +0 -0
  194. fnschoo1/templates/registration/login.html +0 -0
  195. fnschool-20251011.80531.840.dist-info/METADATA +179 -0
  196. fnschool-20251011.80531.840.dist-info/RECORD +207 -0
  197. {fnschool-20250109.80531.837.dist-info → fnschool-20251011.80531.840.dist-info}/WHEEL +1 -1
  198. fnschool-20251011.80531.840.dist-info/entry_points.txt +2 -0
  199. fnschool-20251011.80531.840.dist-info/top_level.txt +1 -0
  200. fnschool/__init__.py +0 -35
  201. fnschool/__main__.py +0 -16
  202. fnschool/app.py +0 -103
  203. fnschool/canteen/__init__.py +0 -3
  204. fnschool/canteen/__main__.py +0 -3
  205. fnschool/canteen/bill.py +0 -253
  206. fnschool/canteen/canteen.py +0 -1
  207. fnschool/canteen/canteen.toml +0 -61
  208. fnschool/canteen/config.py +0 -10
  209. fnschool/canteen/consuming.py +0 -53
  210. fnschool/canteen/currency.py +0 -17
  211. fnschool/canteen/data/bill.i18n.xlsx +0 -0
  212. fnschool/canteen/data/bill.xlsx +0 -0
  213. fnschool/canteen/data/consuming.xlsx +0 -0
  214. fnschool/canteen/data/purchase_list.xlsx +0 -0
  215. fnschool/canteen/entry.py +0 -40
  216. fnschool/canteen/food.py +0 -206
  217. fnschool/canteen/food_classes.py +0 -33
  218. fnschool/canteen/food_classes.toml +0 -64
  219. fnschool/canteen/operator.py +0 -91
  220. fnschool/canteen/path.py +0 -28
  221. fnschool/canteen/spreadsheet/base.py +0 -213
  222. fnschool/canteen/spreadsheet/consuming.py +0 -310
  223. fnschool/canteen/spreadsheet/consumingsum.py +0 -76
  224. fnschool/canteen/spreadsheet/cover.py +0 -64
  225. fnschool/canteen/spreadsheet/ctspreadsheet.py +0 -351
  226. fnschool/canteen/spreadsheet/food.py +0 -680
  227. fnschool/canteen/spreadsheet/inventory.py +0 -375
  228. fnschool/canteen/spreadsheet/merging.py +0 -340
  229. fnschool/canteen/spreadsheet/preconsuming.py +0 -329
  230. fnschool/canteen/spreadsheet/purchasing.py +0 -885
  231. fnschool/canteen/spreadsheet/purchasingsum.py +0 -110
  232. fnschool/canteen/spreadsheet/spreadsheet.py +0 -363
  233. fnschool/canteen/spreadsheet/translating.py +0 -12
  234. fnschool/canteen/spreadsheet/unwarehousing.py +0 -178
  235. fnschool/canteen/spreadsheet/unwarehousingsum.py +0 -11
  236. fnschool/canteen/spreadsheet/warehousing.py +0 -360
  237. fnschool/canteen/spreadsheet/workbook.py +0 -17
  238. fnschool/canteen/test.py +0 -97
  239. fnschool/config.py +0 -48
  240. fnschool/entry.py +0 -67
  241. fnschool/exam/__init__.py +0 -8
  242. fnschool/exam/data/parental_emails.xlsx +0 -0
  243. fnschool/exam/data/score.xlsx +0 -0
  244. fnschool/exam/email.py +0 -349
  245. fnschool/exam/entry.py +0 -36
  246. fnschool/exam/language.py +0 -19
  247. fnschool/exam/path.py +0 -24
  248. fnschool/exam/score.py +0 -1191
  249. fnschool/exam/subject.py +0 -20
  250. fnschool/exam/teacher.py +0 -54
  251. fnschool/external.py +0 -89
  252. fnschool/games/__init__.py +0 -1
  253. fnschool/games/__main__.py +0 -1
  254. fnschool/games/games.py +0 -1
  255. fnschool/inoutput.py +0 -97
  256. fnschool/language.py +0 -40
  257. fnschool/locales/en_US/LC_MESSAGES/fnschool.mo +0 -0
  258. fnschool/locales/zh_CN/LC_MESSAGES/fnschool.mo +0 -0
  259. fnschool/locales/zh_HK/LC_MESSAGES/fnschool.mo +0 -0
  260. fnschool/locales/zh_SG/LC_MESSAGES/fnschool.mo +0 -0
  261. fnschool/locales/zh_TW/LC_MESSAGES/fnschool.mo +0 -0
  262. fnschool/path.py +0 -45
  263. fnschool/test.py +0 -24
  264. fnschool/user.py +0 -262
  265. fnschool-20250109.80531.837.dist-info/METADATA +0 -342
  266. fnschool-20250109.80531.837.dist-info/RECORD +0 -78
  267. fnschool-20250109.80531.837.dist-info/entry_points.txt +0 -5
  268. fnschool-20250109.80531.837.dist-info/top_level.txt +0 -1
  269. /fnschool/canteen/consume.py → /fnschoo1/canteen/__init__.py +0 -0
  270. /fnschool/canteen/food_recount.toml → /fnschoo1/canteen/migrations/__init__.py +0 -0
  271. {fnschool/canteen/spreadsheet → fnschoo1/canteen/workbook}/__init__.py +0 -0
  272. /fnschool/exam/__main__.py → /fnschoo1/fnschool/templatetags/__init__.py +0 -0
  273. /fnschool/canteen/food_recounts.toml → /fnschoo1/profiles/__init__.py +0 -0
  274. /fnschool/canteen/warehouse.py → /fnschoo1/profiles/migrations/__init__.py +0 -0
  275. /fnschool/canteen/workbook.toml → /fnschoo1/templates/base/_content.html +0 -0
  276. {fnschool-20250109.80531.837.dist-info → fnschool-20251011.80531.840.dist-info/licenses}/LICENSE +0 -0
@@ -1,360 +0,0 @@
1
- import os
2
- import sys
3
- from openpyxl.styles import *
4
- from openpyxl.formatting.rule import *
5
- from openpyxl.styles.differential import *
6
- from openpyxl.utils.cell import *
7
-
8
-
9
- from fnschool import *
10
-
11
- from fnschool.canteen.spreadsheet.base import *
12
-
13
-
14
- class Warehousing(Base):
15
- def __init__(self, bill, form_row_len=21):
16
- super().__init__(bill)
17
- self.sheet_name = self.s.warehousing_name
18
- self.entry_row_len0 = 21
19
- pass
20
-
21
- def get_entry_index(self, form_index):
22
- form_index0, form_index1 = form_index
23
- entry_index = [form_index0 + 2, form_index1 - 1]
24
- return entry_index
25
-
26
- def format(self):
27
- wsheet = self.sheet
28
- self.unmerge_sheet_cells()
29
-
30
- for row in wsheet.iter_rows(
31
- min_row=1, max_row=wsheet.max_row, min_col=1, max_col=8
32
- ):
33
- if row[0].value and row[0].value.replace(" ", "") == "入库单":
34
- wsheet.row_dimensions[row[0].row].height = 21
35
- wsheet.merge_cells(
36
- start_row=row[0].row,
37
- end_row=row[0].row,
38
- start_column=1,
39
- end_column=8,
40
- )
41
- wsheet.merge_cells(
42
- start_row=row[0].row + 1,
43
- end_row=row[0].row + 1,
44
- start_column=4,
45
- end_column=6,
46
- )
47
- wsheet.merge_cells(
48
- start_row=row[0].row + 1,
49
- end_row=row[0].row + 1,
50
- start_column=7,
51
- end_column=8,
52
- )
53
-
54
- if row[0].value and row[0].value.replace(" ", "").endswith("类"):
55
- row[6].number_format = numbers.FORMAT_NUMBER_00
56
- for _row in wsheet.iter_rows(
57
- min_row=row[0].row + 1,
58
- max_row=wsheet.max_row + 1,
59
- min_col=1,
60
- max_col=1,
61
- ):
62
- wsheet.row_dimensions[row[0].row].height = self.row_height
63
- if _row[0].value and (
64
- _row[0].value.replace(" ", "").endswith("类")
65
- or _row[0].value.replace(" ", "") == "合计"
66
- ):
67
- wsheet.merge_cells(
68
- start_row=row[0].row,
69
- end_row=_row[0].row - 1,
70
- start_column=1,
71
- end_column=1,
72
- )
73
- wsheet.merge_cells(
74
- start_row=row[0].row,
75
- end_row=_row[0].row - 1,
76
- start_column=7,
77
- end_column=7,
78
- )
79
- break
80
-
81
- ci0, ci1 = row[0].row, 0
82
- for _row in wsheet.iter_rows(
83
- min_row=row[0].row + 1,
84
- max_row=wsheet.max_row + 1,
85
- min_col=1,
86
- max_col=7,
87
- ):
88
- if _row[0].value and (
89
- str(_row[0].value).endswith("类")
90
- or "合计" in str(_row[0].value)
91
- ):
92
-
93
- ci1 = _row[0].row - 1
94
-
95
- fnames = [
96
- wsheet.cell(r, 2).value for r in range(ci0, ci1 + 1)
97
- ]
98
- fnames_d = list(
99
- set(
100
- [n for n in fnames if fnames.count(n) > 1 and n]
101
- )
102
- )
103
-
104
- for dn in fnames_d:
105
- row_index0_d = row[0].row + fnames.index(dn)
106
- row_index1_d = row_index0_d + fnames.count(dn) - 1
107
- fname = dn
108
- funit_name = wsheet.cell(row_index0_d, 3).value
109
- ftotal = sum(
110
- [
111
- wsheet.cell(r, 6).value
112
- for r in range(
113
- row_index0_d, row_index1_d + 1
114
- )
115
- ]
116
- )
117
-
118
- for r in range(row_index0_d, row_index1_d + 1):
119
- wsheet.cell(r, 2, "")
120
- wsheet.cell(r, 3, "")
121
- wsheet.cell(r, 6, "")
122
-
123
- wsheet.merge_cells(
124
- start_row=row_index0_d,
125
- end_row=row_index1_d,
126
- start_column=2,
127
- end_column=2,
128
- )
129
- wsheet.merge_cells(
130
- start_row=row_index0_d,
131
- end_row=row_index1_d,
132
- start_column=3,
133
- end_column=3,
134
- )
135
- wsheet.merge_cells(
136
- start_row=row_index0_d,
137
- end_row=row_index1_d,
138
- start_column=6,
139
- end_column=6,
140
- )
141
- wsheet.cell(row_index0_d, 2, fname)
142
- wsheet.cell(row_index0_d, 3, funit_name)
143
- wsheet.cell(row_index0_d, 6, ftotal)
144
-
145
- break
146
-
147
- if row[0].value and "审核人" in row[0].value.replace(" ", ""):
148
- wsheet.merge_cells(
149
- start_row=row[0].row,
150
- end_row=row[0].row,
151
- start_column=1,
152
- end_column=8,
153
- )
154
-
155
- wb = self.bwb
156
- wb.active = wsheet
157
-
158
- print_info(_("Sheet '%s' was formatted.") % self.sheet.title)
159
-
160
- @property
161
- def form_indexes(self):
162
- if self._form_indexes:
163
- return self._form_indexes
164
- wsheet = self.sheet
165
- indexes = []
166
- row_index = 1
167
- for row in wsheet.iter_rows(max_row=wsheet.max_row + 1, max_col=8):
168
- if row[0].value:
169
- if row[0].value.replace(" ", "") == "入库单":
170
- indexes.append([row_index + 1, 0])
171
- if row[0].value.replace(" ", "") == "合计":
172
- indexes[-1][1] = row_index
173
- row_index += 1
174
-
175
- if len(indexes) > 0:
176
- self._form_indexes = indexes
177
- return self._form_indexes
178
-
179
- return None
180
-
181
- def update(self):
182
- wsheet = self.sheet
183
- foods = [
184
- f
185
- for f in self.bfoods
186
- if (not f.is_inventory and not f.is_abandoned)
187
- ]
188
- form_indexes = self.form_indexes
189
- class_names = self.bill.food_class_names
190
-
191
- self.unmerge_sheet_cells(wsheet)
192
-
193
- for form_index0, form_index1 in form_indexes:
194
- food_index0 = form_index0 + 2
195
- food_index1 = form_index1 - 1
196
- for row in wsheet.iter_rows(
197
- min_row=food_index0,
198
- max_row=food_index1,
199
- min_col=1,
200
- max_col=8,
201
- ):
202
- for cell in row:
203
- cell.value = ""
204
-
205
- w_times = sorted(list(set([f.xdate for f in foods])))
206
-
207
- max_time_index = 0
208
- for windex, w_time in enumerate(w_times):
209
- max_time_index = windex + 1
210
- form_index0, form_index1 = form_indexes[windex]
211
- food_index0 = form_index0 + 2
212
- food_index1 = form_index1 - 1
213
- entry_index = food_index0
214
- warehousing_n = windex + 1
215
-
216
- wfoods = [f for f in foods if (f.xdate == w_time)]
217
- w_class_names = [f.fclass for f in wfoods]
218
- w_class_names_no_food = [
219
- name for name in class_names if not name in w_class_names
220
- ]
221
- row_difference = (
222
- len(wfoods)
223
- + len(w_class_names_no_food)
224
- - (food_index1 - food_index0 + 1)
225
- )
226
-
227
- if row_difference > 0:
228
- self.row_inserting_tip(food_index0 + 1)
229
- wsheet.insert_rows(food_index0 + 1, row_difference)
230
- for row in wsheet.iter_rows(
231
- min_row=food_index0 + 1,
232
- max_row=food_index0 + 1 + row_difference,
233
- min_col=1,
234
- max_col=8,
235
- ):
236
- for cell in row:
237
- cell.alignment = self.cell_alignment0
238
- self.border = self.cell_border0
239
-
240
- self.del_form_indexes()
241
- form_indexes = self.form_indexes
242
-
243
- form_index0, form_index1 = form_indexes[windex]
244
- food_index0 = form_index0 + 2
245
- food_index1 = form_index1 - 1
246
- entry_index = food_index0
247
-
248
- row_difference = 0
249
-
250
- for row in wsheet.iter_rows(
251
- min_row=food_index0,
252
- max_row=food_index1,
253
- min_col=1,
254
- max_col=8,
255
- ):
256
- for cell in row:
257
- cell.value = ""
258
- cell.alignment = self.cell_alignment0
259
- cell.border = self.cell_border0
260
-
261
- wsheet.cell(form_index0, 2, self.purchaser)
262
- wsheet.cell(
263
- form_index0,
264
- 4,
265
- f"{w_time.year}年 {w_time.month} 月 "
266
- + f"{w_time.day} 日 单位:元",
267
- )
268
- wsheet.cell(
269
- form_index0,
270
- 7,
271
- f"编号:R{w_time.month:0>2}{warehousing_n:0>2}",
272
- )
273
-
274
- for class_name in class_names:
275
- cfoods = [f for f in wfoods if f.fclass == class_name]
276
- cfoods = sorted(cfoods, key=lambda f: f.name)
277
-
278
- cfoods_total_price = sum([f.total_price for f in cfoods])
279
-
280
- wsheet.cell(entry_index, 1, class_name)
281
- wsheet.cell(entry_index, 7, cfoods_total_price)
282
-
283
- if len(cfoods) < 1:
284
- entry_index += 1
285
- continue
286
-
287
- for cfindex, cfood in enumerate(cfoods):
288
- cfood_row_index = entry_index + cfindex
289
- wsheet.cell(cfood_row_index, 2, cfood.name)
290
- wsheet.cell(cfood_row_index, 3, cfood.unit_name)
291
- wsheet.cell(cfood_row_index, 4).number_format = (
292
- numbers.FORMAT_NUMBER_00
293
- )
294
- wsheet.cell(cfood_row_index, 4, cfood.count)
295
- wsheet.cell(cfood_row_index, 5).number_format = (
296
- numbers.FORMAT_NUMBER_00
297
- )
298
- wsheet.cell(cfood_row_index, 5, cfood.unit_price)
299
- wsheet.cell(cfood_row_index, 6).number_format = (
300
- numbers.FORMAT_NUMBER_00
301
- )
302
- wsheet.cell(cfood_row_index, 6, cfood.total_price)
303
-
304
- entry_index_end = entry_index + len(cfoods) - 1
305
-
306
- if class_name == class_names[0] and row_difference < 0:
307
- entry_index_end = (
308
- entry_index_end
309
- + abs(row_difference)
310
- - len(w_class_names_no_food)
311
- )
312
-
313
- entry_index = entry_index_end + 1
314
- foods_total_price = sum([f.total_price for f in wfoods])
315
- wsheet.cell(form_index1, 6, foods_total_price)
316
- wsheet.cell(form_index1, 7, foods_total_price)
317
-
318
- wsheet.cell(
319
- form_index1 + 1,
320
- 1,
321
- (
322
- " "
323
- + "审核人:"
324
- + " "
325
- + "经办人:"
326
- + self.operator.name
327
- + "   "
328
- + "过称人:"
329
- + " "
330
- + "仓管人:"
331
- + "  "
332
- ),
333
- )
334
-
335
- if len(form_indexes) > max_time_index:
336
- for time_index in range(max_time_index, len(form_indexes)):
337
- form_index0, form_index1 = form_indexes[time_index]
338
- food_index0, food_index1 = (
339
- form_index0 + 2,
340
- form_index1 - 1,
341
- )
342
-
343
- for row in wsheet.iter_rows(
344
- min_row=food_index0,
345
- max_row=food_index1,
346
- min_col=2,
347
- max_col=7,
348
- ):
349
- for cell in row:
350
- cell.value = ""
351
-
352
- self.del_form_empty_rows([1, 2])
353
- self.format()
354
- wb = self.bwb
355
- wb.active = wsheet
356
-
357
- print_info(_("Sheet '%s' was updated.") % (self.sheet.title))
358
-
359
-
360
- # The end.
@@ -1,17 +0,0 @@
1
- import os
2
- import sys
3
- from openpyxl.styles import *
4
- from openpyxl.formatting.rule import *
5
- from openpyxl.styles.differential import *
6
- from openpyxl.utils.cell import *
7
-
8
-
9
- from fnschool import *
10
- from fnschool.canteen.spreadsheet.base import *
11
-
12
-
13
- class Workbook:
14
- def __init__(self, bill, path=None):
15
- self.path = path or self.bill.operator.bill_fpath
16
-
17
- pass
fnschool/canteen/test.py DELETED
@@ -1,97 +0,0 @@
1
- import os
2
- import sys
3
- from pathlib import Path
4
- import unittest
5
-
6
- sys.path.append(Path(__file__).parent.parent.parent.as_posix())
7
-
8
- from fnschool import *
9
- from fnschool.canteen import *
10
- from fnschool.canteen.bill import *
11
- from fnschool.canteen.profile import *
12
-
13
-
14
- class TestCanteen(unittest.TestCase):
15
- def __init__(self, *args, **kwargs):
16
- super().__init__(*args, **kwargs)
17
- self.bill = Bill()
18
- self.bill.verbose = 3
19
- self.bill.set_profile_to_index0()
20
- self.bill.workbook.purchase_workbook_fdpath = (
21
- Path.home() / "Downloads"
22
- ).as_posix()
23
-
24
- def spreadsheet_by_time_nodes(self):
25
- self.bill.set_profile_to_index0()
26
- self.bill.workbook.purchase_workbook_fdpath = (
27
- Path.home() / "Downloads"
28
- ).as_posix()
29
- for m in range(2, 4):
30
- self.bill.set_month(m)
31
- self.bill.print_month()
32
- self.bill.make_spreadsheet_by_time_nodes()
33
- self.bill.workbook.copy_bill_workbook()
34
-
35
- def print_time_nodes(self):
36
- self.bill.print_time_nodes()
37
-
38
- def read_changsheng_foods(self):
39
- foods = self.bill.workbook.read_changsheng_foods()
40
- foods = sorted(foods, key=lambda f: f.check_date)
41
- check_date = None
42
- for f in foods:
43
- if check_date != f.check_date:
44
- print(f.check_date.strftime("%Y.%m.%d"))
45
- check_date = f.check_date
46
- print(f, end="")
47
-
48
- def get_foods(self):
49
- mfoods = []
50
- for m in range(2, 4):
51
- foods = self.bill.food.get_foods_of_month(m)
52
- mfoods.append([m, foods])
53
-
54
- time_node = None
55
- for m, foods in mfoods:
56
- print("Foods of Month ", m, ":")
57
- for f in foods:
58
- if not time_node == f.check_date:
59
- time_node = f.check_date
60
- print("\n", time_node)
61
- print(f, end="")
62
-
63
- def get_foods_by_time_node(self):
64
- for m in range(2, 4):
65
- self.bill.set_month(m)
66
- time_nodes = self.bill.get_time_nodes_of_month()
67
- for time_node in time_nodes:
68
- self.bill.time_node = time_node
69
- self.bill._foods = None
70
- foods = self.bill.food.get_foods_of_time_node()
71
- if foods:
72
- print(time_node)
73
- print(foods)
74
- else:
75
- print(time_node, "Nothing.")
76
-
77
- def get_changsheng_info_by_dir(self):
78
- for i in self.bill.workbook.get_changsheng_info_by_dir():
79
- print(i)
80
-
81
- def update_inventory_sheet_of_time_node(self):
82
- for m in range(2, 4):
83
- self.bill.set_month(m)
84
- time_nodes = self.bill.get_time_nodes_of_month()
85
- for time_node in time_nodes:
86
- print(time_node)
87
- self.bill.time_node = time_node
88
- self.bill._foods = None
89
- self.bill.workbook.update_
90
- self.bill.workbook.update_inventory_sheet_of_time_node()
91
- print("Updated.")
92
-
93
-
94
- if __name__ == "__main__":
95
- unittest.main()
96
-
97
- # The end.
fnschool/config.py DELETED
@@ -1,48 +0,0 @@
1
- import os
2
- import sys
3
-
4
- from fnschool import *
5
-
6
-
7
- class Config:
8
- def __init__(self, path):
9
- self._path = path
10
- self._data = None
11
-
12
- @property
13
- def path(self):
14
- if not self._path.exists():
15
- with open(self._path, "w", encoding="utf-8") as f:
16
- f.write("")
17
-
18
- return self._path
19
-
20
- @property
21
- def data(self):
22
- if not self._data:
23
- with open(self.path, "rb") as f:
24
- self._data = tomllib.load(f)
25
- print_info(
26
- _("Configurations has been " + 'read from "{0}".').format(
27
- self.path
28
- )
29
- )
30
- return self._data
31
-
32
- def get(self, key):
33
- value = self.data
34
- if key in value.keys():
35
- return value[key]
36
- return None
37
-
38
- def save(self, key, value):
39
- data = self.data
40
- if key in data.keys() and data[key] == value:
41
- return
42
- data[key] = value
43
- with open(self.path, "w", encoding="utf-8") as f:
44
- f.write(
45
- "\n".join(
46
- [f'"{key}"="{value0}"' for key, value0 in data.items()]
47
- )
48
- )
fnschool/entry.py DELETED
@@ -1,67 +0,0 @@
1
- import os
2
- import sys
3
- import importlib
4
- import inspect
5
-
6
- from fnschool import *
7
- from fnschool.canteen.entry import *
8
- from fnschool.exam.entry import *
9
- from fnschool.external import *
10
-
11
-
12
- module_dpath = Path(__file__).parent
13
- entry_name = "entry.py"
14
-
15
-
16
- def get_entries():
17
- entries = [
18
- ".".join(
19
- os.path.splitext(
20
- p.relative_to(module_dpath.parent.as_posix()).as_posix()
21
- )[
22
- 0
23
- ].split("/")
24
- )
25
- for p in module_dpath.glob(f"*/{entry_name}")
26
- ]
27
- print(entries)
28
- return entries
29
-
30
-
31
- def read_cli():
32
- parser = argparse.ArgumentParser(
33
- prog=_("fnschool"),
34
- description=_("Command line interface of fnschool."),
35
- epilog=_("Enjoy it."),
36
- )
37
- subparsers = parser.add_subparsers(help=_("The modules to run."))
38
- entries = get_entries()
39
- added_entries = []
40
-
41
- for entry in entries:
42
- entry_name = entry
43
- entry = importlib.import_module(entry)
44
- names = dir(entry)
45
- for name in names:
46
- attr = getattr(entry, name)
47
- if inspect.isfunction(attr):
48
- if name.startswith("parse_") and not name in added_entries:
49
- attr(subparsers)
50
- added_entries.append(name)
51
- pass
52
-
53
- del added_entries
54
-
55
- args = parser.parse_args()
56
-
57
- if hasattr(args, "func"):
58
- args.func(args)
59
- else:
60
- parser.print_help()
61
-
62
- print_sponsor()
63
-
64
- del parser
65
-
66
-
67
- # The end.
fnschool/exam/__init__.py DELETED
@@ -1,8 +0,0 @@
1
- import os
2
- import sys
3
-
4
- import matplotlib.pyplot as plt
5
-
6
- from fnschool import *
7
- from fnschool.exam.path import *
8
- from fnschool.exam.language import *
Binary file
Binary file