Projects: classes as entities, and the sidebar fits short windows
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
A project is a class with facts (description, status, kind, party, dates, links, notes) in one project.set event behind the format feature projects. Four tools (books.add_project, update_project, projects, project); documents and decisions link to projects; B-37: on-spec costs are expensed as incurred, repayment is revenue, and the unrecovered cost is never below zero (Kani). Viewer: a Projects list and a project page with its figures, by month and by account. The sidebar measures its footer instead of reserving a fixed 172 px. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T3gXMVt7XJPi6ens1or9Dj
This commit is contained in:
71 files changed
+7446
-217
No files matched your search
@@ -1056,6 +1056,14 @@ impl Books {
|
||||
.unwrap_or_else(|| format!("party {id}"))
|
||||
}
|
||||
|
||||
/// A project's name ("project 3" for none such).
|
||||
pub fn project_label(&self, id: ledger_core::ClassId) -> String {
|
||||
self.ledger
|
||||
.get_class(id)
|
||||
.map(|c| c.name.clone())
|
||||
.unwrap_or_else(|| format!("project {id}"))
|
||||
}
|
||||
|
||||
/// Whether a party files a 1099: it has a 1099 role (contractor,
|
||||
/// landlord), or its vendor record has been decided for one (from any
|
||||
/// date: its W-9 matters for those payments).
|
||||
@@ -1352,6 +1360,12 @@ impl Books {
|
||||
Subject::Account(a) => self.account_label(a),
|
||||
Subject::Asset(a) => self.asset_label(a),
|
||||
Subject::Party(p) => self.party_label(p),
|
||||
Subject::Project(c) => format!(
|
||||
"Project {}",
|
||||
u32::try_from(c)
|
||||
.ok()
|
||||
.map_or_else(|| c.to_string(), |c| self.project_label(c))
|
||||
),
|
||||
Subject::Invoice(i) => format!("Invoice {i}"),
|
||||
Subject::Bill(i) => format!("Bill {i}"),
|
||||
Subject::Period(i) => l
|
||||
@@ -1390,6 +1404,7 @@ impl Books {
|
||||
Subject::Account(a) => Route::Account(a),
|
||||
Subject::Asset(a) => Route::Asset(a),
|
||||
Subject::Party(p) => Route::Party(p),
|
||||
Subject::Project(c) => Route::Project(u32::try_from(c).ok()?),
|
||||
Subject::Invoice(i) => Route::Entry(l.get_invoice(i)?.entry_id),
|
||||
Subject::Bill(i) => Route::Entry(l.get_bill(i)?.entry_id),
|
||||
Subject::PayrollRun(i) => Route::Entry(l.get_payroll_run(i)?.entry_id),
|
||||
|
||||
Reference in new issue
Block a user