Skip to main content

FixedAssetRecord

Struct FixedAssetRecord 

Source
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: String

Asset number (unique identifier).

§sub_number: String

Sub-number (for complex assets).

§company_code: String

Company code.

§asset_class: AssetClass

Asset class.

§description: String

Description.

§serial_number: Option<String>

Serial number.

§inventory_number: Option<String>

Inventory number.

§status: AssetStatus

Asset status.

§acquisition_date: NaiveDate

Acquisition date.

§capitalization_date: NaiveDate

Capitalization date.

§first_depreciation_date: NaiveDate

First depreciation period.

§acquisition_cost: Decimal

Original acquisition cost.

§currency: String

Currency.

§accumulated_depreciation: Decimal

Accumulated depreciation.

§net_book_value: Decimal

Net 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: AssetAccountDetermination

GL 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

Source

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.

Source

pub fn add_depreciation_area(&mut self, area: DepreciationArea)

Adds a depreciation area.

Source

pub fn with_standard_depreciation( self, useful_life_years: u32, method: DepreciationMethod, ) -> Self

Creates with standard depreciation areas (book and tax).

Source

pub fn record_depreciation( &mut self, amount: Decimal, area_type: DepreciationAreaType, )

Records depreciation.

Source

pub fn add_acquisition(&mut self, amount: Decimal, _date: NaiveDate)

Records an acquisition addition.

Source

pub fn is_fully_depreciated(&self) -> bool

Checks if fully depreciated.

Source

pub fn remaining_life_months(&self, area_type: DepreciationAreaType) -> u32

Gets remaining useful life in months.

Source

pub fn with_location(self, plant: String, location: String) -> Self

Sets location information.

Source

pub fn with_cost_center(self, cost_center: String) -> Self

Sets cost center.

Source

pub fn with_vendor( self, vendor_id: String, po_reference: Option<String>, ) -> Self

Sets vendor reference.

Source

pub fn asset_id(&self) -> &str

Gets asset_id (alias for asset_number).

Source

pub fn current_acquisition_cost(&self) -> Decimal

Gets current acquisition cost (alias for acquisition_cost).

Source

pub fn salvage_value(&self) -> Decimal

Gets salvage value from the first depreciation area.

Source

pub fn useful_life_months(&self) -> u32

Gets useful life in months from the first depreciation area.

Source

pub fn accumulated_depreciation_account(&self) -> &str

Gets accumulated depreciation account from account determination.

Source

pub fn retire(&mut self, retirement_date: NaiveDate)

Marks as inactive (retired).

Trait Implementations§

Source§

impl Clone for FixedAssetRecord

Source§

fn clone(&self) -> FixedAssetRecord

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FixedAssetRecord

Source§

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

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

impl<'de> Deserialize<'de> for FixedAssetRecord

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for FixedAssetRecord

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,