fix ozon
This commit is contained in:
@@ -23,6 +23,7 @@ class DocumentCreation:
|
|||||||
data = self.build_dict(**kwargs)
|
data = self.build_dict(**kwargs)
|
||||||
|
|
||||||
self.contragent = kwargs.get("Контрагент_Key")
|
self.contragent = kwargs.get("Контрагент_Key")
|
||||||
|
##
|
||||||
response = self.session.post(self.url, json=data)
|
response = self.session.post(self.url, json=data)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
result = response.json()
|
result = response.json()
|
||||||
@@ -33,6 +34,7 @@ class DocumentCreation:
|
|||||||
|
|
||||||
self.save_key_txt(document_key)
|
self.save_key_txt(document_key)
|
||||||
return document_key
|
return document_key
|
||||||
|
|
||||||
|
|
||||||
def fill_document_items_purchase(self, document_key: str, validated_rows: list):
|
def fill_document_items_purchase(self, document_key: str, validated_rows: list):
|
||||||
line_url = f"{self.url}({document_key})"
|
line_url = f"{self.url}({document_key})"
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ def process_sheet(df,real_arti: int,real_quantity: int,real_sum_1: int,real_sum_
|
|||||||
return validated_rows
|
return validated_rows
|
||||||
def evaluating(dfs):
|
def evaluating(dfs):
|
||||||
validated_rows_1 = process_sheet(dfs["Отчет о реализации"], real_arti=2,real_quantity=7, real_sum_1=5,real_sum_2=6) # номера столбцов от озона
|
validated_rows_1 = process_sheet(dfs["Отчет о реализации"], real_arti=2,real_quantity=7, real_sum_1=5,real_sum_2=6) # номера столбцов от озона
|
||||||
validated_rows_2 = process_sheet(dfs["Отчет о реализации"], real_arti=2,real_quantity=13, real_sum_1=10,real_sum_2=11)#
|
validated_rows_2 = process_sheet(dfs["Отчет о реализации"], real_arti=2,real_quantity=12, real_sum_1=10,real_sum_2=11)#
|
||||||
sum_1 = sum(row.price for row in validated_rows_1)
|
sum_1 = sum(row.price for row in validated_rows_1)
|
||||||
sum_2 = sum(row.price for row in validated_rows_2)
|
sum_2 = sum(row.price for row in validated_rows_2)
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class OZONHandler(BaseHandler):
|
|||||||
def process(self):
|
def process(self):
|
||||||
xls= self.struct()
|
xls= self.struct()
|
||||||
if "Отчет о реализации" in xls.sheet_names:
|
if "Отчет о реализации" in xls.sheet_names:
|
||||||
dfs = self.read(xls, skiprows=14, skipfooter=17)
|
dfs = self.read(xls, skiprows=14, skipfooter=14)
|
||||||
else:
|
else:
|
||||||
raise Exception(f"В файле {self.file_path.name} отсутствуют необходимые листы")
|
raise Exception(f"В файле {self.file_path.name} отсутствуют необходимые листы")
|
||||||
validated_data = ozon_handler.evaluating(dfs)
|
validated_data = ozon_handler.evaluating(dfs)
|
||||||
|
|||||||
Reference in New Issue
Block a user