accounts renamed to ledger_accounts from now on
This commit is contained in:
2
client
2
client
Submodule client updated: 1821d1fdd5...455e109f47
@@ -210,7 +210,7 @@ message ColumnDefinition {
|
|||||||
// TIME (timezone-free time of day)
|
// TIME (timezone-free time of day)
|
||||||
// MONEY (= unconstrained NUMERIC; currency is declared below)
|
// MONEY (= unconstrained NUMERIC; currency is declared below)
|
||||||
// ACCOUNTING (creates schema-managed name, account, debit, and credit fields;
|
// ACCOUNTING (creates schema-managed name, account, debit, and credit fields;
|
||||||
// account always selects a row from the profile's managed accounts table;
|
// account always selects a row from the profile's managed ledger_accounts table;
|
||||||
// name is limited to 10 characters and one stored row contributes
|
// name is limited to 10 characters and one stored row contributes
|
||||||
// one line to the profile journal)
|
// one line to the profile journal)
|
||||||
// ACCOUNTING_TRANSFER (creates automatic source-period/account/book/
|
// ACCOUNTING_TRANSFER (creates automatic source-period/account/book/
|
||||||
|
|||||||
Binary file not shown.
@@ -170,7 +170,7 @@ pub struct ColumnDefinition {
|
|||||||
/// TIME (timezone-free time of day)
|
/// TIME (timezone-free time of day)
|
||||||
/// MONEY (= unconstrained NUMERIC; currency is declared below)
|
/// MONEY (= unconstrained NUMERIC; currency is declared below)
|
||||||
/// ACCOUNTING (creates schema-managed name, account, debit, and credit fields;
|
/// ACCOUNTING (creates schema-managed name, account, debit, and credit fields;
|
||||||
/// account always selects a row from the profile's managed accounts table;
|
/// account always selects a row from the profile's managed ledger_accounts table;
|
||||||
/// name is limited to 10 characters and one stored row contributes
|
/// name is limited to 10 characters and one stored row contributes
|
||||||
/// one line to the profile journal)
|
/// one line to the profile journal)
|
||||||
/// ACCOUNTING_TRANSFER (creates automatic source-period/account/book/
|
/// ACCOUNTING_TRANSFER (creates automatic source-period/account/book/
|
||||||
|
|||||||
2
server
2
server
Submodule server updated: 1a7b8946a2...03a8e1887a
@@ -1040,7 +1040,7 @@ mod tests {
|
|||||||
let error = draft.validate(crate::i18n::Locale::default()).unwrap_err();
|
let error = draft.validate(crate::i18n::Locale::default()).unwrap_err();
|
||||||
assert!(error.contains("38 characters"), "{error}");
|
assert!(error.contains("38 characters"), "{error}");
|
||||||
|
|
||||||
draft.table_name = "accounts".to_string();
|
draft.table_name = "ledger_accounts".to_string();
|
||||||
assert!(draft.validate(crate::i18n::Locale::default()).is_err());
|
assert!(draft.validate(crate::i18n::Locale::default()).is_err());
|
||||||
draft.table_name = "general_ledger".to_string();
|
draft.table_name = "general_ledger".to_string();
|
||||||
assert!(draft.validate(crate::i18n::Locale::default()).is_err());
|
assert!(draft.validate(crate::i18n::Locale::default()).is_err());
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ pub(crate) async fn load_page(
|
|||||||
.into_iter()
|
.into_iter()
|
||||||
// The profile's ledger accounts are not a link target of their own: an
|
// The profile's ledger accounts are not a link target of their own: an
|
||||||
// ACCOUNTING column is how a row is posted to one.
|
// ACCOUNTING column is how a row is posted to one.
|
||||||
.filter(|table| table.name != crate::schema::ACCOUNTS_TABLE)
|
.filter(|table| table.name != crate::schema::LEDGER_ACCOUNTS_TABLE)
|
||||||
.map(|table| RelationTableOption {
|
.map(|table| RelationTableOption {
|
||||||
name: table.name,
|
name: table.name,
|
||||||
global: table.global,
|
global: table.global,
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ impl TableDefinitionPageState {
|
|||||||
/// A table cannot link to itself, and the chart of accounts is reached
|
/// A table cannot link to itself, and the chart of accounts is reached
|
||||||
/// through an ACCOUNTING row rather than through a link of one's own.
|
/// through an ACCOUNTING row rather than through a link of one's own.
|
||||||
fn eligible_link_target(&self, table: &TableSummary) -> bool {
|
fn eligible_link_target(&self, table: &TableSummary) -> bool {
|
||||||
table.name != self.selection.table && table.name != crate::schema::ACCOUNTS_TABLE
|
table.name != self.selection.table && table.name != crate::schema::LEDGER_ACCOUNTS_TABLE
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn global_link_target_tables(&self) -> Vec<&str> {
|
pub(crate) fn global_link_target_tables(&self) -> Vec<&str> {
|
||||||
|
|||||||
@@ -268,8 +268,8 @@ mod tests {
|
|||||||
profile: "billing".to_string(),
|
profile: "billing".to_string(),
|
||||||
table: "invoice".to_string(),
|
table: "invoice".to_string(),
|
||||||
},
|
},
|
||||||
tables: vec![table("invoice", "dynamic"), table("accounts", "system")],
|
tables: vec![table("invoice", "dynamic"), table("ledger_accounts", "system")],
|
||||||
link_targets: vec![table("invoice", "dynamic"), table("accounts", "system")],
|
link_targets: vec![table("invoice", "dynamic"), table("ledger_accounts", "system")],
|
||||||
detail: Some(TableDetailView {
|
detail: Some(TableDetailView {
|
||||||
id: 7,
|
id: 7,
|
||||||
row_version: 1,
|
row_version: 1,
|
||||||
@@ -398,7 +398,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn a_system_table_gets_no_write_form() {
|
fn a_system_table_gets_no_write_form() {
|
||||||
let mut state = page();
|
let mut state = page();
|
||||||
state.selection.table = "accounts".to_string();
|
state.selection.table = "ledger_accounts".to_string();
|
||||||
|
|
||||||
let html = render_delete_page(&state);
|
let html = render_delete_page(&state);
|
||||||
assert!(!html.contains("Template error"), "{html}");
|
assert!(!html.contains("Template error"), "{html}");
|
||||||
@@ -551,7 +551,7 @@ mod tests {
|
|||||||
assert!(html.contains(r#"<optgroup label="System-created">"#));
|
assert!(html.contains(r#"<optgroup label="System-created">"#));
|
||||||
assert!(!html.contains(r#"<option value="invoice""#));
|
assert!(!html.contains(r#"<option value="invoice""#));
|
||||||
// The chart of accounts is reached through ACCOUNTING, never linked to.
|
// The chart of accounts is reached through ACCOUNTING, never linked to.
|
||||||
assert!(!html.contains(r#"<option value="accounts""#));
|
assert!(!html.contains(r#"<option value="ledger_accounts""#));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The append screen holds a column to the same rules the builder does,
|
/// The append screen holds a column to the same rules the builder does,
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ const PROFILE_ONLY_TYPES: [&str; 2] = [ACCOUNTING_FIELD_TYPE, ACCOUNTING_TRANSFE
|
|||||||
|
|
||||||
/// The profile's chart of accounts. A row reaches it through an ACCOUNTING
|
/// The profile's chart of accounts. A row reaches it through an ACCOUNTING
|
||||||
/// definition row, never through a link declared by hand.
|
/// definition row, never through a link declared by hand.
|
||||||
pub(crate) const ACCOUNTS_TABLE: &str = "accounts";
|
pub(crate) const LEDGER_ACCOUNTS_TABLE: &str = "ledger_accounts";
|
||||||
|
|
||||||
const TYPE_DISPLAY_ORDER: &[&str] = &[
|
const TYPE_DISPLAY_ORDER: &[&str] = &[
|
||||||
"text",
|
"text",
|
||||||
@@ -883,7 +883,7 @@ impl ColumnDraft {
|
|||||||
column_type: &str,
|
column_type: &str,
|
||||||
) -> Option<String> {
|
) -> Option<String> {
|
||||||
let target = link_target(column_type)?;
|
let target = link_target(column_type)?;
|
||||||
if target == ACCOUNTS_TABLE {
|
if target == LEDGER_ACCOUNTS_TABLE {
|
||||||
return Some(crate::tr!(locale, "schema-err-account-link"));
|
return Some(crate::tr!(locale, "schema-err-account-link"));
|
||||||
}
|
}
|
||||||
(!self.table_name.is_empty() && target == self.table_name).then(|| {
|
(!self.table_name.is_empty() && target == self.table_name).then(|| {
|
||||||
@@ -1232,7 +1232,7 @@ pub(crate) const RESERVED_TABLE_NAMES: [&str; 5] = [
|
|||||||
"general_ledger",
|
"general_ledger",
|
||||||
"journal_lines",
|
"journal_lines",
|
||||||
"quantity_ledger",
|
"quantity_ledger",
|
||||||
ACCOUNTS_TABLE,
|
LEDGER_ACCOUNTS_TABLE,
|
||||||
"custom_exchange_rates",
|
"custom_exchange_rates",
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -1626,7 +1626,7 @@ pub(crate) mod tests {
|
|||||||
generated_column("credit", "money", true),
|
generated_column("credit", "money", true),
|
||||||
// The foreign key to the profile's accounts, which the
|
// The foreign key to the profile's accounts, which the
|
||||||
// backend reports with the rest of them.
|
// backend reports with the rest of them.
|
||||||
generated_column("account", "link(accounts)", false),
|
generated_column("account", "link(ledger_accounts)", false),
|
||||||
],
|
],
|
||||||
..compound("accounting")
|
..compound("accounting")
|
||||||
},
|
},
|
||||||
@@ -2344,7 +2344,7 @@ pub(crate) mod tests {
|
|||||||
let mut draft = draft();
|
let mut draft = draft();
|
||||||
draft.name_input = "posted_to".to_string();
|
draft.name_input = "posted_to".to_string();
|
||||||
draft.type_input = "link".to_string();
|
draft.type_input = "link".to_string();
|
||||||
draft.link_table_input = ACCOUNTS_TABLE.to_string();
|
draft.link_table_input = LEDGER_ACCOUNTS_TABLE.to_string();
|
||||||
|
|
||||||
let error = draft.add_from_inputs(crate::i18n::Locale::default()).unwrap_err();
|
let error = draft.add_from_inputs(crate::i18n::Locale::default()).unwrap_err();
|
||||||
assert!(error.contains("built into ACCOUNTING"), "{error}");
|
assert!(error.contains("built into ACCOUNTING"), "{error}");
|
||||||
|
|||||||
Reference in New Issue
Block a user