Facture électronique Peppol
Débuté par alaingrandchamps, 20 aoû. 2024 14:27 - 25 réponses
Posté le 20 août 2024 - 14:27
Bonjour, Je dois comme tout développeur belge réaliser une facture électronique à envoyer à Peppol. Voici le fichier que je dois avoir. <Invoice xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"> <cbc:CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0</cbc:CustomizationID> <cbc:ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</cbc:ProfileID> <cbc:ID>Snippet1</cbc:ID> <cbc:IssueDate>2017-11-13</cbc:IssueDate> <cbc:DueDate>2017-12-01</cbc:DueDate> <cbc:InvoiceTypeCode>380</cbc:InvoiceTypeCode> <cbc:Note>Please note we have a new phone number: 22 22 22 22</cbc:Note> <cbc:TaxPointDate>2017-12-01</cbc:TaxPointDate> <cbc:DocumentCurrencyCode>EUR</cbc:DocumentCurrencyCode> <cbc:TaxCurrencyCode>SEK</cbc:TaxCurrencyCode> <cbc:AccountingCost>4025:123:4343</cbc:AccountingCost> <cbc:BuyerReference>0150abc</cbc:BuyerReference> <cac:InvoicePeriod> <cbc:StartDate>2017-12-01</cbc:StartDate> <cbc:EndDate>2017-12-31</cbc:EndDate> </cac:InvoicePeriod> <cac:OrderReference> <cbc:ID>o-998877</cbc:ID> <cbc:SalesOrderID>so-12343</cbc:SalesOrderID> </cac:OrderReference> <cac:DespatchDocumentReference> <cbc:ID>despadv-3</cbc:ID> </cac:DespatchDocumentReference> <cac:ReceiptDocumentReference> <cbc:ID>resadv-1</cbc:ID> </cac:ReceiptDocumentReference> <cac:OriginatorDocumentReference> <cbc:ID>ppid-123</cbc:ID> </cac:OriginatorDocumentReference> <cac:ContractDocumentReference> <cbc:ID>framework no 1</cbc:ID> </cac:ContractDocumentReference> <cac:AdditionalDocumentReference> <cbc:ID schemeID="ABT">DR35141</cbc:ID> <cbc:DocumentTypeCode>130</cbc:DocumentTypeCode> </cac:AdditionalDocumentReference> <cac:AdditionalDocumentReference> <cbc:ID>ts12345</cbc:ID> <cbc:DocumentDescription>Technical specification</cbc:DocumentDescription> <cac:Attachment> <cac:ExternalReference> <cbc:URI>www.techspec.no </cac:ExternalReference> </cac:Attachment> </cac:AdditionalDocumentReference> <cac:AdditionalDocumentReference> <cbc:ID>mr4343</cbc:ID> <cbc:DocumentDescription>milage report</cbc:DocumentDescription> <cac:Attachment> <cbc:EmbeddedDocumentBinaryObject mimeCode="text/csv" filename="milage.csv">aHR0cHM6Ly90ZXN0LXZlZmEuZGlmaS5uby9wZXBwb2xiaXMvcG9hY2MvYmlsbGluZy8zLjAvYmlzLw==</cbc:EmbeddedDocumentBinaryObject> </cac:Attachment> </cac:AdditionalDocumentReference> <cac:ProjectReference> <cbc:ID>project333</cbc:ID> </cac:ProjectReference> <cac:AccountingSupplierParty> <cac:Party> <cbc:EndpointID schemeID="0088">7300010000001</cbc:EndpointID> <cac:PartyIdentification> <cbc:ID>99887766</cbc:ID> </cac:PartyIdentification> <cac:PartyName> <cbc:Name>SupplierTradingName Ltd.</cbc:Name> </cac:PartyName> <cac:PostalAddress> <cbc:StreetName>Main street 1</cbc:StreetName> <cbc:AdditionalStreetName>Postbox 123</cbc:AdditionalStreetName> <cbc:CityName>London</cbc:CityName> <cbc:PostalZone>GB 123 EW</cbc:PostalZone> <cbc:CountrySubentity>West London district</cbc:CountrySubentity> <cac:AddressLine> <cbc:Line>Third address line</cbc:Line> </cac:AddressLine> <cac:Country> <cbc:IdentificationCode>GB</cbc:IdentificationCode> </cac:Country> </cac:PostalAddress> <cac:PartyTaxScheme> <cbc:CompanyID>GB1232434</cbc:CompanyID> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:PartyTaxScheme> <cac:PartyTaxScheme> <cbc:CompanyID>Foretaksregisteret</cbc:CompanyID> <cac:TaxScheme> <cbc:ID>TAX</cbc:ID> </cac:TaxScheme> </cac:PartyTaxScheme> <cac:PartyLegalEntity> <cbc:RegistrationName>SupplierOfficialName Ltd</cbc:RegistrationName> <cbc:CompanyID>GB983294</cbc:CompanyID> <cbc:CompanyLegalForm>AdditionalLegalInformation</cbc:CompanyLegalForm> </cac:PartyLegalEntity> <cac:Contact> <cbc:Name>John Doe</cbc:Name> <cbc:Telephone>9384203984</cbc:Telephone> <cbc:ElectronicMail>john.doe@foo.bar</cbc:ElectronicMail> </cac:Contact> </cac:Party> </cac:AccountingSupplierParty> <cac:AccountingCustomerParty> <cac:Party> <cbc:EndpointID schemeID="0002">FR23342</cbc:EndpointID> <cac:PartyIdentification> <cbc:ID schemeID="0002">FR23342</cbc:ID> </cac:PartyIdentification> <cac:PartyName> <cbc:Name>BuyerTradingName AS</cbc:Name> </cac:PartyName> <cac:PostalAddress> <cbc:StreetName>Hovedgatan 32</cbc:StreetName> <cbc:AdditionalStreetName>Po box 878</cbc:AdditionalStreetName> <cbc:CityName>Stockholm</cbc:CityName> <cbc:PostalZone>456 34</cbc:PostalZone> <cbc:CountrySubentity>Södermalm</cbc:CountrySubentity> <cac:AddressLine> <cbc:Line>Third line</cbc:Line> </cac:AddressLine> <cac:Country> <cbc:IdentificationCode>SE</cbc:IdentificationCode> </cac:Country> </cac:PostalAddress> <cac:PartyTaxScheme> <cbc:CompanyID>SE4598375937</cbc:CompanyID> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:PartyTaxScheme> <cac:PartyLegalEntity> <cbc:RegistrationName>Buyer Official Name</cbc:RegistrationName> <cbc:CompanyID schemeID="0183">39937423947</cbc:CompanyID> </cac:PartyLegalEntity> <cac:Contact> <cbc:Name>Lisa Johnson</cbc:Name> <cbc:Telephone>23434234</cbc:Telephone> <cbc:ElectronicMail>lj@buyer.se</cbc:ElectronicMail> </cac:Contact> </cac:Party> </cac:AccountingCustomerParty> <cac:PayeeParty> <cac:PartyIdentification> <cbc:ID schemeID="0088">7300010000001</cbc:ID> </cac:PartyIdentification> <cac:PartyName> <cbc:Name>Payee party</cbc:Name> </cac:PartyName> <cac:PartyLegalEntity> <cbc:CompanyID schemeID="0088">7300010000001</cbc:CompanyID> </cac:PartyLegalEntity> </cac:PayeeParty> <cac:TaxRepresentativeParty> <cac:PartyName> <cbc:Name>TaxRepresentative Name</cbc:Name> </cac:PartyName> <cac:PostalAddress> <cbc:StreetName>Regent street 32</cbc:StreetName> <cbc:AdditionalStreetName>Building 23</cbc:AdditionalStreetName> <cbc:CityName>London</cbc:CityName> <cbc:PostalZone>23W 45H</cbc:PostalZone> <cbc:CountrySubentity>Subentity</cbc:CountrySubentity> <cac:AddressLine> <cbc:Line>Back door</cbc:Line> </cac:AddressLine> <cac:Country> <cbc:IdentificationCode>GB</cbc:IdentificationCode> </cac:Country> </cac:PostalAddress> <cac:PartyTaxScheme> <cbc:CompanyID>GB122324324535</cbc:CompanyID> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:PartyTaxScheme> </cac:TaxRepresentativeParty> <cac:Delivery> <cbc:ActualDeliveryDate>2017-11-01</cbc:ActualDeliveryDate> <cac:DeliveryLocation> <cbc:ID schemeID="0088">7300010000001</cbc:ID> <cac:Address> <cbc:StreetName>Delivery street 2</cbc:StreetName> <cbc:AdditionalStreetName>Building 56</cbc:AdditionalStreetName> <cbc:CityName>Stockholm</cbc:CityName> <cbc:PostalZone>21234</cbc:PostalZone> <cbc:CountrySubentity>Södermalm</cbc:CountrySubentity> <cac:AddressLine> <cbc:Line>Gate 15</cbc:Line> </cac:AddressLine> <cac:Country> <cbc:IdentificationCode>SE</cbc:IdentificationCode> </cac:Country> </cac:Address> </cac:DeliveryLocation> <cac:DeliveryParty> <cac:PartyName> <cbc:Name>Delivery party Name</cbc:Name> </cac:PartyName> </cac:DeliveryParty> </cac:Delivery> <cac:PaymentMeans> <cbc:PaymentMeansCode name="Credit transfer">30</cbc:PaymentMeansCode> <cbc:PaymentID>Snippet1</cbc:PaymentID> <cac:PayeeFinancialAccount> <cbc:ID>IBAN32423940</cbc:ID> <cbc:Name>AccountName</cbc:Name> <cac:FinancialInstitutionBranch> <cbc:ID>BIC324098</cbc:ID> </cac:FinancialInstitutionBranch> </cac:PayeeFinancialAccount> </cac:PaymentMeans> <cac:PaymentTerms> <cbc:Note>Payment within 10 days, 2% discount</cbc:Note> </cac:PaymentTerms> <!-- tag::allowance1[] --> <cac:AllowanceCharge> <cbc:ChargeIndicator>true</cbc:ChargeIndicator> <cbc:AllowanceChargeReasonCode>CG</cbc:AllowanceChargeReasonCode> <cbc:AllowanceChargeReason>Cleaning</cbc:AllowanceChargeReason> <cbc:MultiplierFactorNumeric>20</cbc:MultiplierFactorNumeric> <!-- 2 --> <cbc:Amount currencyID="EUR">200</cbc:Amount> <!-- 3 --> <cbc:BaseAmount currencyID="EUR">1000</cbc:BaseAmount> <!-- 1 --> <cac:TaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>25</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:TaxCategory> </cac:AllowanceCharge> <!-- end::allowance1[] --> <!-- tag::allowance2[] --> <cac:AllowanceCharge> <cbc:ChargeIndicator>false</cbc:ChargeIndicator> <cbc:AllowanceChargeReasonCode>95</cbc:AllowanceChargeReasonCode> <cbc:AllowanceChargeReason>Discount</cbc:AllowanceChargeReason> <cbc:Amount currencyID="EUR">200</cbc:Amount> <!-- 1 --> <cac:TaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>25</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:TaxCategory> </cac:AllowanceCharge> <!-- end::allowance2[] --> <cac:TaxTotal> <cbc:TaxAmount currencyID="EUR">1225.00</cbc:TaxAmount> <cac:TaxSubtotal> <cbc:TaxableAmount currencyID="EUR">4900.0</cbc:TaxableAmount> <cbc:TaxAmount currencyID="EUR">1225</cbc:TaxAmount> <cac:TaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>25</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:TaxCategory> </cac:TaxSubtotal> <cac:TaxSubtotal> <cbc:TaxableAmount currencyID="EUR">1000.0</cbc:TaxableAmount> <cbc:TaxAmount currencyID="EUR">0</cbc:TaxAmount> <cac:TaxCategory> <cbc:ID>E</cbc:ID> <cbc:Percent>0</cbc:Percent> <cbc:TaxExemptionReason>Reason for tax exempt</cbc:TaxExemptionReason> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:TaxCategory> </cac:TaxSubtotal> </cac:TaxTotal> <cac:TaxTotal> <cbc:TaxAmount currencyID="SEK">9324.00</cbc:TaxAmount> </cac:TaxTotal> <cac:LegalMonetaryTotal> <cbc:LineExtensionAmount currencyID="EUR">5900</cbc:LineExtensionAmount> <cbc:TaxExclusiveAmount currencyID="EUR">5900</cbc:TaxExclusiveAmount> <cbc:TaxInclusiveAmount currencyID="EUR">7125</cbc:TaxInclusiveAmount> <cbc:AllowanceTotalAmount currencyID="EUR">200</cbc:AllowanceTotalAmount> <cbc:ChargeTotalAmount currencyID="EUR">200</cbc:ChargeTotalAmount> <cbc:PrepaidAmount currencyID="EUR">1000</cbc:PrepaidAmount> <cbc:PayableAmount currencyID="EUR">6125.00</cbc:PayableAmount> </cac:LegalMonetaryTotal> <cac:InvoiceLine> <cbc:ID>1</cbc:ID> <cbc:Note>Testing note on line level</cbc:Note> <cbc:InvoicedQuantity unitCode="C62">10</cbc:InvoicedQuantity> <cbc:LineExtensionAmount currencyID="EUR">4000.00</cbc:LineExtensionAmount> <cbc:AccountingCost>Konteringsstreng</cbc:AccountingCost> <cac:InvoicePeriod> <cbc:StartDate>2017-12-01</cbc:StartDate> <cbc:EndDate>2017-12-05</cbc:EndDate> </cac:InvoicePeriod> <cac:OrderLineReference> <cbc:LineID>123</cbc:LineID> </cac:OrderLineReference> <cac:DocumentReference> <!-- schemeID not validated from TC434 --> <!-- Code AWV from UNCL1153 are phone number --> <cbc:ID schemeID="AWV">Mobile number 1223432432</cbc:ID> <cbc:DocumentTypeCode>130</cbc:DocumentTypeCode> </cac:DocumentReference> <cac:AllowanceCharge> <cbc:ChargeIndicator>true</cbc:ChargeIndicator> <cbc:AllowanceChargeReasonCode>CG</cbc:AllowanceChargeReasonCode> <cbc:AllowanceChargeReason>Cleaning</cbc:AllowanceChargeReason> <cbc:MultiplierFactorNumeric>1</cbc:MultiplierFactorNumeric> <cbc:Amount currencyID="EUR">1</cbc:Amount> <cbc:BaseAmount currencyID="EUR">100</cbc:BaseAmount> </cac:AllowanceCharge> <cac:AllowanceCharge> <cbc:ChargeIndicator>false</cbc:ChargeIndicator> <cbc:AllowanceChargeReasonCode>95</cbc:AllowanceChargeReasonCode> <cbc:AllowanceChargeReason>Discount</cbc:AllowanceChargeReason> <cbc:Amount currencyID="EUR">101</cbc:Amount> </cac:AllowanceCharge> <cac:Item> <cbc:Description>Description of item</cbc:Description> <cbc:Name>item name</cbc:Name> <cac:BuyersItemIdentification> <cbc:ID>lfjsdlfkj</cbc:ID> </cac:BuyersItemIdentification> <cac:SellersItemIdentification> <cbc:ID>97iugug876</cbc:ID> </cac:SellersItemIdentification> <cac:StandardItemIdentification> <cbc:ID schemeID="0088">7300010000001</cbc:ID> </cac:StandardItemIdentification> <cac:OriginCountry> <cbc:IdentificationCode>NO</cbc:IdentificationCode> </cac:OriginCountry> <cac:CommodityClassification> <!-- SRV= GTIN --> <cbc:ItemClassificationCode listID="SRV">09348023</cbc:ItemClassificationCode> </cac:CommodityClassification> <cac:ClassifiedTaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>25.0</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:ClassifiedTaxCategory> <cac:AdditionalItemProperty> <cbc:Name>AdditionalItemName</cbc:Name> <cbc:Value>AdditionalItemValue</cbc:Value> </cac:AdditionalItemProperty> </cac:Item> <!-- tag::price[] --> <cac:Price> <cbc:PriceAmount currencyID="EUR">410</cbc:PriceAmount> <!-- 3 --> <cbc:BaseQuantity unitCode="C62">1</cbc:BaseQuantity> <cac:AllowanceCharge> <cbc:ChargeIndicator>false</cbc:ChargeIndicator> <cbc:Amount currencyID="EUR">40</cbc:Amount> <!-- 2 --> <cbc:BaseAmount currencyID="EUR">450</cbc:BaseAmount> <!-- 1 --> </cac:AllowanceCharge> </cac:Price> <!-- end::price[] --> </cac:InvoiceLine> <cac:InvoiceLine> <cbc:ID>2</cbc:ID> <cbc:Note>Testing note on line level</cbc:Note> <!-- tag::lineamount[] --> <cbc:InvoicedQuantity unitCode="C62">10</cbc:InvoicedQuantity> <!-- 3 --> <cbc:LineExtensionAmount currencyID="EUR">1000.00</cbc:LineExtensionAmount> <!-- 4 --> <!-- Code omitted for clarity --> <!-- end::lineamount[] --> <cbc:AccountingCost>Konteringsstreng</cbc:AccountingCost> <cac:InvoicePeriod> <cbc:StartDate>2017-12-01</cbc:StartDate> <cbc:EndDate>2017-12-05</cbc:EndDate> </cac:InvoicePeriod> <cac:OrderLineReference> <cbc:LineID>124</cbc:LineID> </cac:OrderLineReference> <cac:Item> <cbc:Description>Description of item</cbc:Description> <cbc:Name>item name</cbc:Name> <cac:SellersItemIdentification> <cbc:ID>97iugug876</cbc:ID> </cac:SellersItemIdentification> <cac:StandardItemIdentification> <cbc:ID schemeID="0088">7300010000001</cbc:ID> </cac:StandardItemIdentification> <cac:CommodityClassification> <!-- SRV= GTIN --> <cbc:ItemClassificationCode listID="SRV">86776</cbc:ItemClassificationCode> </cac:CommodityClassification> <cac:ClassifiedTaxCategory> <cbc:ID>E</cbc:ID> <cbc:Percent>0.0</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:ClassifiedTaxCategory> <cac:AdditionalItemProperty> <cbc:Name>AdditionalItemName</cbc:Name> <cbc:Value>AdditionalItemValue</cbc:Value> </cac:AdditionalItemProperty> </cac:Item> <!-- tag::lineamount[] --> <cac:Price> <cbc:PriceAmount currencyID="EUR">200</cbc:PriceAmount> <!-- 1 --> <cbc:BaseQuantity unitCode="C62">2</cbc:BaseQuantity> <!-- 2 --> </cac:Price> <!-- end::lineamount[] --> </cac:InvoiceLine> <cac:InvoiceLine> <cbc:ID>3</cbc:ID> <cbc:Note>Testing note on line level</cbc:Note> <!-- tag::lineamount2[] --> <cbc:InvoicedQuantity unitCode="C62">10</cbc:InvoicedQuantity> <!-- 4 --> <cbc:LineExtensionAmount currencyID="EUR">900.00</cbc:LineExtensionAmount> <!-- 5 --> <!-- Code omitted for clarity --> <!-- end::lineamount2[] --> <cbc:AccountingCost>Konteringsstreng</cbc:AccountingCost> <cac:InvoicePeriod> <cbc:StartDate>2017-12-01</cbc:StartDate> <cbc:EndDate>2017-12-05</cbc:EndDate> </cac:InvoicePeriod> <cac:OrderLineReference> <cbc:LineID>124</cbc:LineID> </cac:OrderLineReference> <!-- tag::lineamount2[] --> <cac:AllowanceCharge> <cbc:ChargeIndicator>true</cbc:ChargeIndicator> <cbc:AllowanceChargeReasonCode>CG</cbc:AllowanceChargeReasonCode> <cbc:AllowanceChargeReason>Charge</cbc:AllowanceChargeReason> <cbc:MultiplierFactorNumeric>1</cbc:MultiplierFactorNumeric> <cbc:Amount currencyID="EUR">1</cbc:Amount> <!-- 2 --> <cbc:BaseAmount currencyID="EUR">100</cbc:BaseAmount> </cac:AllowanceCharge> <cac:AllowanceCharge> <cbc:ChargeIndicator>false</cbc:ChargeIndicator> <cbc:AllowanceChargeReasonCode>95</cbc:AllowanceChargeReasonCode> <cbc:AllowanceChargeReason>Discount</cbc:AllowanceChargeReason> <cbc:Amount currencyID="EUR">101</cbc:Amount> <!-- 3 --> </cac:AllowanceCharge> <!-- Code omitted for clarity --> <!-- end::lineamount2[] --> <cac:Item> <cbc:Description>Description of item</cbc:Description> <cbc:Name>item name</cbc:Name> <cac:SellersItemIdentification> <cbc:ID>97iugug876</cbc:ID> </cac:SellersItemIdentification> <cac:StandardItemIdentification> <cbc:ID schemeID="0088">7300010000001</cbc:ID> </cac:StandardItemIdentification> <cac:CommodityClassification> <!-- SRV= GTIN --> <cbc:ItemClassificationCode listID="SRV">86776</cbc:ItemClassificationCode> </cac:CommodityClassification> <cac:ClassifiedTaxCategory> <cbc:ID>S</cbc:ID> <cbc:Percent>25.0</cbc:Percent> <cac:TaxScheme> <cbc:ID>VAT</cbc:ID> </cac:TaxScheme> </cac:ClassifiedTaxCategory> <cac:AdditionalItemProperty> <cbc:Name>AdditionalItemName</cbc:Name> <cbc:Value>AdditionalItemValue</cbc:Value> </cac:AdditionalItemProperty> </cac:Item> <!-- tag::lineamount2[] --> <cac:Price> <cbc:PriceAmount currencyID="EUR">100</cbc:PriceAmount> <!-- 1 --> </cac:Price> <!-- end::lineamount2[] --> </cac:InvoiceLine> </Invoice> Voici ce que j'obtiens après exécution de mon code <Invoice xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"> <CustomizationID>urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0</CustomizationID> <ProfileID>urn:fdc:peppol.eu:2017:poacc:billing:01:1.0</ProfileID> <ID>Snippet1</ID> <IssueDate>2023-09-09</IssueDate> <DueDate>2023-09-09</DueDate> <InvoiceTypeCode>380</InvoiceTypeCode> </Invoice> Mon problème est l'absence des "cbc" (dans la ligne <CustomizationID> et les suivantes. Voici la partie de code qui génère le xml // création du fichier xml // Déclaration d'une variable xmlDocument utilisant un modèle de document xmlFacture est un xmlDocument, description = Calc.xml noeudRacine est un xmlNoeud dynamique nameSpace est un xmlNamespace XMLDocument(DocXML,"") // Crée un document XML vierge // Création de la racine noeudRacine = xmlFacture.Invoice nameSpace.Nom = "cac" nameSpace.URI = "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" Ajoute(noeudRacine..NamespaceDéclaré,nameSpace) nameSpace..Nom = "cbc" nameSpace..URI = "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" Ajoute(noeudRacine..NamespaceDéclaré,nameSpace) nameSpace..Nom = "" nameSpace..URI = "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" Ajoute(noeudRacine..NamespaceDéclaré,nameSpace) xmlFacture.Invoice.CustomizationID = "urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0" xmlFacture.Invoice.ProfileID = "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0" xmlFacture.Invoice.ID = "Snippet1" xmlFacture.Invoice.IssueDate = sDatefacture xmlFacture.Invoice.DueDate = sDateecheance xmlFacture.Invoice.InvoiceTypeCode = "380" XMLSauve(xmlFacture, SysRep(srMesDocuments) + ["\"] + ... "Liste_Factures.xml", XMLDocumentDéfaut)
Posté le 21 août 2024 - 08:53
Oups ma question a été envoyée trop rapidement. Je demande donc à ceux qui ont déjà développé leur module de facturation électronique..ou les calés en xml (pour ma part ce n'est pas ma tasse de thé) de m'aider à débloquer ma procédure. Merci déjà à ceux qui me répondront.
Membre enregistré 197 messages
Posté le 21 août 2024 - 09:02
Bonjour j'ai commencé à m'intéresser à l'export au format ubl j'avais le même problème pour les préfixes , j'ai procédé en indiquant des quotes un extrait de code xml_ubl est un xmlDocument nd_invoice est un xmlNoeud Namespace_invoice est un xmlNamespace Namespace_cac est un xmlNamespace Namespace_cbc est un xmlNamespace Namespace_cac.. Nom = "cac" Namespace_cbc.. Nom = "cbc" Namespace_invoice.. URI = "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" Namespace_cac.. URI = "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" Namespace_cbc.. URI = "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" nd_invoice.. Nom = "Invoice" nd_invoice.. NamespaceDéclaré.Ajoute ( Namespace_cac) nd_invoice.. NamespaceDéclaré.Ajoute ( Namespace_cbc) nd_invoice.. NamespaceDéclaré.Ajoute ( Namespace_invoice) nd_invoice. ' cbc: C ustomizationID ' = "urn:cen.eu:en16931:2017#conformant#urn:UBL.BE:1.0.0.20180214" nd_invoice. ' cbc: ProfileID' = "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0" Ajoute ( xml_ubl, nd_invoice) s Ch_xml est une chaîne = XMLConstruitChaîne ( xml_ubl, XMLMiseEnForme )
Message modifié, 21 août 2024 - 09:02
Posté le 21 août 2024 - 13:54
Merci Nicolas, Ton code fonctionne parfaitement. Les quotes il fallait y penser ! J'ai encore un petit souci pour générer la suite qui ne se décale pas par rapport à la racine. J'ai essayé plusieurs pistes dont XMLAjouteFils suivi de XMLAjouteAttribut. Mais cela ne fonctionne pas ! Faut-il déclarer un autre xmlspace ? J'ai réellement de la peine à jouer avec le xml ! Encore merci de ta collaboration. Alain
Membre enregistré 859 messages
Posté le 21 août 2024 - 15:13
Bonjour, Avez-vous pensé à jeter un coup d'œil sur le dépot PCSoft :https://depot.pcsoft.fr/search.awp… Les projets sont pour Factur-X pour la France mais l'objectif est semblable, vous pourriez peut-être trouver des pistes. Cdlt
Posté le 21 août 2024 - 15:51
Bonjour Cedric, En effet j'avais déjà regardé le dépôt PCSoft mais la manière de procéder est différente car en France vous générer le fichier à partir d'un PDF. Merci de votre information, Alain
Posté le 22 août 2024 - 18:12
Bonjour Nicolas, J'ai toujours des soucis pour ajouter les attributs. Voici mon code xmlFacture est un xmlDocument , Description = C alc.xml x Attribut est un xmlAttribut el_invoice est un xmlNoeud Namespace_invoice est un xmlNamespace Namespace_cac est un xmlNamespace Namespace_cbc est un xmlNamespace XMLDocument ( DocXML, "" ) Namespace_cac.. Nom = "cac" Namespace_cbc.. Nom = "cbc" Namespace_invoice.. URI = "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" Namespace_cac.. URI = "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" Namespace_cbc.. URI = "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" el_invoice.. Nom = "Invoice" el_invoice.. NamespaceDéclaré.Ajoute ( Namespace_cac) el_invoice.. NamespaceDéclaré.Ajoute ( Namespace_cbc) el_invoice.. NamespaceDéclaré.Ajoute ( Namespace_invoice) el_invoice. ' cbc: C ustomizationID ' = "urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0" el_invoice. ' cbc: ProfileID' = "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0" el_invoice. ' cbc: ID' = "Snippet1" el_invoice. ' cbc: IssueDate' = s Datefacture el_invoice. ' cbc: DueDate' = s Dateecheance el_invoice. ' cbc: InvoiceTypeCode' = "380" el_invoice. ' cbc: DocumentCurrencyCode' = "EUR" el_invoice. ' cbc: TaxCurrencyCode' = "EUR" el_invoice. ' cac: OrderReference' = "" x Attribut . Nom = "ID" x Attribut . Valeur = "o-998877" Ajoute ( xmlFacture, el_invoice)
Mon problème est de trouver l'instruction qui me permettrait d'ajouter les 2 attributs de "'cac:OrderReference" (ID et SalesOrderID). <cac:OrderReference> <cbc:ID>o-998877</cbc:ID> <cbc:SalesOrderID>so-12343</cbc:SalesOrderID> </cac:OrderReference> Peux-tu encore m'aider afin que je termine ce fichier xml ? Merci d'avance, Alain
Posté le 23 août 2024 - 10:01
Bonjour, je cherche des infos sur la manière d'implémenter une facture electronique au format peppol dans nos logiciel via windev, techniquement parlant aucun soucis mais plutôt sur le contenu / format Je suis ouvert à une collaboration rémunérée. Si vous êtes intéressé par nous aidez merci de prendre contact avec moi. Marc Sauber Saubeo Srl marc.sauber@saubeo.be
Posté le 06 décembre 2024 - 10:26
J'utilise une façon différente pour écrire un fichier xml avec Windev. Je me sers des fonctions XMLDocument(), XMLAjouteFils(), XMLAjouteAttribut(), XMLParent() et tout fonctionne bien une fois qu'on les a compris Exemple: XMLDocument(sMonDocXML, "") XMLAjouteFils(sMonDocXML, "Invoice", "", Vrai) XMLAjouteAttribut(sMonDocXML, "xmlns:cac", "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2") XMLAjouteAttribut(sMonDocXML, "xmlns:cbc", "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2") XMLAjouteAttribut(sMonDocXML, "xmlns", "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2") XMLAjouteFils(sMonDocXML,cbc:CustomizationID","urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0") XMLAjouteFils(sMonDocXML,"cbc:ProfileID","urn:fdc:peppol.eu:2017:poacc:billing:01:1.0") ... XMLAjouteFils(sMonDocXML,"cac:ContractDocumentReference","", Vrai) XMLAjouteFils(sMonDocXML,"cbc:ID","framework no 1") XMLParent(sMonDocXML) XMLAjouteFils(sMonDocXML,"cac:AdditionalDocumentReference","", Vrai) XMLAjouteFils(sMonDocXML,"cbc:ID","DR35141",Vrai) XMLAjouteAttribut(sMonDocXML,"schemeID","ABT") XMLParent(sMonDocXML) XMLAjouteFils(sMonDocXML,"cbc:DocumentTypeCode","130") ... J'ai par contre plusieurs problèmes autres. Les explications fournies dans les documentations (https://docs.peppol.eu/poacc/billing/3.0/ ) ne sont pas des plus claire. - Je cherche un modèle de facture simple en pdf, et son fichier xml. - Une fois ce fichier xml créer, je ne sais pas trop quoi en faire, ou l'envoyer, comment le tester, etc... Si quelqu'un a des explications claires, je suis preneur. Patrice
Posté le 08 janvier 2025 - 14:59
Bonjour à tous et bonne année Je suis également devant le problème de réalisation de facture européenne totalement incapable de programmer en XML, Je recherche également le code à introduire dans un logiciel de facturation Je suis prêt bien sûr à rémunérer et à partager toute aide .... comment faire pour accéder à pepoll? Je travaille avec windev 2025 Bien à vous Alain
Posté le 08 janvier 2025 - 15:01
Bonjour à tous et bonne année Je suis également devant le problème de réalisation de facture européenne totalement incapable de programmer en XML, Je recherche également le code à introduire dans un logiciel de facturation Je suis prêt bien sûr à rémunérer et à partager toute aide .... comment faire pour accéder à pepoll? Je travaille avec windev 2025 Bien à vous Alain
Posté le 27 janvier 2025 - 18:32
Bonjour à tous, je suis aussi dans le meme cas, je doit integrer dans certains logiciels conçus pour mes clients, la creation de facture et l'envoi au reseau peppol. Les infos techniques qu'on trouvent sont (pour moi) difficile à comprendre. Tous infos, sources pedagogique, module/classe windev disponible m'interesse. Merci d'avance Stephane
Membre enregistré 163 messages
Posté le 27 janvier 2025 - 18:58
Bonjour à tous, je suis aussi dans le meme cas, je doit integrer dans certains logiciels conçus pour mes clients, la creation de facture et l'envoi au reseau peppol. Les infos techniques qu'on trouvent sont (pour moi) difficile à comprendre. Tous infos, sources pedagogique, module/classe windev disponible m'interesse. Merci d'avance Stephane -- Stephane Dujourdy Softwares made on measure and computing advice since 1980 Softwares made on measure for Diamond and Luxe sector since 1999 info@diamondsoftware.nethttp://www.diamondsoftware.net
Posté le 22 février 2025 - 12:32
Bonjour, Voici pour info le code que je viens de faire pour tester et le fichier XML généré est valide. Je suis occupé de le transcrire dans une procédure afin de pouvoir l'utiliser plus facilement. Pour le dépôt du fichier xml, il faut passer par un Point d'Accès Certifié. Pour le moment je fait mes test avec les plateformes BillToBox et BillIt qui possèdent un tenant de test permettant soit d'utiliser un api ou d'envoyer le fichier xml sur une adresse mail unique permettant d'être importée directement. Cette solution peux fonctionner jusqu'à 10.000 factures/an Voici le code pour une facture fictive avec un fichier pdf préalablement imprimé afin de l'intégrer au format base64 dans le fichier xml. Evidement les infos de tva et client sont à adapter.LOCAL fichierXML est un xmlDocument nNameSpace est un xmlNamespace nNameSpaceCac est un xmlNamespace nNameSpaceCbc est un xmlNamespace nNoeud est un xmlNoeud dynamique sFichierXml est une chaîne = ComplèteRep(fRepExe())+"test3.xml" sFichierPdf est une chaîne = ComplèteRep(fRepExe())+"15000001.pdf" sFichierTxt est une chaîne = ComplèteRep(fRepExe())+"15000001.txt" sPdfBase64 est une chaîne = "" // Encrypte le fichier pdf dans un fichier texte et on récupère l'info pour l'inclure dans le fichier xml fCrypte(sFichierPdf,sFichierTxt,"",compresseAucun,encodeBASE64SansRC) sPdfBase64 = fChargeTexte(sFichierTxt) fSupprime(sFichierTxt) nNoeud = fichierXML.Invoice // Namespace cac nNameSpaceCac..Nom = "cac" nNameSpaceCac..URI = "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" Ajoute(nNoeud..NamespaceDéclaré,nNameSpaceCac) // Namespace cbc nNameSpaceCbc..Nom = "cbc" nNameSpaceCbc..URI = "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" Ajoute(nNoeud..NamespaceDéclaré,nNameSpaceCbc) // Namespace nNameSpace..Nom = "" nNameSpace..URI = "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" Ajoute(nNoeud..NamespaceDéclaré,nNameSpace) // Détail du fichier XML // Entête fichierXML.Invoice.CustomizationID..Namespace = nNameSpaceCbc fichierXML.Invoice.CustomizationID = "urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0" fichierXML.Invoice.ProfileID..Namespace = nNameSpaceCbc fichierXML.Invoice.ProfileID = "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0" fichierXML.Invoice.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.ID = "FC/15" fichierXML.Invoice.IssueDate..Namespace = nNameSpaceCbc fichierXML.Invoice.IssueDate = DateVersChaîne(DateDuJour(),"AAAA-MM-JJ") fichierXML.Invoice.DueDate..Namespace = nNameSpaceCbc fichierXML.Invoice.DueDate = DateVersChaîne(DateDuJour(),"AAAA-MM-JJ") fichierXML.Invoice.InvoiceTypeCode..Namespace = nNameSpaceCbc fichierXML.Invoice.InvoiceTypeCode = "380" fichierXML.Invoice.Note..Namespace = nNameSpaceCbc fichierXML.Invoice.Note = "Testcase 1" fichierXML.Invoice.DocumentCurrencyCode..Namespace = nNameSpaceCbc fichierXML.Invoice.DocumentCurrencyCode = "EUR" fichierXML.Invoice.DocumentCurrencyCode..Namespace = nNameSpaceCbc fichierXML.Invoice.BuyerReference = "0000000195" // Numéro de tva vendeur // OrderReference fichierXML.Invoice.OrderReference..Namespace = nNameSpaceCac fichierXML.Invoice.OrderReference.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.OrderReference.ID = "YR127129" fichierXML.Invoice.OrderReference.CustomerReference..Namespace = nNameSpaceCbc fichierXML.Invoice.OrderReference.CustomerReference = "C000001" // AdditionalDocumentReference fichierXML.Invoice.AdditionalDocumentReference..Namespace = nNameSpaceCac fichierXML.Invoice.AdditionalDocumentReference.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.AdditionalDocumentReference.ID = "FC/15" fichierXML.Invoice.AdditionalDocumentReference.DocumentDescription..Namespace = nNameSpaceCbc fichierXML.Invoice.AdditionalDocumentReference.DocumentDescription = "CommercialInvoice" // AdditionalDocumentReference.Attachment fichierXML.Invoice.AdditionalDocumentReference.Attachment..Namespace = nNameSpaceCac fichierXML.Invoice.AdditionalDocumentReference.Attachment.EmbeddedDocumentBinaryObject..Namespace = nNameSpaceCbc fichierXML.Invoice.AdditionalDocumentReference.Attachment.EmbeddedDocumentBinaryObject..Attribut["filename"] = "15000001.pdf" fichierXML.Invoice.AdditionalDocumentReference.Attachment.EmbeddedDocumentBinaryObject..Attribut["mimeCode"] = "application/pdf" fichierXML.Invoice.AdditionalDocumentReference.Attachment.EmbeddedDocumentBinaryObject = sPdfBase64 // AccountingSupplierParty fichierXML.Invoice.AccountingSupplierParty..Namespace = nNameSpaceCac // AccountingSupplierParty.Party fichierXML.Invoice.AccountingSupplierParty.Party..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingSupplierParty.Party.EndpointID..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.EndpointID..Attribut["schemeID"] = "0208" fichierXML.Invoice.AccountingSupplierParty.Party.EndpointID = "0000000196" // AccountingSupplierParty.Party.PartyName fichierXML.Invoice.AccountingSupplierParty.Party.PartyName..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingSupplierParty.Party.PartyName.Name..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.PartyName.Name = "My Supplier Company N.V." // AccountingSupplierParty.Party.PostalAddress fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress.StreetName..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress.StreetName = "De Grote Meir 22" fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress.CityName..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress.CityName = "ANTWERPEN" fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress.PostalZone..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress.PostalZone = "2000" // AccountingSupplierParty.Party.PostalAddress.Country fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress.Country..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress.Country.IdentificationCode..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress.Country.IdentificationCode = "BE" // AccountingSupplierParty.Party.PartyTaxScheme fichierXML.Invoice.AccountingSupplierParty.Party.PartyTaxScheme..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingSupplierParty.Party.PartyTaxScheme.CompanyID..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.PartyTaxScheme.CompanyID = "BE0000000196" // AccountingSupplierParty.Party.PartyTaxScheme.TaxScheme fichierXML.Invoice.AccountingSupplierParty.Party.PartyTaxScheme.TaxScheme..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingSupplierParty.Party.PartyTaxScheme.TaxScheme.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.PartyTaxScheme.TaxScheme.ID = "VAT" // AccountingSupplierParty.Party.PartyLegalEntity fichierXML.Invoice.AccountingSupplierParty.Party.PartyLegalEntity..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingSupplierParty.Party.PartyLegalEntity.RegistrationName..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.PartyLegalEntity.RegistrationName = "My Supplier Company" fichierXML.Invoice.AccountingSupplierParty.Party.PartyLegalEntity.CompanyID..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.PartyLegalEntity.CompanyID..Attribut["schemeID"] = "0208" fichierXML.Invoice.AccountingSupplierParty.Party.PartyLegalEntity.CompanyID = "0000000196" // AccountingSupplierParty.Party.Contact fichierXML.Invoice.AccountingSupplierParty.Party.Contact..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingSupplierParty.Party.Contact.ElectronicMail..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.Contact.ElectronicMail = "john.doole@mysuppliercompany.be" // AccountingCustomerParty fichierXML.Invoice.AccountingCustomerParty..Namespace = nNameSpaceCac // AccountingCustomerParty.Party fichierXML.Invoice.AccountingCustomerParty.Party..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingCustomerParty.Party.EndpointID..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.EndpointID..Attribut["schemeID"] = "0208" fichierXML.Invoice.AccountingCustomerParty.Party.EndpointID = "0000000295" // AccountingCustomerParty.Party.PartyName fichierXML.Invoice.AccountingCustomerParty.Party.PartyName..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingCustomerParty.Party.PartyName.Name..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.PartyName.Name = "My Customer Company S.A." // AccountingCustomerParty.Party.PostalAddress fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress.StreetName..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress.StreetName = "Boulevard Sint Michel 53" fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress.CityName..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress.CityName = "BRUXELLES" fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress.PostalZone..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress.PostalZone = "1000" // AccountingCustomerParty.Party.PostalAddress.Country fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress.Country..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress.Country.IdentificationCode..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress.Country.IdentificationCode = "BE" // AccountingCustomerParty.Party.PartyTaxScheme fichierXML.Invoice.AccountingCustomerParty.Party.PartyTaxScheme..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingCustomerParty.Party.PartyTaxScheme.CompanyID..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.PartyTaxScheme.CompanyID = "BE0000000295" // AccountingCustomerParty.Party.PartyTaxScheme.TaxScheme fichierXML.Invoice.AccountingCustomerParty.Party.PartyTaxScheme.TaxScheme..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingCustomerParty.Party.PartyTaxScheme.TaxScheme.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.PartyTaxScheme.TaxScheme.ID = "VAT" // AccountingCustomerParty.Party.PartyLegalEntity fichierXML.Invoice.AccountingCustomerParty.Party.PartyLegalEntity..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingCustomerParty.Party.PartyLegalEntity.RegistrationName..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.PartyLegalEntity.RegistrationName = "My Customer Company" fichierXML.Invoice.AccountingCustomerParty.Party.PartyLegalEntity.CompanyID..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.PartyLegalEntity.CompanyID..Attribut["schemeID"] = "0208" fichierXML.Invoice.AccountingCustomerParty.Party.PartyLegalEntity.CompanyID = "0000000295" // AccountingCustomerParty.Party.Contact fichierXML.Invoice.AccountingCustomerParty.Party.Contact..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingCustomerParty.Party.Contact.ElectronicMail..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.Contact.ElectronicMail = "pete.smith@mycustomercompany.be" // PaymentMeans fichierXML.Invoice.PaymentMeans..Namespace = nNameSpaceCac fichierXML.Invoice.PaymentMeans.PaymentMeansCode..Namespace = nNameSpaceCbc fichierXML.Invoice.PaymentMeans.PaymentMeansCode = "30" fichierXML.Invoice.PaymentMeans.PaymentID..Namespace = nNameSpaceCbc fichierXML.Invoice.PaymentMeans.PaymentID = "Invoice 15000001" // PaymentMeans.PayeeFinancialAccount fichierXML.Invoice.PaymentMeans.PayeeFinancialAccount..Namespace = nNameSpaceCac fichierXML.Invoice.PaymentMeans.PayeeFinancialAccount.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.PaymentMeans.PayeeFinancialAccount.ID = "BE54000000000097" // PaymentMeans.PayeeFinancialAccount.FinancialInstitutionBranch fichierXML.Invoice.PaymentMeans.PayeeFinancialAccount.FinancialInstitutionBranch..Namespace = nNameSpaceCac fichierXML.Invoice.PaymentMeans.PayeeFinancialAccount.FinancialInstitutionBranch.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.PaymentMeans.PayeeFinancialAccount.FinancialInstitutionBranch.ID = "BPOTBEB1" // PaymentTerms fichierXML.Invoice.PaymentTerms..Namespace = nNameSpaceCac fichierXML.Invoice.PaymentTerms.Note..Namespace = nNameSpaceCbc fichierXML.Invoice.PaymentTerms.Note = "30 days after invoice date" // TaxTotal fichierXML.Invoice.TaxTotal..Namespace = nNameSpaceCac fichierXML.Invoice.TaxTotal.TaxAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.TaxTotal.TaxAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.TaxTotal.TaxAmount = "84" // TaxTotal.TaxSubtotal fichierXML.Invoice.TaxTotal.TaxSubtotal..Namespace = nNameSpaceCac fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxableAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxableAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxableAmount = "400" fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxAmount = "84" // TaxTotal.TaxSubtotal.TaxCategory fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxCategory..Namespace = nNameSpaceCac fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxCategory.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxCategory.ID = "S" fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxCategory.Percent..Namespace = nNameSpaceCbc fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxCategory.Percent = "21" // TaxTotal.TaxSubtotal.TaxCategory.TaxScheme fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxCategory.TaxScheme..Namespace = nNameSpaceCac fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxCategory.TaxScheme.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxCategory.TaxScheme.ID = "VAT" // LegalMonetaryTotal fichierXML.Invoice.LegalMonetaryTotal..Namespace = nNameSpaceCac fichierXML.Invoice.LegalMonetaryTotal.LineExtensionAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.LegalMonetaryTotal.LineExtensionAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.LegalMonetaryTotal.LineExtensionAmount = "400" fichierXML.Invoice.LegalMonetaryTotal.TaxExclusiveAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.LegalMonetaryTotal.TaxExclusiveAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.LegalMonetaryTotal.TaxExclusiveAmount = "400" fichierXML.Invoice.LegalMonetaryTotal.TaxInclusiveAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.LegalMonetaryTotal.TaxInclusiveAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.LegalMonetaryTotal.TaxInclusiveAmount = "484" fichierXML.Invoice.LegalMonetaryTotal.AllowanceTotalAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.LegalMonetaryTotal.AllowanceTotalAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.LegalMonetaryTotal.AllowanceTotalAmount = "0" fichierXML.Invoice.LegalMonetaryTotal.ChargeTotalAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.LegalMonetaryTotal.ChargeTotalAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.LegalMonetaryTotal.ChargeTotalAmount = "0" fichierXML.Invoice.LegalMonetaryTotal.PrepaidAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.LegalMonetaryTotal.PrepaidAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.LegalMonetaryTotal.PrepaidAmount = "0" fichierXML.Invoice.LegalMonetaryTotal.PayableAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.LegalMonetaryTotal.PayableAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.LegalMonetaryTotal.PayableAmount = "484" // InvoiceLine fichierXML.Invoice.InvoiceLine..Namespace = nNameSpaceCac fichierXML.Invoice.InvoiceLine.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.InvoiceLine.ID = "1" fichierXML.Invoice.InvoiceLine.InvoicedQuantity..Namespace = nNameSpaceCbc fichierXML.Invoice.InvoiceLine.InvoicedQuantity..Attribut["unitCode"] = "ZZ" fichierXML.Invoice.InvoiceLine.InvoicedQuantity = "2" fichierXML.Invoice.InvoiceLine.LineExtensionAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.InvoiceLine.LineExtensionAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.InvoiceLine.LineExtensionAmount = "400" // InvoiceLine.Item fichierXML.Invoice.InvoiceLine.Item..Namespace = nNameSpaceCac fichierXML.Invoice.InvoiceLine.Item.Name..Namespace = nNameSpaceCbc fichierXML.Invoice.InvoiceLine.Item.Name = "Shoes" // InvoiceLine.Item.ClassifiedTaxCategory fichierXML.Invoice.InvoiceLine.Item.ClassifiedTaxCategory..Namespace = nNameSpaceCac fichierXML.Invoice.InvoiceLine.Item.ClassifiedTaxCategory.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.InvoiceLine.Item.ClassifiedTaxCategory.ID = "S" fichierXML.Invoice.InvoiceLine.Item.ClassifiedTaxCategory.Percent..Namespace = nNameSpaceCbc fichierXML.Invoice.InvoiceLine.Item.ClassifiedTaxCategory.Percent = "21" // InvoiceLine.Item.ClassifiedTaxCategory.TaxScheme fichierXML.Invoice.InvoiceLine.Item.ClassifiedTaxCategory.TaxScheme..Namespace = nNameSpaceCac fichierXML.Invoice.InvoiceLine.Item.ClassifiedTaxCategory.TaxScheme.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.InvoiceLine.Item.ClassifiedTaxCategory.TaxScheme.ID = "VAT" // InvoiceLine.Price fichierXML.Invoice.InvoiceLine.Price..Namespace = nNameSpaceCac fichierXML.Invoice.InvoiceLine.Price.PriceAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.InvoiceLine.Price.PriceAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.InvoiceLine.Price.PriceAmount = "200" XMLSauve(fichierXML, sFichierXml, XMLMiseEnForme) SI ErreurDétectée = Vrai ALORS ErreurConstruit("Une erreur s'est produite pendant la sauvegarde : %1", ... ErreurInfo(errComplet)) FIN
Posté le 22 février 2025 - 12:40
Bonjour, Voici pour info le code que je viens de faire pour tester et le fichier XML généré est valide. Je suis occupé de le transcrire dans une procédure afin de pouvoir l'utiliser plus facilement. Pour le dépôt du fichier xml, il faut passer par un Point d'Accès Certifié. Pour le moment je fait mes test avec les plateformes BillToBox et BillIt qui possèdent un tenant de test permettant soit d'utiliser un api ou d'envoyer le fichier xml sur une adresse mail unique permettant d'être importée directement. Cette solution peux fonctionner jusqu'à 10.000 factures/an Voici le code pour une facture fictive avec un fichier pdf préalablement imprimé afin de l'intégrer au format base64 dans le fichier xml. Evidement les infos de tva et client sont à adapter.LOCAL fichierXML est un xmlDocument nNameSpace est un xmlNamespace nNameSpaceCac est un xmlNamespace nNameSpaceCbc est un xmlNamespace nNoeud est un xmlNoeud dynamique sFichierXml est une chaîne = ComplèteRep(fRepExe())+"test3.xml" sFichierPdf est une chaîne = ComplèteRep(fRepExe())+"15000001.pdf" sFichierTxt est une chaîne = ComplèteRep(fRepExe())+"15000001.txt" sPdfBase64 est une chaîne = "" // Encrypte le fichier pdf dans un fichier texte et on récupère l'info pour l'inclure dans le fichier xml fCrypte(sFichierPdf,sFichierTxt,"",compresseAucun,encodeBASE64SansRC) sPdfBase64 = fChargeTexte(sFichierTxt) fSupprime(sFichierTxt) nNoeud = fichierXML.Invoice // Namespace cac nNameSpaceCac..Nom = "cac" nNameSpaceCac..URI = "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" Ajoute(nNoeud..NamespaceDéclaré,nNameSpaceCac) // Namespace cbc nNameSpaceCbc..Nom = "cbc" nNameSpaceCbc..URI = "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" Ajoute(nNoeud..NamespaceDéclaré,nNameSpaceCbc) // Namespace nNameSpace..Nom = "" nNameSpace..URI = "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" Ajoute(nNoeud..NamespaceDéclaré,nNameSpace) // Détail du fichier XML // Entête fichierXML.Invoice.CustomizationID..Namespace = nNameSpaceCbc fichierXML.Invoice.CustomizationID = "urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0" fichierXML.Invoice.ProfileID..Namespace = nNameSpaceCbc fichierXML.Invoice.ProfileID = "urn:fdc:peppol.eu:2017:poacc:billing:01:1.0" fichierXML.Invoice.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.ID = "FC/15" fichierXML.Invoice.IssueDate..Namespace = nNameSpaceCbc fichierXML.Invoice.IssueDate = DateVersChaîne(DateDuJour(),"AAAA-MM-JJ") fichierXML.Invoice.DueDate..Namespace = nNameSpaceCbc fichierXML.Invoice.DueDate = DateVersChaîne(DateDuJour(),"AAAA-MM-JJ") fichierXML.Invoice.InvoiceTypeCode..Namespace = nNameSpaceCbc fichierXML.Invoice.InvoiceTypeCode = "380" fichierXML.Invoice.Note..Namespace = nNameSpaceCbc fichierXML.Invoice.Note = "Testcase 1" fichierXML.Invoice.DocumentCurrencyCode..Namespace = nNameSpaceCbc fichierXML.Invoice.DocumentCurrencyCode = "EUR" fichierXML.Invoice.DocumentCurrencyCode..Namespace = nNameSpaceCbc fichierXML.Invoice.BuyerReference = "0000000195" // Numéro de tva vendeur // OrderReference fichierXML.Invoice.OrderReference..Namespace = nNameSpaceCac fichierXML.Invoice.OrderReference.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.OrderReference.ID = "YR127129" fichierXML.Invoice.OrderReference.CustomerReference..Namespace = nNameSpaceCbc fichierXML.Invoice.OrderReference.CustomerReference = "C000001" // AdditionalDocumentReference fichierXML.Invoice.AdditionalDocumentReference..Namespace = nNameSpaceCac fichierXML.Invoice.AdditionalDocumentReference.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.AdditionalDocumentReference.ID = "FC/15" fichierXML.Invoice.AdditionalDocumentReference.DocumentDescription..Namespace = nNameSpaceCbc fichierXML.Invoice.AdditionalDocumentReference.DocumentDescription = "CommercialInvoice" // AdditionalDocumentReference.Attachment fichierXML.Invoice.AdditionalDocumentReference.Attachment..Namespace = nNameSpaceCac fichierXML.Invoice.AdditionalDocumentReference.Attachment.EmbeddedDocumentBinaryObject..Namespace = nNameSpaceCbc fichierXML.Invoice.AdditionalDocumentReference.Attachment.EmbeddedDocumentBinaryObject..Attribut["filename"] = "15000001.pdf" fichierXML.Invoice.AdditionalDocumentReference.Attachment.EmbeddedDocumentBinaryObject..Attribut["mimeCode"] = "application/pdf" fichierXML.Invoice.AdditionalDocumentReference.Attachment.EmbeddedDocumentBinaryObject = sPdfBase64 // AccountingSupplierParty fichierXML.Invoice.AccountingSupplierParty..Namespace = nNameSpaceCac // AccountingSupplierParty.Party fichierXML.Invoice.AccountingSupplierParty.Party..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingSupplierParty.Party.EndpointID..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.EndpointID..Attribut["schemeID"] = "0208" fichierXML.Invoice.AccountingSupplierParty.Party.EndpointID = "0000000196" // AccountingSupplierParty.Party.PartyName fichierXML.Invoice.AccountingSupplierParty.Party.PartyName..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingSupplierParty.Party.PartyName.Name..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.PartyName.Name = "My Supplier Company N.V." // AccountingSupplierParty.Party.PostalAddress fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress.StreetName..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress.StreetName = "De Grote Meir 22" fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress.CityName..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress.CityName = "ANTWERPEN" fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress.PostalZone..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress.PostalZone = "2000" // AccountingSupplierParty.Party.PostalAddress.Country fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress.Country..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress.Country.IdentificationCode..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.PostalAddress.Country.IdentificationCode = "BE" // AccountingSupplierParty.Party.PartyTaxScheme fichierXML.Invoice.AccountingSupplierParty.Party.PartyTaxScheme..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingSupplierParty.Party.PartyTaxScheme.CompanyID..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.PartyTaxScheme.CompanyID = "BE0000000196" // AccountingSupplierParty.Party.PartyTaxScheme.TaxScheme fichierXML.Invoice.AccountingSupplierParty.Party.PartyTaxScheme.TaxScheme..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingSupplierParty.Party.PartyTaxScheme.TaxScheme.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.PartyTaxScheme.TaxScheme.ID = "VAT" // AccountingSupplierParty.Party.PartyLegalEntity fichierXML.Invoice.AccountingSupplierParty.Party.PartyLegalEntity..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingSupplierParty.Party.PartyLegalEntity.RegistrationName..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.PartyLegalEntity.RegistrationName = "My Supplier Company" fichierXML.Invoice.AccountingSupplierParty.Party.PartyLegalEntity.CompanyID..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.PartyLegalEntity.CompanyID..Attribut["schemeID"] = "0208" fichierXML.Invoice.AccountingSupplierParty.Party.PartyLegalEntity.CompanyID = "0000000196" // AccountingSupplierParty.Party.Contact fichierXML.Invoice.AccountingSupplierParty.Party.Contact..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingSupplierParty.Party.Contact.ElectronicMail..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingSupplierParty.Party.Contact.ElectronicMail = "john.doole@mysuppliercompany.be" // AccountingCustomerParty fichierXML.Invoice.AccountingCustomerParty..Namespace = nNameSpaceCac // AccountingCustomerParty.Party fichierXML.Invoice.AccountingCustomerParty.Party..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingCustomerParty.Party.EndpointID..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.EndpointID..Attribut["schemeID"] = "0208" fichierXML.Invoice.AccountingCustomerParty.Party.EndpointID = "0000000295" // AccountingCustomerParty.Party.PartyName fichierXML.Invoice.AccountingCustomerParty.Party.PartyName..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingCustomerParty.Party.PartyName.Name..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.PartyName.Name = "My Customer Company S.A." // AccountingCustomerParty.Party.PostalAddress fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress.StreetName..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress.StreetName = "Boulevard Sint Michel 53" fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress.CityName..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress.CityName = "BRUXELLES" fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress.PostalZone..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress.PostalZone = "1000" // AccountingCustomerParty.Party.PostalAddress.Country fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress.Country..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress.Country.IdentificationCode..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.PostalAddress.Country.IdentificationCode = "BE" // AccountingCustomerParty.Party.PartyTaxScheme fichierXML.Invoice.AccountingCustomerParty.Party.PartyTaxScheme..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingCustomerParty.Party.PartyTaxScheme.CompanyID..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.PartyTaxScheme.CompanyID = "BE0000000295" // AccountingCustomerParty.Party.PartyTaxScheme.TaxScheme fichierXML.Invoice.AccountingCustomerParty.Party.PartyTaxScheme.TaxScheme..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingCustomerParty.Party.PartyTaxScheme.TaxScheme.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.PartyTaxScheme.TaxScheme.ID = "VAT" // AccountingCustomerParty.Party.PartyLegalEntity fichierXML.Invoice.AccountingCustomerParty.Party.PartyLegalEntity..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingCustomerParty.Party.PartyLegalEntity.RegistrationName..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.PartyLegalEntity.RegistrationName = "My Customer Company" fichierXML.Invoice.AccountingCustomerParty.Party.PartyLegalEntity.CompanyID..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.PartyLegalEntity.CompanyID..Attribut["schemeID"] = "0208" fichierXML.Invoice.AccountingCustomerParty.Party.PartyLegalEntity.CompanyID = "0000000295" // AccountingCustomerParty.Party.Contact fichierXML.Invoice.AccountingCustomerParty.Party.Contact..Namespace = nNameSpaceCac fichierXML.Invoice.AccountingCustomerParty.Party.Contact.ElectronicMail..Namespace = nNameSpaceCbc fichierXML.Invoice.AccountingCustomerParty.Party.Contact.ElectronicMail = "pete.smith@mycustomercompany.be" // PaymentMeans fichierXML.Invoice.PaymentMeans..Namespace = nNameSpaceCac fichierXML.Invoice.PaymentMeans.PaymentMeansCode..Namespace = nNameSpaceCbc fichierXML.Invoice.PaymentMeans.PaymentMeansCode = "30" fichierXML.Invoice.PaymentMeans.PaymentID..Namespace = nNameSpaceCbc fichierXML.Invoice.PaymentMeans.PaymentID = "Invoice 15000001" // PaymentMeans.PayeeFinancialAccount fichierXML.Invoice.PaymentMeans.PayeeFinancialAccount..Namespace = nNameSpaceCac fichierXML.Invoice.PaymentMeans.PayeeFinancialAccount.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.PaymentMeans.PayeeFinancialAccount.ID = "BE54000000000097" // PaymentMeans.PayeeFinancialAccount.FinancialInstitutionBranch fichierXML.Invoice.PaymentMeans.PayeeFinancialAccount.FinancialInstitutionBranch..Namespace = nNameSpaceCac fichierXML.Invoice.PaymentMeans.PayeeFinancialAccount.FinancialInstitutionBranch.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.PaymentMeans.PayeeFinancialAccount.FinancialInstitutionBranch.ID = "BPOTBEB1" // PaymentTerms fichierXML.Invoice.PaymentTerms..Namespace = nNameSpaceCac fichierXML.Invoice.PaymentTerms.Note..Namespace = nNameSpaceCbc fichierXML.Invoice.PaymentTerms.Note = "30 days after invoice date" // TaxTotal fichierXML.Invoice.TaxTotal..Namespace = nNameSpaceCac fichierXML.Invoice.TaxTotal.TaxAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.TaxTotal.TaxAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.TaxTotal.TaxAmount = "84" // TaxTotal.TaxSubtotal fichierXML.Invoice.TaxTotal.TaxSubtotal..Namespace = nNameSpaceCac fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxableAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxableAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxableAmount = "400" fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxAmount = "84" // TaxTotal.TaxSubtotal.TaxCategory fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxCategory..Namespace = nNameSpaceCac fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxCategory.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxCategory.ID = "S" fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxCategory.Percent..Namespace = nNameSpaceCbc fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxCategory.Percent = "21" // TaxTotal.TaxSubtotal.TaxCategory.TaxScheme fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxCategory.TaxScheme..Namespace = nNameSpaceCac fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxCategory.TaxScheme.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.TaxTotal.TaxSubtotal.TaxCategory.TaxScheme.ID = "VAT" // LegalMonetaryTotal fichierXML.Invoice.LegalMonetaryTotal..Namespace = nNameSpaceCac fichierXML.Invoice.LegalMonetaryTotal.LineExtensionAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.LegalMonetaryTotal.LineExtensionAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.LegalMonetaryTotal.LineExtensionAmount = "400" fichierXML.Invoice.LegalMonetaryTotal.TaxExclusiveAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.LegalMonetaryTotal.TaxExclusiveAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.LegalMonetaryTotal.TaxExclusiveAmount = "400" fichierXML.Invoice.LegalMonetaryTotal.TaxInclusiveAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.LegalMonetaryTotal.TaxInclusiveAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.LegalMonetaryTotal.TaxInclusiveAmount = "484" fichierXML.Invoice.LegalMonetaryTotal.AllowanceTotalAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.LegalMonetaryTotal.AllowanceTotalAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.LegalMonetaryTotal.AllowanceTotalAmount = "0" fichierXML.Invoice.LegalMonetaryTotal.ChargeTotalAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.LegalMonetaryTotal.ChargeTotalAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.LegalMonetaryTotal.ChargeTotalAmount = "0" fichierXML.Invoice.LegalMonetaryTotal.PrepaidAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.LegalMonetaryTotal.PrepaidAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.LegalMonetaryTotal.PrepaidAmount = "0" fichierXML.Invoice.LegalMonetaryTotal.PayableAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.LegalMonetaryTotal.PayableAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.LegalMonetaryTotal.PayableAmount = "484" // InvoiceLine fichierXML.Invoice.InvoiceLine..Namespace = nNameSpaceCac fichierXML.Invoice.InvoiceLine.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.InvoiceLine.ID = "1" fichierXML.Invoice.InvoiceLine.InvoicedQuantity..Namespace = nNameSpaceCbc fichierXML.Invoice.InvoiceLine.InvoicedQuantity..Attribut["unitCode"] = "ZZ" fichierXML.Invoice.InvoiceLine.InvoicedQuantity = "2" fichierXML.Invoice.InvoiceLine.LineExtensionAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.InvoiceLine.LineExtensionAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.InvoiceLine.LineExtensionAmount = "400" // InvoiceLine.Item fichierXML.Invoice.InvoiceLine.Item..Namespace = nNameSpaceCac fichierXML.Invoice.InvoiceLine.Item.Name..Namespace = nNameSpaceCbc fichierXML.Invoice.InvoiceLine.Item.Name = "Shoes" // InvoiceLine.Item.ClassifiedTaxCategory fichierXML.Invoice.InvoiceLine.Item.ClassifiedTaxCategory..Namespace = nNameSpaceCac fichierXML.Invoice.InvoiceLine.Item.ClassifiedTaxCategory.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.InvoiceLine.Item.ClassifiedTaxCategory.ID = "S" fichierXML.Invoice.InvoiceLine.Item.ClassifiedTaxCategory.Percent..Namespace = nNameSpaceCbc fichierXML.Invoice.InvoiceLine.Item.ClassifiedTaxCategory.Percent = "21" // InvoiceLine.Item.ClassifiedTaxCategory.TaxScheme fichierXML.Invoice.InvoiceLine.Item.ClassifiedTaxCategory.TaxScheme..Namespace = nNameSpaceCac fichierXML.Invoice.InvoiceLine.Item.ClassifiedTaxCategory.TaxScheme.ID..Namespace = nNameSpaceCbc fichierXML.Invoice.InvoiceLine.Item.ClassifiedTaxCategory.TaxScheme.ID = "VAT" // InvoiceLine.Price fichierXML.Invoice.InvoiceLine.Price..Namespace = nNameSpaceCac fichierXML.Invoice.InvoiceLine.Price.PriceAmount..Namespace = nNameSpaceCbc fichierXML.Invoice.InvoiceLine.Price.PriceAmount..Attribut["currencyID"] = "EUR" fichierXML.Invoice.InvoiceLine.Price.PriceAmount = "200" XMLSauve(fichierXML, sFichierXml, XMLMiseEnForme) SI ErreurDétectée = Vrai ALORS ErreurConstruit("Une erreur s'est produite pendant la sauvegarde : %1", ... ErreurInfo(errComplet)) FIN
Membre enregistré 1 381 messages
Posté le 24 février 2025 - 15:40
Posté le 26 février 2025 - 11:44
Voici une autre façon de réaliser un fichier XMl. J'au repris l'exemple de Fred, et adapté avec les instructions XMLAJoutefils, etc... Le résultat final est exactement le même. C'est juste une question de choix Il reste toujours de trouver la façon de l'envoyer. Il est possible d'utiliser Billit ou autre, mais il serait préférable de l'envoyer sans devoir être tributaire d'un logiciel intermédaire, mais il trouver comment...sMonDocXML est une chaîne = "XML" sInfoXML est une chaîne // Chaîne résultat // Création du document XML XMLDocument(sMonDocXML, "") // Crée un document XML vierge // Elément Racine XMLAjouteFils(sMonDocXML, "Invoice", "", Vrai) // XMLAjouteAttribut(sMonDocXML, "xmlns:cac", "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2") // Namespace cac XMLAjouteAttribut(sMonDocXML, "xmlns:cbc", "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2") // Namespace cbc XMLAjouteAttribut(sMonDocXML, "xmlns", "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2") // Namespace // Entête XMLAjouteFils(sMonDocXML,"cbc:CustomizationID","urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0") // XMLAjouteFils(sMonDocXML,"cbc:ProfileID","urn:fdc:peppol.eu:2017:poacc:billing:01:1.0") // ID personnalisation XMLAjouteFils(sMonDocXML,"cbc:ID","FC/15") // Identifiant XMLAjouteFils(sMonDocXML,"cbc:IssueDate",DateVersChaîne(DateDuJour(),"AAAA-MM-JJ")) // Date d'émission XMLAjouteFils(sMonDocXML,"cbc:DueDate",DateVersChaîne(DateDuJour(),"AAAA-MM-JJ")) // Date d'échéance XMLAjouteFils(sMonDocXML,"cbc:InvoiceTypeCode","380") // Code de type de facture XMLAjouteFils(sMonDocXML,"cbc:Note","Testcase 1") // Note XMLAjouteFils(sMonDocXML,"cbc:DocumentCurrencyCode","EUR") // Code de la devise du document XMLAjouteFils(sMonDocXML,"cbc:BuyerReference","0000000195") // Numéro de tva vendeur // OrderReference XMLAjouteFils(sMonDocXML,"cac:OrderReference","", Vrai) // Début noeud OrderReference XMLAjouteFils(sMonDocXML,"cbc:ID","YR127129") XMLAjouteFils(sMonDocXML,"cbc:CustomerReference","C000001") XMLParent(sMonDocXML) // Fin noeud OrderReference // AdditionalDocumentReference XMLAjouteFils(sMonDocXML,"cac:AdditionalDocumentReference","", Vrai) // Début noeud AdditionalDocumentReference XMLAjouteFils(sMonDocXML,"cbc:ID","FC/15") XMLAjouteFils(sMonDocXML,"cbc:DocumentDescription","CommercialInvoice") XMLAjouteFils(sMonDocXML,"cac:Attachment","",Vrai) // Début noeud AdditionalDocumentReference.Attachment (pièce jointe) XMLAjouteFils(sMonDocXML,"cbc:EmbeddedDocumentBinaryObject","",Vrai) XMLAjouteAttribut(sMonDocXML,"filename","15000001.pdf") XMLAjouteAttribut(sMonDocXML,"mimeCode","application/pdf") XMLParent(sMonDocXML) // Fin noeud AdditionalDocumentReference.Attachment XMLParent(sMonDocXML) // Fin noeud AdditionalDocumentReference XMLParent(sMonDocXML) // Fin noeud AdditionalDocumentReference // AccountingSupplierParty XMLAjouteFils(sMonDocXML,"cac:AccountingSupplierParty","",Vrai) // Début noeud AccountingSupplierParty, Pièce jointe XMLAjouteFils(sMonDocXML,"cac:Party","",Vrai) // Début noeud AccountingSupplierParty.Party (Pièce jointe) XMLAjouteFils(sMonDocXML,"cbc:EndpointID","0000000196",Vrai) XMLAjouteAttribut(sMonDocXML,"schemeID","0208") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cac:PartyName","",Vrai) // Début noeud AccountingSupplierParty.Party.PartyName XMLAjouteFils(sMonDocXML,"cbc:Name","My Supplier Company N.V.") XMLParent(sMonDocXML) // Fin noeud AccountingSupplierParty.Party.PartyName XMLAjouteFils(sMonDocXML,"cac:PostalAddress","",Vrai) // Début noeud AccountingSupplierParty.Party.PostalAddress (Adresse postale) XMLAjouteFils(sMonDocXML,"cbc:StreetName","e Grote Meir 22") // Nom de la rue XMLAjouteFils(sMonDocXML,"cbc:CityName","ANTWERPEN") // Nom ville XMLAjouteFils(sMonDocXML,"cbc:PostalZone","2000") // Code postal ville XMLAjouteFils(sMonDocXML,"cac:Country","",Vrai) // Début noeud AccountingSupplierParty.Party.PostalAddress.Country (Pays) XMLAjouteFils(sMonDocXML,"cbc:IdentificationCode","BE") // Code identification pays XMLParent(sMonDocXML) // Fin noeud cac:AccountingSupplierParty.Party.PostalAddress.Country XMLParent(sMonDocXML) // Fin noeud AccountingSupplierParty.Party.PostalAddress XMLAjouteFils(sMonDocXML,"cac:PartyTaxScheme","",Vrai) // Début noeud AccountingSupplierParty.Party.PartyTaxScheme XMLAjouteFils(sMonDocXML,"cbc:CompanyID","BE0000000196") // ID de l'entreprise XMLAjouteFils(sMonDocXML,"cac:TaxScheme","",Vrai) // Début noeud AccountingSupplierParty.Party.PartyTaxScheme.TaxScheme XMLAjouteFils(sMonDocXML,"cbc:ID","VAT") // Identifiant XMLParent(sMonDocXML) // Fin noeud cac:AccountingSupplierParty.Party.PartyTaxScheme.TaxScheme XMLParent(sMonDocXML) // Fin noeud AccountingSupplierParty.Party.PartyTaxSchem XMLAjouteFils(sMonDocXML,"cac:PartyLegalEntity","",Vrai) // Début noeud AccountingSupplierParty.Party.PartyLegalEntity XMLAjouteFils(sMonDocXML,"cbc:RegistrationName","My Supplier Company") XMLAjouteFils(sMonDocXML,"cbc:CompanyID","0000000196",Vrai) XMLAjouteAttribut(sMonDocXML,"schemeID","0208") XMLParent(sMonDocXML) // Fin attribut XMLParent(sMonDocXML) // Fin oeud AccountingSupplierParty.Party.PartyLegalEntity XMLAjouteFils(sMonDocXML,"cac:Contact","",Vrai) // Début noeud AccountingSupplierParty.Party.Contact XMLAjouteFils(sMonDocXML,"cbc:ElectronicMail","john.doole@mysuppliercompany.be") // Nom d'enregistrement XMLParent(sMonDocXML) // Fin noeud AccountingSupplierParty.Party.Contact XMLParent(sMonDocXML) // Fin noeud cac:AccountingSupplierParty.Party XMLParent(sMonDocXML) // Fin noeud cac:AccountingSupplierParty // AccountingCustomerParty XMLAjouteFils(sMonDocXML,"cac:AccountingCustomerParty","",Vrai) // Début noeud AccountingCustomerParty XMLAjouteFils(sMonDocXML,"cac:Party","",Vrai) // Début noeud AccountingCustomerParty.Party XMLAjouteFils(sMonDocXML,"cbc:EndpointID","0000000295",Vrai) XMLAjouteAttribut(sMonDocXML,"schemeID","0208") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cac:PartyName","",Vrai) // Début noeud AccountingCustomerParty.Party.PartyName XMLAjouteFils(sMonDocXML,"cbc:Name","My Customer Company S.A.") // Nom XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party.PartyName XMLAjouteFils(sMonDocXML,"cac:PostalAddress","",Vrai) // Début noeud AccountingCustomerParty.Party.PostalAddresse XMLAjouteFils(sMonDocXML,"cbc:StreetName","Boulevard Sint Michel 53") // Nom de la rue XMLAjouteFils(sMonDocXML,"cbc:CityName","BRUXELLES") // Nom ville XMLAjouteFils(sMonDocXML,"cbc:PostalZone","1000") // Code postal XMLAjouteFils(sMonDocXML,"cac:Country","",Vrai) // Début noeud AccountingCustomerParty.Party.PostalAddress.Country XMLAjouteFils(sMonDocXML,"cbc:IdentificationCode","BE") // Code identification XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party.PostalAddresse.Country XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party.PostalAddresse XMLAjouteFils(sMonDocXML,"cac:PartyTaxScheme","",Vrai) // Début noeud AccountingCustomerParty.Party.PartyTaxScheme (Régime fiscal) XMLAjouteFils(sMonDocXML,"cbc:CompanyID","BE0000000295") // Id entreprise XMLAjouteFils(sMonDocXML,"cac:TaxScheme","",Vrai) // Début noeud AccountingCustomerParty.Party.PartyTaxScheme.TaxScheme XMLAjouteFils(sMonDocXML,"cbc:ID","VAT") XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party.PartyTaxScheme.TaxScheme XMLParent(sMonDocXML) // Fin noeud noeud AccountingCustomerParty.Party.PartyTaxScheme XMLAjouteFils(sMonDocXML,"cac:PartyLegalEntity","",Vrai) // Début noeud AccountingCustomerParty.Party.PartyLegalEntity (Entité légale) XMLAjouteFils(sMonDocXML,"cbc:RegistrationName","y Customer Company") // Nom d'enregistrement XMLAjouteFils(sMonDocXML,"cbc:CompanyID","0000000295",Vrai) XMLAjouteAttribut(sMonDocXML,"schemeID","0208") XMLParent(sMonDocXML) // Fin attribut XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party.PartyLegalEntity XMLAjouteFils(sMonDocXML,"cac:Contact","",Vrai) // Début noeud AccountingCustomerParty.Party.Contact XMLAjouteFils(sMonDocXML,"cbc:ElectronicMail","pete.smith@mycustomercompany.be") // Email XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party.Contact XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty // PaymentMeans XMLAjouteFils(sMonDocXML,"cac:PaymentMeans","",Vrai) // Début noeud PaymentMeans (moyen de paiement) XMLAjouteFils(sMonDocXML,"cbc:PaymentMeansCode","30") XMLAjouteFils(sMonDocXML,"cbc:PaymentID","Invoice 15000001") // Code de moyen de paiement XMLAjouteFils(sMonDocXML,"cac:PayeeFinancialAccount","",Vrai) // Début noeud PaymentMeans.PayeeFinancialAccount (Institution financière succursale) XMLAjouteFils(sMonDocXML,"cbc:ID","BE54000000000097") // Id paiement XMLAjouteFils(sMonDocXML,"cac:FinancialInstitutionBranch","",Vrai) // Début noeud PaymentMeans.PayeeFinancialAccount.FinancialInstitutionBranch XMLAjouteFils(sMonDocXML,"cbc:ID","BPOTBEB1") // Identifiant XMLParent(sMonDocXML) // Fin noeud PaymentMeans.PayeeFinancialAccount.FinancialInstitutionBranch XMLParent(sMonDocXML) // Fin noeud PaymentMeans.PayeeFinancialAccount XMLParent(sMonDocXML) // Fin oeud PaymentMeans // PaymentTerms XMLAjouteFils(sMonDocXML,"cac:PaymentTerms","",Vrai) // Début noeud PaymentTerms (Condition de paiement) XMLAjouteFils(sMonDocXML,"cbc:Note","30 days after invoice date") // Note XMLParent(sMonDocXML) // Fin noeud cac:PaymentTerms // TaxTotal XMLAjouteFils(sMonDocXML,"cac:TaxTotal","",Vrai) // Début noeud TaxTotal (Taxe total) XMLAjouteFils(sMonDocXML,"cbc:TaxAmount","84",Vrai) // Montant de la taxe XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") // Fin attribut XMLParent(sMonDocXML) XMLAjouteFils(sMonDocXML,"cac:TaxSubtotal","",Vrai) // Début noeud TaxTotal.TaxSubtotal (total des taxes) XMLAjouteFils(sMonDocXML,"cbc:TaxableAmount","84",Vrai) // Montant de la taxe XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:TaxAmount","84",Vrai) // Montant de la taxe XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin noeud attribut XMLAjouteFils(sMonDocXML,"cac:TaxCategory","",Vrai) // Début noeud TaxTotal.TaxSubtotal.TaxCategory (Catégorie impôt) XMLAjouteFils(sMonDocXML,"cbc:ID","S") // Identifiant XMLAjouteFils(sMonDocXML,"cbc:Percent","21") // Pourcent XMLAjouteFils(sMonDocXML,"cac:TaxScheme","",Vrai) // Début noeud TaxTotal.TaxSubtotal.TaxCategory.TaxScheme (Régime fiscal) XMLAjouteFils(sMonDocXML,"cbc:ID","VAT") // Identifiant XMLParent(sMonDocXML) // Fin noeud TaxTotal.TaxSubtotal.TaxCategory.TaxScheme XMLParent(sMonDocXML) // Fin noeud TaxTotal.TaxSubtotal.TaxCategory XMLParent(sMonDocXML) // Fin noeud TaxTotal.TaxSubtotal XMLParent(sMonDocXML) // Fin noeud TaxSubtotal // LegalMonetaryTotal XMLAjouteFils(sMonDocXML,"cac:LegalMonetaryTotal","",Vrai) // Début noeud LegalMonetaryTotal (Juridique monétaire) XMLAjouteFils(sMonDocXML,"cbc:LineExtensionAmount","400",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:TaxExclusiveAmount","400",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:TaxInclusiveAmount","484",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:AllowanceTotalAmount","0",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:ChargeTotalAmount","0",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:PrepaidAmount","0",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:PayableAmount","484",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLParent(sMonDocXML) // Fin noeud LegalMonetaryTotal // InvoiceLine XMLAjouteFils(sMonDocXML,"cac:InvoiceLine","",Vrai) // Début noeud InvoiceLine (Ligne de facture) XMLAjouteFils(sMonDocXML,"cbc:ID","1") // Identifiant XMLAjouteFils(sMonDocXML,"cbc:InvoicedQuantity","2",Vrai) // Qté facturée XMLAjouteAttribut(sMonDocXML,"unitCode","ZZ") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:LineExtensionAmount","400",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cac:Item","",Vrai) // Début noeud InvoiceLine.Item (Article) XMLAjouteFils(sMonDocXML,"cbc:Name","Shoes") // Nom article XMLAjouteFils(sMonDocXML,"cac:ClassifiedTaxCategory","",Vrai) // Début noeud InvoiceLine.Item.ClassifiedTaxCategory (Catégorie taxe classée) XMLAjouteFils(sMonDocXML,"cbc:ID","S") // Identifiant XMLAjouteFils(sMonDocXML,"cbc:Percent","21") // Pourcent XMLAjouteFils(sMonDocXML,"cac:TaxScheme","",Vrai) // Début noeud InvoiceLine.Item.ClassifiedTaxCategory.TaxScheme (Régime fiscal) XMLAjouteFils(sMonDocXML,"cbc:ID","VAT") // Identifiant XMLParent(sMonDocXML) // Fin noeud InvoiceLine.Item.ClassifiedTaxCategory.TaxScheme XMLParent(sMonDocXML) // Fin noeud cac:ClassifiedTaxCategory XMLParent(sMonDocXML) // Fin noeud cac:Item XMLAjouteFils(sMonDocXML,"cac:Price","",Vrai) // Début noeud InvoiceLine.PricePrix XMLAjouteFils(sMonDocXML,"cbc:PriceAmount","200",Vrai) // Prix montant XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLParent(sMonDocXML) // Fin noeud InvoiceLine.PricePrix XMLParent(sMonDocXML) // Fin noeud cac:InvoiceLine sInfoXML = XMLConstruitChaîne(sMonDocXML,XMLMiseEnForme,XMLEncodageUTF8) XMLTermine(sMonDocXML) // Libère le document XML // Création du fichier XML fSauveTexte(gsNomRepFichier+"Facture_Manycount.xml",sInfoXML) OuvreFille(FEN_Affiche_Code_Xml,gsNomRepFichier+"Facture_Manycount.xml")
Posté le 26 février 2025 - 11:44
Voici une autre façon de réaliser un fichier XMl. J'au repris l'exemple de Fred, et adapté avec les instructions XMLAJoutefils, etc... Le résultat final est exactement le même. C'est juste une question de choix Il reste toujours de trouver la façon de l'envoyer. Il est possible d'utiliser Billit ou autre, mais il serait préférable de l'envoyer sans devoir être tributaire d'un logiciel intermédaire, mais il trouver comment...sMonDocXML est une chaîne = "XML" sInfoXML est une chaîne // Chaîne résultat // Création du document XML XMLDocument(sMonDocXML, "") // Crée un document XML vierge // Elément Racine XMLAjouteFils(sMonDocXML, "Invoice", "", Vrai) // XMLAjouteAttribut(sMonDocXML, "xmlns:cac", "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2") // Namespace cac XMLAjouteAttribut(sMonDocXML, "xmlns:cbc", "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2") // Namespace cbc XMLAjouteAttribut(sMonDocXML, "xmlns", "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2") // Namespace // Entête XMLAjouteFils(sMonDocXML,"cbc:CustomizationID","urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0") // XMLAjouteFils(sMonDocXML,"cbc:ProfileID","urn:fdc:peppol.eu:2017:poacc:billing:01:1.0") // ID personnalisation XMLAjouteFils(sMonDocXML,"cbc:ID","FC/15") // Identifiant XMLAjouteFils(sMonDocXML,"cbc:IssueDate",DateVersChaîne(DateDuJour(),"AAAA-MM-JJ")) // Date d'émission XMLAjouteFils(sMonDocXML,"cbc:DueDate",DateVersChaîne(DateDuJour(),"AAAA-MM-JJ")) // Date d'échéance XMLAjouteFils(sMonDocXML,"cbc:InvoiceTypeCode","380") // Code de type de facture XMLAjouteFils(sMonDocXML,"cbc:Note","Testcase 1") // Note XMLAjouteFils(sMonDocXML,"cbc:DocumentCurrencyCode","EUR") // Code de la devise du document XMLAjouteFils(sMonDocXML,"cbc:BuyerReference","0000000195") // Numéro de tva vendeur // OrderReference XMLAjouteFils(sMonDocXML,"cac:OrderReference","", Vrai) // Début noeud OrderReference XMLAjouteFils(sMonDocXML,"cbc:ID","YR127129") XMLAjouteFils(sMonDocXML,"cbc:CustomerReference","C000001") XMLParent(sMonDocXML) // Fin noeud OrderReference // AdditionalDocumentReference XMLAjouteFils(sMonDocXML,"cac:AdditionalDocumentReference","", Vrai) // Début noeud AdditionalDocumentReference XMLAjouteFils(sMonDocXML,"cbc:ID","FC/15") XMLAjouteFils(sMonDocXML,"cbc:DocumentDescription","CommercialInvoice") XMLAjouteFils(sMonDocXML,"cac:Attachment","",Vrai) // Début noeud AdditionalDocumentReference.Attachment (pièce jointe) XMLAjouteFils(sMonDocXML,"cbc:EmbeddedDocumentBinaryObject","",Vrai) XMLAjouteAttribut(sMonDocXML,"filename","15000001.pdf") XMLAjouteAttribut(sMonDocXML,"mimeCode","application/pdf") XMLParent(sMonDocXML) // Fin noeud AdditionalDocumentReference.Attachment XMLParent(sMonDocXML) // Fin noeud AdditionalDocumentReference XMLParent(sMonDocXML) // Fin noeud AdditionalDocumentReference // AccountingSupplierParty XMLAjouteFils(sMonDocXML,"cac:AccountingSupplierParty","",Vrai) // Début noeud AccountingSupplierParty, Pièce jointe XMLAjouteFils(sMonDocXML,"cac:Party","",Vrai) // Début noeud AccountingSupplierParty.Party (Pièce jointe) XMLAjouteFils(sMonDocXML,"cbc:EndpointID","0000000196",Vrai) XMLAjouteAttribut(sMonDocXML,"schemeID","0208") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cac:PartyName","",Vrai) // Début noeud AccountingSupplierParty.Party.PartyName XMLAjouteFils(sMonDocXML,"cbc:Name","My Supplier Company N.V.") XMLParent(sMonDocXML) // Fin noeud AccountingSupplierParty.Party.PartyName XMLAjouteFils(sMonDocXML,"cac:PostalAddress","",Vrai) // Début noeud AccountingSupplierParty.Party.PostalAddress (Adresse postale) XMLAjouteFils(sMonDocXML,"cbc:StreetName","e Grote Meir 22") // Nom de la rue XMLAjouteFils(sMonDocXML,"cbc:CityName","ANTWERPEN") // Nom ville XMLAjouteFils(sMonDocXML,"cbc:PostalZone","2000") // Code postal ville XMLAjouteFils(sMonDocXML,"cac:Country","",Vrai) // Début noeud AccountingSupplierParty.Party.PostalAddress.Country (Pays) XMLAjouteFils(sMonDocXML,"cbc:IdentificationCode","BE") // Code identification pays XMLParent(sMonDocXML) // Fin noeud cac:AccountingSupplierParty.Party.PostalAddress.Country XMLParent(sMonDocXML) // Fin noeud AccountingSupplierParty.Party.PostalAddress XMLAjouteFils(sMonDocXML,"cac:PartyTaxScheme","",Vrai) // Début noeud AccountingSupplierParty.Party.PartyTaxScheme XMLAjouteFils(sMonDocXML,"cbc:CompanyID","BE0000000196") // ID de l'entreprise XMLAjouteFils(sMonDocXML,"cac:TaxScheme","",Vrai) // Début noeud AccountingSupplierParty.Party.PartyTaxScheme.TaxScheme XMLAjouteFils(sMonDocXML,"cbc:ID","VAT") // Identifiant XMLParent(sMonDocXML) // Fin noeud cac:AccountingSupplierParty.Party.PartyTaxScheme.TaxScheme XMLParent(sMonDocXML) // Fin noeud AccountingSupplierParty.Party.PartyTaxSchem XMLAjouteFils(sMonDocXML,"cac:PartyLegalEntity","",Vrai) // Début noeud AccountingSupplierParty.Party.PartyLegalEntity XMLAjouteFils(sMonDocXML,"cbc:RegistrationName","My Supplier Company") XMLAjouteFils(sMonDocXML,"cbc:CompanyID","0000000196",Vrai) XMLAjouteAttribut(sMonDocXML,"schemeID","0208") XMLParent(sMonDocXML) // Fin attribut XMLParent(sMonDocXML) // Fin oeud AccountingSupplierParty.Party.PartyLegalEntity XMLAjouteFils(sMonDocXML,"cac:Contact","",Vrai) // Début noeud AccountingSupplierParty.Party.Contact XMLAjouteFils(sMonDocXML,"cbc:ElectronicMail","john.doole@mysuppliercompany.be") // Nom d'enregistrement XMLParent(sMonDocXML) // Fin noeud AccountingSupplierParty.Party.Contact XMLParent(sMonDocXML) // Fin noeud cac:AccountingSupplierParty.Party XMLParent(sMonDocXML) // Fin noeud cac:AccountingSupplierParty // AccountingCustomerParty XMLAjouteFils(sMonDocXML,"cac:AccountingCustomerParty","",Vrai) // Début noeud AccountingCustomerParty XMLAjouteFils(sMonDocXML,"cac:Party","",Vrai) // Début noeud AccountingCustomerParty.Party XMLAjouteFils(sMonDocXML,"cbc:EndpointID","0000000295",Vrai) XMLAjouteAttribut(sMonDocXML,"schemeID","0208") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cac:PartyName","",Vrai) // Début noeud AccountingCustomerParty.Party.PartyName XMLAjouteFils(sMonDocXML,"cbc:Name","My Customer Company S.A.") // Nom XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party.PartyName XMLAjouteFils(sMonDocXML,"cac:PostalAddress","",Vrai) // Début noeud AccountingCustomerParty.Party.PostalAddresse XMLAjouteFils(sMonDocXML,"cbc:StreetName","Boulevard Sint Michel 53") // Nom de la rue XMLAjouteFils(sMonDocXML,"cbc:CityName","BRUXELLES") // Nom ville XMLAjouteFils(sMonDocXML,"cbc:PostalZone","1000") // Code postal XMLAjouteFils(sMonDocXML,"cac:Country","",Vrai) // Début noeud AccountingCustomerParty.Party.PostalAddress.Country XMLAjouteFils(sMonDocXML,"cbc:IdentificationCode","BE") // Code identification XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party.PostalAddresse.Country XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party.PostalAddresse XMLAjouteFils(sMonDocXML,"cac:PartyTaxScheme","",Vrai) // Début noeud AccountingCustomerParty.Party.PartyTaxScheme (Régime fiscal) XMLAjouteFils(sMonDocXML,"cbc:CompanyID","BE0000000295") // Id entreprise XMLAjouteFils(sMonDocXML,"cac:TaxScheme","",Vrai) // Début noeud AccountingCustomerParty.Party.PartyTaxScheme.TaxScheme XMLAjouteFils(sMonDocXML,"cbc:ID","VAT") XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party.PartyTaxScheme.TaxScheme XMLParent(sMonDocXML) // Fin noeud noeud AccountingCustomerParty.Party.PartyTaxScheme XMLAjouteFils(sMonDocXML,"cac:PartyLegalEntity","",Vrai) // Début noeud AccountingCustomerParty.Party.PartyLegalEntity (Entité légale) XMLAjouteFils(sMonDocXML,"cbc:RegistrationName","y Customer Company") // Nom d'enregistrement XMLAjouteFils(sMonDocXML,"cbc:CompanyID","0000000295",Vrai) XMLAjouteAttribut(sMonDocXML,"schemeID","0208") XMLParent(sMonDocXML) // Fin attribut XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party.PartyLegalEntity XMLAjouteFils(sMonDocXML,"cac:Contact","",Vrai) // Début noeud AccountingCustomerParty.Party.Contact XMLAjouteFils(sMonDocXML,"cbc:ElectronicMail","pete.smith@mycustomercompany.be") // Email XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party.Contact XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty // PaymentMeans XMLAjouteFils(sMonDocXML,"cac:PaymentMeans","",Vrai) // Début noeud PaymentMeans (moyen de paiement) XMLAjouteFils(sMonDocXML,"cbc:PaymentMeansCode","30") XMLAjouteFils(sMonDocXML,"cbc:PaymentID","Invoice 15000001") // Code de moyen de paiement XMLAjouteFils(sMonDocXML,"cac:PayeeFinancialAccount","",Vrai) // Début noeud PaymentMeans.PayeeFinancialAccount (Institution financière succursale) XMLAjouteFils(sMonDocXML,"cbc:ID","BE54000000000097") // Id paiement XMLAjouteFils(sMonDocXML,"cac:FinancialInstitutionBranch","",Vrai) // Début noeud PaymentMeans.PayeeFinancialAccount.FinancialInstitutionBranch XMLAjouteFils(sMonDocXML,"cbc:ID","BPOTBEB1") // Identifiant XMLParent(sMonDocXML) // Fin noeud PaymentMeans.PayeeFinancialAccount.FinancialInstitutionBranch XMLParent(sMonDocXML) // Fin noeud PaymentMeans.PayeeFinancialAccount XMLParent(sMonDocXML) // Fin oeud PaymentMeans // PaymentTerms XMLAjouteFils(sMonDocXML,"cac:PaymentTerms","",Vrai) // Début noeud PaymentTerms (Condition de paiement) XMLAjouteFils(sMonDocXML,"cbc:Note","30 days after invoice date") // Note XMLParent(sMonDocXML) // Fin noeud cac:PaymentTerms // TaxTotal XMLAjouteFils(sMonDocXML,"cac:TaxTotal","",Vrai) // Début noeud TaxTotal (Taxe total) XMLAjouteFils(sMonDocXML,"cbc:TaxAmount","84",Vrai) // Montant de la taxe XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") // Fin attribut XMLParent(sMonDocXML) XMLAjouteFils(sMonDocXML,"cac:TaxSubtotal","",Vrai) // Début noeud TaxTotal.TaxSubtotal (total des taxes) XMLAjouteFils(sMonDocXML,"cbc:TaxableAmount","84",Vrai) // Montant de la taxe XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:TaxAmount","84",Vrai) // Montant de la taxe XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin noeud attribut XMLAjouteFils(sMonDocXML,"cac:TaxCategory","",Vrai) // Début noeud TaxTotal.TaxSubtotal.TaxCategory (Catégorie impôt) XMLAjouteFils(sMonDocXML,"cbc:ID","S") // Identifiant XMLAjouteFils(sMonDocXML,"cbc:Percent","21") // Pourcent XMLAjouteFils(sMonDocXML,"cac:TaxScheme","",Vrai) // Début noeud TaxTotal.TaxSubtotal.TaxCategory.TaxScheme (Régime fiscal) XMLAjouteFils(sMonDocXML,"cbc:ID","VAT") // Identifiant XMLParent(sMonDocXML) // Fin noeud TaxTotal.TaxSubtotal.TaxCategory.TaxScheme XMLParent(sMonDocXML) // Fin noeud TaxTotal.TaxSubtotal.TaxCategory XMLParent(sMonDocXML) // Fin noeud TaxTotal.TaxSubtotal XMLParent(sMonDocXML) // Fin noeud TaxSubtotal // LegalMonetaryTotal XMLAjouteFils(sMonDocXML,"cac:LegalMonetaryTotal","",Vrai) // Début noeud LegalMonetaryTotal (Juridique monétaire) XMLAjouteFils(sMonDocXML,"cbc:LineExtensionAmount","400",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:TaxExclusiveAmount","400",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:TaxInclusiveAmount","484",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:AllowanceTotalAmount","0",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:ChargeTotalAmount","0",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:PrepaidAmount","0",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:PayableAmount","484",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLParent(sMonDocXML) // Fin noeud LegalMonetaryTotal // InvoiceLine XMLAjouteFils(sMonDocXML,"cac:InvoiceLine","",Vrai) // Début noeud InvoiceLine (Ligne de facture) XMLAjouteFils(sMonDocXML,"cbc:ID","1") // Identifiant XMLAjouteFils(sMonDocXML,"cbc:InvoicedQuantity","2",Vrai) // Qté facturée XMLAjouteAttribut(sMonDocXML,"unitCode","ZZ") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:LineExtensionAmount","400",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cac:Item","",Vrai) // Début noeud InvoiceLine.Item (Article) XMLAjouteFils(sMonDocXML,"cbc:Name","Shoes") // Nom article XMLAjouteFils(sMonDocXML,"cac:ClassifiedTaxCategory","",Vrai) // Début noeud InvoiceLine.Item.ClassifiedTaxCategory (Catégorie taxe classée) XMLAjouteFils(sMonDocXML,"cbc:ID","S") // Identifiant XMLAjouteFils(sMonDocXML,"cbc:Percent","21") // Pourcent XMLAjouteFils(sMonDocXML,"cac:TaxScheme","",Vrai) // Début noeud InvoiceLine.Item.ClassifiedTaxCategory.TaxScheme (Régime fiscal) XMLAjouteFils(sMonDocXML,"cbc:ID","VAT") // Identifiant XMLParent(sMonDocXML) // Fin noeud InvoiceLine.Item.ClassifiedTaxCategory.TaxScheme XMLParent(sMonDocXML) // Fin noeud cac:ClassifiedTaxCategory XMLParent(sMonDocXML) // Fin noeud cac:Item XMLAjouteFils(sMonDocXML,"cac:Price","",Vrai) // Début noeud InvoiceLine.PricePrix XMLAjouteFils(sMonDocXML,"cbc:PriceAmount","200",Vrai) // Prix montant XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLParent(sMonDocXML) // Fin noeud InvoiceLine.PricePrix XMLParent(sMonDocXML) // Fin noeud cac:InvoiceLine sInfoXML = XMLConstruitChaîne(sMonDocXML,XMLMiseEnForme,XMLEncodageUTF8) XMLTermine(sMonDocXML) // Libère le document XML // Création du fichier XML fSauveTexte(gsNomRepFichier+"Facture_Manycount.xml",sInfoXML) OuvreFille(FEN_Affiche_Code_Xml,gsNomRepFichier+"Facture_Manycount.xml")
Posté le 26 février 2025 - 14:15
Après différentes recherches, j'ai trouvé un programme permettant de tester le fichier XML. Programme de test: https://ecosio.com/en/peppol-and-xml-document-validator/ Plusieurs erreurs sont apparues avec le fichier testé. Après recherche et correction, voilà ci-dessous le fichier corrigé Ce test fonctionne sans aucune erreur. Pour réaliser un test, il faut créer le fichier XML Ouvrir la page web https://ecosio.com/en/peppol-and-xml-document-validator/ Choisir ADID Peppol Invoice (3.0.2) (for BIS 3.0.14) Choisir le fichier créé auparavant Cliquer sur validate Code écrit en WXindev 25: sMonDocXML est une chaîne = "XML" sInfoXML est une chaîne // Chaîne résultat // Création du document XML XMLDocument(sMonDocXML, "") // Crée un document XML vierge // Elément Racine XMLAjouteFils(sMonDocXML, "Invoice", "", Vrai) // XMLAjouteAttribut(sMonDocXML, "xmlns:cac", "urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2") // Namespace cac XMLAjouteAttribut(sMonDocXML, "xmlns:cbc", "urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2") // Namespace cbc XMLAjouteAttribut(sMonDocXML, "xmlns", "urn:oasis:names:specification:ubl:schema:xsd:Invoice-2") // Namespace // Entête XMLAjouteFils(sMonDocXML,"cbc:CustomizationID","urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0") // XMLAjouteFils(sMonDocXML,"cbc:ProfileID","urn:fdc:peppol.eu:2017:poacc:billing:01:1.0") // ID personnalisation XMLAjouteFils(sMonDocXML,"cbc:ID","FC/15") // Identifiant XMLAjouteFils(sMonDocXML,"cbc:IssueDate",DateVersChaîne(DateDuJour(),"AAAA-MM-JJ")) // Date d'émission XMLAjouteFils(sMonDocXML,"cbc:DueDate",DateVersChaîne(DateDuJour(),"AAAA-MM-JJ")) // Date d'échéance XMLAjouteFils(sMonDocXML,"cbc:InvoiceTypeCode","380") // Code de type de facture XMLAjouteFils(sMonDocXML,"cbc:Note","Testcase 1") // Note XMLAjouteFils(sMonDocXML,"cbc:DocumentCurrencyCode","EUR") // Code de la devise du document XMLAjouteFils(sMonDocXML,"cbc:BuyerReference","0000000195") // Numéro de tva vendeur // OrderReference XMLAjouteFils(sMonDocXML,"cac:OrderReference","", Vrai) // Début noeud OrderReference XMLAjouteFils(sMonDocXML,"cbc:ID","YR127129") // XMLAjouteFils(sMonDocXML,"cbc:CustomerReference","C000001") XMLParent(sMonDocXML) // Fin noeud OrderReference // AdditionalDocumentReference XMLAjouteFils(sMonDocXML,"cac:AdditionalDocumentReference","", Vrai) // Début noeud AdditionalDocumentReference XMLAjouteFils(sMonDocXML,"cbc:ID","FC/15") XMLAjouteFils(sMonDocXML,"cbc:DocumentDescription","CommercialInvoice") XMLAjouteFils(sMonDocXML,"cac:Attachment","",Vrai) // Début noeud AdditionalDocumentReference.Attachment (pièce jointe) XMLAjouteFils(sMonDocXML,"cac:ExternalReference","",Vrai) // Début noeud AdditionalDocumentReference.Attachment.ExternalReference XMLAjouteFils(sMonDocXML,"cbc:URI","15000001.pdf") XMLParent(sMonDocXML) // Fin noeud AdditionalDocumentReference.Attachment.ExternalReference XMLParent(sMonDocXML) // Fin noeud AdditionalDocumentReference.Attachment XMLParent(sMonDocXML) // Fin noeud AdditionalDocumentReference // AccountingSupplierParty XMLAjouteFils(sMonDocXML,"cac:AccountingSupplierParty","",Vrai) // Début noeud AccountingSupplierParty, Pièce jointe XMLAjouteFils(sMonDocXML,"cac:Party","",Vrai) // Début noeud AccountingSupplierParty.Party (Pièce jointe) XMLAjouteFils(sMonDocXML,"cbc:EndpointID","0000000196",Vrai) XMLAjouteAttribut(sMonDocXML,"schemeID","0208") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cac:PartyName","",Vrai) // Début noeud AccountingSupplierParty.Party.PartyName XMLAjouteFils(sMonDocXML,"cbc:Name","My Supplier Company N.V.") XMLParent(sMonDocXML) // Fin noeud AccountingSupplierParty.Party.PartyName XMLAjouteFils(sMonDocXML,"cac:PostalAddress","",Vrai) // Début noeud AccountingSupplierParty.Party.PostalAddress (Adresse postale) XMLAjouteFils(sMonDocXML,"cbc:StreetName","e Grote Meir 22") // Nom de la rue XMLAjouteFils(sMonDocXML,"cbc:CityName","ANTWERPEN") // Nom ville XMLAjouteFils(sMonDocXML,"cbc:PostalZone","2000") // Code postal ville XMLAjouteFils(sMonDocXML,"cac:Country","",Vrai) // Début noeud AccountingSupplierParty.Party.PostalAddress.Country (Pays) XMLAjouteFils(sMonDocXML,"cbc:IdentificationCode","BE") // Code identification pays XMLParent(sMonDocXML) // Fin noeud cac:AccountingSupplierParty.Party.PostalAddress.Country XMLParent(sMonDocXML) // Fin noeud AccountingSupplierParty.Party.PostalAddress XMLAjouteFils(sMonDocXML,"cac:PartyTaxScheme","",Vrai) // Début noeud AccountingSupplierParty.Party.PartyTaxScheme XMLAjouteFils(sMonDocXML,"cbc:CompanyID","BE0000000196") // ID de l'entreprise XMLAjouteFils(sMonDocXML,"cac:TaxScheme","",Vrai) // Début noeud AccountingSupplierParty.Party.PartyTaxScheme.TaxScheme XMLAjouteFils(sMonDocXML,"cbc:ID","VAT") // Identifiant XMLParent(sMonDocXML) // Fin noeud cac:AccountingSupplierParty.Party.PartyTaxScheme.TaxScheme XMLParent(sMonDocXML) // Fin noeud AccountingSupplierParty.Party.PartyTaxSchem XMLAjouteFils(sMonDocXML,"cac:PartyLegalEntity","",Vrai) // Début noeud AccountingSupplierParty.Party.PartyLegalEntity XMLAjouteFils(sMonDocXML,"cbc:RegistrationName","My Supplier Company") XMLAjouteFils(sMonDocXML,"cbc:CompanyID","0000000196",Vrai) XMLAjouteAttribut(sMonDocXML,"schemeID","0208") XMLParent(sMonDocXML) // Fin attribut XMLParent(sMonDocXML) // Fin oeud AccountingSupplierParty.Party.PartyLegalEntity XMLAjouteFils(sMonDocXML,"cac:Contact","",Vrai) // Début noeud AccountingSupplierParty.Party.Contact XMLAjouteFils(sMonDocXML,"cbc:ElectronicMail","john.doole@mysuppliercompany.be") // Nom d'enregistrement XMLParent(sMonDocXML) // Fin noeud AccountingSupplierParty.Party.Contact XMLParent(sMonDocXML) // Fin noeud cac:AccountingSupplierParty.Party XMLParent(sMonDocXML) // Fin noeud cac:AccountingSupplierParty // AccountingCustomerParty XMLAjouteFils(sMonDocXML,"cac:AccountingCustomerParty","",Vrai) // Début noeud AccountingCustomerParty XMLAjouteFils(sMonDocXML,"cac:Party","",Vrai) // Début noeud AccountingCustomerParty.Party XMLAjouteFils(sMonDocXML,"cbc:EndpointID","0000000295",Vrai) XMLAjouteAttribut(sMonDocXML,"schemeID","0208") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cac:PartyName","",Vrai) // Début noeud AccountingCustomerParty.Party.PartyName XMLAjouteFils(sMonDocXML,"cbc:Name","My Customer Company S.A.") // Nom XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party.PartyName XMLAjouteFils(sMonDocXML,"cac:PostalAddress","",Vrai) // Début noeud AccountingCustomerParty.Party.PostalAddresse XMLAjouteFils(sMonDocXML,"cbc:StreetName","Boulevard Sint Michel 53") // Nom de la rue XMLAjouteFils(sMonDocXML,"cbc:CityName","BRUXELLES") // Nom ville XMLAjouteFils(sMonDocXML,"cbc:PostalZone","1000") // Code postal XMLAjouteFils(sMonDocXML,"cac:Country","",Vrai) // Début noeud AccountingCustomerParty.Party.PostalAddress.Country XMLAjouteFils(sMonDocXML,"cbc:IdentificationCode","BE") // Code identification XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party.PostalAddresse.Country XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party.PostalAddresse XMLAjouteFils(sMonDocXML,"cac:PartyTaxScheme","",Vrai) // Début noeud AccountingCustomerParty.Party.PartyTaxScheme (Régime fiscal) XMLAjouteFils(sMonDocXML,"cbc:CompanyID","BE0000000295") // Id entreprise XMLAjouteFils(sMonDocXML,"cac:TaxScheme","",Vrai) // Début noeud AccountingCustomerParty.Party.PartyTaxScheme.TaxScheme XMLAjouteFils(sMonDocXML,"cbc:ID","VAT") XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party.PartyTaxScheme.TaxScheme XMLParent(sMonDocXML) // Fin noeud noeud AccountingCustomerParty.Party.PartyTaxScheme XMLAjouteFils(sMonDocXML,"cac:PartyLegalEntity","",Vrai) // Début noeud AccountingCustomerParty.Party.PartyLegalEntity (Entité légale) XMLAjouteFils(sMonDocXML,"cbc:RegistrationName","y Customer Company") // Nom d'enregistrement XMLAjouteFils(sMonDocXML,"cbc:CompanyID","0000000295",Vrai) XMLAjouteAttribut(sMonDocXML,"schemeID","0208") XMLParent(sMonDocXML) // Fin attribut XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party.PartyLegalEntity XMLAjouteFils(sMonDocXML,"cac:Contact","",Vrai) // Début noeud AccountingCustomerParty.Party.Contact XMLAjouteFils(sMonDocXML,"cbc:ElectronicMail","pete.smith@mycustomercompany.be") // Email XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party.Contact XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty.Party XMLParent(sMonDocXML) // Fin noeud AccountingCustomerParty // PaymentMeans XMLAjouteFils(sMonDocXML,"cac:PaymentMeans","",Vrai) // Début noeud PaymentMeans (moyen de paiement) XMLAjouteFils(sMonDocXML,"cbc:PaymentMeansCode","30") XMLAjouteFils(sMonDocXML,"cbc:PaymentID","Invoice 15000001") // Code de moyen de paiement XMLAjouteFils(sMonDocXML,"cac:PayeeFinancialAccount","",Vrai) // Début noeud PaymentMeans.PayeeFinancialAccount (Institution financière succursale) XMLAjouteFils(sMonDocXML,"cbc:ID","BE54000000000097") // Id paiement XMLAjouteFils(sMonDocXML,"cac:FinancialInstitutionBranch","",Vrai) // Début noeud PaymentMeans.PayeeFinancialAccount.FinancialInstitutionBranch XMLAjouteFils(sMonDocXML,"cbc:ID","BPOTBEB1") // Identifiant XMLParent(sMonDocXML) // Fin noeud PaymentMeans.PayeeFinancialAccount.FinancialInstitutionBranch XMLParent(sMonDocXML) // Fin noeud PaymentMeans.PayeeFinancialAccount XMLParent(sMonDocXML) // Fin oeud PaymentMeans // PaymentTerms XMLAjouteFils(sMonDocXML,"cac:PaymentTerms","",Vrai) // Début noeud PaymentTerms (Condition de paiement) XMLAjouteFils(sMonDocXML,"cbc:Note","30 days after invoice date") // Note XMLParent(sMonDocXML) // Fin noeud cac:PaymentTerms // TaxTotal XMLAjouteFils(sMonDocXML,"cac:TaxTotal","",Vrai) // Début noeud TaxTotal (Taxe total) XMLAjouteFils(sMonDocXML,"cbc:TaxAmount","84",Vrai) // Montant de la taxe XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") // Fin attribut XMLParent(sMonDocXML) XMLAjouteFils(sMonDocXML,"cac:TaxSubtotal","",Vrai) // Début noeud TaxTotal.TaxSubtotal (total des taxes) XMLAjouteFils(sMonDocXML,"cbc:TaxableAmount","400",Vrai) // Montant hors taxe XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:TaxAmount","84",Vrai) // Montant de la taxe XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin noeud attribut XMLAjouteFils(sMonDocXML,"cac:TaxCategory","",Vrai) // Début noeud TaxTotal.TaxSubtotal.TaxCategory (Catégorie impôt) XMLAjouteFils(sMonDocXML,"cbc:ID","S") // Identifiant XMLAjouteFils(sMonDocXML,"cbc:Percent","21") // Pourcent XMLAjouteFils(sMonDocXML,"cac:TaxScheme","",Vrai) // Début noeud TaxTotal.TaxSubtotal.TaxCategory.TaxScheme (Régime fiscal) XMLAjouteFils(sMonDocXML,"cbc:ID","VAT") // Identifiant XMLParent(sMonDocXML) // Fin noeud TaxTotal.TaxSubtotal.TaxCategory.TaxScheme XMLParent(sMonDocXML) // Fin noeud TaxTotal.TaxSubtotal.TaxCategory XMLParent(sMonDocXML) // Fin noeud TaxTotal.TaxSubtotal XMLParent(sMonDocXML) // Fin noeud TaxSubtotal // LegalMonetaryTotal XMLAjouteFils(sMonDocXML,"cac:LegalMonetaryTotal","",Vrai) // Début noeud LegalMonetaryTotal (Juridique monétaire) XMLAjouteFils(sMonDocXML,"cbc:LineExtensionAmount","400",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:TaxExclusiveAmount","400",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:TaxInclusiveAmount","484",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:AllowanceTotalAmount","0",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:ChargeTotalAmount","0",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:PrepaidAmount","0",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:PayableAmount","484",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLParent(sMonDocXML) // Fin noeud LegalMonetaryTotal // InvoiceLine XMLAjouteFils(sMonDocXML,"cac:InvoiceLine","",Vrai) // Début noeud InvoiceLine (Ligne de facture) XMLAjouteFils(sMonDocXML,"cbc:ID","1") // Identifiant XMLAjouteFils(sMonDocXML,"cbc:InvoicedQuantity","2",Vrai) // Qté facturée XMLAjouteAttribut(sMonDocXML,"unitCode","ZZ") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cbc:LineExtensionAmount","400",Vrai) XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLAjouteFils(sMonDocXML,"cac:Item","",Vrai) // Début noeud InvoiceLine.Item (Article) XMLAjouteFils(sMonDocXML,"cbc:Name","Shoes") // Nom article XMLAjouteFils(sMonDocXML,"cac:ClassifiedTaxCategory","",Vrai) // Début noeud InvoiceLine.Item.ClassifiedTaxCategory (Catégorie taxe classée) XMLAjouteFils(sMonDocXML,"cbc:ID","S") // Identifiant XMLAjouteFils(sMonDocXML,"cbc:Percent","21") // Pourcent XMLAjouteFils(sMonDocXML,"cac:TaxScheme","",Vrai) // Début noeud InvoiceLine.Item.ClassifiedTaxCategory.TaxScheme (Régime fiscal) XMLAjouteFils(sMonDocXML,"cbc:ID","VAT") // Identifiant XMLParent(sMonDocXML) // Fin noeud InvoiceLine.Item.ClassifiedTaxCategory.TaxScheme XMLParent(sMonDocXML) // Fin noeud cac:ClassifiedTaxCategory XMLParent(sMonDocXML) // Fin noeud cac:Item XMLAjouteFils(sMonDocXML,"cac:Price","",Vrai) // Début noeud InvoiceLine.PricePrix XMLAjouteFils(sMonDocXML,"cbc:PriceAmount","200",Vrai) // Prix montant XMLAjouteAttribut(sMonDocXML,"currencyID","EUR") XMLParent(sMonDocXML) // Fin attribut XMLParent(sMonDocXML) // Fin noeud InvoiceLine.PricePrix XMLParent(sMonDocXML) // Fin noeud cac:InvoiceLine sInfoXML = XMLConstruitChaîne(sMonDocXML,XMLMiseEnForme,XMLEncodageUTF8) XMLTermine(sMonDocXML) // Libère le document XML // Création du fichier XML fSauveTexte(gsNomRepFichier+"Facture_Test2.xml",sInfoXML) OuvreFille(FEN_Affiche_Code_Xml,gsNomRepFichier+"Facture_Test2.xml")
Posté le 26 février 2025 - 14:29
Bonjour Sacré Patrice, Merci pour la modification du code qui semble plus propre. Après, c'est effectivement une question de choix et de préférence. Pour l'envoi de la facture, il n'y a pas 36 solutions, soit il faut devenir un point d'accès officiel PEPPOL et pour cela j'avais pris mes renseignement l'année passée et le prix est exorbitant dans le cas d'une petite structure ou alors il faut utiliser des points d'accès existant comme BillToBox ou BillIt qui ne sont pas des programmes mes des sites internet permettant d'envoyer la facture au format UBL sur une adresse mail afin de la traiter automatiquement ou manuellement ensuite. La plateforme DOCCLE en Belgique va également proposer ce type de fonctionnalité mais ils ne sont pas encore opérationnels pour l'envoi. Dans tout les cas, il est évident que ce type de solution est très bien pour de petite structure mais devient très limité dans le cas ou le débit de facture mensuel est très élevé. De mon côté je n'ai pas encore trouvé mieux mais je suis preneur si une solution plus automatisée existe.
Membre enregistré 1 381 messages
Posté le 27 février 2025 - 16:54
Posté le 04 mars 2025 - 15:43
MERCI @Sacré Patrice
Membre enregistré 3 messages
Posté le 06 mars 2025 - 12:16
Bertin - Zen-Project a écrit : Bonjour, Concernés aussi. Si vous avez une solutions pour l'envoi dans le réseau Peppol nous sommes preneur
Posté le 25 mars 2025 - 22:31
Bonjour, A partir du code présent sur ce forum ,j'ai créé 3 classes clFacture, clLigneFacture et clIntervenant pour générer le fichier xml. Voici le lien vers un projet test (Windev 2024) : https://github.com/JFbil/Facture-Electronique-Peppol Il faut créer une classe qui hérite de la classe clFacture et dans laquelle on implémente le code spécifique au projet (voir classe clFactureTest) N'hésitez pas à me faire part de vos remarques, commentaires et/ou améliorations éventuelles. Email : info@billinfo.be
Membre enregistré 173 messages
Posté le 26 mars 2025 - 09:07
Jbil a écrit : Bonjour,
A partir du code présent sur ce forum ,j'ai créé 3 classes clFacture, clLigneFacture et clIntervenant pour générer le fichier xml.
Voici le lien vers un projet test (Windev 2024) :
https://github.com/JFbil/Facture-Electronique-Peppol Il faut créer une classe qui hérite de la classe clFacture et dans laquelle on implémente le code spécifique au projet (voir classe clFactureTest)
N'hésitez pas à me faire part de vos remarques, commentaires et/ou améliorations éventuelles.
Email : info@billinfo.be
Bonjour, Vous auriez une version WinDev 28 ou bien les sources des classes au format texte svp ?
Posté le 26 mars 2025 - 19:52
BP a écrit : Jbil a écrit :
Bonjour,
A partir du code présent sur ce forum ,j'ai créé 3 classes clFacture, clLigneFacture et clIntervenant pour générer le fichier xml.
Voici le lien vers un projet test (Windev 2024) :
https://github.com/JFbil/Facture-Electronique-Peppol Il faut créer une classe qui hérite de la classe clFacture et dans laquelle on implémente le code spécifique au projet (voir classe clFactureTest)
N'hésitez pas à me faire part de vos remarques, commentaires et/ou améliorations éventuelles.
Email : info@billinfo.be
Bonjour,
Vous auriez une version WinDev 28 ou bien les sources des classes au format texte svp ?
Voilà, j'ai ajouté les fichiers txt. ça risque d'être plus compliqué à importer. J'ai WD27, je vais essayer de transférer de WD2024 à WD27. Vous pourrez l'importer avec WD28 Email : info@billinfo.be