BalanceSheetParams

Struct BalanceSheetParams 

Source
pub struct BalanceSheetParams {
Show 13 fields pub customer: Option<Vec<CustomerId>>, pub qzurl: Option<String>, pub end_date: Option<NaiveDate>, pub accounting_method: Option<AccountingMethod>, pub date_macro: Option<DateMacro>, pub adjusted_gain_loss: Option<String>, pub class: Option<String>, pub item: Option<Vec<ItemId>>, pub sort_order: Option<SortOrder>, pub summarize_column_by: Option<SummarizeColumnBy>, pub department: Option<String>, pub vendor: Option<Vec<VendorId>>, pub start_date: Option<NaiveDate>,
}
Expand description

Parameters for the BalanceSheet report.

Fields§

§customer: Option<Vec<CustomerId>>§qzurl: Option<String>§end_date: Option<NaiveDate>§accounting_method: Option<AccountingMethod>§date_macro: Option<DateMacro>§adjusted_gain_loss: Option<String>§class: Option<String>§item: Option<Vec<ItemId>>§sort_order: Option<SortOrder>§summarize_column_by: Option<SummarizeColumnBy>§department: Option<String>§vendor: Option<Vec<VendorId>>§start_date: Option<NaiveDate>

Implementations§

Source§

impl BalanceSheetParams

Source

pub fn new() -> Self

Examples found in repository?
examples/simplified_params.rs (line 6)
5fn main() {
6    let balance_sheet = BalanceSheetParams::new()
7        .accounting_method(AccountingMethod::Cash)
8        .start_date(NaiveDate::from_ymd_opt(2024, 1, 1).unwrap())
9        .end_date(NaiveDate::from_ymd_opt(2024, 12, 31).unwrap())
10        .date_macro(DateMacro::ThisFiscalYear)
11        .summarize_column_by(SummarizeColumnBy::Month)
12        .customer(CustomerId(123u32))
13        .vendor(VendorId(456u32));
14
15    println!("Query string: {}", balance_sheet.to_query_string());
16
17    // Another example with different types
18    let ap_aging = APAgingDetailParams::new()
19        .as_of_date(NaiveDate::from_ymd_opt(2024, 6, 30).unwrap())
20        .aging_method(AgingMethod::Current)
21        .vendor(VendorId(789u32))
22        .column("Name")
23        .column("DueDate")
24        .column("Amount");
25
26    println!("AP Aging query: {}", ap_aging.to_query_string());
27}
Source

pub fn customer(self, param: impl Into<CustomerId>) -> Self

Examples found in repository?
examples/simplified_params.rs (line 12)
5fn main() {
6    let balance_sheet = BalanceSheetParams::new()
7        .accounting_method(AccountingMethod::Cash)
8        .start_date(NaiveDate::from_ymd_opt(2024, 1, 1).unwrap())
9        .end_date(NaiveDate::from_ymd_opt(2024, 12, 31).unwrap())
10        .date_macro(DateMacro::ThisFiscalYear)
11        .summarize_column_by(SummarizeColumnBy::Month)
12        .customer(CustomerId(123u32))
13        .vendor(VendorId(456u32));
14
15    println!("Query string: {}", balance_sheet.to_query_string());
16
17    // Another example with different types
18    let ap_aging = APAgingDetailParams::new()
19        .as_of_date(NaiveDate::from_ymd_opt(2024, 6, 30).unwrap())
20        .aging_method(AgingMethod::Current)
21        .vendor(VendorId(789u32))
22        .column("Name")
23        .column("DueDate")
24        .column("Amount");
25
26    println!("AP Aging query: {}", ap_aging.to_query_string());
27}
Source

pub fn customers(self, params: Vec<CustomerId>) -> Self

Source

pub fn qzurl(self, param: impl Into<String>) -> Self

Source

pub fn end_date(self, param: impl Into<NaiveDate>) -> Self

