pub struct FixedAsset {Show 28 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>,
}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
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).
Trait Implementations§
Source§impl Clone for FixedAsset
impl Clone for FixedAsset
Source§fn clone(&self) -> FixedAsset
fn clone(&self) -> FixedAsset
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more