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

@@ -2,11 +2,12 @@ from pydantic import ValidationError
from server.backend.schemas.pydantic import ExcelInfo, settings,Translit
from server.backend.api.nomenclature import processing
import datetime
def last_day_of_month(date_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(date_format)
#Доставать дату из колонки
def last_day_of_month(format: str):
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, document_type:str):
#Выборка
df = df[['Артикул поставщика', 'Тип документа', 'Кол-во', 'Вайлдберриз реализовал Товар (Пр)']].copy().dropna() #copy and drop all NA values