Fixed assets, fully featured: tags, serials, acquisition links, label sheets, the fixed asset register, and an Assets section in the viewer; fix a flaky verify
check / check (push) Waiting to run
check / check (push) Waiting to run
- core: asset tags (generated PREFIX-0001 or the human's own; unique ignoring case; never reused by another asset) and serial numbers (rules.md B-24); a journaled link from an asset to the entry that acquired it (posted, unreversed, debiting the cost account); fixed_asset_register(as_of), reconciled to the GL (unposted depreciation, unregistered cost) - store: asset.tagged, asset.serial_set, asset.acquisition_linked journaled, replayed, projected (schema v9); differs_from now also compares control roles and tag history - config: [books] asset_tag_prefix, default the company's initials without legal-form words - import: Avery 5160/8160 label sheets with QR codes (geometry vendored from Avery, docs/spec/sources/avery-5160.md); the register as XLSX and PDF - mcp: register_asset tags (and links) automatically; books.label_asset, books.asset_labels; asset tools take a tag; books.show asset / assets page / register report; export fixed_asset_register (json, csv, xlsx, pdf) and in the CPA package - viewer: Assets page (register, reconciliation), asset page (identity, schedule posted vs not, entries, documents), Fixed asset register report, global search by tag/serial/description, journal text, needs-attention items - fix: verify compared snapshot amounts as strings; a zero total summed in hash-map order could print "0" or "0.00", so agreeing books failed verify at random. Now by value (regression test) - tests: spec-blind suites for tags, register, prefix, store, MCP; label and register PDF/XLSX tests; viewer tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GWVo7x3UHw5kwCUaWxiejX
This commit is contained in:
1 parent
767fd469cd
commit
ee7e205f5c
53 files changed
+7872
-104
No files matched your search
@@ -18,6 +18,7 @@ fn show_requests_navigate_the_viewer() {
|
||||
};
|
||||
let books = data::load_once(&source).unwrap();
|
||||
let rent = books.ledger.chart().find_by_code("6200").unwrap().id;
|
||||
let laptop = books.ledger.asset_by_tag("js-0001").unwrap().id;
|
||||
let mut h = Harness::builder()
|
||||
.with_size(egui::vec2(1440.0, 920.0))
|
||||
.build_eframe(|cc| App::with_books(&cc.egui_ctx, books, true, Route::Overview));
|
||||
@@ -62,6 +63,44 @@ fn show_requests_navigate_the_viewer() {
|
||||
assert_eq!(h.state_mut().route(), &Route::Transactions);
|
||||
assert_eq!(h.state_mut().state_mut().transactions.query, "adobe");
|
||||
|
||||
// "Show me the asset register", "the laptop", "the register at June 30".
|
||||
h.state_mut().show(ViewerTarget::Page {
|
||||
page: "assets".into(),
|
||||
});
|
||||
h.run_steps(2);
|
||||
assert_eq!(h.state_mut().route(), &Route::Assets);
|
||||
h.state_mut().show(ViewerTarget::Asset { asset_id: laptop });
|
||||
h.run_steps(2);
|
||||
assert_eq!(h.state_mut().route(), &Route::Asset(laptop));
|
||||
h.state_mut().show(ViewerTarget::Report {
|
||||
report: "fixed_asset_register".into(),
|
||||
start: None,
|
||||
end: Some("2026-06-30".into()),
|
||||
columns: None,
|
||||
compare: None,
|
||||
});
|
||||
h.run_steps(2);
|
||||
assert_eq!(
|
||||
h.state_mut().route(),
|
||||
&Route::Reports(ReportKind::FixedAssetRegister)
|
||||
);
|
||||
assert!(matches!(
|
||||
h.state_mut().state_mut().reports.range,
|
||||
ledger_gui::pages::reports::Range::Custom(_, e)
|
||||
if e == chrono::NaiveDate::from_ymd_opt(2026, 6, 30).unwrap()
|
||||
));
|
||||
// An unknown asset is ignored.
|
||||
h.state_mut().show(ViewerTarget::Asset { asset_id: 999 });
|
||||
h.run_steps(1);
|
||||
assert_eq!(
|
||||
h.state_mut().route(),
|
||||
&Route::Reports(ReportKind::FixedAssetRegister)
|
||||
);
|
||||
h.state_mut().show(ViewerTarget::Search {
|
||||
query: "adobe".into(),
|
||||
});
|
||||
h.run_steps(2);
|
||||
|
||||
// Unknown accounts are ignored, not crashes.
|
||||
h.state_mut().show(ViewerTarget::Account {
|
||||
code: "9999".into(),
|
||||
|
||||
Reference in new issue
Block a user