test(core): the adapter runs a platform's payout, an asset's tag and the K-1's tax-basis note through the engine
The bookspec schema gained a `payout` event, a `tag_asset` event, an `asset_tag` query and a note on the tax-basis property line (BS-revenue-1, BS-asset-3, BS-partner-17). The adapter runs each through the engine and rebuilds none of it: a payout goes through `payouts::payout_plan`, which refuses unless gross less fee is the deposit to the cent, and its plan's lines post as one entry; a tag goes through `Store::set_asset_tag`, which refuses a tag of a wrong form and one another asset holds or ever held; the tax-basis line's note is `Note::PrepaidAtBook` read off the worksheet. The engine's InvalidPayout, InvalidAssetTag and AssetTagTaken are worded as the examples word them. Thirteen examples were added and every one the engine's picks reach passes: five are for options wanderbooks did not pick (no-tags, every-prepaid-is-cash, every-prepaid-is-property, left-open, whole-payment-to-each) and are skipped, so the skipped count is 22 + 5 = 27 and 112 of 139 run. A prepaid contract credited straight to capital is property (1,500.00 each) and a service paid through Due to Members is cash (1,000.00 each); the contract enters the tax capital at its book amount with the note; a 1,000.00 check naming Dana Studio at 600.00 counts 600.00 toward Dana's 1099. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e45c62348a
commit
a87e2d0a7a
8 files changed
+138
-11
No files matched your search
@@ -43,6 +43,10 @@ impl Books<'_> {
|
||||
format!("{name}.contributions_cash"),
|
||||
Value::String(figure(row.contributions_cash)),
|
||||
);
|
||||
m.insert(
|
||||
format!("{name}.contributions_property_note"),
|
||||
Value::String(property_note(&row.contributions_property).to_string()),
|
||||
);
|
||||
for (line, tax) in [
|
||||
("beginning", &row.beginning),
|
||||
("contributions_property", &row.contributions_property),
|
||||
@@ -173,6 +177,10 @@ pub(crate) fn check_k1_tax_basis(b: &Books<'_>, x: &Expect) {
|
||||
format!("{m}.contributions_cash"),
|
||||
figure(row.contributions_cash),
|
||||
);
|
||||
figures.insert(
|
||||
format!("{m}.contributions_property_note"),
|
||||
property_note(&row.contributions_property).to_string(),
|
||||
);
|
||||
for (line, tax) in [
|
||||
("beginning", &row.beginning),
|
||||
("contributions_property", &row.contributions_property),
|
||||
@@ -191,6 +199,23 @@ pub(crate) fn check_k1_tax_basis(b: &Books<'_>, x: &Expect) {
|
||||
named(ex, x, &what, &figures);
|
||||
}
|
||||
|
||||
/// The note a property line carries (BS-partner-17): `prepaid_at_book` when
|
||||
/// property contributed to a prepaid account with no fixed asset behind it
|
||||
/// was taken at its book amount for the preparer to confirm, `none` when the
|
||||
/// line carries no note.
|
||||
fn property_note(line: &ledger_core::tax_capital::TaxLine) -> &'static str {
|
||||
use ledger_core::tax_capital::Note;
|
||||
if line
|
||||
.notes
|
||||
.iter()
|
||||
.any(|n| matches!(n, Note::PrepaidAtBook { .. }))
|
||||
{
|
||||
"prepaid_at_book"
|
||||
} else {
|
||||
"none"
|
||||
}
|
||||
}
|
||||
|
||||
/// The causes `k1_reconciliation` reports, each member's every one.
|
||||
pub(crate) const RECONCILING_CAUSES: [&str; 5] = [
|
||||
"beginning",
|
||||
|
||||
Reference in new issue
Block a user