pub struct FixedAsset {Show 29 fields
pub asset_id: String,
pub sub_number: u16,
pub description: String,
pub asset_class: AssetClass,
pub company_code: String,
pub cost_center: Option<String>,
pub location: Option<String>,
pub acquisition_date: NaiveDate,
pub acquisition_type: AcquisitionType,
pub acquisition_cost: Decimal,
pub capitalized_date: Option<NaiveDate>,
pub depreciation_method: DepreciationMethod,
pub useful_life_months: u32,
pub salvage_value: Decimal,
pub accumulated_depreciation: Decimal,
pub net_book_value: Decimal,
pub account_determination: AssetAccountDetermination,
pub status: AssetStatus,
pub disposal_date: Option<NaiveDate>,
pub disposal_proceeds: Option<Decimal>,
pub serial_number: Option<String>,
pub manufacturer: Option<String>,
pub model: Option<String>,
pub warranty_expiration: Option<NaiveDate>,
pub insurance_policy: Option<String>,
pub purchase_order: Option<String>,
pub vendor_id: Option<String>,
pub invoice_reference: Option<String>,
pub is_gwg: Option<bool>,
}Expand description
Fixed asset master data.
Fields§
§asset_id: StringAsset ID (e.g., “FA-001234”)
sub_number: u16Asset sub-number (for component accounting)
description: StringAsset description
asset_class: AssetClassAsset class
company_code: StringCompany code
cost_center: Option<String>Cost center responsible for the asset
location: Option<String>Location/plant
acquisition_date: NaiveDateAcquisition date
acquisition_type: AcquisitionTypeAcquisition type
acquisition_cost: DecimalOriginal acquisition cost
capitalized_date: Option<NaiveDate>Capitalized date (when depreciation starts)
depreciation_method: DepreciationMethodDepreciation method
useful_life_months: u32Useful life in months
salvage_value: DecimalSalvage/residual value
accumulated_depreciation: DecimalAccumulated depreciation as of current period
net_book_value: DecimalNet book value (acquisition_cost - accumulated_depreciation)
account_determination: AssetAccountDeterminationAccount determination rules
status: AssetStatusCurrent status
disposal_date: Option<NaiveDate>Disposal date (if disposed)
disposal_proceeds: Option<Decimal>Disposal proceeds (if disposed)
serial_number: Option<String>Serial number (for tracking)
manufacturer: Option<String>Manufacturer
model: Option<String>Model
warranty_expiration: Option<NaiveDate>Warranty expiration date
insurance_policy: Option<String>Insurance policy number
purchase_order: Option<String>Original PO number
vendor_id: Option<String>Vendor ID (who supplied the asset)
invoice_reference: Option<String>Invoice reference
is_gwg: Option<bool>Whether this asset is a GWG (geringwertiges Wirtschaftsgut) under German tax law. Assets with acquisition cost ≤ 800 EUR are eligible for immediate full expensing per EStG §6(2).
Implementations§
Source§impl FixedAsset
impl FixedAsset
Sourcepub fn new(
asset_id: impl Into<String>,
description: impl Into<String>,
asset_class: AssetClass,
company_code: impl Into<String>,
acquisition_date: NaiveDate,
acquisition_cost: Decimal,
) -> Self
pub fn new( asset_id: impl Into<String>, description: impl Into<String>, asset_class: AssetClass, company_code: impl Into<String>, acquisition_date: NaiveDate, acquisition_cost: Decimal, ) -> Self
Create a new fixed asset.
Sourcepub fn with_cost_center(self, cost_center: impl Into<String>) -> Self
pub fn with_cost_center(self, cost_center: impl Into<String>) -> Self
Set cost center.
Sourcepub fn with_location(self, location: impl Into<String>) -> Self
pub fn with_location(self, location: impl Into<String>) -> Self
Set location.
Sourcepub fn with_salvage_value(self, salvage_value: Decimal) -> Self
pub fn with_salvage_value(self, salvage_value: Decimal) -> Self
Set salvage value.
Sourcepub fn with_depreciation_method(self, method: DepreciationMethod) -> Self
pub fn with_depreciation_method(self, method: DepreciationMethod) -> Self
Set depreciation method.
Sourcepub fn with_useful_life_months(self, months: u32) -> Self
pub fn with_useful_life_months(self, months: u32) -> Self
Set useful life.
Sourcepub fn with_vendor(self, vendor_id: impl Into<String>) -> Self
pub fn with_vendor(self, vendor_id: impl Into<String>) -> Self
Set vendor ID.
Sourcepub fn months_since_capitalization(&self, as_of_date: NaiveDate) -> u32
pub fn months_since_capitalization(&self, as_of_date: NaiveDate) -> u32
Calculate months since capitalization.
Sourcepub fn calculate_monthly_depreciation(&self, as_of_date: NaiveDate) -> Decimal
pub fn calculate_monthly_depreciation(&self, as_of_date: NaiveDate) -> Decimal
Calculate depreciation for a specific month.
Sourcepub fn apply_depreciation(&mut self, depreciation_amount: Decimal)
pub fn apply_depreciation(&mut self, depreciation_amount: Decimal)
Apply depreciation and update balances.
Sourcepub fn calculate_disposal_gain_loss(&self, proceeds: Decimal) -> Decimal
pub fn calculate_disposal_gain_loss(&self, proceeds: Decimal) -> Decimal
Calculate gain/loss on disposal.
Sourcepub fn is_fully_depreciated(&self) -> bool
pub fn is_fully_depreciated(&self) -> bool
Check if asset is fully depreciated.
Sourcepub fn remaining_useful_life_months(&self, as_of_date: NaiveDate) -> u32
pub fn remaining_useful_life_months(&self, as_of_date: NaiveDate) -> u32
Calculate remaining useful life in months.
Sourcepub fn annual_depreciation_rate(&self) -> Decimal
pub fn annual_depreciation_rate(&self) -> Decimal
Calculate depreciation rate (annual percentage).
Sourcepub fn macrs_depreciation(&self, year: u32) -> Decimal
pub fn macrs_depreciation(&self, year: u32) -> Decimal
Return the annual MACRS depreciation for a given recovery year (1-indexed).
Uses the IRS Publication 946 GDS half-year convention tables.
MACRS depreciation is based on the full acquisition cost (salvage value is ignored).
Returns Decimal::ZERO if the year is out of range or no table matches the useful life.
Sourcepub fn ddb_depreciation(&self) -> Decimal
pub fn ddb_depreciation(&self) -> Decimal
Return the monthly double-declining balance depreciation amount.
The DDB rate is 2 / useful_life_months * 12 applied monthly against the current
net book value. The result is rounded to 2 decimal places and capped so the asset
does not depreciate below the salvage value.
Trait Implementations§
Source§impl Clone for FixedAsset
impl Clone for FixedAsset
Source§fn clone(&self) -> FixedAsset
fn clone(&self) -> FixedAsset
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FixedAsset
impl Debug for FixedAsset
Source§impl<'de> Deserialize<'de> for FixedAsset
impl<'de> Deserialize<'de> for FixedAsset
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for FixedAsset
impl RefUnwindSafe for FixedAsset
impl Send for FixedAsset
impl Sync for FixedAsset
impl Unpin for FixedAsset
impl UnsafeUnpin for FixedAsset
impl UnwindSafe for FixedAsset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.