Skip to content

Commit

Permalink
Страница №1 v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Wellheor1 committed Oct 12, 2023
1 parent 03df126 commit b0fd751
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 9 deletions.
59 changes: 51 additions & 8 deletions forms/forms100.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,6 @@ def form_05(request_data):
style.fontName = "PTAstraSerifReg"
style.fontSize = 11
style.alignment = TA_LEFT
style.leading = 4.2 * mm
styleBold = deepcopy(style)
styleBold.fontName = "PTAstraSerifBold"
styleOrgName = deepcopy(styleBold)
Expand All @@ -1105,9 +1104,9 @@ def form_05(request_data):

objs = []

space_symbol = ' '
open_bold_tag = '<font fontname="PTAstraSerifBold">'
close_bold_tag = '</font>'
# space_symbol = '&nbsp;'
# open_bold_tag = '<font fontname="PTAstraSerifBold">'
# close_bold_tag = '</font>'

order_data = [
[
Expand Down Expand Up @@ -1137,7 +1136,7 @@ def form_05(request_data):
f'<font fontname="PTAstraSerifReg" size=10>{hospital_address}</font>', styleOrgName),
Paragraph('Медицинская документация <br/>Учетная форма № 025-1/у <br/>Утверждена приказом Минздрава России от 15 '
'декабря 2014 г. № 834н', styleCenterBold),
],
]
]

header_table = Table(header_data, [200 * mm, 80 * mm], hAlign='RIGHT')
Expand Down Expand Up @@ -1217,7 +1216,7 @@ def form_05(request_data):
f'{disability_group} 18. Инвалид с детства: {disability_childhood}', style))

params_columns.append({'x': 0 * mm, 'y': -51 * mm, 'width': 279 * mm, 'height': 48 * mm, 'text': frame_data, 'left_padding': 2 * mm, 'right_padding': 2 * mm, 'bottom_padding': 2 * mm,
'top_padding': 2, 'showBoundary': 1})
'top_padding': 2, 'showBoundary': 1, 'fake_width': None})
objs.append(FrameDataCol(params_columns))

frame_data = []
Expand Down Expand Up @@ -1248,10 +1247,54 @@ def form_05(request_data):

finance_source = 'ОМС – 1; бюджета – 2; личных средств – 3; ДМС – 4; иных источников, разрешенных законодательством – 5'
frame_data.append(Paragraph(f'26. Оплата за счет: {finance_source}', style))
params_columns.append({'x': 0 * mm, 'y': -121 * mm, 'width': 279 * mm, 'height': 70 * mm, 'text': frame_data, 'left_padding': 2 * mm, 'right_padding': 2 * mm, 'bottom_padding': 2 * mm,
'top_padding': 2, 'showBoundary': 1})

frame_data.append(Spacer(1, 3 * mm))
visit_dates = [
[
Paragraph('27. Даты посещений (число, месяц, год): ', style),
Paragraph('', style),
Paragraph('', style),
Paragraph('', style),
Paragraph('', style),
Paragraph('', style),
Paragraph('', style),
Paragraph('', style),
],
[
Paragraph('', style),
Paragraph('', style),
Paragraph('', style),
Paragraph('', style),
Paragraph('', style),
Paragraph('', style),
Paragraph('', style),
Paragraph('', style),
]
]

columns_widths = [40 * mm, 33.6 * mm, 33.6 * mm, 33.6 * mm, 33.6 * mm, 33.6 * mm, 33.6 * mm, 33.6 * mm]
visit_dates_table = Table(visit_dates, colWidths=columns_widths, hAlign='LEFT')
visit_dates_table.setStyle(
TableStyle(
[
('GRID', (0, 0), (-1, -1), 0.5, colors.black),
('VALIGN', (0, 0), (-1, -1), 'TOP'),
('SPAN', (0, 0), (0, 1))
# ('TOPPADDING', (0, 0), (-1, -1), 1.5 * mm),
# ('BOTTOMPADDING', (0, 0), (-1, -1), 1.5 * mm),

]
)
)
frame_data.append(visit_dates_table)

params_columns.append({'x': 0 * mm, 'y': -136 * mm, 'width': 279 * mm, 'height': 85 * mm, 'text': frame_data, 'left_padding': 2 * mm, 'right_padding': 2 * mm, 'bottom_padding': 2 * mm,
'top_padding': 2, 'showBoundary': 1, 'fake_width': None})
objs.append(FrameDataCol(params_columns))




def first_pages(canvas, document):
canvas.saveState()
canvas.restoreState()
Expand Down
2 changes: 1 addition & 1 deletion results/forms/flowable.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ def draw(self):
bottomPadding=params.get('bottom_padding', 0), rightPadding=params.get("right_padding", 0),
topPadding=params.get("top_padding", 0), showBoundary=params.get("showBoundary", 0)
)
data_inframe = KeepInFrame(params["width"], params["height"], params["text"], vAlign='TOP', fakeWidth=False)
data_inframe = KeepInFrame(params["width"], params["height"], params["text"], vAlign='TOP', fakeWidth=params.get('fake_width', False))
current_data_frame.addFromList([data_inframe], self.canv)
self.canv.restoreState()

0 comments on commit b0fd751

Please sign in to comment.