Examples found in repository?
examples/simplified_params.rs (line 9)
5fn main() {
6    let balance_sheet = BalanceSheetParams::new()
7        .accounting_method(AccountingMethod::Cash)
8        .start_date(NaiveDate::from_ymd_opt(2024, 1, 1).unwrap())
9        .end_date(NaiveDate::from_ymd_opt(2024, 12, 31).unwrap())
10        .date_macro(DateMacro::ThisFiscalYear)
11        .summarize_column_by(SummarizeColumnBy::Month)
12        .customer(CustomerId(123u32))
13        .vendor(VendorId(456u32));
14
15    println!("Query string: {}", balance_sheet.to_query_string());
16
17    // Another example with different types
18    let ap_aging = APAgingDetailParams::new()
19        .as_of_date(NaiveDate::from_ymd_opt(2024, 6, 30).unwrap())
20        .aging_method(AgingMethod::Current)
21        .vendor(VendorId(789u32))
22        .column("Name")
23        .column("DueDate")
24        .column("Amount");
25
26    println!("AP Aging query: {}", ap_aging.to_query_string());
27}
Source

pub fn accounting_method(self, param: impl Into<AccountingMethod>) -> Self

Examples found in repository?
examples/simplified_params.rs (line 7)
5fn main() {
6    let balance_sheet = BalanceSheetParams::new()
7        .accounting_method(AccountingMethod::Cash)
8        .start_date(NaiveDate::from_ymd_opt(2024, 1, 1).unwrap())
9        .end_date(NaiveDate::from_ymd_opt(2024, 12, 31).unwrap())
10        .date_macro(DateMacro::ThisFiscalYear)
11        .summarize_column_by(SummarizeColumnBy::Month)
12        .customer(CustomerId(123u32))
13        .vendor(VendorId(456u32));
14
15    println!("Query string: {}", balance_sheet.to_query_string());
16
17    // Another example with different types
18    let ap_aging = APAgingDetailParams::new()
19        .as_of_date(NaiveDate::from_ymd_opt(2024, 6, 30).unwrap())
20        .aging_method(AgingMethod::Current)
21        .vendor(VendorId(789u32))
22        .column("Name")
23        .column("DueDate")
24        .column("Amount");
25
26    println!("AP Aging query: {}", ap_aging.to_query_string());
27}
Source

pub fn date_macro(self, param: impl Into<DateMacro>) -> Self

Examples found in repository?
examples/simplified_params.rs (line 10)
5fn main() {
6    let balance_sheet = BalanceSheetParams::new()
7        .accounting_method(AccountingMethod::Cash)
8        .start_date(NaiveDate::from_ymd_opt(2024, 1, 1).unwrap())
9        .end_date(NaiveDate::from_ymd_opt(2024, 12, 31).unwrap())
10        .date_macro(DateMacro::ThisFiscalYear)
11        .summarize_column_by(SummarizeColumnBy::Month)
12        .customer(CustomerId(123u32))
13        .vendor(VendorId(456u32));
14
15    println!("Query string: {}", balance_sheet.to_query_string());
16
17    // Another example with different types
18    let ap_aging = APAgingDetailParams::new()
19        .as_of_date(NaiveDate::from_ymd_opt(2024, 6, 30).unwrap())
20        .aging_method(AgingMethod::Current)
21        .vendor(VendorId(789u32))
22        .column("Name")
23        .column("DueDate")
24        .column("Amount");
25
26    println!("AP Aging query: {}", ap_aging.to_query_string());
27}
Source

pub fn adjusted_gain_loss(self, param: impl Into<String>) -> Self

Source

pub fn class(self, param: impl Into<String>) -> Self

Source

pub fn item(self, param: impl Into<ItemId>) -> Self

Source

pub fn items(self, params: Vec<ItemId>) -> Self

Source

pub fn sort_order(self, param: impl Into<SortOrder>) -> Self

Source

pub fn summarize_column_by(self, param: impl Into<SummarizeColumnBy>) -> Self

