Business plan draft 0.3 in two versions: Plan A ~180M and Plan B ~225M THB
Deploy test site / deploy (push) Successful in 52s
Deploy test site / deploy (push) Successful in 52s
- One build makes both documents: plan_variant.py switches the plan-specific text (pick / is_a / label); build_plan.py writes CNX-Vinyl-Business-Plan-A and -B (docx), export_pdf.py exports both PDFs with the table of contents filled in. Draft 0.2 (single launch-plant plan with contingency) is removed; it stays in the history. - Plan A: the launch plant with every machine and six cost levers, ~177M THB with the ramp-up reserve, no contingency. Plan B: the second Duplex at launch, five presses, ~224M THB on the same basis. Each version reads as a complete plan with one table comparing it with the other; the 216M investor-question text is gone, Pheenix is priced at OMS's reference plus 20 %. - Calculator renders in both documents, each from its own preset: the plant at a glance (Figure 4), the budget check (Figure 5) and ten years of cash (Figure 6), in docs/renders/calculator/. - Calculator budget card: the verdict and third KPI now name the tightest budget the midpoint fits (Plan A: 3.3M to spare under 180M; Plan B: 0.8M under 225M) instead of always 225M. - Fixes: CD replication cross-references point to section 4.10; the blended price in section 3.3 and roadmap item 1 is 3.76 to 5.27 USD at 60 % specials (3.50 to 4.60 at a standard-heavy mix).
This commit is contained in:
1 parent
f2ff1eac1f
commit
bd357ab03f
19 files changed
+1618
-685
No files matched your search
@@ -1,5 +1,5 @@
|
||||
|
||||
"""Export CNX-Vinyl-Business-Plan.docx to PDF with LibreOffice, filling in the table of contents.
|
||||
"""Export CNX-Vinyl-Business-Plan-A.docx and -B.docx to PDF with LibreOffice, filling in the table of contents.
|
||||
|
||||
Run with LibreOffice's own Python (it ships the uno module):
|
||||
"C:/Program Files/LibreOffice/program/python.exe" export_pdf.py
|
||||
@@ -8,8 +8,8 @@ A plain `soffice --convert-to pdf` leaves the Word TOC field unfilled.
|
||||
import uno, sys, time, subprocess, os
|
||||
from pathlib import Path
|
||||
HERE = Path(__file__).resolve().parent
|
||||
DOCX = HERE.parent / "CNX-Vinyl-Business-Plan.docx"
|
||||
PDF = HERE.parent / "CNX-Vinyl-Business-Plan.pdf"
|
||||
DOCXS = [HERE.parent / f"CNX-Vinyl-Business-Plan-{p}.docx" for p in ("A", "B")]
|
||||
DOCXS = [d for d in DOCXS if d.exists()]
|
||||
from com.sun.star.beans import PropertyValue
|
||||
def pv(n, v):
|
||||
p = PropertyValue(); p.Name = n; p.Value = v; return p
|
||||
@@ -24,20 +24,22 @@ for i in range(60):
|
||||
time.sleep(0.5)
|
||||
smgr = ctx.ServiceManager
|
||||
desktop = smgr.createInstanceWithContext("com.sun.star.frame.Desktop", ctx)
|
||||
src = uno.systemPathToFileUrl(str(DOCX))
|
||||
doc = desktop.loadComponentFromURL(src, "_blank", 0, (pv("Hidden", True),))
|
||||
idx = doc.getDocumentIndexes()
|
||||
print("indexes", idx.getCount())
|
||||
for i in range(idx.getCount()):
|
||||
idx.getByIndex(i).update()
|
||||
doc.refresh()
|
||||
# update fields (page numbers)
|
||||
doc.getTextFields().refresh()
|
||||
for i in range(idx.getCount()):
|
||||
idx.getByIndex(i).update()
|
||||
out = uno.systemPathToFileUrl(str(PDF))
|
||||
doc.storeToURL(out, (pv("FilterName", "writer_pdf_Export"),))
|
||||
doc.close(True)
|
||||
for DOCX in DOCXS:
|
||||
PDF = DOCX.with_suffix(".pdf")
|
||||
src = uno.systemPathToFileUrl(str(DOCX))
|
||||
doc = desktop.loadComponentFromURL(src, "_blank", 0, (pv("Hidden", True),))
|
||||
idx = doc.getDocumentIndexes()
|
||||
print(DOCX.name, "indexes", idx.getCount())
|
||||
for i in range(idx.getCount()):
|
||||
idx.getByIndex(i).update()
|
||||
doc.refresh()
|
||||
# update fields (page numbers)
|
||||
doc.getTextFields().refresh()
|
||||
for i in range(idx.getCount()):
|
||||
idx.getByIndex(i).update()
|
||||
out = uno.systemPathToFileUrl(str(PDF))
|
||||
doc.storeToURL(out, (pv("FilterName", "writer_pdf_Export"),))
|
||||
doc.close(True)
|
||||
try:
|
||||
desktop.terminate()
|
||||
except Exception:
|
||||
|
||||
Reference in new issue
Block a user