The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Business::cXML::Amount - cXML amounts

SYNOPSIS

        use Business::cXML::Amount;
        my $charge = new Business::cXML::Amount 'Charge' {
                currency => 'CAD',
                amount   => '17.99',
        };

DESCRIPTION

Object representation of the common cXML amounts:

    AdditionalCost AvailablePrice Charge DeductedPrice DeductionAmount DepositAmount DiscountAmount DiscountBasis DueAmount ExactAmount ExpectedLimit Fee FeeAmount FixedAmount GoodsAndServiceAmount GrossAmount GrossProgressPaymentAmount InformationalAmount InformationalPrice InformationalPriceExclTax MaxAmount MaxReleaseAmount MinAmount MinReleaseAMount NetAmount OriginalPrice OverallLimit PartialAmount Penalty Shipping ShippingAmount SpecialHandlingAmount SubtotalAmount Tax TaxableAmount TaxAdjustment TaxAdjustmentDetail TaxAmount TotalAllowances TotalAmountInBillingCurrency TotalAmountInPostedCurrency TotalAmountWithoutTax TotalCharges TotalRetailAmount TotalReturnableItemsDepositAmount UnitGrossPrice UnitNetPriceCorrection

Not all variations allow the same attributes, but since they overwhelmingly share the same basic function and structure, they were grouped into a single object.

Specifically NOT implemented are:

  • Distribution sub-section

  • Modifications sub-section

  • PriceBasisQuantity sub-section

  • AdditionalCost with a Percentage sub-section (only its Money is implemented)

METHODS

See "COMMON METHODS" in Business::cXML::Object.

PROPERTY METHODS

See "PROPERTY METHODS" in Business::cXML::Object for how the following operate.

currency

Mandatory, i.e. USD (default)

amount

Mandatory, i.e 0.0 (default). Use a string if you want control over formatting.

AvailablePrice, Penalty, Shipping, SpecialHandlingAmount, Tax add:

description

Optional, Business::cXML::Description object

AvailablePrice, Fee, OriginalPrice add:

type

Optional. For AvailablePrice, it is expected to be one of: lowest, lowestCompliant, highestCompliant, highest, other (default)

FeeAmount adds:

fees[]

Optional, Business::cXML::Amount objects of Fee type

Shipping adds:

tracking_domain

Optional, logistics supplier, i.e. FedEx, UPS

tracking_id

Optional, logistics supplier tracking number

Tax adds:

tax_details[]

Optional, "Business::cXML::Amount::TaxDetail" objects

TaxAdjustment adds:

taxadj_details[]

Optional, Business::cXML::Amount objects named TaxAdjustmentDetail

TaxAdjustmentDetail adds:

category

Mandatory

region

Optional

AUTHOR

Stéphane Lavergne https://github.com/vphantom

ACKNOWLEDGEMENTS

Graph X Design Inc. https://www.gxd.ca/ sponsored this project.

COPYRIGHT & LICENSE

Copyright (c) 2017-2018 Stéphane Lavergne https://github.com/vphantom

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.