Spaces:
Sleeping
Sleeping
Commit History
-
Auto-form: add the รับทราบ acknowledgement box (bottom-left) to form1
Bordered 1-cell box with 'รับทราบ' + signature line + ( ) name + ตำแหน่ง.. + วันที่.., for the vendor to sign on receipt, matching the real letters. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>c6994c8 -
Auto-form: remove the หมายเหตุ note block from form1 template
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>9b33109 -
Auto-form: generate the body in the exact PTT 2-paragraph format
The body is now an AI-generated เนื้อความ matching the real letters: para 1 context ("ตามที่ ปตท. ได้ดำเนินการ[จัดจ้าง/จัดซื้อ] <work> โดย <vendor> เป็น[ผู้รับจ้าง/ผู้ขาย]นั้น") and para 2 instruction ("<unit> ขอแจ้งให้บริษัทของท่านเริ่มเข้าดำเนินการ[ปฏิบัติงาน/ส่งมอบสินค้า] ได้นับถัดจากวันที่ <date> เป็นต้นไป [จนกว่างานจะแล้วเสร็จ…ไม่เกิน X วัน] ตาม[ใบสั่งจ้าง/ใบสั่งซื้อ] ที่อ้างถึงนั้น"). procurementType drives the ซื้อ/จ้าง swaps. - ai_clean: generate_body() (AI primary + IDENTICAL-format deterministic compose_body fallback so it's always on-format despite free-model 429s); thai_date(); งวด-aware เรื่อง suffix kept. - form1.docx: body replaced by a single [เนื้อความ] block; form_logic inserts the 2 paragraphs (first-line indent preserved) via insert_body_paragraphs(). - streamlit: start-date picker (วันที่เริ่มดำเนินการ); unit from prCreatorUnitName; gathers fields and calls generate_body during the AI animation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropi…256df8f -
Auto-form: AI-clean กำหนดส่งมอบ into the document + งวด selector
- ai_clean.py (new): parse_nguad() lists selectable งวด (deterministic); clean_delivery() rewrites the chosen งวด's TOR clause into clean letter Thai via OpenRouter (gemma-4-31b-it:free primary, llama-3.3-70b + gpt-oss-120b free fallbacks, retry on 429, raw-text fallback so generation never hard-fails). Key from OPENROUTER_API_KEY env. - streamlit_app: งวดส่งมอบ selector (from the TOR กำหนดส่งมอบ); generate button renamed "สร้างเอกสารด้วย AI"; on generate, AI-clean the selected งวด and pass it + a "(งวดที่ N)" เรื่อง suffix to the form. - form1.docx + form_logic: new [กำหนดส่งมอบ] body block (filled or dropped if empty); fill the existing จำนวนวัน token from daySLA. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>0941280 -
Auto-form: vendor-name cleanup, real PO date, PTT/vendor swap, TOR กำหนดส่งมอบ, signer ตำแหน่ง
- streamlit_app: strip leading SAP vendor code from VendorName; convert poCreateDate Excel serial -> date; resolve SMP signers once per render and show the TOR กำหนดส่งมอบ (การส่งมอบงาน) clause in the info card; pass signer position to the form. - signer_lookup: fold a TOR delivery-clause fetch into the browser resolver (PROnline.torId -> TOROnline eager:details -> section 7 contentPreview), returned as deliveryClause; add pick_delivery(); stripHtml helper. - form_logic: clean_vendor_name(); fill signer_position; PTT/vendor swap uses the repositioned Vendor token. - form1.docx: PTT now subject of the body clause; add centered ตำแหน่งผู้ลงนาม line under the signer name. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>b5c887b
-
Remove stray "???" draft marker from form1 body text
It was not a PLACEHOLDER_* token, so it printed literally in every generated form1. Sentence is grammatically complete without it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>ab7e3be -
Clean up form templates: remove category line, center signer, all-black text
- remove the 'category/usage' annotation line (form1 standalone; form2 full when-to-use paragraph) so the letter starts at the letterhead - center the signer (name) line on the page; form_logic no longer pads it with leading spaces (centering via paragraph alignment) - normalize all text to black (run + paragraph-mark/list-number colors) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>51e875d -
Add PTT letterhead to form templates (LFS), remove sample markers
- form1-5: embed official PTT letterhead (logo + address) at top-left - remove leading sample line and form-number page header - assets/ptt_letterhead.png: letterhead source asset - .gitattributes: LFS-track templates/*.docx and assets/*.png Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>3d280e8
-
Lock Step 2 for forms 2-5 and auto-fill PO + work title
Forms 2-5 were uses_po=False, which forced step1_done=True so Step 2 never locked before a PO lookup. They actually depend on the lookup (vendor already, plus PO + title per the reference line). Set uses_po=True for forms 2-5 so Step 2 gates on the lookup like form1, and fill the work title and PO into the 'อ้างถึง (1) สัญญา...' line. - form_logic.py: uses_po=True for forms 2-5; fill title/PO in the form2-5 branch. - templates/form2-5.docx: insert ชื่องาน / PO_No tokens into the reference line. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>b1eb504
-
Upload 17 files
Verified signature4584aec