Skip to content

Commit

Permalink
service note done
Browse files Browse the repository at this point in the history
  • Loading branch information
leeroymk committed Jun 4, 2024
1 parent ce99367 commit f6ff7a6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions makedoc/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def form_auto_document(self, request):
ws = wb.active

self.fill_contract_info(ws, client)
self.fill_product_info(ws, product)
self.fill_product_info(ws, product, 10)
self.fill_factory_info(ws, factory)
self.fill_auto_services(ws)
self.fill_debt_info(ws)
Expand All @@ -101,8 +101,7 @@ def fill_contract_info(self, ws, client):
ws.cell(row=4, column=1, value=client.client_name)
ws.cell(row=6, column=6, value=get_formatted_date_agreement())

def fill_product_info(self, ws, product):
caret = 10
def fill_product_info(self, ws, product, caret):
goods_quantity = 7
thin_border = Border(
left=Side(style="thin"),
Expand Down Expand Up @@ -277,7 +276,7 @@ def form_rw_document(self, request):
ws = wb.active

self.fill_contract_info(ws, client)
self.fill_product_info(ws, product)
self.fill_product_info(ws, product, 10)
self.fill_factory_info(ws, factory)
self.fill_rw_services(ws, rw, factory, client)
self.fill_debt_info(ws)
Expand Down Expand Up @@ -360,6 +359,7 @@ def form_service_note(self, request):
discount = self.get_discount(request)
city = self.get_city(request)
user = self.get_user(request)
product = self.get_product(request)
except Exception as e:
return f"Error fetching data: {e}"

Expand All @@ -368,13 +368,13 @@ def form_service_note(self, request):
wb = openpyxl.load_workbook(template_path, keep_vba=True)
ws = wb.active

self.fill_service_note(ws, client, discount, city)

self.fill_text_note(ws, client, discount, city)
self.fill_product_info(ws, product, 22)
self.apply_styles(ws)

self.save_workbook(wb, user)

def fill_service_note(self, ws, client, discount, city):
def fill_text_note(self, ws, client, discount, city):
ws.cell(row=15, column=1, value=f"{get_formatted_date_agreement()} № 12/2.2/23/3-")
text = f" В целях увеличения объема продаж на территории {city.region} прошу Вашего \
согласования применить скидку для контрагента {client.client_name} (г. {city.city}) до {discount}%\
Expand Down

0 comments on commit f6ff7a6

Please sign in to comment.