pub struct FixedAssets { /* private fields */ }Expand description
Fixed asset register operations.
Implementations§
Source§impl FixedAssets
impl FixedAssets
Sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Whether fixed assets are supported by the active backend.
Sourcepub fn create(&self, input: CreateFixedAsset) -> Result<FixedAsset>
pub fn create(&self, input: CreateFixedAsset) -> Result<FixedAsset>
Create a new fixed asset.
Sourcepub fn list(&self, filter: FixedAssetFilter) -> Result<Vec<FixedAsset>>
pub fn list(&self, filter: FixedAssetFilter) -> Result<Vec<FixedAsset>>
List fixed assets with optional filtering.
Sourcepub fn update(&self, id: Uuid, input: UpdateFixedAsset) -> Result<FixedAsset>
pub fn update(&self, id: Uuid, input: UpdateFixedAsset) -> Result<FixedAsset>
Update a fixed asset (partial).
Sourcepub fn place_in_service(&self, id: Uuid, date: NaiveDate) -> Result<FixedAsset>
pub fn place_in_service(&self, id: Uuid, date: NaiveDate) -> Result<FixedAsset>
Place a draft asset in service.
Sourcepub fn dispose(
&self,
id: Uuid,
date: NaiveDate,
proceeds: Decimal,
notes: Option<String>,
) -> Result<FixedAsset>
pub fn dispose( &self, id: Uuid, date: NaiveDate, proceeds: Decimal, notes: Option<String>, ) -> Result<FixedAsset>
Dispose of an asset for the given proceeds, recording gain/loss.
Sourcepub fn write_off(
&self,
id: Uuid,
date: NaiveDate,
notes: Option<String>,
) -> Result<FixedAsset>
pub fn write_off( &self, id: Uuid, date: NaiveDate, notes: Option<String>, ) -> Result<FixedAsset>
Write off an asset (disposal with zero proceeds).
Sourcepub fn generate_schedule(&self, id: Uuid) -> Result<DepreciationSchedule>
pub fn generate_schedule(&self, id: Uuid) -> Result<DepreciationSchedule>
Generate and persist the depreciation schedule for an asset.
Sourcepub fn get_schedule(&self, id: Uuid) -> Result<Option<DepreciationSchedule>>
pub fn get_schedule(&self, id: Uuid) -> Result<Option<DepreciationSchedule>>
Get the persisted depreciation schedule for an asset, if generated.
Sourcepub fn post_depreciation(&self, id: Uuid, periods: u32) -> Result<FixedAsset>
pub fn post_depreciation(&self, id: Uuid, periods: u32) -> Result<FixedAsset>
Post the next periods scheduled depreciation entries.
If the active GL auto-posting configuration has auto_post_depreciation
enabled, a balanced journal entry is also created and posted (debit
depreciation expense, credit accumulated depreciation), using the
asset’s configured GL accounts or, as a fallback, the first active
posting accounts with the matching account sub-types.