1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//! **Full-return** Form 8949 fill — the WHOLE-DOLLAR path (P6.3a / ARCH-P6.3a D2/D6).
//!
//! Form 8949 is not optional on a full return: **Schedule D lines 3 and 10 are literally "Totals for
//! all transactions reported on Form(s) 8949 with Box C / Box F checked"** (pre-2025; the 2025
//! digital-asset revision reads "with Box C or Box I checked" / "Box F or Box L checked"). A Schedule
//! D with those lines filled and no 8949 behind it is an incomplete return.
//!
//! **This module does no tax arithmetic.** The rows come from core's [`Printed8949`] chain, where
//! columns (d) and (e) are rounded at the cell and column **(h) is DERIVED, `h = d − e`** — never
//! rounded independently from the exact gain. That derivation is what makes each row satisfy the form's
//! own column-(h) instruction ("Subtract column (e) from column (d)…") and what makes Σh ≡ Σd − Σe an
//! integer identity, so Schedule D's Part I cross-foots against these very totals.
//!
//! What it DOES do — and the one thing sanctioned despite the "zero arithmetic in forms" rule — is
//! **partition** the rows into pages and sum each page's already-whole-dollar cells for that page's
//! line-2 totals. No rounding remains at that point, so partitioned integer sums cannot re-diverge
//! (Σ page-totals ≡ core's grand total, by associativity), and page capacity is legitimately the map's
//! datum, not core's. The KATs pin it anyway.
//!
//! The crypto-slice filler ([`crate::fill8949`]) keeps its exact-CENTS rendering, untouched: it is
//! CSV-identical shipped behavior, and a crypto-only filer may legitimately file in cents.
use crateFormsError;
use crate;
use crateForm8949Map;
use TaxDate;
use ReturnHeader;
use ;
use Usd;
/// Format a date the way the form does (MM/DD/YYYY).
/// Build one part's `PartData` from the PRINTED rows.
///
/// `PartData` is pre-formatted STRINGS — rounding-agnostic — which is exactly why the geometry half of
/// the slice's filler can be reused without importing its cents arithmetic. (The slice's `part_data`,
/// which sums exact `Decimal`s inside the forms crate, is NOT reused: it is slice-only.)
/// Fill the full-return Form 8949 (whole dollars) from the core-derived printed chain.
///
/// Both parts are emitted on one form; more rows than a page holds REFUSES
/// ([`FormsError::Overflow`]) exactly as the slice does — the continuation-page pattern is a
/// post-v1 item.