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, multiply_price=1, sheet_name=''):
#Выборка
df = df[['Ваш SKU', 'Количество, шт.', 'Сумма транзакции, ₽']].copy().dropna() #выбираем нужные колонки, делаем копию, чтобы можно было удалить None inline модом