pub struct ARReceipt {Show 24 fields
pub receipt_number: String,
pub company_code: String,
pub customer_id: String,
pub customer_name: String,
pub receipt_date: NaiveDate,
pub posting_date: NaiveDate,
pub value_date: NaiveDate,
pub receipt_type: ARReceiptType,
pub status: SubledgerDocumentStatus,
pub amount: CurrencyAmount,
pub bank_charges: Decimal,
pub discount_taken: Decimal,
pub write_off_amount: Decimal,
pub net_applied: Decimal,
pub unapplied_amount: Decimal,
pub payment_method: PaymentMethod,
pub bank_account: String,
pub bank_reference: Option<String>,
pub check_number: Option<String>,
pub applied_invoices: Vec<ReceiptApplication>,
pub gl_references: Vec<GLReference>,
pub created_at: DateTime<Utc>,
pub created_by: Option<String>,
pub notes: Option<String>,
}Expand description
AR Receipt (payment from customer).
Fields§
§receipt_number: StringUnique receipt number.
company_code: StringCompany code.
customer_id: StringCustomer ID.
customer_name: StringCustomer name.
receipt_date: NaiveDateReceipt date.
posting_date: NaiveDatePosting date.
value_date: NaiveDateValue date (bank value date).
receipt_type: ARReceiptTypeReceipt type.
status: SubledgerDocumentStatusReceipt status.
amount: CurrencyAmountReceipt amount.
bank_charges: DecimalBank charges deducted.
discount_taken: DecimalDiscount taken.
write_off_amount: DecimalWrite-off amount.
net_applied: DecimalNet amount applied to invoices.
unapplied_amount: DecimalUnapplied amount.
payment_method: PaymentMethodPayment method.
bank_account: StringBank account.
bank_reference: Option<String>Bank reference.
check_number: Option<String>Check number (if check payment).
applied_invoices: Vec<ReceiptApplication>Applied invoices.
gl_references: Vec<GLReference>GL references.
created_at: DateTime<Utc>Created timestamp.
created_by: Option<String>Created by user.
notes: Option<String>Notes.
Implementations§
Source§impl ARReceipt
impl ARReceipt
Sourcepub fn new(
receipt_number: String,
company_code: String,
customer_id: String,
customer_name: String,
receipt_date: NaiveDate,
amount: Decimal,
currency: String,
payment_method: PaymentMethod,
bank_account: String,
) -> Self
pub fn new( receipt_number: String, company_code: String, customer_id: String, customer_name: String, receipt_date: NaiveDate, amount: Decimal, currency: String, payment_method: PaymentMethod, bank_account: String, ) -> Self
Creates a new AR receipt.
Sourcepub fn apply_to_invoice(
&mut self,
invoice_number: String,
amount_applied: Decimal,
discount: Decimal,
)
pub fn apply_to_invoice( &mut self, invoice_number: String, amount_applied: Decimal, discount: Decimal, )
Applies receipt to an invoice.
Sourcepub fn with_bank_charges(self, charges: Decimal) -> Self
pub fn with_bank_charges(self, charges: Decimal) -> Self
Sets bank charges.
Sourcepub fn with_check(self, check_number: String) -> Self
pub fn with_check(self, check_number: String) -> Self
Sets check number.
Sourcepub fn with_bank_reference(self, reference: String) -> Self
pub fn with_bank_reference(self, reference: String) -> Self
Sets bank reference.
Sourcepub fn add_gl_reference(&mut self, reference: GLReference)
pub fn add_gl_reference(&mut self, reference: GLReference)
Adds a GL reference.
Sourcepub fn total_settlement(&self) -> Decimal
pub fn total_settlement(&self) -> Decimal
Gets total amount including discount.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ARReceipt
impl<'de> Deserialize<'de> for ARReceipt
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 ARReceipt
impl RefUnwindSafe for ARReceipt
impl Send for ARReceipt
impl Sync for ARReceipt
impl Unpin for ARReceipt
impl UnsafeUnpin for ARReceipt
impl UnwindSafe for ARReceipt
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