Examples found in repository?
examples/simplified_params.rs (line 11)
5fn main() {
6    let balance_sheet = BalanceSheetParams::new()
7        .accounting_method(AccountingMethod::Cash)
8        .start_date(NaiveDate::from_ymd_opt(2024, 1, 1).unwrap())
9        .end_date(NaiveDate::from_ymd_opt(2024, 12, 31).unwrap())
10        .date_macro(DateMacro::ThisFiscalYear)
11        .summarize_column_by(SummarizeColumnBy::Month)
12        .customer(CustomerId(123u32))
13        .vendor(VendorId(456u32));
14
15    println!("Query string: {}", balance_sheet.to_query_string());
16
17    // Another example with different types
18    let ap_aging = APAgingDetailParams::new()
19        .as_of_date(NaiveDate::from_ymd_opt(2024, 6, 30).unwrap())
20        .aging_method(AgingMethod::Current)
21        .vendor(VendorId(789u32))
22        .column("Name")
23        .column("DueDate")
24        .column("Amount");
25
26    println!("AP Aging query: {}", ap_aging.to_query_string());
27}
Source

pub fn department(self, param: impl Into<String>) -> Self

Source

pub fn vendor(self, param: impl Into<VendorId>) -> Self

Examples found in repository?
examples/simplified_params.rs (line 13)
5fn main() {
6    let balance_sheet = BalanceSheetParams::new()
7        .accounting_method(AccountingMethod::Cash)
8        .start_date(NaiveDate::from_ymd_opt(2024, 1, 1).unwrap())
9        .end_date(NaiveDate::from_ymd_opt(2024, 12, 31).unwrap())
10        .date_macro(DateMacro::ThisFiscalYear)
11        .summarize_column_by(SummarizeColumnBy::Month)
12        .customer(CustomerId(123u32))
13        .vendor(VendorId(456u32));
14
15    println!("Query string: {}", balance_sheet.to_query_string());
16
17    // Another example with different types
18    let ap_aging = APAgingDetailParams::new()
19        .as_of_date(NaiveDate::from_ymd_opt(2024, 6, 30).unwrap())
20        .aging_method(AgingMethod::Current)
21        .vendor(VendorId(789u32))
22        .column("Name")
23        .column("DueDate")
24        .column("Amount");
25
26    println!("AP Aging query: {}", ap_aging.to_query_string());
27}
Source

pub fn vendors(self, params: Vec<VendorId>) -> Self

Source

pub fn start_date(self, param: impl Into<NaiveDate>) -> Self

Examples found in repository?
examples/simplified_params.rs (line 8)
5fn main() {
6    let balance_sheet = BalanceSheetParams::new()
7        .accounting_method(AccountingMethod::Cash)
8        .start_date(NaiveDate::from_ymd_opt(2024, 1, 1).unwrap())
9        .end_date(NaiveDate::from_ymd_opt(2024, 12, 31).unwrap())
10        .date_macro(DateMacro::ThisFiscalYear)
11        .summarize_column_by(SummarizeColumnBy::Month)
12        .customer(CustomerId(123u32))
13        .vendor(VendorId(456u32));
14
15    println!("Query string: {}", balance_sheet.to_query_string());
16
17    // Another example with different types
18    let ap_aging = APAgingDetailParams::new()
19        .as_of_date(NaiveDate::from_ymd_opt(2024, 6, 30).unwrap())
20        .aging_method(AgingMethod::Current)
21        .vendor(VendorId(789u32))
22        .column("Name")
23        .column("DueDate")
24        .column("Amount");
25
26    println!("AP Aging query: {}", ap_aging.to_query_string());
27}

Trait Implementations§

Source§

impl Debug for BalanceSheetParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BalanceSheetParams

Source§

fn default() -> BalanceSheetParams

Returns the “default value” for a type. Read more
Source§

impl QBReportParams for BalanceSheetParams

Source§

fn params(&self) -> impl Iterator<Item = (&'static str, Cow<'_, str>)>

Source§

fn to_query_string(&self) -> String

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.