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.
- fnschoo1/__init__.py +53 -0
- fnschoo1/canteen/admin.py +3 -0
- fnschoo1/canteen/apps.py +6 -0
- fnschoo1/canteen/forms.py +84 -0
- fnschoo1/canteen/migrations/0001_initial.py +119 -0
- fnschoo1/canteen/migrations/0002_ingredient_is_disabled.py +20 -0
- fnschoo1/canteen/migrations/0003_consumption_is_disabled_alter_ingredient_is_disabled.py +23 -0
- fnschoo1/canteen/migrations/0004_alter_ingredient_name_category_and_more.py +66 -0
- fnschoo1/canteen/migrations/0005_alter_category_created_at_alter_category_name_and_more.py +41 -0
- fnschoo1/canteen/migrations/0006_category_is_disabled_alter_category_user_and_more.py +49 -0
- fnschoo1/canteen/migrations/0007_alter_consumption_amount_used_and_more.py +30 -0
- fnschoo1/canteen/migrations/0008_category_abbreviation_mealtype.py +67 -0
- fnschoo1/canteen/migrations/0009_alter_category_abbreviation_and_more.py +55 -0
- fnschoo1/canteen/migrations/0010_alter_consumption_options_alter_ingredient_options_and_more.py +215 -0
- fnschoo1/canteen/migrations/0011_category_pin_to_consumptions_top.py +23 -0
- fnschoo1/canteen/migrations/0012_alter_ingredient_storage_date.py +18 -0
- fnschoo1/canteen/models.py +179 -0
- fnschoo1/canteen/templates/canteen/category/create.html +17 -0
- fnschoo1/canteen/templates/canteen/category/delete.html +61 -0
- fnschoo1/canteen/templates/canteen/category/list.html +63 -0
- fnschoo1/canteen/templates/canteen/category/update.html +23 -0
- fnschoo1/canteen/templates/canteen/close.html +11 -0
- fnschoo1/canteen/templates/canteen/consumption/_create.html +19 -0
- fnschoo1/canteen/templates/canteen/consumption/create.html +456 -0
- fnschoo1/canteen/templates/canteen/ingredient/close.html +11 -0
- fnschoo1/canteen/templates/canteen/ingredient/create.html +19 -0
- fnschoo1/canteen/templates/canteen/ingredient/create_one.html +17 -0
- fnschoo1/canteen/templates/canteen/ingredient/delete.html +41 -0
- fnschoo1/canteen/templates/canteen/ingredient/list.html +128 -0
- fnschoo1/canteen/templates/canteen/ingredient/update.html +23 -0
- fnschoo1/canteen/templates/canteen/meal_type/create.html +17 -0
- fnschoo1/canteen/templates/canteen/meal_type/delete.html +56 -0
- fnschoo1/canteen/templates/canteen/meal_type/list.html +59 -0
- fnschoo1/canteen/templates/canteen/meal_type/update.html +23 -0
- fnschoo1/canteen/tests.py +3 -0
- fnschoo1/canteen/urls.py +116 -0
- fnschoo1/canteen/views.py +814 -0
- fnschoo1/canteen/workbook/generate.py +2098 -0
- fnschoo1/db.sqlite3 +0 -0
- fnschoo1/fnschool/__init__.py +13 -0
- fnschoo1/fnschool/asgi.py +16 -0
- fnschoo1/fnschool/settings.py +167 -0
- fnschoo1/fnschool/templatetags/fnschool_tags.py +27 -0
- fnschoo1/fnschool/urls.py +30 -0
- fnschoo1/fnschool/views.py +9 -0
- fnschoo1/fnschool/wsgi.py +16 -0
- fnschoo1/locale/en/LC_MESSAGES/django.mo +0 -0
- fnschoo1/locale/zh_Hans/LC_MESSAGES/django.mo +0 -0
- fnschoo1/manage.py +25 -0
- fnschoo1/profiles/admin.py +27 -0
- fnschoo1/profiles/apps.py +12 -0
- fnschoo1/profiles/forms.py +67 -0
- fnschoo1/profiles/migrations/0001_initial.py +192 -0
- fnschoo1/profiles/migrations/0002_alter_profile_bio.py +20 -0
- fnschoo1/profiles/migrations/0003_alter_profile_options_alter_profile_address_and_more.py +67 -0
- fnschoo1/profiles/migrations/0004_profile_gender.py +26 -0
- fnschoo1/profiles/migrations/0005_alter_profile_gender.py +23 -0
- fnschoo1/profiles/models.py +60 -0
- fnschoo1/profiles/signals.py +20 -0
- fnschoo1/profiles/templates/profiles/create.html +16 -0
- fnschoo1/profiles/templates/profiles/detail.html +14 -0
- fnschoo1/profiles/templates/profiles/edit.html +12 -0
- fnschoo1/profiles/templates/profiles/log_in.html +20 -0
- fnschoo1/profiles/templates/profiles/log_out.html +12 -0
- fnschoo1/profiles/tests.py +3 -0
- fnschoo1/profiles/urls.py +15 -0
- fnschoo1/profiles/views.py +63 -0
- fnschoo1/static/css/bootstrap.min.css +11776 -0
- fnschoo1/static/css/fnschool.css +26 -0
- fnschoo1/static/images/favicon.ico +0 -0
- fnschoo1/static/js/bootstrap.bundle.min.js +4223 -0
- fnschoo1/static/js/bootstrap.min.js +2919 -0
- fnschoo1/static/js/fnschool.js +84 -0
- fnschoo1/static/js/jquery.min.js +5413 -0
- fnschoo1/static/js/jquery.slim.min.js +4331 -0
- fnschoo1/static/js/popper.min.js +1306 -0
- fnschoo1/static_collected/admin/css/autocomplete.css +377 -0
- fnschoo1/static_collected/admin/css/base.css +1224 -0
- fnschoo1/static_collected/admin/css/changelists.css +334 -0
- fnschoo1/static_collected/admin/css/dark_mode.css +136 -0
- fnschoo1/static_collected/admin/css/dashboard.css +30 -0
- fnschoo1/static_collected/admin/css/forms.css +546 -0
- fnschoo1/static_collected/admin/css/login.css +62 -0
- fnschoo1/static_collected/admin/css/nav_sidebar.css +145 -0
- fnschoo1/static_collected/admin/css/responsive.css +1043 -0
- fnschoo1/static_collected/admin/css/responsive_rtl.css +84 -0
- fnschoo1/static_collected/admin/css/rtl.css +311 -0
- fnschoo1/static_collected/admin/css/vendor/select2/select2.css +708 -0
- fnschoo1/static_collected/admin/css/vendor/select2/select2.min.css +1 -0
- fnschoo1/static_collected/admin/css/widgets.css +639 -0
- fnschoo1/static_collected/admin/js/SelectBox.js +128 -0
- fnschoo1/static_collected/admin/js/SelectFilter2.js +503 -0
- fnschoo1/static_collected/admin/js/actions.js +232 -0
- fnschoo1/static_collected/admin/js/admin/DateTimeShortcuts.js +496 -0
- fnschoo1/static_collected/admin/js/admin/RelatedObjectLookups.js +276 -0
- fnschoo1/static_collected/admin/js/autocomplete.js +33 -0
- fnschoo1/static_collected/admin/js/calendar.js +251 -0
- fnschoo1/static_collected/admin/js/cancel.js +29 -0
- fnschoo1/static_collected/admin/js/change_form.js +21 -0
- fnschoo1/static_collected/admin/js/collapse.js +43 -0
- fnschoo1/static_collected/admin/js/core.js +174 -0
- fnschoo1/static_collected/admin/js/filters.js +37 -0
- fnschoo1/static_collected/admin/js/inlines.js +439 -0
- fnschoo1/static_collected/admin/js/jquery.init.js +8 -0
- fnschoo1/static_collected/admin/js/nav_sidebar.js +81 -0
- fnschoo1/static_collected/admin/js/popup_response.js +24 -0
- fnschoo1/static_collected/admin/js/prepopulate.js +43 -0
- fnschoo1/static_collected/admin/js/prepopulate_init.js +20 -0
- fnschoo1/static_collected/admin/js/theme.js +57 -0
- fnschoo1/static_collected/admin/js/urlify.js +529 -0
- fnschoo1/static_collected/admin/js/vendor/jquery/jquery.js +10913 -0
- fnschoo1/static_collected/admin/js/vendor/jquery/jquery.min.js +2 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/af.js +43 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/ar.js +36 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/az.js +33 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/bg.js +38 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/bn.js +39 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/bs.js +48 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/ca.js +41 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/cs.js +62 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/da.js +37 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/de.js +41 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/dsb.js +51 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/el.js +43 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/en.js +41 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/es.js +41 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/et.js +38 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/eu.js +45 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/fa.js +42 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/fi.js +42 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/fr.js +43 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/gl.js +40 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/he.js +44 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/hi.js +40 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/hr.js +45 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/hsb.js +51 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/hu.js +44 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/hy.js +40 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/id.js +36 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/is.js +37 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/it.js +43 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/ja.js +40 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/ka.js +42 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/km.js +38 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/ko.js +42 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/lt.js +45 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/lv.js +41 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/mk.js +42 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/ms.js +38 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/nb.js +38 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/ne.js +44 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/nl.js +46 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/pl.js +43 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/ps.js +41 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/pt-BR.js +39 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/pt.js +41 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/ro.js +43 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/ru.js +48 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/sk.js +61 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/sl.js +41 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/sq.js +43 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/sr-Cyrl.js +48 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/sr.js +48 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/sv.js +40 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/th.js +36 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/tk.js +36 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/tr.js +40 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/uk.js +59 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/vi.js +37 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/zh-CN.js +36 -0
- fnschoo1/static_collected/admin/js/vendor/select2/i18n/zh-TW.js +33 -0
- fnschoo1/static_collected/admin/js/vendor/select2/select2.full.js +7115 -0
- fnschoo1/static_collected/admin/js/vendor/select2/select2.full.min.js +2 -0
- fnschoo1/static_collected/admin/js/vendor/xregexp/xregexp.js +4993 -0
- fnschoo1/static_collected/admin/js/vendor/xregexp/xregexp.min.js +160 -0
- fnschoo1/static_collected/css/bootstrap.min.css +11776 -0
- fnschoo1/static_collected/css/fnschool.css +26 -0
- fnschoo1/static_collected/images/favicon.ico +0 -0
- fnschoo1/static_collected/js/bootstrap.bundle.min.js +4223 -0
- fnschoo1/static_collected/js/bootstrap.min.js +2919 -0
- fnschoo1/static_collected/js/fnschool.js +84 -0
- fnschoo1/static_collected/js/jquery.min.js +5413 -0
- fnschoo1/static_collected/js/jquery.slim.min.js +4331 -0
- fnschoo1/static_collected/js/popper.min.js +1306 -0
- fnschoo1/templates/base/_css.html +1 -0
- fnschoo1/templates/base/_js.html +15 -0
- fnschoo1/templates/base/content.html +30 -0
- fnschoo1/templates/base/header_content_footer.html +35 -0
- fnschoo1/templates/close.html +11 -0
- fnschoo1/templates/home.html +51 -0
- fnschoo1/templates/includes/_footer.html +39 -0
- fnschoo1/templates/includes/_header.html +77 -0
- fnschoo1/templates/includes/_navigation.html +0 -0
- fnschoo1/templates/includes/_paginator.html +27 -0
- fnschoo1/templates/registration/logged_out.html +0 -0
- fnschoo1/templates/registration/login.html +0 -0
- fnschool-20251011.81638.854.dist-info/METADATA +179 -0
- fnschool-20251011.81638.854.dist-info/RECORD +209 -0
- {fnschool-20250109.80531.837.dist-info → fnschool-20251011.81638.854.dist-info}/WHEEL +1 -1
- fnschool-20251011.81638.854.dist-info/entry_points.txt +2 -0
- fnschool-20251011.81638.854.dist-info/top_level.txt +1 -0
- fnschool/__init__.py +0 -35
- fnschool/__main__.py +0 -16
- fnschool/app.py +0 -103
- fnschool/canteen/__init__.py +0 -3
- fnschool/canteen/__main__.py +0 -3
- fnschool/canteen/bill.py +0 -253
- fnschool/canteen/canteen.py +0 -1
- fnschool/canteen/canteen.toml +0 -61
- fnschool/canteen/config.py +0 -10
- fnschool/canteen/consuming.py +0 -53
- fnschool/canteen/currency.py +0 -17
- fnschool/canteen/data/bill.i18n.xlsx +0 -0
- fnschool/canteen/data/bill.xlsx +0 -0
- fnschool/canteen/data/consuming.xlsx +0 -0
- fnschool/canteen/data/purchase_list.xlsx +0 -0
- fnschool/canteen/entry.py +0 -40
- fnschool/canteen/food.py +0 -206
- fnschool/canteen/food_classes.py +0 -33
- fnschool/canteen/food_classes.toml +0 -64
- fnschool/canteen/operator.py +0 -91
- fnschool/canteen/path.py +0 -28
- fnschool/canteen/spreadsheet/base.py +0 -213
- fnschool/canteen/spreadsheet/consuming.py +0 -310
- fnschool/canteen/spreadsheet/consumingsum.py +0 -76
- fnschool/canteen/spreadsheet/cover.py +0 -64
- fnschool/canteen/spreadsheet/ctspreadsheet.py +0 -351
- fnschool/canteen/spreadsheet/food.py +0 -680
- fnschool/canteen/spreadsheet/inventory.py +0 -375
- fnschool/canteen/spreadsheet/merging.py +0 -340
- fnschool/canteen/spreadsheet/preconsuming.py +0 -329
- fnschool/canteen/spreadsheet/purchasing.py +0 -885
- fnschool/canteen/spreadsheet/purchasingsum.py +0 -110
- fnschool/canteen/spreadsheet/spreadsheet.py +0 -363
- fnschool/canteen/spreadsheet/translating.py +0 -12
- fnschool/canteen/spreadsheet/unwarehousing.py +0 -178
- fnschool/canteen/spreadsheet/unwarehousingsum.py +0 -11
- fnschool/canteen/spreadsheet/warehousing.py +0 -360
- fnschool/canteen/spreadsheet/workbook.py +0 -17
- fnschool/canteen/test.py +0 -97
- fnschool/config.py +0 -48
- fnschool/entry.py +0 -67
- fnschool/exam/__init__.py +0 -8
- fnschool/exam/data/parental_emails.xlsx +0 -0
- fnschool/exam/data/score.xlsx +0 -0
- fnschool/exam/email.py +0 -349
- fnschool/exam/entry.py +0 -36
- fnschool/exam/language.py +0 -19
- fnschool/exam/path.py +0 -24
- fnschool/exam/score.py +0 -1191
- fnschool/exam/subject.py +0 -20
- fnschool/exam/teacher.py +0 -54
- fnschool/external.py +0 -89
- fnschool/games/__init__.py +0 -1
- fnschool/games/__main__.py +0 -1
- fnschool/games/games.py +0 -1
- fnschool/inoutput.py +0 -97
- fnschool/language.py +0 -40
- fnschool/locales/en_US/LC_MESSAGES/fnschool.mo +0 -0
- fnschool/locales/zh_CN/LC_MESSAGES/fnschool.mo +0 -0
- fnschool/locales/zh_HK/LC_MESSAGES/fnschool.mo +0 -0
- fnschool/locales/zh_SG/LC_MESSAGES/fnschool.mo +0 -0
- fnschool/locales/zh_TW/LC_MESSAGES/fnschool.mo +0 -0
- fnschool/path.py +0 -45
- fnschool/test.py +0 -24
- fnschool/user.py +0 -262
- fnschool-20250109.80531.837.dist-info/METADATA +0 -342
- fnschool-20250109.80531.837.dist-info/RECORD +0 -78
- fnschool-20250109.80531.837.dist-info/entry_points.txt +0 -5
- fnschool-20250109.80531.837.dist-info/top_level.txt +0 -1
- /fnschool/canteen/consume.py → /fnschoo1/canteen/__init__.py +0 -0
- /fnschool/canteen/food_recount.toml → /fnschoo1/canteen/migrations/__init__.py +0 -0
- {fnschool/canteen/spreadsheet → fnschoo1/canteen/workbook}/__init__.py +0 -0
- /fnschool/exam/__main__.py → /fnschoo1/fnschool/templatetags/__init__.py +0 -0
- /fnschool/canteen/food_recounts.toml → /fnschoo1/profiles/__init__.py +0 -0
- /fnschool/canteen/warehouse.py → /fnschoo1/profiles/migrations/__init__.py +0 -0
- /fnschool/canteen/workbook.toml → /fnschoo1/templates/base/_content.html +0 -0
- {fnschool-20250109.80531.837.dist-info → fnschool-20251011.81638.854.dist-info/licenses}/LICENSE +0 -0
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import sys
|
|
3
|
-
|
|
4
|
-
from fnschool import *
|
|
5
|
-
from fnschool.canteen.spreadsheet.base import *
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class PurchasingSum(Base):
|
|
9
|
-
def __init__(self, bill):
|
|
10
|
-
super().__init__(bill)
|
|
11
|
-
self.sheet_name = self.s.purchasingsum_name
|
|
12
|
-
pass
|
|
13
|
-
|
|
14
|
-
def update(self):
|
|
15
|
-
|
|
16
|
-
pssheet = self.sheet
|
|
17
|
-
year = self.bill.consuming.year
|
|
18
|
-
month = self.bill.consuming.month
|
|
19
|
-
day = self.consuming_day_m1
|
|
20
|
-
|
|
21
|
-
pssheet.cell(
|
|
22
|
-
1,
|
|
23
|
-
1,
|
|
24
|
-
(
|
|
25
|
-
self.bill.operator.superior_department
|
|
26
|
-
+ _("食堂食品、材料入库汇总报销单")
|
|
27
|
-
),
|
|
28
|
-
)
|
|
29
|
-
pssheet.cell(
|
|
30
|
-
19,
|
|
31
|
-
1,
|
|
32
|
-
(
|
|
33
|
-
self.bill.operator.superior_department
|
|
34
|
-
+ _("食堂食品、材料未入库汇总报销单")
|
|
35
|
-
),
|
|
36
|
-
)
|
|
37
|
-
pssheet.cell(
|
|
38
|
-
2,
|
|
39
|
-
1,
|
|
40
|
-
_("编制单位:")
|
|
41
|
-
+ f"{self.purchaser}"
|
|
42
|
-
+ f" "
|
|
43
|
-
+ _("单位:")
|
|
44
|
-
+ f"{self.currency.unit}"
|
|
45
|
-
+ f" "
|
|
46
|
-
+ _("{0}年{1}月{2}日").format(year, month, day),
|
|
47
|
-
)
|
|
48
|
-
pssheet.cell(
|
|
49
|
-
20,
|
|
50
|
-
1,
|
|
51
|
-
_("编制单位:")
|
|
52
|
-
+ f"{self.purchaser}"
|
|
53
|
-
+ f" "
|
|
54
|
-
+ _("单位:")
|
|
55
|
-
+ self.currency.unit
|
|
56
|
-
+ f" "
|
|
57
|
-
+ _("{0}年{1}月{2}日").format(year, month, day),
|
|
58
|
-
)
|
|
59
|
-
foods = [f for f in self.bfoods if (not f.is_inventory)]
|
|
60
|
-
|
|
61
|
-
wfoods = [f for f in foods if not f.is_abandoned]
|
|
62
|
-
uwfoods = [f for f in foods if f.is_abandoned]
|
|
63
|
-
total_price = 0.0
|
|
64
|
-
|
|
65
|
-
for row in pssheet.iter_rows(
|
|
66
|
-
min_row=4, max_row=10, min_col=1, max_col=3
|
|
67
|
-
):
|
|
68
|
-
class_name = row[0].value.replace(" ", "")
|
|
69
|
-
_total_price = 0.0
|
|
70
|
-
for food in wfoods:
|
|
71
|
-
if food.fclass == class_name:
|
|
72
|
-
_total_price += food.count * food.unit_price
|
|
73
|
-
_total_price = round(_total_price, self.sd + 1)
|
|
74
|
-
|
|
75
|
-
pssheet.cell(row[0].row, 2, _total_price)
|
|
76
|
-
total_price += _total_price
|
|
77
|
-
|
|
78
|
-
total_price = round(total_price, self.sd + 1)
|
|
79
|
-
local_total_price = self.get_local_total_price(total_price)
|
|
80
|
-
pssheet.cell(
|
|
81
|
-
11,
|
|
82
|
-
1,
|
|
83
|
-
(
|
|
84
|
-
_("总金额(大写):")
|
|
85
|
-
+ f"{local_total_price} "
|
|
86
|
-
+ f"{self.currency.mark}{total_price}"
|
|
87
|
-
),
|
|
88
|
-
)
|
|
89
|
-
pssheet.cell(12, 1, _("经办人:") + f"{self.operator.name} ")
|
|
90
|
-
|
|
91
|
-
total_price = sum([f.count * f.unit_price for f in uwfoods])
|
|
92
|
-
local_total_price = self.bill.get_CNY_chars(total_price)
|
|
93
|
-
pssheet.cell(27, 2, total_price)
|
|
94
|
-
pssheet.cell(
|
|
95
|
-
29,
|
|
96
|
-
1,
|
|
97
|
-
_("总金额(大写):")
|
|
98
|
-
+ f"{local_total_price} "
|
|
99
|
-
+ f"{self.currency.mark}{total_price}",
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
pssheet.cell(30, 1, _("经办人:") + f"{self.operator.name} ")
|
|
103
|
-
|
|
104
|
-
wb = self.bwb
|
|
105
|
-
wb.active = pssheet
|
|
106
|
-
|
|
107
|
-
print_info(_("Sheet '%s' was updated.") % self.sheet.title)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
# The end.
|
|
@@ -1,363 +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
|
-
from fnschool.canteen.spreadsheet.merging import Merging
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class SpreadSheet:
|
|
31
|
-
def __init__(self, bill):
|
|
32
|
-
self.bill = bill
|
|
33
|
-
self.operator = self.bill.operator
|
|
34
|
-
self._bill_fpath = None
|
|
35
|
-
self._purchasing_fpath = None
|
|
36
|
-
self._bwb = None
|
|
37
|
-
self._pwb = None
|
|
38
|
-
self._preconsuming = None
|
|
39
|
-
self._purchasing = None
|
|
40
|
-
self._consuming = None
|
|
41
|
-
self._inventory = None
|
|
42
|
-
self._warehousing = None
|
|
43
|
-
self._unwareshousing = None
|
|
44
|
-
self._purchasingsum = None
|
|
45
|
-
self._consumingsum = None
|
|
46
|
-
self._sfood = None
|
|
47
|
-
self._cover = None
|
|
48
|
-
self.sd = self.bill.significant_digits
|
|
49
|
-
|
|
50
|
-
self.preconsuming_name0 = "出库计划表"
|
|
51
|
-
self.purchasing_name = None
|
|
52
|
-
self.consuming_name = "出库单"
|
|
53
|
-
self.inventory_name = "食材盘存表"
|
|
54
|
-
self.warehousing_name = "入库单"
|
|
55
|
-
self.unwarehousing_name = "未入库明细表"
|
|
56
|
-
self.purchasingsum_name = "入库、未入库汇总表"
|
|
57
|
-
self.consumingsum_name = "出库汇总表"
|
|
58
|
-
self.sfood_name = "材料台账母表"
|
|
59
|
-
self.cover_name = "六大类总封面"
|
|
60
|
-
|
|
61
|
-
@property
|
|
62
|
-
def bill_fpath(self):
|
|
63
|
-
if not self._bill_fpath:
|
|
64
|
-
self._bill_fpath = self.bill.operator.bill_fpath
|
|
65
|
-
return self._bill_fpath
|
|
66
|
-
|
|
67
|
-
@property
|
|
68
|
-
def bill_workbook(self):
|
|
69
|
-
if not self._bwb:
|
|
70
|
-
self._bwb = load_workbook(self.bill_fpath)
|
|
71
|
-
print_info(
|
|
72
|
-
_('Spreadsheet "{0}" is in use.').format(self.bill_fpath)
|
|
73
|
-
)
|
|
74
|
-
return self._bwb
|
|
75
|
-
|
|
76
|
-
@property
|
|
77
|
-
def bwb(self):
|
|
78
|
-
return self.bill_workbook
|
|
79
|
-
|
|
80
|
-
def del_bill_workbook(self):
|
|
81
|
-
self._bwb = None
|
|
82
|
-
self._bill_fpath = None
|
|
83
|
-
|
|
84
|
-
def del_bwb(self):
|
|
85
|
-
self.del_bill_workbook()
|
|
86
|
-
|
|
87
|
-
@property
|
|
88
|
-
def consumingsum(self):
|
|
89
|
-
if not self._consumingsum:
|
|
90
|
-
self._consumingsum = ConsumingSum(self.bill)
|
|
91
|
-
return self._consumingsum
|
|
92
|
-
|
|
93
|
-
@property
|
|
94
|
-
def purchasingsum(self):
|
|
95
|
-
if not self._purchasingsum:
|
|
96
|
-
self._purchasingsum = PurchasingSum(self.bill)
|
|
97
|
-
return self._purchasingsum
|
|
98
|
-
|
|
99
|
-
@property
|
|
100
|
-
def sfood(self):
|
|
101
|
-
if not self._sfood:
|
|
102
|
-
self._sfood = SFood(self.bill)
|
|
103
|
-
return self._sfood
|
|
104
|
-
|
|
105
|
-
@property
|
|
106
|
-
def unwarehousing(self):
|
|
107
|
-
if not self._unwareshousing:
|
|
108
|
-
self._unwareshousing = Unwarehousing(self.bill)
|
|
109
|
-
return self._unwareshousing
|
|
110
|
-
|
|
111
|
-
@property
|
|
112
|
-
def cover(self):
|
|
113
|
-
if not self._cover:
|
|
114
|
-
self._cover = Cover(self.bill)
|
|
115
|
-
|
|
116
|
-
return self._cover
|
|
117
|
-
|
|
118
|
-
@property
|
|
119
|
-
def warehousing(self):
|
|
120
|
-
if not self._warehousing:
|
|
121
|
-
self._warehousing = Warehousing(self.bill)
|
|
122
|
-
return self._warehousing
|
|
123
|
-
|
|
124
|
-
@property
|
|
125
|
-
def purchasing(self):
|
|
126
|
-
if not self._purchasing:
|
|
127
|
-
self._purchasing = Purchasing(self.bill)
|
|
128
|
-
return self._purchasing
|
|
129
|
-
|
|
130
|
-
@property
|
|
131
|
-
def preconsuming(self):
|
|
132
|
-
if not self._preconsuming:
|
|
133
|
-
self._preconsuming = PreConsuming(self.bill)
|
|
134
|
-
return self._preconsuming
|
|
135
|
-
|
|
136
|
-
@property
|
|
137
|
-
def consuming(self):
|
|
138
|
-
if not self._consuming:
|
|
139
|
-
self._consuming = Consuming(self.bill)
|
|
140
|
-
return self._consuming
|
|
141
|
-
|
|
142
|
-
@property
|
|
143
|
-
def inventory(self):
|
|
144
|
-
if not self._inventory:
|
|
145
|
-
self._inventory = Inventory(self.bill)
|
|
146
|
-
return self._inventory
|
|
147
|
-
|
|
148
|
-
@property
|
|
149
|
-
def meal_type(self):
|
|
150
|
-
return self.bill.meal_type
|
|
151
|
-
|
|
152
|
-
def save_workbook(self):
|
|
153
|
-
bill_fpath0 = self.operator.bill_fpath_uuid
|
|
154
|
-
print_error(
|
|
155
|
-
_(
|
|
156
|
-
"Do you want to save all updated data "
|
|
157
|
-
+ 'to "{0}"? or just save it as a '
|
|
158
|
-
+ 'copy to "{1}". (Yy[N]n)'
|
|
159
|
-
).format(self.operator.bill_fpath, bill_fpath0)
|
|
160
|
-
)
|
|
161
|
-
print_warning(
|
|
162
|
-
_(
|
|
163
|
-
'If you save updated data to "{0}", '
|
|
164
|
-
+ "data of food sheets will be saved "
|
|
165
|
-
+ "for every month."
|
|
166
|
-
).format(self.operator.bill_fpath)
|
|
167
|
-
)
|
|
168
|
-
|
|
169
|
-
s_input = get_input()
|
|
170
|
-
|
|
171
|
-
print()
|
|
172
|
-
print_info(_("Saving. . ."))
|
|
173
|
-
|
|
174
|
-
if len(s_input) > 0 and s_input in "Yy":
|
|
175
|
-
self.bwb.save(self.operator.bill_fpath)
|
|
176
|
-
bill_fpath0 = self.operator.bill_fpath
|
|
177
|
-
print_info(
|
|
178
|
-
_(
|
|
179
|
-
"You can fill in the monthly missing data "
|
|
180
|
-
+ "to food sheets, they will be saved "
|
|
181
|
-
+ "for next updating."
|
|
182
|
-
)
|
|
183
|
-
)
|
|
184
|
-
else:
|
|
185
|
-
self.bwb.save(bill_fpath0)
|
|
186
|
-
|
|
187
|
-
print_info(
|
|
188
|
-
_('Updated data has been saved to "{0}".').format(bill_fpath0)
|
|
189
|
-
)
|
|
190
|
-
|
|
191
|
-
open_path(bill_fpath0)
|
|
192
|
-
|
|
193
|
-
print_info(_("Updated data was saved."))
|
|
194
|
-
|
|
195
|
-
def print_summary(self, foods=None):
|
|
196
|
-
bfoods = foods or self.bill.foods
|
|
197
|
-
cfoods = [f for f in bfoods if not f.is_abandoned]
|
|
198
|
-
currency_mark = self.bill.currency.mark
|
|
199
|
-
summary = []
|
|
200
|
-
summary_len = 0
|
|
201
|
-
|
|
202
|
-
inventory_mm1 = sum([f.total_price for f in cfoods if f.is_inventory])
|
|
203
|
-
inventory_mm1 = round(inventory_mm1, self.sd + 1)
|
|
204
|
-
|
|
205
|
-
inventory_mm1 = (
|
|
206
|
-
_("Inventory of last month: ") + currency_mark + str(inventory_mm1)
|
|
207
|
-
)
|
|
208
|
-
|
|
209
|
-
warehousing_m = sum(
|
|
210
|
-
[f.total_price for f in cfoods if not f.is_inventory]
|
|
211
|
-
)
|
|
212
|
-
|
|
213
|
-
warehousing_m_cp = warehousing_m
|
|
214
|
-
warehousing_m = (
|
|
215
|
-
_("Warehousing of this month: ")
|
|
216
|
-
+ currency_mark
|
|
217
|
-
+ str(warehousing_m)
|
|
218
|
-
)
|
|
219
|
-
inventory_mm1_warehousing_m = (
|
|
220
|
-
_("Total: ")
|
|
221
|
-
+ currency_mark
|
|
222
|
-
+ str(round(sum([f.total_price for f in cfoods]), 2))
|
|
223
|
-
)
|
|
224
|
-
consuming_m = 0
|
|
225
|
-
for f in cfoods:
|
|
226
|
-
f_consuming_m = sum([c for __, c in f.consumptions])
|
|
227
|
-
consuming_m += f_consuming_m * f.unit_price
|
|
228
|
-
consuming_m = round(consuming_m, self.sd + 1)
|
|
229
|
-
|
|
230
|
-
consuming_m_cp = consuming_m
|
|
231
|
-
consuming_m = (
|
|
232
|
-
_("Consuming of this month: ") + currency_mark + str(consuming_m)
|
|
233
|
-
)
|
|
234
|
-
|
|
235
|
-
month_day_m1 = sorted([f.xdate for f in cfoods])[0]
|
|
236
|
-
for f in cfoods:
|
|
237
|
-
month_day_m1 = max([d for d, __ in f.consumptions] + [month_day_m1])
|
|
238
|
-
|
|
239
|
-
inventory_m = sum(
|
|
240
|
-
[
|
|
241
|
-
f.get_remainder(month_day_m1) * f.unit_price
|
|
242
|
-
for f in cfoods
|
|
243
|
-
if f.get_remainder(month_day_m1) > 0
|
|
244
|
-
]
|
|
245
|
-
)
|
|
246
|
-
inventory_m = round(inventory_m, self.sd + 1)
|
|
247
|
-
|
|
248
|
-
inventory_m_cp = inventory_m
|
|
249
|
-
inventory_m = (
|
|
250
|
-
_("Inventory of this month: ") + currency_mark + str(inventory_m)
|
|
251
|
-
)
|
|
252
|
-
|
|
253
|
-
consuming_m_inventory_m = (
|
|
254
|
-
_("Total: ")
|
|
255
|
-
+ currency_mark
|
|
256
|
-
+ str(round(consuming_m_cp + inventory_m_cp, self.sd + 1))
|
|
257
|
-
)
|
|
258
|
-
|
|
259
|
-
afoods = [f for f in bfoods if f.is_abandoned]
|
|
260
|
-
unwarehousing_m = (
|
|
261
|
-
_("Unwarehousing of this month: ")
|
|
262
|
-
+ currency_mark
|
|
263
|
-
+ str(sum([f.total_price for f in afoods]))
|
|
264
|
-
)
|
|
265
|
-
|
|
266
|
-
total_purchasing_m = (
|
|
267
|
-
_("Total purchasing of this month: ")
|
|
268
|
-
+ currency_mark
|
|
269
|
-
+ str(
|
|
270
|
-
round(
|
|
271
|
-
sum([f.total_price for f in bfoods if not f.is_inventory]),
|
|
272
|
-
self.sd + 1,
|
|
273
|
-
)
|
|
274
|
-
)
|
|
275
|
-
)
|
|
276
|
-
summary = [
|
|
277
|
-
inventory_mm1,
|
|
278
|
-
warehousing_m,
|
|
279
|
-
inventory_mm1_warehousing_m,
|
|
280
|
-
consuming_m,
|
|
281
|
-
inventory_m,
|
|
282
|
-
consuming_m_inventory_m,
|
|
283
|
-
warehousing_m,
|
|
284
|
-
unwarehousing_m,
|
|
285
|
-
total_purchasing_m,
|
|
286
|
-
]
|
|
287
|
-
|
|
288
|
-
summary_len = max(
|
|
289
|
-
[len(s) + len([c for c in s if is_zh_CN_char(c)]) for s in summary]
|
|
290
|
-
)
|
|
291
|
-
summary_sep = get_random_sep_char() * summary_len
|
|
292
|
-
consuming_date_m1 = (
|
|
293
|
-
f"{self.bill.consuming.year}"
|
|
294
|
-
+ f".{self.bill.consuming.month:0>2}"
|
|
295
|
-
+ f".{self.bill.consuming.day_m1:0>2}"
|
|
296
|
-
)
|
|
297
|
-
summary = (
|
|
298
|
-
[summary_sep]
|
|
299
|
-
+ [self.meal_type]
|
|
300
|
-
+ [summary_sep]
|
|
301
|
-
+ summary[:3]
|
|
302
|
-
+ [summary_sep]
|
|
303
|
-
+ summary[3:6]
|
|
304
|
-
+ [summary_sep]
|
|
305
|
-
+ summary[6:]
|
|
306
|
-
+ [summary_sep]
|
|
307
|
-
+ [f"{consuming_date_m1:>{summary_len}}"]
|
|
308
|
-
)
|
|
309
|
-
summary = "\n".join(summary)
|
|
310
|
-
print()
|
|
311
|
-
print_error(_("Summary:"))
|
|
312
|
-
print_info(summary)
|
|
313
|
-
print()
|
|
314
|
-
|
|
315
|
-
def del_sheets_var(self):
|
|
316
|
-
self._inventory = None
|
|
317
|
-
self._warehousing = None
|
|
318
|
-
self._unwareshousing = None
|
|
319
|
-
self._consuming = None
|
|
320
|
-
self._sfood = None
|
|
321
|
-
self._purchasingsum = None
|
|
322
|
-
self._consumingsum = None
|
|
323
|
-
self._cover = None
|
|
324
|
-
|
|
325
|
-
def merge(self):
|
|
326
|
-
merging = Merging(self.bill)
|
|
327
|
-
merging.start()
|
|
328
|
-
pass
|
|
329
|
-
|
|
330
|
-
def update(self):
|
|
331
|
-
|
|
332
|
-
foods0 = self.bill.foods.copy()
|
|
333
|
-
meal_types = list(set([f.meal_type for f in foods0]))
|
|
334
|
-
|
|
335
|
-
for t in meal_types:
|
|
336
|
-
|
|
337
|
-
print_info(_("Updating sheets for {0}.").format(t))
|
|
338
|
-
|
|
339
|
-
_foods = [f for f in foods0 if f.meal_type == t]
|
|
340
|
-
|
|
341
|
-
del self.bill.meal_type
|
|
342
|
-
self.bill.foods = _foods
|
|
343
|
-
|
|
344
|
-
self.inventory.update()
|
|
345
|
-
self.warehousing.update()
|
|
346
|
-
self.unwarehousing.update()
|
|
347
|
-
self.consuming.update()
|
|
348
|
-
self.sfood.update()
|
|
349
|
-
self.purchasingsum.update()
|
|
350
|
-
self.consumingsum.update()
|
|
351
|
-
self.cover.update()
|
|
352
|
-
|
|
353
|
-
self.print_summary()
|
|
354
|
-
|
|
355
|
-
self.save_workbook()
|
|
356
|
-
|
|
357
|
-
self.del_sheets_var()
|
|
358
|
-
self.del_bwb()
|
|
359
|
-
|
|
360
|
-
print_info(_("Update completely!"))
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
# The end.
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# Why does this file appear?
|
|
2
|
-
# In fact, this project was not built from scratch. At first, I just wanted
|
|
3
|
-
# to complete the tasks assigned by the superior department, so I didn't think
|
|
4
|
-
# too much because there were many things that needed to be urgently completed.
|
|
5
|
-
# So some files in this project inevitably contain a large number of Chinese
|
|
6
|
-
# characters in their text. When this project can successfully complete many
|
|
7
|
-
# tasks, internationalization has become very troublesome and difficult to
|
|
8
|
-
# start (and I don't have that much time). So, this file is responsible for
|
|
9
|
-
# translating an international copy.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
# The end.
|
|
@@ -1,178 +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 Unwarehousing(Base):
|
|
14
|
-
def __init__(self, bill):
|
|
15
|
-
super().__init__(bill)
|
|
16
|
-
self.sheet_name = self.s.unwarehousing_name
|
|
17
|
-
self.entry_row_len0 = 11
|
|
18
|
-
self.form_title0 = "未入库明细表"
|
|
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
|
-
@property
|
|
27
|
-
def form_indexes(self):
|
|
28
|
-
if not self._form_indexes:
|
|
29
|
-
unwsheet = self.sheet
|
|
30
|
-
indexes = []
|
|
31
|
-
row_index = 1
|
|
32
|
-
for row in unwsheet.iter_rows(
|
|
33
|
-
max_row=unwsheet.max_row + 1, max_col=7
|
|
34
|
-
):
|
|
35
|
-
if row[0].value and self.form_title0 in row[0].value.replace(
|
|
36
|
-
" ", ""
|
|
37
|
-
):
|
|
38
|
-
indexes.append([row_index + 1, 0])
|
|
39
|
-
|
|
40
|
-
r1_value = row[1].value
|
|
41
|
-
if r1_value and (
|
|
42
|
-
"合计" in r1_value.replace(" ", "")
|
|
43
|
-
or "总合计" in r1_value.replace(" ", "")
|
|
44
|
-
):
|
|
45
|
-
indexes[-1][1] = row_index
|
|
46
|
-
|
|
47
|
-
row_index += 1
|
|
48
|
-
|
|
49
|
-
if len(indexes) > 0:
|
|
50
|
-
self._form_indexes = indexes
|
|
51
|
-
else:
|
|
52
|
-
return None
|
|
53
|
-
|
|
54
|
-
return self._form_indexes
|
|
55
|
-
|
|
56
|
-
def get_form_title(self, fclass="调味类"):
|
|
57
|
-
title = _("{0} ({1})").format(self.form_title0, fclass)
|
|
58
|
-
return title
|
|
59
|
-
|
|
60
|
-
def update(self):
|
|
61
|
-
unwsheet = self.sheet
|
|
62
|
-
form_indexes = self.form_indexes
|
|
63
|
-
|
|
64
|
-
ufoods = [f for f in self.bfoods if f.is_abandoned]
|
|
65
|
-
if len(ufoods) < 1:
|
|
66
|
-
print_info(
|
|
67
|
-
_(
|
|
68
|
-
"There is no abandoned food. "
|
|
69
|
-
+ "Sheet {0} updating skipped."
|
|
70
|
-
).format(self.sheet.title)
|
|
71
|
-
)
|
|
72
|
-
return None
|
|
73
|
-
|
|
74
|
-
food_classes = list(set([f.fclass for f in ufoods]))
|
|
75
|
-
used_form_index0 = None
|
|
76
|
-
used_form_index1 = None
|
|
77
|
-
for fclass in food_classes:
|
|
78
|
-
foods = [f for f in ufoods if f.fclass == fclass]
|
|
79
|
-
foods = sorted(foods, key=lambda f: f.xdate)
|
|
80
|
-
foods_len = len(foods)
|
|
81
|
-
|
|
82
|
-
t1 = self.bill.consuming.date_m1
|
|
83
|
-
c_row_count = 0
|
|
84
|
-
used_form_index0 = used_form_index1 + 1 if used_form_index1 else 0
|
|
85
|
-
used_form_index1 = (
|
|
86
|
-
-1 if used_form_index1 == None else used_form_index1
|
|
87
|
-
)
|
|
88
|
-
c_form_indexes = form_indexes[used_form_index0:]
|
|
89
|
-
for i0, i1 in c_form_indexes:
|
|
90
|
-
c_row_count += (i1 - 1) - (i0 + 1)
|
|
91
|
-
used_form_index1 += 1
|
|
92
|
-
if c_row_count >= foods_len:
|
|
93
|
-
break
|
|
94
|
-
c_form_indexes = form_indexes[
|
|
95
|
-
used_form_index0 : used_form_index1 + 1
|
|
96
|
-
]
|
|
97
|
-
|
|
98
|
-
row_indexes = []
|
|
99
|
-
for form_index in c_form_indexes:
|
|
100
|
-
form_index0, form_index1 = form_index
|
|
101
|
-
unwsheet.cell(form_index0 - 1, 1, self.get_form_title(fclass))
|
|
102
|
-
unwsheet.cell(form_index0, 1, f" 学校名称:{self.purchaser}")
|
|
103
|
-
unwsheet.cell(
|
|
104
|
-
form_index0,
|
|
105
|
-
4,
|
|
106
|
-
f" "
|
|
107
|
-
+ f"{t1.year} 年 {t1.month} 月 "
|
|
108
|
-
+ f"{t1.day} 日"
|
|
109
|
-
+ f" ",
|
|
110
|
-
)
|
|
111
|
-
row_index_start = form_index0 + 2
|
|
112
|
-
row_index_end = form_index1 - 1
|
|
113
|
-
row_indexes += list(range(row_index_start, row_index_end + 1))
|
|
114
|
-
|
|
115
|
-
for row_index in row_indexes:
|
|
116
|
-
for col_index in range(1, 7 + 1):
|
|
117
|
-
unwsheet.cell(row_index, col_index, "")
|
|
118
|
-
|
|
119
|
-
total_price = 0.0
|
|
120
|
-
cross_forms = False
|
|
121
|
-
|
|
122
|
-
for _index, row_index in enumerate(row_indexes):
|
|
123
|
-
food = foods[_index]
|
|
124
|
-
total_price += food.total_price
|
|
125
|
-
unwsheet.cell(row_index, 1, food.xdate.strftime("%Y.%m.%d"))
|
|
126
|
-
unwsheet.cell(row_index, 2, food.name)
|
|
127
|
-
unwsheet.cell(row_index, 3, food.unit_name)
|
|
128
|
-
|
|
129
|
-
unwsheet.cell(row_index, 4).number_format = (
|
|
130
|
-
numbers.FORMAT_NUMBER_00
|
|
131
|
-
)
|
|
132
|
-
unwsheet.cell(row_index, 4, food.count)
|
|
133
|
-
|
|
134
|
-
unwsheet.cell(row_index, 5).number_format = (
|
|
135
|
-
numbers.FORMAT_NUMBER_00
|
|
136
|
-
)
|
|
137
|
-
unwsheet.cell(row_index, 6).number_format = (
|
|
138
|
-
numbers.FORMAT_NUMBER_00
|
|
139
|
-
)
|
|
140
|
-
|
|
141
|
-
unwsheet.cell(row_index, 5, food.unit_price)
|
|
142
|
-
unwsheet.cell(row_index, 6, food.total_price)
|
|
143
|
-
|
|
144
|
-
for u_col_index in range(1, 7):
|
|
145
|
-
cell = unwsheet.cell(row_index, u_col_index)
|
|
146
|
-
cell.alignment = self.cell_alignment0
|
|
147
|
-
cell.border = self.cell_border0
|
|
148
|
-
|
|
149
|
-
if (
|
|
150
|
-
str(unwsheet.cell(row_index + 1, 2).value)
|
|
151
|
-
.replace(" ", "")
|
|
152
|
-
.endswith("合计")
|
|
153
|
-
and foods_len > _index
|
|
154
|
-
):
|
|
155
|
-
unwsheet.cell(row_index + 1, 2, "合计")
|
|
156
|
-
unwsheet.cell(row_index + 1, 6, total_price)
|
|
157
|
-
cross_forms = True
|
|
158
|
-
|
|
159
|
-
if len(foods) - 1 == _index:
|
|
160
|
-
for row in unwsheet.iter_rows(
|
|
161
|
-
min_row=row_index,
|
|
162
|
-
max_row=unwsheet.max_row,
|
|
163
|
-
min_col=1,
|
|
164
|
-
max_col=7,
|
|
165
|
-
):
|
|
166
|
-
r1_value = row[1].value
|
|
167
|
-
if r1_value and str(r1_value).replace(" ", "").endswith(
|
|
168
|
-
"合计"
|
|
169
|
-
):
|
|
170
|
-
row[1].value = "总合计" if cross_forms else "合计"
|
|
171
|
-
row[5].value = total_price
|
|
172
|
-
break
|
|
173
|
-
break
|
|
174
|
-
|
|
175
|
-
print_info(_("Sheet '%s' was updated.") % self.sheet.title)
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
# The end.
|