pub struct OwnerContribution {Show 18 fields
pub id: Uuid,
pub organization_id: Uuid,
pub owner_id: Uuid,
pub unit_id: Option<Uuid>,
pub description: String,
pub amount: f64,
pub account_code: Option<String>,
pub contribution_type: ContributionType,
pub contribution_date: DateTime<Utc>,
pub payment_date: Option<DateTime<Utc>>,
pub payment_method: Option<ContributionPaymentMethod>,
pub payment_reference: Option<String>,
pub payment_status: ContributionPaymentStatus,
pub call_for_funds_id: Option<Uuid>,
pub notes: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub created_by: Option<Uuid>,
}Expand description
Owner contribution (appel de fonds / cotisation)
Represents money paid BY owners TO the ACP (REVENUE - classe 7 PCMN) This is the opposite of Expense which represents money paid BY ACP TO suppliers
Fields§
§id: Uuid§organization_id: Uuid§owner_id: Uuid§unit_id: Option<Uuid>§description: String§amount: f64§account_code: Option<String>PCMN code (classe 7 - Produits) Examples: “7000” = regular fees, “7100” = extraordinary fees
contribution_type: ContributionType§contribution_date: DateTime<Utc>§payment_date: Option<DateTime<Utc>>§payment_method: Option<ContributionPaymentMethod>§payment_reference: Option<String>§payment_status: ContributionPaymentStatus§call_for_funds_id: Option<Uuid>§notes: Option<String>§created_at: DateTime<Utc>§updated_at: DateTime<Utc>§created_by: Option<Uuid>Implementations§
Source§impl OwnerContribution
impl OwnerContribution
pub fn new( organization_id: Uuid, owner_id: Uuid, unit_id: Option<Uuid>, description: String, amount: f64, contribution_type: ContributionType, contribution_date: DateTime<Utc>, account_code: Option<String>, ) -> Result<Self, String>
Sourcepub fn mark_as_paid(
&mut self,
payment_date: DateTime<Utc>,
payment_method: ContributionPaymentMethod,
payment_reference: Option<String>,
)
pub fn mark_as_paid( &mut self, payment_date: DateTime<Utc>, payment_method: ContributionPaymentMethod, payment_reference: Option<String>, )
Mark contribution as paid
Sourcepub fn is_overdue(&self) -> bool
pub fn is_overdue(&self) -> bool
Check if contribution is overdue (not paid and past contribution_date)
Trait Implementations§
Source§impl Clone for OwnerContribution
impl Clone for OwnerContribution
Source§fn clone(&self) -> OwnerContribution
fn clone(&self) -> OwnerContribution
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 OwnerContribution
impl Debug for OwnerContribution
Source§impl<'de> Deserialize<'de> for OwnerContribution
impl<'de> Deserialize<'de> for OwnerContribution
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
Source§impl From<OwnerContribution> for OwnerContributionResponse
impl From<OwnerContribution> for OwnerContributionResponse
Source§fn from(contribution: OwnerContribution) -> Self
fn from(contribution: OwnerContribution) -> Self
Converts to this type from the input type.
Source§impl PartialEq for OwnerContribution
impl PartialEq for OwnerContribution
Source§impl Serialize for OwnerContribution
impl Serialize for OwnerContribution
impl StructuralPartialEq for OwnerContribution
Auto Trait Implementations§
impl Freeze for OwnerContribution
impl RefUnwindSafe for OwnerContribution
impl Send for OwnerContribution
impl Sync for OwnerContribution
impl Unpin for OwnerContribution
impl UnwindSafe for OwnerContribution
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
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.