dates fix

This commit is contained in:
2026-01-08 19:25:19 +03:00
parent 9980c1f002
commit 4e546bfc64
8 changed files with 195 additions and 221 deletions

View File

@@ -4,9 +4,10 @@ from server.backend.api.nomenclature import processing
import datetime
import re
def last_day_of_month(format: str):
next_month = datetime.datetime.now().replace(day=28) + datetime.timedelta(days=4)
last_day = next_month - datetime.timedelta(days=next_month.day)
return last_day.strftime(format)
today = datetime.datetime.now()
first_day_current_month = today.replace(day=1)
last_day_prev_month = first_day_current_month - datetime.timedelta(days=1)
return last_day_prev_month.strftime(format)
def process_sheet(df,real_arti: int,real_quantity: int,real_sum_1: int,real_sum_2: int):
# выбираем нужные колонки по индексам
df = df.iloc[:, [real_arti, real_quantity, real_sum_1, real_sum_2]].copy()