Odoo18-Base/addons/l10n_jo_edi/data/ubl_jo_templates.xml
2025-01-06 10:57:38 +07:00

85 lines
4.3 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<template id="ubl_jo_InvoiceType" inherit_id="account_edi_ubl_cii.ubl_20_InvoiceType" primary="True">
<xpath expr="//*[local-name()='BillingReference']//*[local-name()='InvoiceDocumentReference']" position="inside">
<cbc:DocumentDescription
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
t-out="billing_reference_vals.get('document_description')"/>
</xpath>
<xpath expr="//*[local-name()='AdditionalDocumentReference']//*[local-name()='ID']" position="after">
<cbc:UUID
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
t-out="foreach_vals['uuid']"/>
</xpath>
<xpath expr="//*[local-name()='AccountingCustomerParty']" position="inside">
<cac:AccountingContact
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
<cbc:Telephone t-out="accounting_customer_vals['accounting_contact']['telephone']"/>
</cac:AccountingContact>
</xpath>
<xpath expr="//*[local-name()='AccountingCustomerParty']" position="after">
<cac:SellerSupplierParty
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
<t t-set="seller_supplier_vals" t-value="vals['seller_supplier_party_vals']"/>
<cac:Party>
<t t-call="{{PartyType_template}}">
<t t-set="vals" t-value="seller_supplier_vals['party_vals']"/>
</t>
</cac:Party>
</cac:SellerSupplierParty>
</xpath>
</template>
<template id="ubl_jo_Invoice">
<Invoice
xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2">
<t t-call="{{InvoiceType_template}}"/>
</Invoice>
</template>
<template id="ubl_jo_PaymentMeansType" inherit_id="account_edi_ubl_cii.ubl_20_PaymentMeansType" primary="True">
<xpath expr="//*[local-name()='PaymentMeansCode']" position="after">
<cbc:InstructionNote
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
t-out="vals['instruction_note']"/>
</xpath>
</template>
<template id="ubl_jo_InvoiceLineType" inherit_id="account_edi_ubl_cii.ubl_20_InvoiceLineType" primary="True">
<xpath expr="//*[local-name()='AllowanceCharge']" position="replace"/>
<xpath expr="//*[local-name()='Price']//*[local-name()='BaseQuantity']" position="after">
<cac:AllowanceCharge
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
t-foreach="vals['allowance_charge_vals']" t-as="foreach_vals">
<t t-call="{{AllowanceChargeType_template}}">
<t t-set="vals" t-value="foreach_vals"/>
</t>
</cac:AllowanceCharge>
</xpath>
<xpath expr="//*[local-name()='Price']//*[local-name()='PriceAmount']" position="attributes">
<attribute name="t-out">
format_float(vals['price_amount'], vals['product_price_dp'])
</attribute>
</xpath>
</template>
<template id="ubl_jo_TaxTotalType" inherit_id="account_edi_ubl_cii.ubl_20_TaxTotalType" primary="True">
<xpath expr="//*[local-name()='TaxAmount']" position="after">
<cbc:RoundingAmount
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
t-att-currencyID="vals['currency'].name"
t-out="format_float(vals.get('rounding_amount'), vals.get('currency_dp'))"/>
</xpath>
</template>
</odoo>