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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more