pub struct WithholdingTaxRecord {
pub id: String,
pub payment_id: String,
pub vendor_id: String,
pub withholding_type: WithholdingType,
pub treaty_rate: Option<Decimal>,
pub statutory_rate: Decimal,
pub applied_rate: Decimal,
pub base_amount: Decimal,
pub withheld_amount: Decimal,
pub certificate_number: Option<String>,
}Expand description
A withholding tax record associated with a cross-border payment.
Fields§
§id: StringUnique record identifier
payment_id: StringPayment document this withholding relates to
vendor_id: StringVendor / payee subject to withholding
withholding_type: WithholdingTypeCategory of withholding
treaty_rate: Option<Decimal>Reduced rate under an applicable tax treaty
statutory_rate: DecimalDomestic statutory withholding rate
applied_rate: DecimalRate actually applied (may equal treaty_rate or statutory_rate)
base_amount: DecimalGross payment amount subject to withholding
withheld_amount: DecimalAmount withheld (base_amount * applied_rate)
certificate_number: Option<String>Tax certificate / receipt number from the authority
Implementations§
Source§impl WithholdingTaxRecord
impl WithholdingTaxRecord
Sourcepub fn new(
id: impl Into<String>,
payment_id: impl Into<String>,
vendor_id: impl Into<String>,
withholding_type: WithholdingType,
statutory_rate: Decimal,
applied_rate: Decimal,
base_amount: Decimal,
) -> Self
pub fn new( id: impl Into<String>, payment_id: impl Into<String>, vendor_id: impl Into<String>, withholding_type: WithholdingType, statutory_rate: Decimal, applied_rate: Decimal, base_amount: Decimal, ) -> Self
Creates a new withholding tax record.
Sourcepub fn with_treaty_rate(self, rate: Decimal) -> Self
pub fn with_treaty_rate(self, rate: Decimal) -> Self
Sets the treaty rate.
Sourcepub fn with_certificate_number(self, number: impl Into<String>) -> Self
pub fn with_certificate_number(self, number: impl Into<String>) -> Self
Sets the certificate number.
Sourcepub fn has_treaty_benefit(&self) -> bool
pub fn has_treaty_benefit(&self) -> bool
Returns true if a tax-treaty benefit has been applied.
A treaty benefit exists when a treaty rate is present and the applied rate is strictly less than the statutory rate.
Sourcepub fn treaty_savings(&self) -> Decimal
pub fn treaty_savings(&self) -> Decimal
Computes the savings achieved through the treaty benefit.
(statutory_rate - applied_rate) * base_amount, rounded to 2 dp.
Trait Implementations§
Source§impl Clone for WithholdingTaxRecord
impl Clone for WithholdingTaxRecord
Source§fn clone(&self) -> WithholdingTaxRecord
fn clone(&self) -> WithholdingTaxRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WithholdingTaxRecord
impl Debug for WithholdingTaxRecord
Source§impl<'de> Deserialize<'de> for WithholdingTaxRecord
impl<'de> Deserialize<'de> for WithholdingTaxRecord
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>,
Source§impl Serialize for WithholdingTaxRecord
impl Serialize for WithholdingTaxRecord
Source§impl ToNodeProperties for WithholdingTaxRecord
impl ToNodeProperties for WithholdingTaxRecord
Source§fn node_type_name(&self) -> &'static str
fn node_type_name(&self) -> &'static str
"uncertain_tax_position".Source§fn node_type_code(&self) -> u16
fn node_type_code(&self) -> u16
416.Source§fn to_node_properties(&self) -> HashMap<String, GraphPropertyValue>
fn to_node_properties(&self) -> HashMap<String, GraphPropertyValue>
Auto Trait Implementations§
impl Freeze for WithholdingTaxRecord
impl RefUnwindSafe for WithholdingTaxRecord
impl Send for WithholdingTaxRecord
impl Sync for WithholdingTaxRecord
impl Unpin for WithholdingTaxRecord
impl UnsafeUnpin for WithholdingTaxRecord
impl UnwindSafe for WithholdingTaxRecord
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.