-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ruff
committed
Jul 17, 2024
1 parent
9a66751
commit 516fc28
Showing
5 changed files
with
216 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
<?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:GuidelineSpecifiedDocumentContextParameter> | ||
<ram:ID>urn:cen.eu:en16931:2017</ram:ID> | ||
</ram:GuidelineSpecifiedDocumentContextParameter> | ||
</rsm:ExchangedDocumentContext> | ||
<rsm:ExchangedDocument> | ||
<ram:ID>471102</ram:ID> | ||
<ram:TypeCode>380</ram:TypeCode> | ||
<ram:IssueDateTime> | ||
<udt:DateTimeString format="102">20180305</udt:DateTimeString> | ||
</ram:IssueDateTime> | ||
<ram:IncludedNote> | ||
<ram:Content>Rechnung gemäß Bestellung vom 01.03.2018.</ram:Content> | ||
</ram:IncludedNote> | ||
<ram:IncludedNote> | ||
<ram:Content>Lieferant GmbH | ||
Lieferantenstraße 20 | ||
80333 München | ||
Deutschland | ||
Geschäftsführer: Hans Muster | ||
Handelsregisternummer: H A 123 | ||
</ram:Content> | ||
<ram:SubjectCode>REG</ram:SubjectCode> | ||
</ram:IncludedNote> | ||
</rsm:ExchangedDocument> | ||
<rsm:SupplyChainTradeTransaction> | ||
<ram:IncludedSupplyChainTradeLineItem> | ||
<ram:AssociatedDocumentLineDocument> | ||
<ram:LineID>1</ram:LineID> | ||
</ram:AssociatedDocumentLineDocument> | ||
<ram:SpecifiedTradeProduct> | ||
<ram:GlobalID schemeID="0160">4012345001235</ram:GlobalID> | ||
<ram:SellerAssignedID>TB100A4</ram:SellerAssignedID> | ||
<ram:Name>Trennblätter A4</ram:Name> | ||
</ram:SpecifiedTradeProduct> | ||
<ram:SpecifiedLineTradeAgreement> | ||
<ram:GrossPriceProductTradePrice> | ||
<ram:ChargeAmount>9.9000</ram:ChargeAmount> | ||
</ram:GrossPriceProductTradePrice> | ||
<ram:NetPriceProductTradePrice> | ||
<ram:ChargeAmount>9.9000</ram:ChargeAmount> | ||
</ram:NetPriceProductTradePrice> | ||
</ram:SpecifiedLineTradeAgreement> | ||
<ram:SpecifiedLineTradeDelivery> | ||
<ram:BilledQuantity unitCode="H87">20.0000</ram:BilledQuantity> | ||
</ram:SpecifiedLineTradeDelivery> | ||
<ram:SpecifiedLineTradeSettlement> | ||
<ram:ApplicableTradeTax> | ||
<ram:TypeCode>VAT</ram:TypeCode> | ||
<ram:CategoryCode>S</ram:CategoryCode> | ||
<ram:RateApplicablePercent>19.00</ram:RateApplicablePercent> | ||
</ram:ApplicableTradeTax> | ||
<ram:SpecifiedTradeSettlementLineMonetarySummation> | ||
<ram:LineTotalAmount>198.00</ram:LineTotalAmount> | ||
</ram:SpecifiedTradeSettlementLineMonetarySummation> | ||
</ram:SpecifiedLineTradeSettlement> | ||
</ram:IncludedSupplyChainTradeLineItem> | ||
<ram:IncludedSupplyChainTradeLineItem> | ||
<ram:AssociatedDocumentLineDocument> | ||
<ram:LineID>2</ram:LineID> | ||
</ram:AssociatedDocumentLineDocument> | ||
<ram:SpecifiedTradeProduct> | ||
<ram:GlobalID schemeID="0160">4000050986428</ram:GlobalID> | ||
<ram:SellerAssignedID>ARNR2</ram:SellerAssignedID> | ||
<ram:Name>Joghurt Banane</ram:Name> | ||
</ram:SpecifiedTradeProduct> | ||
<ram:SpecifiedLineTradeAgreement> | ||
<ram:GrossPriceProductTradePrice> | ||
<ram:ChargeAmount>5.5000</ram:ChargeAmount> | ||
</ram:GrossPriceProductTradePrice> | ||
<ram:NetPriceProductTradePrice> | ||
<ram:ChargeAmount>5.5000</ram:ChargeAmount> | ||
</ram:NetPriceProductTradePrice> | ||
</ram:SpecifiedLineTradeAgreement> | ||
<ram:SpecifiedLineTradeDelivery> | ||
<ram:BilledQuantity unitCode="H87">50.0000</ram:BilledQuantity> | ||
</ram:SpecifiedLineTradeDelivery> | ||
<ram:SpecifiedLineTradeSettlement> | ||
<ram:ApplicableTradeTax> | ||
<ram:TypeCode>VAT</ram:TypeCode> | ||
<ram:CategoryCode>S</ram:CategoryCode> | ||
<ram:RateApplicablePercent>7.00</ram:RateApplicablePercent> | ||
</ram:ApplicableTradeTax> | ||
<ram:SpecifiedTradeSettlementLineMonetarySummation> | ||
<ram:LineTotalAmount>275.00</ram:LineTotalAmount> | ||
</ram:SpecifiedTradeSettlementLineMonetarySummation> | ||
</ram:SpecifiedLineTradeSettlement> | ||
</ram:IncludedSupplyChainTradeLineItem> | ||
<ram:ApplicableHeaderTradeAgreement> | ||
<ram:SellerTradeParty> | ||
<ram:ID>549910</ram:ID> | ||
<ram:GlobalID schemeID="0088">4000001123452</ram:GlobalID> | ||
<ram:Name>Lieferant GmbH</ram:Name> | ||
<ram:PostalTradeAddress> | ||
<ram:PostcodeCode>80333</ram:PostcodeCode> | ||
<ram:LineOne>Lieferantenstraße 20</ram:LineOne> | ||
<ram:CityName>München</ram:CityName> | ||
<ram:CountryID>DE</ram:CountryID> | ||
</ram:PostalTradeAddress> | ||
<ram:SpecifiedTaxRegistration> | ||
<ram:ID schemeID="FC">201/113/40209</ram:ID> | ||
</ram:SpecifiedTaxRegistration> | ||
<ram:SpecifiedTaxRegistration> | ||
<ram:ID schemeID="VA">DE123456789</ram:ID> | ||
</ram:SpecifiedTaxRegistration> | ||
</ram:SellerTradeParty> | ||
<ram:BuyerTradeParty> | ||
<ram:ID>GE2020211</ram:ID> | ||
<ram:Name>Kunden AG Mitte</ram:Name> | ||
<ram:PostalTradeAddress> | ||
<ram:PostcodeCode>69876</ram:PostcodeCode> | ||
<ram:LineOne>Kundenstraße 15</ram:LineOne> | ||
<ram:CityName>Frankfurt</ram:CityName> | ||
<ram:CountryID>DE</ram:CountryID> | ||
</ram:PostalTradeAddress> | ||
</ram:BuyerTradeParty> | ||
</ram:ApplicableHeaderTradeAgreement> | ||
<ram:ApplicableHeaderTradeDelivery> | ||
<ram:ActualDeliverySupplyChainEvent> | ||
<ram:OccurrenceDateTime> | ||
<udt:DateTimeString format="102">20180305</udt:DateTimeString> | ||
</ram:OccurrenceDateTime> | ||
</ram:ActualDeliverySupplyChainEvent> | ||
</ram:ApplicableHeaderTradeDelivery> | ||
<ram:ApplicableHeaderTradeSettlement> | ||
<ram:InvoiceCurrencyCode>EUR</ram:InvoiceCurrencyCode> | ||
<ram:ApplicableTradeTax> | ||
<ram:CalculatedAmount>19.25</ram:CalculatedAmount> | ||
<ram:TypeCode>VAT</ram:TypeCode> | ||
<ram:BasisAmount>275.00</ram:BasisAmount> | ||
<ram:CategoryCode>S</ram:CategoryCode> | ||
<ram:RateApplicablePercent>7.00</ram:RateApplicablePercent> | ||
</ram:ApplicableTradeTax> | ||
<ram:ApplicableTradeTax> | ||
<ram:CalculatedAmount>37.62</ram:CalculatedAmount> | ||
<ram:TypeCode>VAT</ram:TypeCode> | ||
<ram:BasisAmount>198.00</ram:BasisAmount> | ||
<ram:CategoryCode>S</ram:CategoryCode> | ||
<ram:RateApplicablePercent>19.00</ram:RateApplicablePercent> | ||
</ram:ApplicableTradeTax> | ||
<ram:SpecifiedTradePaymentTerms> | ||
<ram:Description>Zahlbar innerhalb 30 Tagen netto bis 04.04.2018, 3% Skonto innerhalb 10 Tagen bis 15.03.2018</ram:Description> | ||
</ram:SpecifiedTradePaymentTerms> | ||
<ram:SpecifiedTradeSettlementHeaderMonetarySummation> | ||
<ram:LineTotalAmount>473.00</ram:LineTotalAmount> | ||
<ram:ChargeTotalAmount>0.00</ram:ChargeTotalAmount> | ||
<ram:AllowanceTotalAmount>0.00</ram:AllowanceTotalAmount> | ||
<ram:TaxBasisTotalAmount>473.00</ram:TaxBasisTotalAmount> | ||
<ram:TaxTotalAmount currencyID="EUR">56.87</ram:TaxTotalAmount> | ||
<ram:GrandTotalAmount>529.87</ram:GrandTotalAmount> | ||
<ram:TotalPrepaidAmount>0.00</ram:TotalPrepaidAmount> | ||
<ram:DuePayableAmount>529.87</ram:DuePayableAmount> | ||
</ram:SpecifiedTradeSettlementHeaderMonetarySummation> | ||
</ram:ApplicableHeaderTradeSettlement> | ||
</rsm:SupplyChainTradeTransaction> | ||
</rsm:CrossIndustryInvoice> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
namespace horstoeko\zugferdublbridge\tests\testcases; | ||
|
||
use horstoeko\zugferdublbridge\tests\TestCase; | ||
use horstoeko\zugferdublbridge\XmlConverterCiiToUbl; | ||
use \horstoeko\zugferdublbridge\tests\traits\HandlesXmlTests; | ||
|
||
class CiiToUblSimpleTest extends TestCase | ||
{ | ||
use HandlesXmlTests; | ||
|
||
public function testLoadAndConvert(): void | ||
{ | ||
self::$document = XmlConverterCiiToUbl::fromFile(dirname(__FILE__) . "/../assets/cii/1_cii_simple.xml")->enableAutomaticMode()->convert(); | ||
$this->assertNotNull(self::$document); | ||
} | ||
|
||
public function testDocumentGeneral(): void | ||
{ | ||
$this->assertXPathValue('/ubl:Invoice/cbc:CustomizationID', "urn:cen.eu:en16931:2017"); | ||
$this->assertXPathValue('/ubl:Invoice/cbc:ProfileID', "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0"); | ||
$this->assertXPathValue('/ubl:Invoice/cbc:ID', "471102"); | ||
$this->assertXPathValue('/ubl:Invoice/cbc:IssueDate', "2018-03-05"); | ||
$this->assertXPathNotExists('/ubl:Invoice/cbc:DueDate'); | ||
$this->assertXPathValue('/ubl:Invoice/cbc:InvoiceTypeCode', "380"); | ||
$this->assertXPathNotExists('/ubl:Invoice/cbc:CreditNoteTypeCode'); | ||
$this->assertXPathValueWithIndex('/ubl:Invoice/cbc:Note', 0, "Rechnung gemäß Bestellung vom 01.03.2018."); | ||
$this->assertXPathValueStartsWithIndex('/ubl:Invoice/cbc:Note', 1, "#REG#Lieferant GmbH"); | ||
$this->assertXPathNotExists('/ubl:Invoice/cbc:TaxPointDate'); | ||
$this->assertXPathValue('/ubl:Invoice/cbc:DocumentCurrencyCode', "EUR"); | ||
$this->assertXPathNotExists('/ubl:Invoice/cbc:TaxCurrencyCode'); | ||
$this->assertXPathNotExists('/ubl:Invoice/cbc:AccountingCost'); | ||
$this->assertXPathNotExists('/ubl:Invoice/cbc:BuyerReference'); | ||
$this->assertXPathNotExists('/ubl:Invoice/cbc:StartDate'); | ||
$this->assertXPathNotExists('/ubl:Invoice/cbc:EndDate'); | ||
$this->assertXPathNotExists('/ubl:Invoice/cac:OrderReference/cbc:ID'); | ||
$this->assertXPathNotExists('/ubl:Invoice/cac:OrderReference/cbc:SalesOrderID'); | ||
$this->assertXPathNotExists('/ubl:Invoice/cac:BillingReference/cac:InvoiceDocumentReference/cbc:ID'); | ||
$this->assertXPathNotExists('/ubl:Invoice/cac:BillingReference/cac:InvoiceDocumentReference/cbc:IssueDate'); | ||
$this->assertXPathNotExists('/ubl:Invoice/cac:DespatchDocumentReference/cbc:ID'); | ||
$this->assertXPathNotExists('/ubl:Invoice/cac:ReceiptDocumentReference/cbc:ID'); | ||
$this->assertXPathNotExists('/ubl:Invoice/cac:AdditionalDocumentReference/cbc:ID'); | ||
$this->assertXPathNotExists('/ubl:Invoice/cac:AdditionalDocumentReference/cbc:DocumentTypeCode'); | ||
$this->assertXPathNotExists('/ubl:Invoice/cac:AdditionalDocumentReference/cbc:DocumentDescription'); | ||
$this->assertXPathNotExists('/ubl:Invoice/cac:AdditionalDocumentReference/cbc:EmbeddedDocumentBinaryObject'); | ||
$this->assertXPathNotExists('/ubl:Invoice/cac:OriginatorDocumentReference/cbc:ID'); | ||
$this->assertXPathNotExists('/ubl:Invoice/cac:ProjectReference/cbc:ID'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters