Skip to content

PR6 — party statement as PDF - #143

Open
lamemustafa wants to merge 16 commits into
feat/party-statement-xlsxfrom
feat/party-statement-pdf
Open

PR6 — party statement as PDF#143
lamemustafa wants to merge 16 commits into
feat/party-statement-xlsxfrom
feat/party-statement-pdf

Conversation

@lamemustafa

Copy link
Copy Markdown
Owner

Stacked on feat/party-statement-xlsx — review only this PR's own diff.

Local gate green at this level: workspace tests and clippy in both feature configurations, fmt, tools tests, live-read boundary, fixture byte integrity, licence inventory, tsc, production build, and the workflow-consistency gate.

CI is NOT proven: the GitHub-hosted Windows and bundle-smoke jobs have never run, and one read-transport harness test fails deterministically on macOS with an unknown ubuntu outcome.

@lamemustafa
lamemustafa force-pushed the feat/party-statement-pdf branch from 1ff1dd4 to 2c761c6 Compare August 14, 2026 05:30
@lamemustafa
lamemustafa force-pushed the feat/party-statement-pdf branch from 2c761c6 to 54f83d9 Compare August 14, 2026 07:21
@lamemustafa
lamemustafa marked this pull request as ready for review August 14, 2026 09:47

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 54f83d9d4d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src-tauri/src/reports/party_statement_pdf.rs
Comment thread src-tauri/src/reports/party_statement_pdf.rs
Comment thread src-tauri/src/reports/party_statement_pdf.rs
Comment thread src-tauri/src/reports/party_statement_pdf.rs
@lamemustafa
lamemustafa force-pushed the feat/party-statement-pdf branch from 54f83d9 to 4312e65 Compare August 15, 2026 05:42

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4312e65a4c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src-tauri/src/reports/party_statement_pdf.rs
Comment thread src-tauri/src/reports/party_statement_pdf.rs
@lamemustafa
lamemustafa force-pushed the feat/party-statement-pdf branch from 4312e65 to 1900596 Compare August 16, 2026 06:48
@lamemustafa
lamemustafa force-pushed the feat/party-statement-pdf branch from 1900596 to 2633a37 Compare August 17, 2026 14:37
@lamemustafa
lamemustafa force-pushed the feat/party-statement-pdf branch from 2633a37 to f53e9d2 Compare August 17, 2026 18:16
@lamemustafa
lamemustafa force-pushed the feat/party-statement-pdf branch from f53e9d2 to 771d668 Compare August 17, 2026 21:20
@lamemustafa
lamemustafa force-pushed the feat/party-statement-pdf branch from 771d668 to a4cdaf7 Compare August 17, 2026 23:52
@lamemustafa
lamemustafa force-pushed the feat/party-statement-pdf branch from a4cdaf7 to 5f7e8c1 Compare August 18, 2026 04:21
Choose pdf-writer 0.15.0 (MIT OR Apache-2.0): it is a maintained pure-Rust PDF writer with no C toolchain and gives the statement renderer explicit control of layout and failure handling. It is preferred over printpdf and genpdf because this narrowly scoped report does not need a higher-level layout engine or bundled font stack; the renderer will intentionally use ASCII INR text with a core font rather than rely on the unsupported rupee glyph. No font is bundled.
Render the existing pure PartyStatement model with pdf-writer and PDF-standard Helvetica. Currency is deliberately emitted as ASCII INR because Helvetica has no rupee glyph; extraction coverage verifies the emitted text. The renderer validates its amount conversion before rendering and rejects unsupported core-font text rather than emitting blank data.
Let the party-statement command select xlsx or pdf while retaining XLSX as its default. Both UI actions use the existing checked report-download and reveal path; no second browser download mechanism is introduced.
Read the XLSX sheet XML alongside the PDF content stream to pin the rendered value shared by both client-facing formats.

The test-only zip 8.6.0 dependency is MIT licensed; it is used with default features disabled and the pure-Rust deflate feature only to inspect workbook XML, and is included in the repository licence inventory.
Mutation proof: changing the repeated statement identity heading made every_pdf_page_repeats_the_statement_identity fail (RC 101). The page identity is restored.
Records source-surface digest changes only; no compatibility claim, evidence file, or trusted key changed.

Resealed entries: src-tauri/{Cargo.toml,Cargo.lock,src/commands.rs}; src/{OutstandingsScreen.tsx,styles.css}. Matrix changed only compatibility_surface_sha256.
Mirror the XLSX direction column in PDF as Receivable or Payable and rename the mixed-party aggregate to Total bill magnitudes (not net). Amount magnitudes and the shared statement total are unchanged.
Mutation proof: mapping payable bills to Receivable made renders_bill_direction_for_mixed_party_documents fail because the generated PDF text no longer contained the expected Payable row. Restored the Payable mapping; the generated-document test passes. This test covers the document boundary for the F3 direction presentation without changing any amount magnitude.
PDF and XLSX label unallocated residual magnitudes with the same receivable/payable wording. PDF also emits explicit Not due and Unaged fields for future-due bills.

Proof: generated PDF text and generated XLSX XML assertions cover the new labels.
Signed-off-by: Tapish Khandelwal <tapishkhandelwal13@gmail.com>
Carry the PR6 PDF statement surface over the F4X BILLREF presentation disclosure. Claims, evidence, and trusted-evidence keys remain byte-identical to the preserved PR6 head.

Compatibility gate: exit 0, unknown_claims=11, evidenced_claims=0. Claims/evidence/trusted identity checks: exit 0.
Rust 1.96.0 all-target Clippy failed at PR6 with needless_borrow (exit 101). The checked filename path is unchanged; default all-target Clippy passes at exit 0 after the repair.
@lamemustafa
lamemustafa force-pushed the feat/party-statement-pdf branch from 5f7e8c1 to 45939e4 Compare August 18, 2026 09:10

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 45939e4960

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src-tauri/src/commands.rs
Comment thread src/OutstandingsScreen.tsx
Comment thread src/OutstandingsScreen.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant