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,213 +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
-
12
- class Base:
13
- def __init__(self, bill):
14
- self.bill = bill
15
- self.currency = self.bill.currency
16
- self.spreadsheet = self.bill.spreadsheet
17
- self.s = self.spreadsheet
18
- self._bill_workbook = None
19
- self.sd = self.bill.significant_digits
20
- self._bwb = None
21
- self.sheet_name = None
22
- self._sheet = None
23
- self._form_indexes = None
24
- self.cell_alignment0 = Alignment(horizontal="center", vertical="center")
25
- self.cell_side0 = Side(border_style="thin")
26
- self.cell_border0 = Border(
27
- top=self.cell_side0,
28
- left=self.cell_side0,
29
- right=self.cell_side0,
30
- bottom=self.cell_side0,
31
- )
32
- self.cell_side1 = Side(border_style="thin", color="ff0066")
33
- self.cell_border1 = Border(
34
- top=self.cell_side1,
35
- left=self.cell_side1,
36
- right=self.cell_side1,
37
- bottom=self.cell_side1,
38
- )
39
- self.cell_fill0 = PatternFill("solid", start_color="ffccff")
40
- self.row_height = 12.75
41
- self.filetypes_xlsx = [(_("Spreadsheet Files"), "*.xlsx")]
42
- self.food_sheet0_name = "材料台账母表"
43
- self.food_form_title_like = "材料入库、出库台账"
44
-
45
- def get_local_total_price(self, total_price):
46
- return (
47
- self.bill.get_CNY_chars(total_price)
48
- if is_zh_CN
49
- else self.bill.get_CNY_chars(total_price)
50
- )
51
-
52
- @property
53
- def bill_workbook(self):
54
- if not self._bill_workbook:
55
- self._bill_workbook = self.spreadsheet.bill_workbook
56
- return self._bill_workbook
57
-
58
- @property
59
- def bwb(self):
60
- if not self._bwb:
61
- self._bwb = self.bill_workbook
62
- return self._bwb
63
-
64
- def row_inserting_tip(self, row_index):
65
- print_error(
66
- _(
67
- "Row {0} of {1} is being inserted, " + "please wait a moment."
68
- ).format(row_index, self.sheet.title)
69
- )
70
-
71
- def del_form_indexes(self):
72
- self._form_indexes = None
73
-
74
- @property
75
- def consuming_day_m1(self):
76
- dates = []
77
- for f in self.bfoods:
78
- dates += [d for d, __ in f.consumptions]
79
- date = max(dates)
80
- return date.day
81
-
82
- @property
83
- def bill_foods(self):
84
- return self.bill.foods
85
-
86
- @property
87
- def bfoods(self):
88
- return self.bill_foods
89
-
90
- @property
91
- def purchaser(self):
92
- return self.bill.purchaser
93
-
94
- @property
95
- def operator(self):
96
- return self.bill.operator
97
-
98
- @property
99
- def config(self):
100
- return self.operator.config
101
-
102
- def get_bill_sheet(self, name):
103
- sheet = self.bwb[name]
104
- return sheet
105
-
106
- def unmerge_sheet_cells(self, sheet=None):
107
- sheet = sheet or self.sheet
108
- if isinstance(sheet, str):
109
- sheet = self.get_bill_sheet(sheet)
110
- merged_ranges = list(sheet.merged_cells.ranges)
111
- for cell_group in merged_ranges:
112
- sheet.unmerge_cells(str(cell_group))
113
- print_info(_("Cells of {0} was unmerged.").format(sheet.title))
114
-
115
- @property
116
- def sheet(self):
117
- if not self.sheet_name:
118
- return None
119
- if not self._sheet:
120
- self._sheet = self.get_bill_sheet(self.sheet_name)
121
- return self._sheet
122
-
123
- def get_bill_year(self, wb=None):
124
- return (
125
- self.get_zh_CN_bill_year(wb)
126
- if is_zh_CN
127
- else self.get_zh_CN_bill_year(wb)
128
- )
129
-
130
- def get_zh_CN_bill_year(self, wb=None):
131
- return self.get_bill_year_by_x_year(wb, "年")
132
-
133
- def get_bill_year_by_x_year(self, wb=None, year_word="年"):
134
- wb = wb or self.bwb
135
- cover_sheet = wb[self.s.cover_name]
136
- year = str(cover_sheet.cell(1, 1).value)
137
- year0 = ""
138
- year_word = year_word
139
- year = year.split(year_word)[0]
140
- for i in range(len(year) - 1, -1, -1):
141
- if year[i].isnumeric():
142
- year0 = year[i] + year0
143
- else:
144
- break
145
-
146
- bill_year = year0
147
-
148
- return bill_year
149
-
150
- def update_food_sheet_year(self, sheet, year=None):
151
- wb = sheet.parent
152
- bill_year = year or self.get_bill_year(wb)
153
- bill_year = str(bill_year)
154
- csheet = sheet
155
- for row_index in range(1, csheet.max_row + 1):
156
- cell0_value = str(csheet.cell(row_index, 1).value).replace(" ", "")
157
- if cell0_value.endswith("年") and cell0_value[:-1].isnumeric():
158
- csheet.cell(row_index, 1, bill_year + "年")
159
- pass
160
- pass
161
-
162
- def del_form_empty_rows(self, empty_cols):
163
-
164
- self.del_form_indexes()
165
- form_indexes = self.form_indexes
166
-
167
- empty_cols = (
168
- [empty_cols] if not isinstance(empty_cols, list) else empty_cols
169
- )
170
-
171
- form_indexes_len = len(form_indexes)
172
- for i in range(form_indexes_len):
173
-
174
- self.del_form_indexes()
175
-
176
- form_index = self.form_indexes[i]
177
- entry_index0, entry_index1 = self.get_entry_index(form_index)
178
-
179
- entry_len = (entry_index1 - entry_index0) + 1
180
- len_diff = entry_len - self.entry_row_len0
181
-
182
- if len_diff > 0:
183
-
184
- entry_index1_0 = entry_index1 + 1
185
- for row_index in range(entry_index0, entry_index1 + 1):
186
- if all(
187
- [
188
- self.sheet.cell(row_index, col_index).value is None
189
- for col_index in empty_cols
190
- ]
191
- ):
192
- self.sheet.delete_rows(row_index, 1)
193
- print_warning(
194
- _(
195
- 'Empty row {0} of sheet "{1}" has been deleted.'
196
- ).format(row_index, self.sheet.title)
197
- )
198
- entry_index1_0 -= 1
199
- len_diff -= 1
200
-
201
- if row_index >= entry_index1_0 or len_diff < 1:
202
- break
203
- pass
204
- pass
205
- pass
206
- pass
207
- pass
208
- pass
209
-
210
- pass
211
-
212
-
213
- # The end.
@@ -1,310 +0,0 @@
1
- from fnschool.canteen.spreadsheet.base import *
2
-
3
-
4
- class Consuming(Base):
5
- def __init__(self, bill):
6
- super().__init__(bill)
7
- self.sheet_name = self.s.consuming_name
8
- self.entry_row_len0 = 21
9
- pass
10
-
11
- def get_entry_index(self, form_index):
12
- form_index0, form_index1 = form_index
13
- entry_index = [form_index0 + 2, form_index1 - 1]
14
- return entry_index
15
-
16
- @property
17
- def form_indexes(self):
18
- if not self._form_indexes:
19
- csheet = self.sheet
20
- indexes = []
21
- row_index = 1
22
- for row in csheet.iter_rows(max_row=csheet.max_row + 1, max_col=9):
23
- if row[0].value:
24
- if row[0].value.replace(" ", "") == "出库单":
25
- indexes.append([row_index + 1, 0])
26
- if row[0].value.replace(" ", "") == "合计":
27
- indexes[-1][1] = row_index
28
- row_index += 1
29
-
30
- if len(indexes) > 0:
31
- self._form_indexes = indexes
32
- else:
33
- return None
34
-
35
- return self._form_indexes
36
-
37
- def update(self):
38
- foods = [f for f in self.bfoods if not f.is_abandoned]
39
- csheet = self.sheet
40
- form_indexes = self.form_indexes
41
-
42
- class_names = self.bill.food_class_names
43
-
44
- cdays = []
45
- for f in foods:
46
- for d, __ in f.consumptions:
47
- if not d in cdays:
48
- cdays.append(d)
49
- cdays = sorted(cdays)
50
-
51
- print_info(
52
- _("Consuming days:")
53
- + "\n"
54
- + sqr_slist([d.strftime("%Y.%m.%d") for d in cdays])
55
- )
56
-
57
- merged_ranges = list(csheet.merged_cells.ranges)
58
- for cell_group in merged_ranges:
59
- csheet.unmerge_cells(str(cell_group))
60
-
61
- max_day_index = 0
62
- for day_index in range(0, len(cdays)):
63
- max_day_index = day_index + 1
64
- day = cdays[day_index]
65
- form_index = form_indexes[day_index]
66
- form_index0, form_index1 = form_index
67
- food_index0 = form_index0 + 2
68
- food_index1 = form_index1 - 1
69
- food_index_len = food_index1 - food_index0 + 1
70
- tfoods = [
71
- food
72
- for food in foods
73
- if day in [d for d, __ in food.consumptions]
74
- ]
75
-
76
- tfoods_classes = [f.fclass for f in tfoods]
77
-
78
- classes_without_food = [
79
- _name for _name in class_names if not _name in tfoods_classes
80
- ]
81
-
82
- tfoods_len = len(tfoods)
83
- consuming_n = day_index + 1
84
- csheet.cell(form_index0, 2, self.purchaser)
85
- csheet.cell(
86
- form_index0,
87
- 4,
88
- f"{day.year}年 {day.month} 月 {day.day} 日 " + f"单位:元",
89
- )
90
-
91
- csheet.cell(
92
- form_index0,
93
- 7,
94
- f"编号:C{day.month:0>2}{consuming_n:0>2}",
95
- )
96
-
97
- csheet.cell(
98
- form_index1 + 1,
99
- 1,
100
- (
101
- " "
102
- + "审核人:"
103
- + " "
104
- + "经办人:"
105
- + self.operator.name
106
- + "  "
107
- + "过称人:"
108
- + " "
109
- + "仓管人:"
110
- + "   "
111
- ),
112
- )
113
-
114
- row_difference = (
115
- tfoods_len + len(classes_without_food) - food_index_len
116
- )
117
-
118
- if row_difference > 0:
119
- self.row_inserting_tip(food_index0 + 1)
120
- csheet.insert_rows(food_index0 + 1, row_difference)
121
- for row in csheet.iter_rows(
122
- min_row=food_index0 + 1,
123
- max_row=food_index0 + 1 + row_difference,
124
- min_col=1,
125
- max_col=8,
126
- ):
127
- for cell in row:
128
- cell.alignment = self.cell_alignment0
129
- self.border = self.cell_border0
130
-
131
- self.del_form_indexes()
132
- form_indexes = self.form_indexes
133
- form_index1 += row_difference
134
- food_index1 = form_index1 - 1
135
- row_difference = 0
136
-
137
- for row in csheet.iter_rows(
138
- min_row=food_index0,
139
- max_row=food_index1,
140
- min_col=1,
141
- max_col=8,
142
- ):
143
- for cell in row:
144
- cell.value = ""
145
- cell.alignment = self.cell_alignment0
146
- cell.border = self.cell_border0
147
-
148
- fentry_index = food_index0
149
-
150
- for class_name in class_names:
151
- class_foods = [
152
- food for food in tfoods if (food.fclass == class_name)
153
- ]
154
-
155
- fentry_index_start = fentry_index
156
- if len(class_foods) < 1:
157
- csheet.cell(fentry_index_start, 1, class_name)
158
- fentry_index = fentry_index_start + 1
159
- continue
160
-
161
- class_consuming_count = 0.0
162
- for food in class_foods:
163
- for _date, _count in food.consumptions:
164
- if _date == day:
165
- class_consuming_count += _count * food.unit_price
166
-
167
- class_foods_len = len(class_foods)
168
- if class_name == class_names[0] and row_difference < 0:
169
- class_foods_len += abs(row_difference) - len(
170
- classes_without_food
171
- )
172
- fentry_index_end = fentry_index_start - 1 + class_foods_len
173
-
174
- csheet.cell(fentry_index_start, 1, class_name)
175
- csheet.cell(fentry_index_start, 7, class_consuming_count)
176
- csheet.cell(fentry_index_start, 7).number_format = (
177
- numbers.FORMAT_NUMBER_00
178
- )
179
-
180
- for findex, food in enumerate(class_foods):
181
- consuming_count = [
182
- _count
183
- for _date, _count in food.consumptions
184
- if _date == day
185
- ][0]
186
- frow_index = fentry_index_start + findex
187
- csheet.cell(frow_index, 2, food.name)
188
- csheet.cell(frow_index, 3, food.unit_name)
189
- csheet.cell(frow_index, 4).number_format = (
190
- numbers.FORMAT_NUMBER_00
191
- )
192
- csheet.cell(frow_index, 4, consuming_count)
193
- csheet.cell(frow_index, 5).number_format = (
194
- numbers.FORMAT_NUMBER_00
195
- )
196
- csheet.cell(frow_index, 5, food.unit_price)
197
- csheet.cell(frow_index, 6).number_format = (
198
- numbers.FORMAT_NUMBER_00
199
- )
200
- csheet.cell(
201
- frow_index,
202
- 6,
203
- consuming_count * food.unit_price,
204
- )
205
-
206
- fentry_index = fentry_index_end + 1
207
-
208
- tfoods_total_price = 0.0
209
- for food in tfoods:
210
- for _date, _count in food.consumptions:
211
- if _date == day:
212
- tfoods_total_price += _count * food.unit_price
213
- csheet.cell(form_index1, 6, tfoods_total_price)
214
- csheet.cell(form_index1, 7, tfoods_total_price)
215
-
216
- if len(form_indexes) > max_day_index:
217
- for time_index in range(max_day_index, len(form_indexes)):
218
- form_index0, form_index1 = form_indexes[time_index]
219
- food_index0, food_index1 = (
220
- form_index0 + 2,
221
- form_index1 - 1,
222
- )
223
- for row in csheet.iter_rows(
224
- min_row=food_index0,
225
- max_row=food_index1,
226
- min_col=2,
227
- max_col=7,
228
- ):
229
- for cell in row:
230
- cell.value = ""
231
-
232
- self.del_form_empty_rows([1, 2])
233
-
234
- self.format()
235
-
236
- wb = self.bwb
237
- wb.active = csheet
238
- print_info(_("Sheet '%s' was updated.") % self.sheet.title)
239
-
240
- def format(self):
241
- csheet = self.sheet
242
- merged_ranges = list(csheet.merged_cells.ranges)
243
- for cell_group in merged_ranges:
244
- csheet.unmerge_cells(str(cell_group))
245
-
246
- for row in csheet.iter_rows(
247
- min_row=1, max_row=csheet.max_row, min_col=1, max_col=8
248
- ):
249
- if row[0].value and row[0].value.replace(" ", "") == "出库单":
250
- csheet.row_dimensions[row[0].row].height = 21
251
- csheet.merge_cells(
252
- start_row=row[0].row,
253
- end_row=row[0].row,
254
- start_column=1,
255
- end_column=8,
256
- )
257
- csheet.merge_cells(
258
- start_row=row[0].row + 1,
259
- end_row=row[0].row + 1,
260
- start_column=4,
261
- end_column=6,
262
- )
263
- csheet.merge_cells(
264
- start_row=row[0].row + 1,
265
- end_row=row[0].row + 1,
266
- start_column=7,
267
- end_column=8,
268
- )
269
-
270
- if row[0].value and row[0].value.replace(" ", "").endswith("类"):
271
- row[6].number_format = numbers.FORMAT_NUMBER_00
272
- for _row in csheet.iter_rows(
273
- min_row=row[0].row + 1,
274
- max_row=csheet.max_row + 1,
275
- min_col=1,
276
- max_col=1,
277
- ):
278
- if _row[0].value and (
279
- _row[0].value.replace(" ", "").endswith("类")
280
- or _row[0].value.replace(" ", "") == "合计"
281
- ):
282
- csheet.merge_cells(
283
- start_row=row[0].row,
284
- end_row=_row[0].row - 1,
285
- start_column=1,
286
- end_column=1,
287
- )
288
- csheet.merge_cells(
289
- start_row=row[0].row,
290
- end_row=_row[0].row - 1,
291
- start_column=7,
292
- end_column=7,
293
- )
294
- break
295
-
296
- if row[0].value and "审核人" in row[0].value.replace(" ", ""):
297
- csheet.merge_cells(
298
- start_row=row[0].row,
299
- end_row=row[0].row,
300
- start_column=1,
301
- end_column=8,
302
- )
303
-
304
- wb = self.bwb
305
- wb.active = csheet
306
-
307
- print_info(_("Sheet '%s' was formatted.") % self.sheet.title)
308
-
309
-
310
- # The end.
@@ -1,76 +0,0 @@
1
- import os
2
- import sys
3
- from fnschool.canteen.food import *
4
- from fnschool.canteen.spreadsheet.base import *
5
-
6
-
7
- class ConsumingSum(Base):
8
- def __init__(self, bill):
9
- super().__init__(bill)
10
- self.sheet_name = self.s.consumingsum_name
11
- pass
12
-
13
- def update(self):
14
- cssheet = self.sheet
15
- year = self.bill.consuming.year
16
- month = self.bill.consuming.month
17
- day = self.consuming_day_m1
18
- foods = [f for f in self.bfoods if not f.is_abandoned]
19
-
20
- total_price = 0.0
21
- for row in cssheet.iter_rows(
22
- min_row=4, max_row=10, min_col=1, max_col=3
23
- ):
24
- class_name = row[0].value.replace(" ", "")
25
- m_total_price = 0.0
26
- for food in foods:
27
- if food.fclass == class_name:
28
- m_total_price += sum(
29
- [
30
- _count * food.unit_price
31
- for _date, _count in food.consumptions
32
- ]
33
- )
34
-
35
- m_total_price = round(m_total_price, self.sd + 1)
36
- total_price += m_total_price
37
- cssheet.cell(row[0].row, 2, m_total_price)
38
- cssheet.cell(row[0].row, 2).number_format = numbers.FORMAT_NUMBER_00
39
-
40
- total_price = round(total_price, self.sd + 1)
41
- local_total_price = self.get_local_total_price(total_price)
42
- cssheet.cell(
43
- 1,
44
- 1,
45
- (
46
- self.bill.operator.superior_department
47
- + _("食堂食品、材料出库汇总报销单")
48
- ),
49
- )
50
- cssheet.cell(
51
- 2,
52
- 1,
53
- _("编制单位:")
54
- + f"{self.purchaser} "
55
- + _("单位:元")
56
- + f" "
57
- + _("{0}年{1}月{2}日").format(year, month, day),
58
- )
59
- cssheet.cell(
60
- 11,
61
- 1,
62
- (
63
- _("总金额(大写)")
64
- + f":{local_total_price} "
65
- + f"{self.currency.mark}{total_price}"
66
- ),
67
- )
68
- cssheet.cell(12, 1, _("经办人:") + f"{self.operator.name} ")
69
-
70
- wb = self.bwb
71
- wb.active = cssheet
72
-
73
- print_info(_("Sheet '%s' was updated.") % self.sheet.title)
74
-
75
-
76
- # The end.
@@ -1,64 +0,0 @@
1
- import os
2
- import sys
3
- from fnschool import *
4
- from fnschool.canteen.spreadsheet.base import *
5
-
6
-
7
- class Cover(Base):
8
- def __init__(self, bill):
9
- super().__init__(bill)
10
- self.sheet_name = self.s.cover_name
11
- pass
12
-
13
- def update(self):
14
- year = self.bill.consuming.year
15
- month = self.bill.consuming.month
16
- day = self.consuming_day_m1
17
-
18
- cvsheet = self.sheet
19
- cvsheet.cell(
20
- 1,
21
- 1,
22
- self.purchaser + f"{year}年{month}月份食堂食品采购统计表",
23
- )
24
- foods = [f for f in self.bfoods if (not f.is_inventory)]
25
- wfoods = [f for f in foods if not f.is_abandoned]
26
- uwfoods = [f for f in foods if f.is_abandoned]
27
- total_price = 0.0
28
- for row in cvsheet.iter_rows(
29
- min_row=3, max_row=9, min_col=1, max_col=3
30
- ):
31
- class_name = row[0].value.replace(" ", "")
32
- m_total_price = 0.0
33
- for f in foods:
34
- if f.fclass == class_name:
35
- m_total_price += f.count * f.unit_price
36
- cvsheet.cell(row[0].row, 2, m_total_price)
37
-
38
- total_price += m_total_price
39
- cvsheet.cell(10, 2, total_price)
40
-
41
- w_seasoning_total_price = sum(
42
- [f.count * f.unit_price for f in wfoods if ("调味" in f.fclass)]
43
- )
44
- unw_seasoning_total_price = sum(
45
- [f.count * f.unit_price for f in uwfoods if ("调味" in f.fclass)]
46
- )
47
-
48
- for row_index in range(3, 11):
49
- cvsheet.cell(row_index, 3, "")
50
-
51
- cvsheet.cell(
52
- 8,
53
- 3,
54
- f"入库:{w_seasoning_total_price:.2f}元;"
55
- + f"未入库:{unw_seasoning_total_price:.2f}元。",
56
- )
57
-
58
- wb = self.bwb
59
- wb.active = cvsheet
60
-
61
- print_info(_("Sheet '%s' was updated.") % self.sheet.title)
62
-
63
-
64
- # The end.