cii_22_templates.xml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <data>
  4. <template id="account_invoice_line_facturx_export_22">
  5. <t t-set="line" t-value="line_vals['line']"/>
  6. <t xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
  7. xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
  8. xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
  9. <ram:IncludedSupplyChainTradeLineItem>
  10. <!-- Line number. -->
  11. <ram:AssociatedDocumentLineDocument>
  12. <ram:LineID t-out="line_vals.get('index')"/>
  13. </ram:AssociatedDocumentLineDocument>
  14. <!-- Product. -->
  15. <ram:SpecifiedTradeProduct>
  16. <ram:GlobalID
  17. schemeID="0160"
  18. t-if="line.product_id and line.product_id.barcode"
  19. t-out="line.product_id.barcode"/>
  20. <ram:SellerAssignedID
  21. t-if="line.product_id and line.product_id.default_code"
  22. t-out="line.product_id.default_code"/>
  23. <!-- TODO:
  24. <ram:Name t-esc="line.product_id.name or line.name"/>
  25. <ram:Description t-esc="line.name" t-if="line.name != line.product_id.name"/>
  26. -->
  27. <ram:Name t-esc="line.name"/>
  28. </ram:SpecifiedTradeProduct>
  29. <!-- Amounts. -->
  30. <ram:SpecifiedLineTradeAgreement>
  31. <!-- Line information: unit_price
  32. NB: the gross_price_unit should be the price tax excluded !
  33. if price_unit = 100 and tax 10% price_include -> then the gross_price_unit is 91
  34. -->
  35. <ram:GrossPriceProductTradePrice>
  36. <ram:ChargeAmount t-out="format_monetary(line_vals['gross_price_total_unit'], 2)"/>
  37. <!-- Discount. -->
  38. <ram:AppliedTradeAllowanceCharge t-if="line.discount">
  39. <ram:ChargeIndicator>
  40. <udt:Indicator>false</udt:Indicator>
  41. </ram:ChargeIndicator>
  42. <ram:ActualAmount t-out="format_monetary(line_vals['price_discount_unit'], 2)"/>
  43. </ram:AppliedTradeAllowanceCharge>
  44. </ram:GrossPriceProductTradePrice>
  45. <!-- Line unit price, with discount applied -->
  46. <ram:NetPriceProductTradePrice>
  47. <ram:ChargeAmount
  48. t-out="format_monetary(line_vals['price_subtotal_unit'], 2)"/>
  49. </ram:NetPriceProductTradePrice>
  50. </ram:SpecifiedLineTradeAgreement>
  51. <!-- Quantity. -->
  52. <ram:SpecifiedLineTradeDelivery>
  53. <ram:BilledQuantity
  54. t-att-unitCode="line_vals.get('unece_uom_code')"
  55. t-out="line.quantity"/> <!-- /!\ The quantity is the line.quantity since we keep the unece_uom_code ! -->
  56. </ram:SpecifiedLineTradeDelivery>
  57. <ram:SpecifiedLineTradeSettlement>
  58. <t t-foreach="tax_details['tax_details_per_record'][line]['tax_details'].values()"
  59. t-as="tax_detail_vals">
  60. <ram:ApplicableTradeTax t-if="tax_detail_vals['amount_type'] == 'percent'">
  61. <ram:TypeCode t-translation="off">VAT</ram:TypeCode>
  62. <ram:CategoryCode t-out="tax_detail_vals['tax_category_code']"/>
  63. <ram:RateApplicablePercent t-out="tax_detail_vals['amount']"/>
  64. </ram:ApplicableTradeTax>
  65. </t>
  66. <!-- Allowance/Charge on the line -->
  67. <t t-foreach="line_vals.get('allowance_charge_vals_list')" t-as="allowance_charge_vals">
  68. <ram:SpecifiedTradeAllowanceCharge>
  69. <ram:ChargeIndicator>
  70. <udt:Indicator t-esc="allowance_charge_vals['indicator']"/>
  71. </ram:ChargeIndicator>
  72. <ram:ActualAmount t-esc="format_monetary(allowance_charge_vals['amount'], 2)"/>
  73. <ram:ReasonCode t-esc="allowance_charge_vals['reason_code']"/>
  74. <ram:Reason t-esc="allowance_charge_vals['reason']"/>
  75. </ram:SpecifiedTradeAllowanceCharge>
  76. </t>
  77. <!-- Subtotal. -->
  78. <ram:SpecifiedTradeSettlementLineMonetarySummation>
  79. <ram:LineTotalAmount t-esc="format_monetary(line_vals['line_total_amount'], 2)"/>
  80. </ram:SpecifiedTradeSettlementLineMonetarySummation>
  81. </ram:SpecifiedLineTradeSettlement>
  82. </ram:IncludedSupplyChainTradeLineItem>
  83. </t>
  84. </template>
  85. <template id="account_invoice_partner_facturx_export_22">
  86. <t xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
  87. xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
  88. xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
  89. <!-- Contact. -->
  90. <ram:Name t-out="partner.name"/>
  91. <ram:SpecifiedLegalOrganization t-if="specified_legal_organization_val">
  92. <ram:ID t-att-schemeID="str('0002')"
  93. t-out="specified_legal_organization_val"/>
  94. </ram:SpecifiedLegalOrganization>
  95. <ram:DefinedTradeContact t-if="not hide_dtc">
  96. <ram:PersonName t-esc="partner.name"/>
  97. <ram:TelephoneUniversalCommunication t-if="partner.phone or partner.mobile">
  98. <ram:CompleteNumber t-esc="partner.phone or partner.mobile"/>
  99. </ram:TelephoneUniversalCommunication>
  100. <ram:EmailURIUniversalCommunication t-if="partner.email">
  101. <ram:URIID schemeID='SMTP' t-esc="partner.email"/>
  102. </ram:EmailURIUniversalCommunication>
  103. </ram:DefinedTradeContact>
  104. <!-- Address. -->
  105. <t t-call="account_edi_ubl_cii.account_invoice_address_facturx_export_22"/>
  106. </t>
  107. </template>
  108. <template id="account_invoice_address_facturx_export_22">
  109. <t xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
  110. xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
  111. xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
  112. <!-- Address. -->
  113. <ram:PostalTradeAddress>
  114. <ram:PostcodeCode t-out="partner.zip"/>
  115. <ram:LineOne t-out="partner.street"/>
  116. <ram:LineTwo t-out="partner.street2"/>
  117. <ram:CityName t-out="partner.city"/>
  118. <ram:CountryID t-out="partner.country_id.code"/>
  119. </ram:PostalTradeAddress>
  120. </t>
  121. </template>
  122. <template id="account_invoice_facturx_export_22">
  123. <t t-set="currency" t-value="record.currency_id or record.company_currency_id"/>
  124. <rsm:CrossIndustryInvoice
  125. xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100"
  126. xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100"
  127. xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100">
  128. <!-- Factur-x level:
  129. * minimum or basicwl: urn:factur-x.eu:1p0...
  130. * basic: urn:cen.eu:en16931:2017:compliant:factur-x.eu:1p0:basic
  131. * en16931: urn:cen.eu:en16931:2017
  132. -->
  133. <rsm:ExchangedDocumentContext>
  134. <ram:GuidelineSpecifiedDocumentContextParameter>
  135. <ram:ID t-out="document_context_id"/>
  136. </ram:GuidelineSpecifiedDocumentContextParameter>
  137. </rsm:ExchangedDocumentContext>
  138. <!-- Document Headers. -->
  139. <rsm:ExchangedDocument>
  140. <ram:ID t-out="ExchangedDocument_vals.get('id')"/>
  141. <ram:TypeCode t-out="ExchangedDocument_vals.get('type_code')"/>
  142. <ram:IssueDateTime t-if="ExchangedDocument_vals.get('issue_date_time')">
  143. <udt:DateTimeString format="102" t-out="format_date(ExchangedDocument_vals.get('issue_date_time'))"/>
  144. </ram:IssueDateTime>
  145. <ram:IncludedNote>
  146. <ram:Content t-out="ExchangedDocument_vals.get('included_note')"/>
  147. </ram:IncludedNote>
  148. </rsm:ExchangedDocument>
  149. <rsm:SupplyChainTradeTransaction>
  150. <!-- Invoice lines. -->
  151. <t t-foreach="invoice_line_vals_list" t-as="line_vals">
  152. <t t-call="account_edi_ubl_cii.account_invoice_line_facturx_export_22"/>
  153. </t>
  154. <!-- Partners. -->
  155. <ram:ApplicableHeaderTradeAgreement>
  156. <!-- "Service Exécutant" (Used by Chorus Pro) -->
  157. <ram:BuyerReference t-out="buyer_reference"/>
  158. <!-- Seller. -->
  159. <ram:SellerTradeParty>
  160. <!-- Address. -->
  161. <t t-call="account_edi_ubl_cii.account_invoice_partner_facturx_export_22">
  162. <t t-set="partner" t-value="record.company_id.partner_id"/>
  163. <t t-set="specified_legal_organization_val" t-value="seller_specified_legal_organization"/>
  164. </t>
  165. <!-- VAT. -->
  166. <ram:SpecifiedTaxRegistration t-if="record.company_id.vat">
  167. <ram:ID schemeID="VA" t-out="record.company_id.vat"/>
  168. </ram:SpecifiedTaxRegistration>
  169. </ram:SellerTradeParty>
  170. <!-- Customer. -->
  171. <ram:BuyerTradeParty>
  172. <!-- Address. -->
  173. <t t-call="account_edi_ubl_cii.account_invoice_partner_facturx_export_22">
  174. <t t-set="partner" t-value="record.commercial_partner_id"/>
  175. <t t-set="specified_legal_organization_val" t-value="buyer_specified_legal_organization"/>
  176. </t>
  177. <!-- VAT. -->
  178. <ram:SpecifiedTaxRegistration t-if="record.commercial_partner_id.vat">
  179. <ram:ID schemeID="VA" t-out="record.commercial_partner_id.vat"/>
  180. </ram:SpecifiedTaxRegistration>
  181. </ram:BuyerTradeParty>
  182. <!-- Reference. -->
  183. <ram:BuyerOrderReferencedDocument>
  184. <!-- "Engagement Juridique" (used by Chorus Pro) -->
  185. <ram:IssuerAssignedID t-out="purchase_order_reference"/>
  186. </ram:BuyerOrderReferencedDocument>
  187. <ram:ContractReferencedDocument>
  188. <!-- "Numéro de Marché" (Used by Chorus Pro) -->
  189. <ram:IssuerAssignedID t-out="contract_reference"/>
  190. </ram:ContractReferencedDocument>
  191. </ram:ApplicableHeaderTradeAgreement>
  192. <!-- Delivery -->
  193. <ram:ApplicableHeaderTradeDelivery>
  194. <ram:ShipToTradeParty>
  195. <t t-call="account_edi_ubl_cii.account_invoice_partner_facturx_export_22">
  196. <t t-set="partner"
  197. t-value="ship_to_trade_party"/>
  198. <t t-set="hide_dtc" t-value="document_context_id == 'urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.2'"/>
  199. </t>
  200. </ram:ShipToTradeParty>
  201. <ram:ActualDeliverySupplyChainEvent t-if="scheduled_delivery_time">
  202. <ram:OccurrenceDateTime>
  203. <udt:DateTimeString t-att-format="102"
  204. t-out="format_date(scheduled_delivery_time)"/>
  205. </ram:OccurrenceDateTime>
  206. </ram:ActualDeliverySupplyChainEvent>
  207. </ram:ApplicableHeaderTradeDelivery>
  208. <!-- Taxes. -->
  209. <ram:ApplicableHeaderTradeSettlement>
  210. <ram:PaymentReference t-out="record.payment_reference"/>
  211. <ram:InvoiceCurrencyCode t-out="currency.name"/>
  212. <!-- Bank account. -->
  213. <ram:SpecifiedTradeSettlementPaymentMeans t-if="record.partner_bank_id.sanitized_acc_number">
  214. <ram:TypeCode>42</ram:TypeCode>
  215. <ram:PayeePartyCreditorFinancialAccount>
  216. <ram:IBANID
  217. t-if="record.partner_bank_id.sanitized_acc_number == 'iban'"
  218. t-out="record.partner_bank_id.sanitized_acc_number"/>
  219. <ram:ProprietaryID
  220. t-if="record.partner_bank_id.sanitized_acc_number != 'iban'"
  221. t-out="record.partner_bank_id.sanitized_acc_number"/>
  222. </ram:PayeePartyCreditorFinancialAccount>
  223. </ram:SpecifiedTradeSettlementPaymentMeans>
  224. <!-- Tax Summary. -->
  225. <t t-foreach="tax_details.get('tax_details', {}).values()" t-as="tax_detail_vals">
  226. <ram:ApplicableTradeTax>
  227. <ram:CalculatedAmount
  228. t-out="format_monetary(tax_detail_vals.get('calculated_amount'), 2)"/>
  229. <ram:TypeCode t-translation="off">VAT</ram:TypeCode>
  230. <ram:ExemptionReason t-out="tax_detail_vals.get('tax_exemption_reason')"/>
  231. <ram:BasisAmount
  232. t-out="format_monetary(tax_detail_vals['base_amount_currency'], 2)"/>
  233. <ram:CategoryCode t-out="tax_detail_vals['tax_category_code']"/>
  234. <ram:ExemptionReasonCode t-out="tax_detail_vals['tax_exemption_reason_code']"/>
  235. <!-- 5 = Tax is exigible on the date on the invoice -->
  236. <ram:DueDateTypeCode>5</ram:DueDateTypeCode>
  237. <ram:RateApplicablePercent
  238. t-if="tax_detail_vals['amount_type'] == 'percent'"
  239. t-out="tax_detail_vals['amount']"/>
  240. </ram:ApplicableTradeTax>
  241. </t>
  242. <!-- Billing Period -->
  243. <ram:BillingSpecifiedPeriod t-if="billing_start and billing_end">
  244. <ram:StartDateTime>
  245. <udt:DateTimeString format="102" t-out="format_date(billing_start)"/>
  246. </ram:StartDateTime>
  247. <ram:EndDateTime>
  248. <udt:DateTimeString format="102" t-out="format_date(billing_end)"/>
  249. </ram:EndDateTime>
  250. </ram:BillingSpecifiedPeriod>
  251. <!-- Payment Term. -->
  252. <ram:SpecifiedTradePaymentTerms>
  253. <ram:Description t-if="record.invoice_payment_term_id" t-out="record.invoice_payment_term_id.name"/>
  254. <ram:DueDateDateTime t-if="record.invoice_date_due">
  255. <udt:DateTimeString format="102" t-out="format_date(record.invoice_date_due)"/>
  256. </ram:DueDateDateTime>
  257. </ram:SpecifiedTradePaymentTerms>
  258. <!-- Summary. -->
  259. <ram:SpecifiedTradeSettlementHeaderMonetarySummation>
  260. <ram:LineTotalAmount
  261. t-esc="format_monetary(tax_basis_total_amount, 2)"/>
  262. <ram:TaxBasisTotalAmount
  263. t-esc="format_monetary(tax_basis_total_amount, 2)"/>
  264. <ram:TaxTotalAmount
  265. t-att-currencyID="currency.name"
  266. t-esc="format_monetary(tax_total_amount, 2)"/>
  267. <ram:GrandTotalAmount
  268. t-out="format_monetary(record.amount_total, 2)"/>
  269. <ram:TotalPrepaidAmount
  270. t-out="format_monetary(record.amount_total - record.amount_residual, 2)"/>
  271. <ram:DuePayableAmount
  272. t-out="format_monetary(record.amount_residual, 2)"/>
  273. </ram:SpecifiedTradeSettlementHeaderMonetarySummation>
  274. </ram:ApplicableHeaderTradeSettlement>
  275. </rsm:SupplyChainTradeTransaction>
  276. </rsm:CrossIndustryInvoice>
  277. </template>
  278. <template id="account_invoice_pdfa_3_facturx_metadata">
  279. <x:xmpmeta xmlns:x="adobe:ns:meta/">
  280. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  281. <rdf:Description xmlns:pdfaid="http://www.aiim.org/pdfa/ns/id/" rdf:about="">
  282. <pdfaid:part>3</pdfaid:part>
  283. <pdfaid:conformance>B</pdfaid:conformance>
  284. </rdf:Description>
  285. <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
  286. <dc:title>
  287. <rdf:Alt>
  288. <rdf:li t-att="{'xml:lang': 'x-default'}" t-esc="title"/>
  289. </rdf:Alt>
  290. </dc:title>
  291. <dc:creator>
  292. <rdf:Seq>
  293. <rdf:li>Odoo</rdf:li>
  294. </rdf:Seq>
  295. </dc:creator>
  296. <dc:description>
  297. <rdf:Alt>
  298. <rdf:li t-att="{'xml:lang': 'x-default'}">Invoice generated by Odoo</rdf:li>
  299. </rdf:Alt>
  300. </dc:description>
  301. </rdf:Description>
  302. <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
  303. <pdf:Producer>Odoo</pdf:Producer>
  304. </rdf:Description>
  305. <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
  306. <xmp:CreatorTool>Odoo</xmp:CreatorTool>
  307. <xmp:CreateDate t-esc="date"/>
  308. <xmp:ModifyDate t-esc="date"/>
  309. </rdf:Description>
  310. <rdf:Description xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/"
  311. xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#"
  312. xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#" rdf:about="">
  313. <pdfaExtension:schemas>
  314. <rdf:Bag>
  315. <rdf:li rdf:parseType="Resource">
  316. <pdfaSchema:schema t-translation="off">Factur-X PDFA Extension Schema</pdfaSchema:schema>
  317. <pdfaSchema:namespaceURI>urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#</pdfaSchema:namespaceURI>
  318. <pdfaSchema:prefix>fx</pdfaSchema:prefix>
  319. <pdfaSchema:property>
  320. <rdf:Seq>
  321. <rdf:li rdf:parseType="Resource">
  322. <pdfaProperty:name t-translation="off">DocumentFileName</pdfaProperty:name>
  323. <pdfaProperty:valueType t-translation="off">Text</pdfaProperty:valueType>
  324. <pdfaProperty:category t-translation="off">external</pdfaProperty:category>
  325. <pdfaProperty:description t-translation="off">name of the embedded XML invoice file</pdfaProperty:description>
  326. </rdf:li>
  327. <rdf:li rdf:parseType="Resource">
  328. <pdfaProperty:name t-translation="off">DocumentType</pdfaProperty:name>
  329. <pdfaProperty:valueType t-translation="off">Text</pdfaProperty:valueType>
  330. <pdfaProperty:category t-translation="off">external</pdfaProperty:category>
  331. <pdfaProperty:description t-translation="off">INVOICE</pdfaProperty:description>
  332. </rdf:li>
  333. <rdf:li rdf:parseType="Resource">
  334. <pdfaProperty:name t-translation="off">Version</pdfaProperty:name>
  335. <pdfaProperty:valueType t-translation="off">Text</pdfaProperty:valueType>
  336. <pdfaProperty:category t-translation="off">external</pdfaProperty:category>
  337. <pdfaProperty:description t-translation="off">The actual version of the Factur-X XML schema</pdfaProperty:description>
  338. </rdf:li>
  339. <rdf:li rdf:parseType="Resource">
  340. <pdfaProperty:name t-translation="off">ConformanceLevel</pdfaProperty:name>
  341. <pdfaProperty:valueType t-translation="off">Text</pdfaProperty:valueType>
  342. <pdfaProperty:category t-translation="off">external</pdfaProperty:category>
  343. <pdfaProperty:description t-translation="off">The conformance level of the embedded Factur-X data</pdfaProperty:description>
  344. </rdf:li>
  345. </rdf:Seq>
  346. </pdfaSchema:property>
  347. </rdf:li>
  348. </rdf:Bag>
  349. </pdfaExtension:schemas>
  350. </rdf:Description>
  351. <rdf:Description xmlns:fx="urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0#" rdf:about="">
  352. <fx:ConformanceLevel>EN 16931</fx:ConformanceLevel>
  353. <fx:DocumentFileName>factur-x.xml</fx:DocumentFileName>
  354. <fx:DocumentType t-translation="off">INVOICE</fx:DocumentType>
  355. <fx:Version>1.0</fx:Version>
  356. </rdf:Description>
  357. </rdf:RDF>
  358. </x:xmpmeta>
  359. </template>
  360. </data>
  361. </odoo>