Skip to content

Commit

Permalink
Added tests for foreign currencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ruff committed Jul 29, 2024
1 parent a25f1a1 commit 5b864fe
Show file tree
Hide file tree
Showing 4 changed files with 566 additions and 6 deletions.
1 change: 1 addition & 0 deletions build/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<file>../tests/testcases/CiiToUblSimplePayeeTest.php</file>
<file>../tests/testcases/CiiToUblDiscountTest.php</file>
<file>../tests/testcases/CiiToUblExtendedTest.php</file>
<file>../tests/testcases/CiiToUblExtendedFwTest.php</file>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
Expand Down
254 changes: 254 additions & 0 deletions tests/assets/cii/2_cii_extended_fw.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
<?xml version="1.0" encoding="UTF-8"?>
<rsm:CrossIndustryInvoice xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100" xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100" xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
<rsm:ExchangedDocumentContext>
<ram:BusinessProcessSpecifiedDocumentContextParameter>
<ram:ID>Beispielgeschäftsprozess</ram:ID>
</ram:BusinessProcessSpecifiedDocumentContextParameter>
<ram:GuidelineSpecifiedDocumentContextParameter>
<ram:ID>urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended</ram:ID>
</ram:GuidelineSpecifiedDocumentContextParameter>
</rsm:ExchangedDocumentContext>
<rsm:ExchangedDocument>
<ram:ID>47110815</ram:ID>
<ram:Name>RECHNUNG</ram:Name>
<ram:TypeCode>380</ram:TypeCode>
<ram:IssueDateTime>
<udt:DateTimeString format="102">20181031</udt:DateTimeString>
</ram:IssueDateTime>
<ram:IncludedNote>
<ram:Content>Mitglieder der Geschäftsleitung
H. Meier Geschäftsführer
T. Müller Prokurist
HRB Braunschweig 12345</ram:Content>
<ram:SubjectCode>REG</ram:SubjectCode>
</ram:IncludedNote>
<ram:IncludedNote>
<ram:Content>Vom 17. Dezember 2018 bis 6. Januar 2019 haben wir Betriebsferien.</ram:Content>
<ram:SubjectCode>AAI</ram:SubjectCode>
</ram:IncludedNote>
<ram:IncludedNote>
<ram:Content>Aus konzern-internen Gründen wird der Steuerbetrag sowohl in der Rechungswährung (EUR) als auch in der Buchwährung (GBP) ausgegeben.</ram:Content>
<ram:SubjectCode>TXD</ram:SubjectCode>
</ram:IncludedNote>
</rsm:ExchangedDocument>
<rsm:SupplyChainTradeTransaction>
<ram:IncludedSupplyChainTradeLineItem>
<ram:AssociatedDocumentLineDocument>
<ram:LineID>1</ram:LineID>
<ram:IncludedNote>
<ram:Content>Materialzertifikat X-234 gem ISO XYZ.
Ware bleibt bis zur vollständigen Bezahlung unser Eigentum.
</ram:Content>
</ram:IncludedNote>
</ram:AssociatedDocumentLineDocument>
<ram:SpecifiedTradeProduct>
<ram:SellerAssignedID>CO-123/V2A</ram:SellerAssignedID>
<ram:BuyerAssignedID>Toolbox 0815</ram:BuyerAssignedID>
<ram:Name>Stahlcoil</ram:Name>
<ram:OriginTradeCountry>
<ram:ID>DE</ram:ID>
</ram:OriginTradeCountry>
</ram:SpecifiedTradeProduct>
<ram:SpecifiedLineTradeAgreement>
<ram:BuyerOrderReferencedDocument>
<ram:IssuerAssignedID>ORDER84359</ram:IssuerAssignedID>
<ram:LineID>1</ram:LineID>
</ram:BuyerOrderReferencedDocument>
<ram:GrossPriceProductTradePrice>
<ram:ChargeAmount>100.00</ram:ChargeAmount>
<ram:BasisQuantity unitCode="H87">1</ram:BasisQuantity>
</ram:GrossPriceProductTradePrice>
<ram:NetPriceProductTradePrice>
<ram:ChargeAmount>100</ram:ChargeAmount>
<ram:BasisQuantity unitCode="H87">1</ram:BasisQuantity>
</ram:NetPriceProductTradePrice>
</ram:SpecifiedLineTradeAgreement>
<ram:SpecifiedLineTradeDelivery>
<ram:BilledQuantity unitCode="H87">10</ram:BilledQuantity>
</ram:SpecifiedLineTradeDelivery>
<ram:SpecifiedLineTradeSettlement>
<ram:ApplicableTradeTax>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:CategoryCode>S</ram:CategoryCode>
<ram:RateApplicablePercent>19</ram:RateApplicablePercent>
</ram:ApplicableTradeTax>
<ram:SpecifiedTradeAllowanceCharge>
<ram:ChargeIndicator>
<udt:Indicator>false</udt:Indicator>
</ram:ChargeIndicator>
<ram:CalculationPercent>10</ram:CalculationPercent>
<ram:BasisAmount>1000</ram:BasisAmount>
<ram:ActualAmount>100</ram:ActualAmount>
<ram:ReasonCode>CAO</ram:ReasonCode>
<ram:Reason>Lagerware</ram:Reason>
</ram:SpecifiedTradeAllowanceCharge>
<ram:SpecifiedTradeAllowanceCharge>
<ram:ChargeIndicator>
<udt:Indicator>false</udt:Indicator>
</ram:ChargeIndicator>
<ram:BasisAmount>1000</ram:BasisAmount>
<ram:ActualAmount>50</ram:ActualAmount>
<ram:ReasonCode>ADZ</ram:ReasonCode>
<ram:Reason>Direktbelieferung</ram:Reason>
</ram:SpecifiedTradeAllowanceCharge>
<ram:SpecifiedTradeSettlementLineMonetarySummation>
<ram:LineTotalAmount>850</ram:LineTotalAmount>
</ram:SpecifiedTradeSettlementLineMonetarySummation>
</ram:SpecifiedLineTradeSettlement>
</ram:IncludedSupplyChainTradeLineItem>
<ram:ApplicableHeaderTradeAgreement>
<ram:SellerTradeParty>
<ram:ID>12345676</ram:ID>
<ram:Name>Rohstoff AG Salzgitter</ram:Name>
<ram:PostalTradeAddress>
<ram:PostcodeCode>38226</ram:PostcodeCode>
<ram:LineOne>Marktstr. 153</ram:LineOne>
<ram:CityName>Salzgitter</ram:CityName>
<ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
<ram:SpecifiedTaxRegistration>
<ram:ID schemeID="VA">DE123456789</ram:ID>
</ram:SpecifiedTaxRegistration>
</ram:SellerTradeParty>
<ram:BuyerTradeParty>
<ram:ID>75969813</ram:ID>
<ram:Name>Metallbau Leipzig GmbH &amp; Co. KG</ram:Name>
<ram:PostalTradeAddress>
<ram:PostcodeCode>12345</ram:PostcodeCode>
<ram:LineOne>Pappelallee 15</ram:LineOne>
<ram:LineTwo>Hof 3</ram:LineTwo>
<ram:CityName>Leipzig</ram:CityName>
<ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
<ram:URIUniversalCommunication>
<ram:URIID schemeID="9958">04 0 11 000 - 12345 12345 - 35</ram:URIID>
</ram:URIUniversalCommunication>
</ram:BuyerTradeParty>
<ram:SellerTaxRepresentativeTradeParty>
<ram:Name>Global Supplies Financial Services</ram:Name>
<ram:PostalTradeAddress>
<ram:PostcodeCode>12345</ram:PostcodeCode>
<ram:LineOne>Friedrichstraße 165</ram:LineOne>
<ram:CityName>Berlin</ram:CityName>
<ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
<ram:SpecifiedTaxRegistration>
<ram:ID schemeID="VA">DE1334567</ram:ID>
</ram:SpecifiedTaxRegistration>
</ram:SellerTaxRepresentativeTradeParty>
</ram:ApplicableHeaderTradeAgreement>
<ram:ApplicableHeaderTradeDelivery>
<ram:ShipToTradeParty>
<ram:ID>75969815</ram:ID>
<ram:Name>Metallbau Leipzig GmbH &amp; Co. KG</ram:Name>
<ram:PostalTradeAddress>
<ram:PostcodeCode>12347</ram:PostcodeCode>
<ram:LineOne>Eichenpromenade 37</ram:LineOne>
<ram:LineTwo>Tor 1</ram:LineTwo>
<ram:CityName>Metallstadt</ram:CityName>
<ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
<ram:URIUniversalCommunication>
<ram:URIID schemeID="0060">999999999</ram:URIID>
</ram:URIUniversalCommunication>
</ram:ShipToTradeParty>
</ram:ApplicableHeaderTradeDelivery>
<ram:ApplicableHeaderTradeSettlement>
<ram:TaxCurrencyCode>EUR</ram:TaxCurrencyCode>
<ram:InvoiceCurrencyCode>GBP</ram:InvoiceCurrencyCode>
<ram:PayeeTradeParty>
<ram:GlobalID schemeID="0060">432156789</ram:GlobalID>
<ram:Name>Global Supplies Financial Services</ram:Name>
<ram:PostalTradeAddress>
<ram:PostcodeCode>12345</ram:PostcodeCode>
<ram:LineOne>Friedrichstraße 165</ram:LineOne>
<ram:CityName>Berlin</ram:CityName>
<ram:CountryID>DE</ram:CountryID>
</ram:PostalTradeAddress>
</ram:PayeeTradeParty>
<ram:TaxApplicableTradeCurrencyExchange>
<ram:SourceCurrencyCode>GBP</ram:SourceCurrencyCode>
<ram:TargetCurrencyCode>EUR</ram:TargetCurrencyCode>
<ram:ConversionRate>1.12244</ram:ConversionRate>
<ram:ConversionRateDateTime>
<udt:DateTimeString format="102">20181031</udt:DateTimeString>
</ram:ConversionRateDateTime>
</ram:TaxApplicableTradeCurrencyExchange>
<ram:SpecifiedTradeSettlementPaymentMeans>
<ram:TypeCode>58</ram:TypeCode>
<ram:PayeePartyCreditorFinancialAccount>
<ram:IBANID>DE12 1234 4321 9876 00</ram:IBANID>
<ram:AccountName>Global Supplies Financial Services</ram:AccountName>
</ram:PayeePartyCreditorFinancialAccount>
</ram:SpecifiedTradeSettlementPaymentMeans>
<ram:ApplicableTradeTax>
<ram:CalculatedAmount>163.16</ram:CalculatedAmount>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:BasisAmount>858.75</ram:BasisAmount>
<ram:LineTotalBasisAmount>850</ram:LineTotalBasisAmount>
<ram:AllowanceChargeBasisAmount>8.75</ram:AllowanceChargeBasisAmount>
<ram:CategoryCode>S</ram:CategoryCode>
<ram:RateApplicablePercent>19</ram:RateApplicablePercent>
</ram:ApplicableTradeTax>
<ram:BillingSpecifiedPeriod>
<ram:StartDateTime>
<udt:DateTimeString format="102">20181001</udt:DateTimeString>
</ram:StartDateTime>
<ram:EndDateTime>
<udt:DateTimeString format="102">20181031</udt:DateTimeString>
</ram:EndDateTime>
</ram:BillingSpecifiedPeriod>
<ram:SpecifiedTradeAllowanceCharge>
<ram:ChargeIndicator>
<udt:Indicator>true</udt:Indicator>
</ram:ChargeIndicator>
<ram:ActualAmount>30</ram:ActualAmount>
<ram:ReasonCode>ABK</ram:ReasonCode>
<ram:Reason>Einwegverpackung</ram:Reason>
<ram:CategoryTradeTax>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:CategoryCode>S</ram:CategoryCode>
<ram:RateApplicablePercent>19</ram:RateApplicablePercent>
</ram:CategoryTradeTax>
</ram:SpecifiedTradeAllowanceCharge>
<ram:SpecifiedTradeAllowanceCharge>
<ram:ChargeIndicator>
<udt:Indicator>false</udt:Indicator>
</ram:ChargeIndicator>
<ram:CalculationPercent>2.5</ram:CalculationPercent>
<ram:BasisAmount>850</ram:BasisAmount>
<ram:ActualAmount>21.25</ram:ActualAmount>
<ram:ReasonCode>ABK</ram:ReasonCode>
<ram:Reason>Stammkundenrabatt</ram:Reason>
<ram:CategoryTradeTax>
<ram:TypeCode>VAT</ram:TypeCode>
<ram:CategoryCode>S</ram:CategoryCode>
<ram:RateApplicablePercent>19</ram:RateApplicablePercent>
</ram:CategoryTradeTax>
</ram:SpecifiedTradeAllowanceCharge>
<ram:SpecifiedTradePaymentTerms>
<ram:Description>Zahlbar ohne Abschlag bis </ram:Description>
<ram:DueDateDateTime>
<udt:DateTimeString format="102">20181120</udt:DateTimeString>
</ram:DueDateDateTime>
</ram:SpecifiedTradePaymentTerms>
<ram:SpecifiedTradePaymentTerms>
<ram:Description>Zahlbar mit 2% Skonto bis</ram:Description>
<ram:DueDateDateTime>
<udt:DateTimeString format="102">20181114</udt:DateTimeString>
</ram:DueDateDateTime>
</ram:SpecifiedTradePaymentTerms>
<ram:SpecifiedTradeSettlementHeaderMonetarySummation>
<ram:LineTotalAmount>850</ram:LineTotalAmount>
<ram:ChargeTotalAmount>30</ram:ChargeTotalAmount>
<ram:AllowanceTotalAmount>21.25</ram:AllowanceTotalAmount>
<ram:TaxBasisTotalAmount>858.75</ram:TaxBasisTotalAmount>
<ram:TaxTotalAmount currencyID="GBP">163.16</ram:TaxTotalAmount>
<ram:TaxTotalAmount currencyID="EUR">183.14</ram:TaxTotalAmount>
<ram:GrandTotalAmount>1021.91</ram:GrandTotalAmount>
<ram:TotalPrepaidAmount>500</ram:TotalPrepaidAmount>
<ram:DuePayableAmount>521.91</ram:DuePayableAmount>
</ram:SpecifiedTradeSettlementHeaderMonetarySummation>
</ram:ApplicableHeaderTradeSettlement>
</rsm:SupplyChainTradeTransaction>
</rsm:CrossIndustryInvoice>
Loading

0 comments on commit 5b864fe

Please sign in to comment.