feat: enforce KS-2/KS-3 stornation integrity
This commit is contained in:
@@ -5,7 +5,7 @@ from docx import Document
|
||||
from docx.enum.section import WD_ORIENT
|
||||
from docx.enum.table import WD_TABLE_ALIGNMENT
|
||||
from docx.enum.text import WD_ALIGN_PARAGRAPH
|
||||
from docx.shared import Pt
|
||||
from docx.shared import Pt, RGBColor
|
||||
|
||||
from app.exporters.common import MONEY_TEXT, QTY_TEXT, format_period, project_requisite_lines
|
||||
from app.exporters.ks2_dto import KS2ExportDocument
|
||||
@@ -26,6 +26,14 @@ def render_ks2_word(doc: KS2ExportDocument) -> bytes:
|
||||
run.bold = True
|
||||
run.font.size = Pt(14)
|
||||
|
||||
if h.status == "cancelled":
|
||||
mark = d.add_paragraph()
|
||||
mark.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
||||
run = mark.add_run("СТОРНИРОВАН")
|
||||
run.bold = True
|
||||
run.font.size = Pt(12)
|
||||
run.font.color.rgb = RGBColor(0xC0, 0x00, 0x00)
|
||||
|
||||
d.add_paragraph()
|
||||
|
||||
header_lines = project_requisite_lines(
|
||||
|
||||
@@ -5,7 +5,7 @@ from docx import Document
|
||||
from docx.enum.section import WD_ORIENT
|
||||
from docx.enum.table import WD_TABLE_ALIGNMENT
|
||||
from docx.enum.text import WD_ALIGN_PARAGRAPH
|
||||
from docx.shared import Pt
|
||||
from docx.shared import Pt, RGBColor
|
||||
|
||||
from app.exporters.common import MONEY_TEXT, format_date, format_period, project_requisite_lines
|
||||
from app.exporters.ks3_dto import KS3ExportDocument
|
||||
@@ -26,6 +26,14 @@ def render_ks3_word(doc: KS3ExportDocument) -> bytes:
|
||||
run.bold = True
|
||||
run.font.size = Pt(14)
|
||||
|
||||
if h.status == "cancelled":
|
||||
mark = d.add_paragraph()
|
||||
mark.alignment = WD_ALIGN_PARAGRAPH.CENTER
|
||||
run = mark.add_run("СТОРНИРОВАН")
|
||||
run.bold = True
|
||||
run.font.size = Pt(12)
|
||||
run.font.color.rgb = RGBColor(0xC0, 0x00, 0x00)
|
||||
|
||||
d.add_paragraph()
|
||||
|
||||
header_lines = project_requisite_lines(
|
||||
|
||||
Reference in New Issue
Block a user