pub struct AssetDisposal {Show 27 fields
pub disposal_id: String,
pub asset_number: String,
pub sub_number: String,
pub company_code: String,
pub disposal_date: NaiveDate,
pub posting_date: NaiveDate,
pub disposal_type: DisposalType,
pub disposal_reason: DisposalReason,
pub asset_description: String,
pub asset_class: AssetClass,
pub acquisition_cost: Decimal,
pub accumulated_depreciation: Decimal,
pub net_book_value: Decimal,
pub sale_proceeds: Decimal,
pub disposal_costs: Decimal,
pub net_proceeds: Decimal,
pub gain_loss: Decimal,
pub is_gain: bool,
pub customer_id: Option<String>,
pub invoice_reference: Option<String>,
pub gl_references: Vec<GLReference>,
pub approval_status: DisposalApprovalStatus,
pub approved_by: Option<String>,
pub approval_date: Option<NaiveDate>,
pub created_by: String,
pub created_at: DateTime<Utc>,
pub notes: Option<String>,
}Expand description
Asset disposal transaction.
Fields§
§disposal_id: StringDisposal ID.
asset_number: StringAsset number.
sub_number: StringSub-number.
company_code: StringCompany code.
disposal_date: NaiveDateDisposal date.
posting_date: NaiveDatePosting date.
disposal_type: DisposalTypeDisposal type.
disposal_reason: DisposalReasonDisposal reason.
asset_description: StringAsset description.
asset_class: AssetClassAsset class.
acquisition_cost: DecimalOriginal acquisition cost.
accumulated_depreciation: DecimalAccumulated depreciation at disposal.
net_book_value: DecimalNet book value at disposal.
sale_proceeds: DecimalSale proceeds (if sold).
disposal_costs: DecimalDisposal costs (removal, transport, etc.).
net_proceeds: DecimalNet proceeds.
gain_loss: DecimalGain or loss on disposal.
is_gain: boolIs gain (vs loss).
customer_id: Option<String>Customer (if sold).
invoice_reference: Option<String>Invoice reference.
gl_references: Vec<GLReference>GL references.
approval_status: DisposalApprovalStatusApproval status.
approved_by: Option<String>Approved by.
approval_date: Option<NaiveDate>Approval date.
created_by: StringCreated by.
created_at: DateTime<Utc>Created at.
notes: Option<String>Notes.
Implementations§
Source§impl AssetDisposal
impl AssetDisposal
Sourcepub fn new(
disposal_id: String,
asset: &FixedAssetRecord,
disposal_date: NaiveDate,
disposal_type: DisposalType,
disposal_reason: DisposalReason,
created_by: String,
) -> Self
pub fn new( disposal_id: String, asset: &FixedAssetRecord, disposal_date: NaiveDate, disposal_type: DisposalType, disposal_reason: DisposalReason, created_by: String, ) -> Self
Creates a new disposal record.
Sourcepub fn sale(
disposal_id: String,
asset: &FixedAssetRecord,
disposal_date: NaiveDate,
sale_proceeds: Decimal,
customer_id: String,
created_by: String,
) -> Self
pub fn sale( disposal_id: String, asset: &FixedAssetRecord, disposal_date: NaiveDate, sale_proceeds: Decimal, customer_id: String, created_by: String, ) -> Self
Creates a sale disposal.
Sourcepub fn scrap(
disposal_id: String,
asset: &FixedAssetRecord,
disposal_date: NaiveDate,
reason: DisposalReason,
created_by: String,
) -> Self
pub fn scrap( disposal_id: String, asset: &FixedAssetRecord, disposal_date: NaiveDate, reason: DisposalReason, created_by: String, ) -> Self
Creates a scrapping disposal.
Sourcepub fn with_sale_proceeds(self, proceeds: Decimal) -> Self
pub fn with_sale_proceeds(self, proceeds: Decimal) -> Self
Sets sale proceeds.
Sourcepub fn with_disposal_costs(self, costs: Decimal) -> Self
pub fn with_disposal_costs(self, costs: Decimal) -> Self
Sets disposal costs.
Sourcepub fn calculate_gain_loss(&mut self)
pub fn calculate_gain_loss(&mut self)
Calculates gain or loss on disposal.
Sourcepub fn add_gl_reference(&mut self, reference: GLReference)
pub fn add_gl_reference(&mut self, reference: GLReference)
Adds a GL reference.
Sourcepub fn requires_approval(&self, threshold: Decimal) -> bool
pub fn requires_approval(&self, threshold: Decimal) -> bool
Requires approval based on threshold.
Trait Implementations§
Source§impl Clone for AssetDisposal
impl Clone for AssetDisposal
Source§fn clone(&self) -> AssetDisposal
fn clone(&self) -> AssetDisposal
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 AssetDisposal
impl Debug for AssetDisposal
Source§impl<'de> Deserialize<'de> for AssetDisposal
impl<'de> Deserialize<'de> for AssetDisposal
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 AssetDisposal
impl RefUnwindSafe for AssetDisposal
impl Send for AssetDisposal
impl Sync for AssetDisposal
impl Unpin for AssetDisposal
impl UnwindSafe for AssetDisposal
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