Merge main into the K-U5 branch: X-H1b, K-U3, S-E2, S-E3, X-H1c
This commit is contained in:
commit
5e4950697e
100 files changed
+1793
-374
No files matched your search
@@ -31,7 +31,7 @@
|
||||
//! 6. A section says an invoice's or bill's lines take a project only
|
||||
//! for books that declared the journal feature
|
||||
//! `document_line_projects`; for the rest, that they wait for their
|
||||
//! format upgrade (BS-format-1, BS-statement-5 item 8).
|
||||
//! format upgrade (BS-format-1, BS-statement-5 statement 6).
|
||||
//! ```
|
||||
|
||||
use crate::settings::Settings;
|
||||
@@ -186,8 +186,8 @@ pub fn period_rule() -> String {
|
||||
)
|
||||
}
|
||||
|
||||
/// How an invoice's or bill's lines reach a project (BS-statement-5 item
|
||||
/// 8), for books that declared the journal feature
|
||||
/// How an invoice's or bill's lines reach a project (BS-statement-5 statement
|
||||
/// 6), for books that declared the journal feature
|
||||
/// `document_line_projects` or not yet (INVARIANT 6).
|
||||
pub fn document_projects_rule(declared: bool) -> &'static str {
|
||||
if declared {
|
||||
@@ -591,7 +591,7 @@ mod tests {
|
||||
with.contains("books.create_invoice and books.create_bill take class on each line")
|
||||
);
|
||||
assert!(!with.contains("takes no project"));
|
||||
// The owner's decision (BS-statement-5 item 8, D-43): one project or none a
|
||||
// The owner's decision (BS-statement-5 statement 4, D-43): one project or none a
|
||||
// line, no percentage split, a shared cost by the allocation
|
||||
// convention.
|
||||
assert!(with.contains("Each line names one project or none"));
|
||||
|
||||
@@ -78,7 +78,7 @@ fn document_lines(
|
||||
/// A document's notes, each project once, in the order first named: its
|
||||
/// late-tag note ([`projects::late_tag_note`]) for a finished or abandoned
|
||||
/// project, and on an invoice ([`projects::on_spec_invoice_note`]) one for
|
||||
/// an on-spec project (BS-statement-5 items 4, 5 and 8).
|
||||
/// an on-spec project (BS-statement-5 statements 5, 6 and 7).
|
||||
fn document_notes(
|
||||
ledger: &ledger_core::Ledger,
|
||||
lines: &[DocumentLine],
|
||||
|
||||
@@ -141,7 +141,7 @@ pub(crate) fn settings_problems(ledger: &Ledger, cfg: &Settings) -> Vec<String>
|
||||
let how = " with books.set_setting";
|
||||
// The cash flow roles: codes the chart lacks here; the rest is the
|
||||
// engine's own check, the one the statement refuses on (BS-statement-3
|
||||
// rule 2), so the two never disagree.
|
||||
// statement 3), so the two never disagree.
|
||||
let lists = [
|
||||
(
|
||||
ledger_core::RoleList::Cash,
|
||||
|
||||
@@ -144,7 +144,7 @@ fn party_document(
|
||||
}
|
||||
|
||||
/// A party-totals `basis` from a tool: "cash" (the default) or "all"
|
||||
/// (BS-partner-3 item 4); any other word is refused.
|
||||
/// (BS-partner-3 statement 5); any other word is refused.
|
||||
fn parse_basis(basis: Option<&str>) -> Result<ledger_core::parties::Basis, String> {
|
||||
match basis {
|
||||
None => Ok(ledger_core::parties::Basis::default()),
|
||||
|
||||
@@ -144,7 +144,7 @@ fn by_name(ledger: &Ledger) -> Vec<ClassId> {
|
||||
}
|
||||
|
||||
/// The note `books.add_line` and `books.record_payout` give for a line tagged to a finished or
|
||||
/// abandoned project (BS-statement-5 item 5).
|
||||
/// abandoned project (BS-statement-5 statement 7).
|
||||
pub(super) fn late_tag_note(ledger: &Ledger, id: ClassId) -> Option<String> {
|
||||
let f = ledger.project_facts(id)?;
|
||||
if !f.status.is_over() {
|
||||
@@ -162,7 +162,7 @@ pub(super) fn late_tag_note(ledger: &Ledger, id: ClassId) -> Option<String> {
|
||||
}
|
||||
|
||||
/// The note `books.create_invoice` gives for a line naming an on-spec
|
||||
/// project (BS-statement-5 items 4 and 8): on spec, a hoped-for payment is
|
||||
/// project (BS-statement-5 statements 5 and 6): on spec, a hoped-for payment is
|
||||
/// no receivable and no income until received, so an invoice for one
|
||||
/// means there is now an agreement, or it shouldn't be an invoice.
|
||||
pub(super) fn on_spec_invoice_note(ledger: &Ledger, id: ClassId) -> Option<String> {
|
||||
|
||||
@@ -729,7 +729,7 @@ impl BooksServer {
|
||||
checked.push(format!("{n} stored files match their SHA-256"));
|
||||
}
|
||||
// Receivables and payables equal their documents (BS-arap-2
|
||||
// INVARIANT 1): an identity, so a difference is an engine error.
|
||||
// invariant 1): an identity, so a difference is an engine error.
|
||||
let checks = store
|
||||
.ledger()
|
||||
.control_check(chrono::NaiveDate::MAX)
|
||||
|
||||
@@ -65,7 +65,7 @@ impl BooksServer {
|
||||
Some(a) => parse_amount(a)?,
|
||||
None => owed,
|
||||
};
|
||||
// The evidence is the point of a write-off (BS-arap-5 INVARIANT 1): one
|
||||
// The evidence is the point of a write-off (BS-arap-5 statement 9): one
|
||||
// of the two, and the preview says so too rather than posting
|
||||
// without it later.
|
||||
match (p.upload_id.is_some(), p.existing_attachment_id.is_some()) {
|
||||
|
||||
@@ -3764,7 +3764,7 @@ pub struct AgingDocumentOut {
|
||||
}
|
||||
|
||||
/// The aging's account against its documents (the control check, BS-ledger-8,
|
||||
/// BS-arap-2 INVARIANT 1).
|
||||
/// BS-arap-2 invariant 1).
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
|
||||
pub struct AgingControlOut {
|
||||
/// "1200 Accounts Receivable" or "2000 Accounts Payable".
|
||||
|
||||
Reference in new issue
Block a user