pub struct FixedAssetRecord {Show 28 fields
pub asset_number: String,
pub sub_number: String,
pub company_code: String,
pub asset_class: AssetClass,
pub description: String,
pub serial_number: Option<String>,
pub inventory_number: Option<String>,
pub status: AssetStatus,
pub acquisition_date: NaiveDate,
pub capitalization_date: NaiveDate,
pub first_depreciation_date: NaiveDate,
pub acquisition_cost: Decimal,
pub currency: String,
pub accumulated_depreciation: Decimal,
pub net_book_value: Decimal,
pub depreciation_areas: Vec<DepreciationArea>,
pub cost_center: Option<String>,
pub profit_center: Option<String>,
pub plant: Option<String>,
pub location: Option<String>,
pub responsible_person: Option<String>,
pub vendor_id: Option<String>,
pub po_reference: Option<String>,
pub account_determination: AssetAccountDetermination,
pub created_at: DateTime<Utc>,
pub created_by: Option<String>,
pub modified_at: Option<DateTime<Utc>>,
pub notes: Option<String>,
}Expand description
Fixed Asset record.
Fields§
§asset_number: StringAsset number (unique identifier).
sub_number: StringSub-number (for complex assets).
company_code: StringCompany code.
asset_class: AssetClassAsset class.
description: StringDescription.
serial_number: Option<String>Serial number.
inventory_number: Option<String>Inventory number.
status: AssetStatusAsset status.
acquisition_date: NaiveDateAcquisition date.
capitalization_date: NaiveDateCapitalization date.
first_depreciation_date: NaiveDateFirst depreciation period.
acquisition_cost: DecimalOriginal acquisition cost.
currency: StringCurrency.
accumulated_depreciation: DecimalAccumulated depreciation.
net_book_value: DecimalNet book value.
depreciation_areas: Vec<DepreciationArea>Depreciation areas.
cost_center: Option<String>Cost center.
profit_center: Option<String>Profit center.
plant: Option<String>Plant/location.
location: Option<String>Room/location detail.
responsible_person: Option<String>Responsible person.
vendor_id: Option<String>Vendor (for acquisitions).
po_reference: Option<String>Purchase order reference.
account_determination: AssetAccountDeterminationGL account mappings.
created_at: DateTime<Utc>Created timestamp.
created_by: Option<String>Created by user.
modified_at: Option<DateTime<Utc>>Last modified.
notes: Option<String>Notes.
Implementations§
Source§impl FixedAssetRecord
impl FixedAssetRecord
Sourcepub fn new(
asset_number: String,
company_code: String,
asset_class: AssetClass,
description: String,
acquisition_date: NaiveDate,
acquisition_cost: Decimal,
currency: String,
) -> Self
pub fn new( asset_number: String, company_code: String, asset_class: AssetClass, description: String, acquisition_date: NaiveDate, acquisition_cost: Decimal, currency: String, ) -> Self
Creates a new fixed asset.
Sourcepub fn add_depreciation_area(&mut self, area: DepreciationArea)
pub fn add_depreciation_area(&mut self, area: DepreciationArea)
Adds a depreciation area.
Sourcepub fn with_standard_depreciation(
self,
useful_life_years: u32,
method: DepreciationMethod,
) -> Self
pub fn with_standard_depreciation( self, useful_life_years: u32, method: DepreciationMethod, ) -> Self
Creates with standard depreciation areas (book and tax).
Sourcepub fn record_depreciation(
&mut self,
amount: Decimal,
area_type: DepreciationAreaType,
)
pub fn record_depreciation( &mut self, amount: Decimal, area_type: DepreciationAreaType, )
Records depreciation.
Sourcepub fn add_acquisition(&mut self, amount: Decimal, _date: NaiveDate)
pub fn add_acquisition(&mut self, amount: Decimal, _date: NaiveDate)
Records an acquisition addition.
Sourcepub fn is_fully_depreciated(&self) -> bool
pub fn is_fully_depreciated(&self) -> bool
Checks if fully depreciated.
Sourcepub fn remaining_life_months(&self, area_type: DepreciationAreaType) -> u32
pub fn remaining_life_months(&self, area_type: DepreciationAreaType) -> u32
Gets remaining useful life in months.
Sourcepub fn with_location(self, plant: String, location: String) -> Self
pub fn with_location(self, plant: String, location: String) -> Self
Sets location information.
Sourcepub fn with_cost_center(self, cost_center: String) -> Self
pub fn with_cost_center(self, cost_center: String) -> Self
Sets cost center.
Sourcepub fn with_vendor(
self,
vendor_id: String,
po_reference: Option<String>,
) -> Self
pub fn with_vendor( self, vendor_id: String, po_reference: Option<String>, ) -> Self
Sets vendor reference.
Sourcepub fn current_acquisition_cost(&self) -> Decimal
pub fn current_acquisition_cost(&self) -> Decimal
Gets current acquisition cost (alias for acquisition_cost).
Sourcepub fn salvage_value(&self) -> Decimal
pub fn salvage_value(&self) -> Decimal
Gets salvage value from the first depreciation area.
Sourcepub fn useful_life_months(&self) -> u32
pub fn useful_life_months(&self) -> u32
Gets useful life in months from the first depreciation area.
Sourcepub fn accumulated_depreciation_account(&self) -> &str
pub fn accumulated_depreciation_account(&self) -> &str
Gets accumulated depreciation account from account determination.
Trait Implementations§
Source§impl Clone for FixedAssetRecord
impl Clone for FixedAssetRecord
Source§fn clone(&self) -> FixedAssetRecord
fn clone(&self) -> FixedAssetRecord
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more