feat(parties): an email and default terms per side (P4b S4.2)
A customer's email is copied onto an invoice's bill-to snapshot at issue, and a party's default terms (one as our customer, one as our vendor) are the fallback a document's due date takes when the document itself names none (A-13, rules.md B-39). Both are journaled as party.updated facts and guarded by documents_v2: in books that have not declared it the write is refused with the upgrade remedy and journaling nothing, and replay gives the same directory back. An email must be one plain address: one @, no spaces, no full TIN (the party text rule already refuses nine digits). Terms are typed and already canonical, so there is no second spelling to check. A party.updated naming a field this version does not know is now NewerJournal, never corrupt (B-27): an older version must say update, not damage; a known field with a malformed value is still corrupt.
This commit is contained in:
1 parent
1fa77cff02
commit
02cb7f0254
8 files changed
+257
-12
No files matched your search
@@ -430,9 +430,7 @@ pub fn export(s: &Settings, base_currency: &str) -> String {
|
||||
for table in ["company", "books", "invoicing", "bills"] {
|
||||
// The invoicing and bills tables are written only once a key is
|
||||
// set: an empty table says nothing.
|
||||
if !["company", "books"].contains(&table)
|
||||
&& !s.iter().any(|(k, _)| k.toml.0 == table)
|
||||
{
|
||||
if !["company", "books"].contains(&table) && !s.iter().any(|(k, _)| k.toml.0 == table) {
|
||||
continue;
|
||||
}
|
||||
let _ = write!(out, "\n[{table}]\n");
|
||||
@@ -593,10 +591,7 @@ open_at_start = "ask"
|
||||
discount_warn_days = 3\n"
|
||||
);
|
||||
let s = imported(&file);
|
||||
assert_eq!(
|
||||
s.get("invoicing.first_number").unwrap().value,
|
||||
json!(1000)
|
||||
);
|
||||
assert_eq!(s.get("invoicing.first_number").unwrap().value, json!(1000));
|
||||
assert_eq!(
|
||||
s.get("invoicing.default_terms").unwrap().value,
|
||||
json!("2/10 net 30")
|
||||
@@ -632,7 +627,6 @@ open_at_start = "ask"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn the_tax_category_policy_round_trips() {
|
||||
let file = FERNHILL.replace(
|
||||
|
||||
Reference in new issue
Block a user