pub struct DepreciationArea {
pub area_type: DepreciationAreaType,
pub method: DepreciationMethod,
pub useful_life_months: u32,
pub depreciation_start_date: Option<NaiveDate>,
pub acquisition_cost: Decimal,
pub accumulated_depreciation: Decimal,
pub net_book_value: Decimal,
pub salvage_value: Decimal,
pub periods_completed: u32,
pub last_depreciation_date: Option<NaiveDate>,
}Expand description
Depreciation area (book, tax, etc.).
Fields§
§area_type: DepreciationAreaTypeArea type.
method: DepreciationMethodDepreciation method.
useful_life_months: u32Useful life in months.
depreciation_start_date: Option<NaiveDate>Depreciation start date.
acquisition_cost: DecimalAcquisition cost (can differ from main asset).
accumulated_depreciation: DecimalAccumulated depreciation.
net_book_value: DecimalNet book value.
salvage_value: DecimalSalvage value.
periods_completed: u32Depreciation periods completed.
last_depreciation_date: Option<NaiveDate>Last depreciation date.
Implementations§
Source§impl DepreciationArea
impl DepreciationArea
Sourcepub fn new(
area_type: DepreciationAreaType,
method: DepreciationMethod,
useful_life_months: u32,
acquisition_cost: Decimal,
) -> Self
pub fn new( area_type: DepreciationAreaType, method: DepreciationMethod, useful_life_months: u32, acquisition_cost: Decimal, ) -> Self
Creates a new depreciation area.
Sourcepub fn with_salvage_value(self, value: Decimal) -> Self
pub fn with_salvage_value(self, value: Decimal) -> Self
Sets salvage value.
Sourcepub fn remaining_life_months(&self) -> u32
pub fn remaining_life_months(&self) -> u32
Gets remaining useful life in months.
Sourcepub fn is_fully_depreciated(&self) -> bool
pub fn is_fully_depreciated(&self) -> bool
Checks if fully depreciated.
Sourcepub fn calculate_monthly_depreciation(&self) -> Decimal
pub fn calculate_monthly_depreciation(&self) -> Decimal
Calculates monthly depreciation based on method.
Trait Implementations§
Source§impl Clone for DepreciationArea
impl Clone for DepreciationArea
Source§fn clone(&self) -> DepreciationArea
fn clone(&self) -> DepreciationArea
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DepreciationArea
impl Debug for DepreciationArea
Source§impl<'de> Deserialize<'de> for DepreciationArea
impl<'de> Deserialize<'de> for DepreciationArea
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DepreciationArea
impl RefUnwindSafe for DepreciationArea
impl Send for DepreciationArea
impl Sync for DepreciationArea
impl Unpin for DepreciationArea
impl UnsafeUnpin for DepreciationArea
impl UnwindSafe for DepreciationArea
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
Mutably borrows from an owned value. Read more