fnschool 20250109.80500.803__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.80500.803.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 -212
  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.80500.803.dist-info/METADATA +0 -342
  266. fnschool-20250109.80500.803.dist-info/RECORD +0 -78
  267. fnschool-20250109.80500.803.dist-info/entry_points.txt +0 -5
  268. fnschool-20250109.80500.803.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.80500.803.dist-info → fnschool-20251011.80531.840.dist-info/licenses}/LICENSE +0 -0
@@ -1,351 +0,0 @@
1
- import os
2
- import random
3
- import sys
4
- from pathlib import Path
5
- import shutil
6
- import calendar
7
- import pandas as pd
8
- from datetime import datetime, timedelta
9
- import numpy as np
10
-
11
- from tkinter import filedialog
12
-
13
- from fnschool import *
14
- from fnschool.canteen.food import *
15
- from fnschool.canteen.path import *
16
- from fnschool.canteen.spreadsheet.purchasing import Purchasing
17
- from fnschool.canteen.spreadsheet.consuming import Consuming
18
- from fnschool.canteen.spreadsheet.preconsuming import PreConsuming
19
- from fnschool.canteen.spreadsheet.inventory import Inventory
20
- from fnschool.canteen.spreadsheet.warehousing import Warehousing
21
- from fnschool.canteen.spreadsheet.unwarehousing import Unwarehousing
22
- from fnschool.canteen.spreadsheet.unwarehousingsum import UnwarehousingSum
23
- from fnschool.canteen.spreadsheet.food import Food as SFood
24
- from fnschool.canteen.spreadsheet.purchasingsum import PurchasingSum
25
- from fnschool.canteen.spreadsheet.consumingsum import ConsumingSum
26
- from fnschool.canteen.spreadsheet.cover import Cover
27
-
28
-
29
- class CtSpreadSheet:
30
- def __init__(self, bill):
31
- self.bill = bill
32
- self.operator = self.bill.operator
33
- self._bill_fpath = None
34
- self._purchasing_fpath = None
35
- self._bwb = None
36
- self._pwb = None
37
- self._preconsuming = None
38
- self._purchasing = None
39
- self._consuming = None
40
- self._inventory = None
41
- self._warehousing = None
42
- self._unwareshousing = None
43
- self._purchasingsum = None
44
- self._consumingsum = None
45
- self._sfood = None
46
- self._cover = None
47
- self.sd = self.bill.significant_digits
48
-
49
- self.preconsuming_name0 = "出库计划表"
50
- self.purchasing_name = None
51
- self.consuming_name = "出库单"
52
- self.inventory_name = "食材盘存表"
53
- self.warehousing_name = "入库单"
54
- self.unwarehousing_name = "未入库明细表"
55
- self.purchasingsum_name = "入库、未入库汇总表"
56
- self.consumingsum_name = "出库汇总表"
57
- self.sfood_name = "材料台账母表"
58
- self.cover_name = "六大类总封面"
59
-
60
- @property
61
- def bill_fpath(self):
62
- if not self._bill_fpath:
63
- self._bill_fpath = self.bill.operator.bill_fpath
64
- return self._bill_fpath
65
-
66
- @property
67
- def bill_workbook(self):
68
- if not self._bwb:
69
- self._bwb = load_workbook(self.bill_fpath)
70
- print_info(
71
- _('Spreadsheet "{0}" is in use.').format(self.bill_fpath)
72
- )
73
- return self._bwb
74
-
75
- @property
76
- def bwb(self):
77
- return self.bill_workbook
78
-
79
- def del_bill_workbook(self):
80
- self._bwb = None
81
- self._bill_fpath = None
82
-
83
- def del_bwb(self):
84
- self.del_bill_workbook()
85
-
86
- @property
87
- def consumingsum(self):
88
- if not self._consumingsum:
89
- self._consumingsum = ConsumingSum(self.bill)
90
- return self._consumingsum
91
-
92
- @property
93
- def purchasingsum(self):
94
- if not self._purchasingsum:
95
- self._purchasingsum = PurchasingSum(self.bill)
96
- return self._purchasingsum
97
-
98
- @property
99
- def sfood(self):
100
- if not self._sfood:
101
- self._sfood = SFood(self.bill)
102
- return self._sfood
103
-
104
- @property
105
- def unwarehousing(self):
106
- if not self._unwareshousing:
107
- self._unwareshousing = Unwarehousing(self.bill)
108
- return self._unwareshousing
109
-
110
- @property
111
- def cover(self):
112
- if not self._cover:
113
- self._cover = Cover(self.bill)
114
-
115
- return self._cover
116
-
117
- @property
118
- def warehousing(self):
119
- if not self._warehousing:
120
- self._warehousing = Warehousing(self.bill)
121
- return self._warehousing
122
-
123
- @property
124
- def purchasing(self):
125
- if not self._purchasing:
126
- self._purchasing = Purchasing(self.bill)
127
- return self._purchasing
128
-
129
- @property
130
- def preconsuming(self):
131
- if not self._preconsuming:
132
- self._preconsuming = PreConsuming(self.bill)
133
- return self._preconsuming
134
-
135
- @property
136
- def consuming(self):
137
- if not self._consuming:
138
- self._consuming = Consuming(self.bill)
139
- return self._consuming
140
-
141
- @property
142
- def inventory(self):
143
- if not self._inventory:
144
- self._inventory = Inventory(self.bill)
145
- return self._inventory
146
-
147
- @property
148
- def meal_type(self):
149
- return self.bill.meal_type
150
-
151
- def save_workbook(self):
152
- bill_fpath0 = self.operator.bill_fpath_uuid
153
- print_error(
154
- _(
155
- "Do you want to save all updated data "
156
- + 'to "{0}"? or just save it as a '
157
- + 'copy to "{1}". (YyNn)'
158
- ).format(self.operator.bill_fpath, bill_fpath0)
159
- )
160
- print_warning(
161
- _(
162
- 'If you save updated data to "{0}", '
163
- + "data of food sheets will be saved "
164
- + "for every month."
165
- ).format(self.operator.bill_fpath)
166
- )
167
-
168
- s_input = get_input()
169
-
170
- print()
171
- print_info(_("Saving. . ."))
172
-
173
- if len(s_input) > 0 and s_input in "Yy":
174
- self.bwb.save(self.operator.bill_fpath)
175
- bill_fpath0 = self.operator.bill_fpath
176
- print_info(
177
- _(
178
- "You can fill in the monthly missing data "
179
- + "to food sheets, they will be saved "
180
- + "for next updating."
181
- )
182
- )
183
- else:
184
- self.bwb.save(bill_fpath0)
185
-
186
- print_info(
187
- _('Updated data has been saved to "{0}".').format(bill_fpath0)
188
- )
189
-
190
- open_path(bill_fpath0)
191
-
192
- print_info(_("Updated data was saved."))
193
-
194
- def print_summary(self, foods=None):
195
- bfoods = foods or self.bill.foods
196
- cfoods = [f for f in bfoods if not f.is_abandoned]
197
- currency_mark = self.bill.currency.mark
198
- summary = []
199
- summary_len = 0
200
-
201
- inventory_mm1 = sum([f.total_price for f in cfoods if f.is_inventory])
202
- inventory_mm1 = round(inventory_mm1, self.sd + 1)
203
-
204
- inventory_mm1 = (
205
- _("Inventory of last month: ") + currency_mark + str(inventory_mm1)
206
- )
207
-
208
- warehousing_m = sum(
209
- [f.total_price for f in cfoods if not f.is_inventory]
210
- )
211
-
212
- warehousing_m_cp = warehousing_m
213
- warehousing_m = (
214
- _("Warehousing of this month: ")
215
- + currency_mark
216
- + str(warehousing_m)
217
- )
218
- inventory_mm1_warehousing_m = (
219
- _("Total: ")
220
- + currency_mark
221
- + str(round(sum([f.total_price for f in cfoods]), 2))
222
- )
223
- consuming_m = 0
224
- for f in cfoods:
225
- f_consuming_m = sum([c for __, c in f.consumptions])
226
- consuming_m += f_consuming_m * f.unit_price
227
- consuming_m = round(consuming_m, self.sd + 1)
228
-
229
- consuming_m_cp = consuming_m
230
- consuming_m = (
231
- _("Consuming of this month: ") + currency_mark + str(consuming_m)
232
- )
233
-
234
- month_day_m1 = sorted([f.xdate for f in cfoods])[0]
235
- for f in cfoods:
236
- month_day_m1 = max([d for d, __ in f.consumptions] + [month_day_m1])
237
-
238
- inventory_m = sum(
239
- [
240
- f.get_remainder(month_day_m1) * f.unit_price
241
- for f in cfoods
242
- if f.get_remainder(month_day_m1) > 0
243
- ]
244
- )
245
- inventory_m = round(inventory_m, self.sd + 1)
246
-
247
- inventory_m_cp = inventory_m
248
- inventory_m = (
249
- _("Inventory of this month: ") + currency_mark + str(inventory_m)
250
- )
251
-
252
- consuming_m_inventory_m = (
253
- _("Total: ")
254
- + currency_mark
255
- + str(round(consuming_m_cp + inventory_m_cp, self.sd + 1))
256
- )
257
-
258
- afoods = [f for f in bfoods if f.is_abandoned]
259
- unwarehousing_m = (
260
- _("Unwarehousing of this month: ")
261
- + currency_mark
262
- + str(sum([f.total_price for f in afoods]))
263
- )
264
-
265
- total_purchasing_m = (
266
- _("Total purchasing of this month: ")
267
- + currency_mark
268
- + str(sum([f.total_price for f in bfoods if not f.is_inventory]))
269
- )
270
- summary = [
271
- inventory_mm1,
272
- warehousing_m,
273
- inventory_mm1_warehousing_m,
274
- consuming_m,
275
- inventory_m,
276
- consuming_m_inventory_m,
277
- warehousing_m,
278
- unwarehousing_m,
279
- total_purchasing_m,
280
- ]
281
-
282
- summary_len = max(
283
- [len(s) + len([c for c in s if is_zh_CN_char(c)]) for s in summary]
284
- )
285
- summary_sep = get_random_sep_char() * summary_len
286
- consuming_date_m1 = (
287
- f"{self.bill.consuming.year}"
288
- + f".{self.bill.consuming.month:0>2}"
289
- + f".{self.bill.consuming.day_m1:0>2}"
290
- )
291
- summary = (
292
- [summary_sep]
293
- + [self.meal_type]
294
- + [summary_sep]
295
- + summary[:3]
296
- + [summary_sep]
297
- + summary[3:6]
298
- + [summary_sep]
299
- + summary[6:]
300
- + [summary_sep]
301
- + [f"{consuming_date_m1:>{summary_len}}"]
302
- )
303
- summary = "\n".join(summary)
304
- print()
305
- print_error(_("Summary:"))
306
- print_info(summary)
307
- print()
308
-
309
- def del_sheets_var(self):
310
- self._inventory = None
311
- self._warehousing = None
312
- self._unwareshousing = None
313
- self._consuming = None
314
- self._sfood = None
315
- self._purchasingsum = None
316
- self._consumingsum = None
317
- self._cover = None
318
-
319
- def update(self):
320
-
321
- foods0 = self.bill.foods.copy()
322
- meal_types = list(set([f.meal_type for f in foods0]))
323
-
324
- for t in meal_types:
325
-
326
- print_info(_("Updating sheets for {0}.").format(t))
327
-
328
- _foods = [f for f in foods0 if f.meal_type == t]
329
-
330
- self.bill.foods = _foods
331
-
332
- self.inventory.update()
333
- self.warehousing.update()
334
- self.unwarehousing.update()
335
- self.consuming.update()
336
- self.sfood.update()
337
- self.purchasingsum.update()
338
- self.consumingsum.update()
339
- self.cover.update()
340
-
341
- self.print_summary()
342
-
343
- self.save_workbook()
344
-
345
- self.del_sheets_var()
346
- self.del_bwb()
347
-
348
- print_info(_("Update completely!"))
349
-
350
-
351
- # The end.