OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

ubl-dev message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [ubl-dev] UBL 2.0 Order document with discounts and VAT calculations


That example also highlights to me that LineExtension is misdefined
since the only place I can see the goods value before tax and allowances
and charges is in the Price. I get a feeling it should have been LineExtension
too (since price has a slightly different meaning when used together with
quantity and units - it can be price per unit). I think this is an error for
eventual correction (or there is a need for another BBIE for the price before
allowances, charges and tax, etc).

Best regards

Steve
---
Stephen D Green



On 16 December 2011 16:37, Stephen D Green <stephen.green@documentengineeringservices.com> wrote:
I've looked at this some more and I think Kees does have a valid use
case which highlights a gap in UBL 2.0.
 
The best I can do for his use case is as below and it doesn't really work
well. I think the answer would be to include TaxTotal as a child of LineItem.
 
See below for the best I could do without it and it doesn't state anywhere
nor can it do so, I think) that the tax amount on the goods is 8.00 EUR.
You have to get that from a calculation. In contrast it does state that the
tax on the charge is 2.00 EUR.
 

<Order

xmlns="urn:oasis:names:specification:ubl:schema:xsd:Order-2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
<cbc:ID>xyz</cbc:ID>
<cbc:IssueDate>2012-01-01</cbc:IssueDate>
<cac:BuyerCustomerParty></cac:BuyerCustomerParty>
<cac:SellerSupplierParty></cac:SellerSupplierParty>

<cac:TaxTotal>
<cbc:TaxAmount currencyID="EUR">10.00</cbc:TaxAmount>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="EUR">50.00</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="EUR">10.00</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:Percent>20</cbc:Percent>
<cac:TaxScheme>
<cbc:TaxTypeCode>Dom-H</cbc:TaxTypeCode>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
<cac:AnticipatedMonetaryTotal>
<cbc:LineExtensionAmount currencyID="EUR">50.00</cbc:LineExtensionAmount>
<cbc:TaxExclusiveAmount currencyID="EUR">50.00</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID="EUR">60.00</cbc:TaxInclusiveAmount>
<cbc:AllowanceTotalAmount currencyID="EUR">60.00</cbc:AllowanceTotalAmount>
<cbc:ChargeTotalAmount currencyID="EUR">10.00</cbc:ChargeTotalAmount>
<cbc:PayableAmount currencyID="GBP">60.00</cbc:PayableAmount>
</cac:AnticipatedMonetaryTotal>
<cac:OrderLine>
<cbc:Note>goods</cbc:Note>
<cac:LineItem>
<cbc:ID>1</cbc:ID>
<cbc:SalesOrderID>A</cbc:SalesOrderID>
<cbc:LineStatusCode>NoStatus</cbc:LineStatusCode>
<cbc:Quantity unitCode="KM">1</cbc:Quantity>
<cbc:LineExtensionAmount currencyID="EUR">50.00</cbc:LineExtensionAmount>
<cbc:TotalTaxAmount currencyID="EUR">10</cbc:TotalTaxAmount>
<cac:Price>
<cbc:PriceAmount currencyID="EUR">100.00</cbc:PriceAmount>
<cac:AllowanceCharge>
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
<cbc:Amount currencyID="EUR">60.00</cbc:Amount>
</cac:AllowanceCharge>
<cac:AllowanceCharge>
<cbc:ChargeIndicator>true</cbc:ChargeIndicator>
<cbc:Amount currencyID="EUR">10.00</cbc:Amount>
<cac:TaxTotal>
<cbc:TaxAmount>2.00</cbc:TaxAmount>
<cac:TaxSubtotal>
<cbc:TaxAmount>2.00</cbc:TaxAmount>

<cac:TaxCategory>
<cbc:Percent>20</cbc:Percent>
<cac:TaxScheme>
<cbc:TaxTypeCode>Dom-H</cbc:TaxTypeCode>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
</cac:AllowanceCharge>
</cac:Price>
<cac:Item>
<cbc:Description>Item A</cbc:Description>
<cac:ClassifiedTaxCategory>
<cbc:Percent>20</cbc:Percent>
<cac:TaxScheme>
<cbc:TaxTypeCode>Dom-H</cbc:TaxTypeCode>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>
</cac:Item>
</cac:LineItem>
</cac:OrderLine>
</Order>
 

Best regards

Steve
---
Stephen D Green



On 16 December 2011 12:12, Stephen D Green <stephen.green@documentengineeringservices.com> wrote:
Kees,
 
Is there a problem with putting the tax details in LineItem/Item/ClassifiedTaxCategory and the
tax amount inside LineItem/TaxTotalAmount ? Is it that you don't want to lump the tax for
the charge in with the tax for the goods? If so I'd still be inclined to put the charge on a
separate line and/or rely on the tax structure inside the AllowanceCharge for making
everything unambiguous.
 
Thanks for pointing out the Tax structures inside the AllowanceCharge; I hadn't noticed these
because I've been using a subset with didn't include them. For this kind of thing they do seem
useful. I do reckon having more than one way to do the same thing is a nuisance sometimes
but when you are handling both sending and receiving that wouldn't be such a problem for you
and you can probably happily use whatever you like in UBL.
 

Best regards

Steve
---
Stephen D Green



On 16 December 2011 10:14, Duvekot, Kees <kduvekot@wehkamp.nl> wrote:

Steve,

 

The ClassifiedTaxCategory almost has all the components that we would need, except for one important one: the actual TaxAmount involved. So I can not use it to show the calculated TaxAmount.

And because there might be rounding issue’s involved in the TaxAmount calculation, I do not want to do any calculations on the receiving party’s side.

 

Your suggestion to create a separate line for the Disposal Charge might work, but how can I show that this disposal charge is linked to an other line in the order? So that from a presentation/logic perspective I can keep those 2 lines together.

 

But as far as I can see there is no way to show the Tax details for an Item (including the TaxAmount) in one place. A possible workaround is to “abuse” the TotalTaxAmount in combination with the ClassifiedTaxCategory, but that would only allow for a single type of Tax on an LineItem. And … it is an ugly hack.

 

Are there any changes in UBL 2.1 that would help solve this?  Or am I looking at this completely the wrong way? What were the design decisions around how to handle VAT information at LineItem level?

How do other users of UBL in the EU handle VAT details at item level?

 

Your remark about the Tax Details inside the AllowanceCharge component. The UBL 2.0 specification already allows for that via the TaxTotal component.

http://www.schemacentral.com/sc/ubl20/e-cac_AllowanceCharge.html

 

Kees

 

 

Van: stephengreenubl@gmail.com [mailto:stephengreenubl@gmail.com] Namens Stephen D Green
Verzonden: donderdag 15 december 2011 18:18
Aan: Duvekot, Kees
CC: UBL-Dev
Onderwerp: Re: [ubl-dev] UBL 2.0 Order document with discounts and VAT calculations

 

Kees

 

Nice that you don't have to agree the document usage

with other parties (for me the tax office would have been

interested though in the calculation model being defined

as would the internal and external auditors).

 

I agree with your correction of my LineExtensionAmount. Sorry.

 

I wouldn't put the tax details inside the AllowanceCharge. I would

do this (Did you notice there is an  Item/ClassifiedTaxCategory ?)

 

<cac:Item>


<cbc:Description>Item A</cbc:Description>
<cac:ClassifiedTaxCategory>
<cbc:Percent>20</cbc:Percent>
<cac:TaxScheme>
<cbc:TaxTypeCode>Dom-H</cbc:TaxTypeCode>
</cac:TaxScheme>
</cac:ClassifiedTaxCategory>

</cac:Item>

 

Another way to handle the disposal charge might be

to make it an extra OrderLine so that you can clearly

state its tax details separately from those of the goods.

 

The fact that the tax category for the goods and that for the

disposal charge are the same means you could combine

them (unless there are objections from your local tax

inspectors), in this instance, but what if they were different?

 

Does UBL 2.1 now allow tax details inside AllowanceCharge?

I haven't seen this before. I guess the fact allowances and

charges do have their own tax details suggests they should be

there, if it can be done without the need to extend UBL.

 


Best regards

Steve
---
Stephen D Green


On 15 December 2011 14:52, Duvekot, Kees <kduvekot@wehkamp.nl> wrote:

Steve,

 

Thanks for looking into this issue with us.

 

You suggest to look into the 'calculation model' of a document. For the moment we (wehkamp.nl) are both the sender and the receiver of the document. So we could determine these calculation models our self.

 

Below I have put an indented version of your message with some changes to it.

 

Here are some remarks about your proposal:

 

The documentation says for LineExtensionAmount the following:

The total amount for the Line Item, including Allowance Charges but net of taxes

 

So I think that should be 50 (40 Euros for the Item and 10 for the DisposalCharge).

 

 

 

 

In your example you show a TotalTaxAmount of 8 Euro under the LineItem component, but there is no specification of what kind of Tax it relates to.

I also think it should have been 10 Euros because that is the total tax amount of this LineItem (8 for the Item, 2 for the disposal charge)

 

The Tax for the disposal charge can be specified under the AllowanceCharge line under the LineItem. So the problem that I see is that there is no place to put the Tax details for the 8 Euro VAT of the Item.  There is no TaxTotal element under the Price component and also not at a higher level directly under the LineItem component.

 

So what other options do I have to correctly communicate the VAT details (Category, Percentage, Amount) of the OrderLine/LineItem? This should be there for information purposes so that it could be shown to the recipient of the order. I know that the Tax details at OrderLine level are for information purposes, but now I have no way to put this information in the UBL document at all.

 

And now that I think about it a bit more … even if there were no disposal charges or discounts, how can I communicate the Tax Details (Category, Percentage, Amount) at line level for information purposes?

 

Kees

 

 

 

======================== Indented Example =======

 

<cac:TaxTotal>

                <cbc:TaxAmount currencyID="EUR">10.00</cbc:TaxAmount>

                <cac:TaxSubtotal>

                               <cbc:TaxableAmount currencyID="EUR">50.00</cbc:TaxableAmount>

                               <cbc:TaxAmount currencyID="EUR">10.00</cbc:TaxAmount>

                               <cac:TaxCategory>

                                               <cbc:Percent>20</cbc:Percent>

                                               <cac:TaxScheme>

                                                               <cbc:TaxTypeCode>Dom-H</cbc:TaxTypeCode>

                                               </cac:TaxScheme>

                               </cac:TaxCategory>

                </cac:TaxSubtotal>

</cac:TaxTotal>

 

<cac:AnticipatedMonetaryTotal>

                <cbc:LineExtensionAmount currencyID="EUR">50.00</cbc:LineExtensionAmount>

                <cbc:TaxExclusiveAmount currencyID="EUR">50.00</cbc:TaxExclusiveAmount>

                <cbc:TaxInclusiveAmount currencyID="EUR">60.00</cbc:TaxInclusiveAmount>

                <cbc:AllowanceTotalAmount currencyID="EUR">60.00</cbc:AllowanceTotalAmount>

                <cbc:ChargeTotalAmount currencyID="EUR">10.00</cbc:ChargeTotalAmount>

                <cbc:PayableAmount currencyID="EUR">60.00</cbc:PayableAmount>

</cac:AnticipatedMonetaryTotal>

 

 

<cac:OrderLine>

                <cbc:Note>goods</cbc:Note>

                <cac:LineItem>

                               <cbc:ID>1</cbc:ID>

                               <cbc:SalesOrderID>A</cbc:SalesOrderID>

                               <cbc:LineStatusCode>NoStatus</cbc:LineStatusCode>

                               <cbc:Quantity unitCode="KM">1</cbc:Quantity>

                               <cbc:LineExtensionAmount currencyID="EUR">50.00</cbc:LineExtensionAmount>

                               <cbc:TotalTaxAmount currencyID="EUR">10</cbc:TotalTaxAmount>

<!-- ===== Price Component ===== -->

                               <cac:Price>

                                               <cbc:PriceAmount currencyID="EUR">100.00</cbc:PriceAmount>

<!-- ===== AllowanceCharge for the Discount ===== -->

                                               <cac:AllowanceCharge>

                                                               <cbc:ChargeIndicator>false</cbc:ChargeIndicator>

                                                               <cbc:AllowanceChargeReason>Discount</cbc:AllowanceChargeReason>

                                                               <cbc:Amount currencyID="EUR">60.00</cbc:Amount>

                                               </cac:AllowanceCharge>

                               </cac:Price>

<!-- ===== AllowanceCharge for the Disposal Charge ===== -->

                               <cac:AllowanceCharge>

                                               <cbc:ChargeIndicator>true</cbc:ChargeIndicator>

                                               <cbc:AllowanceChargeReason>Disposal Charge</cbc:AllowanceChargeReason>

                                               <cbc:Amount currencyID="EUR">10.00</cbc:Amount>

<!-- ===== TaxTotal for the Disposal Charge ===== -->

<cac:TaxTotal>

               <cbc:TaxAmount currencyID="EUR">2.00</cbc:TaxAmount>

               <cac:TaxSubtotal>

                               <cbc:TaxableAmount currencyID="EUR">10.00</cbc:TaxableAmount>

                               <cbc:TaxAmount currencyID="EUR">2.00</cbc:TaxAmount>

                               <cac:TaxCategory>

                                               <cbc:Percent>20</cbc:Percent>

                                               <cac:TaxScheme>

                                                              <cbc:TaxTypeCode>Dom-H</cbc:TaxTypeCode>

                                               </cac:TaxScheme>

                               </cac:TaxCategory>

               </cac:TaxSubtotal>

</cac:TaxTotal>

                               </cac:AllowanceCharge>

 

                               <cac:Item>

                                               <cbc:Description>Item A</cbc:Description>

                               </cac:Item>

                </cac:LineItem>

</cac:OrderLine>

 

======================== Indented Example =======

 

 

Van: stephengreenubl@gmail.com [mailto:stephengreenubl@gmail.com] Namens Stephen D Green
Verzonden: donderdag 15 december 2011 13:22
Aan: UBL-Dev
CC: Duvekot, Kees
Onderwerp: Fwd: [ubl-dev] UBL 2.0 Order document with discounts and VAT calculations

 

Just realised I didn't copy this to the list. (I think the 'charge'

needs some added identification as a delivery charge too.)

 

By the way, Kees, would it be appropriate in your scenario

to seek a common agreement between users of your documents

on the way you use UBL? It is usually advised to do this for

what we call the 'calculation model' of a document. See the

recent example I posted to ubl-comment showing how to do

so in technical jargon using XPath expressions and appropriate

markup like Test Assertion Markup Language (that's a plug!)

A bit of a complex way to do it and maybe using just the model

behind the markup here (try Test Assertions Model by OASIS'

TAG TC) and prose descriptions of calculation rules might better

suit your scenario (then individual developers can test some

other way such as using Schematron). 


Best regards

Steve
---
Stephen D Green

---------- Forwarded message ----------
From: Stephen D Green <stephen.green@documentengineeringservices.com>
Date: 15 December 2011 11:30
Subject: Re: [ubl-dev] UBL 2.0 Order document with discounts and VAT calculations
To: "Duvekot, Kees" <kduvekot@wehkamp.nl>

How about this?

 

 ...

<cac:TaxTotal>


<cbc:TaxAmount currencyID="EUR">10.00</cbc:TaxAmount>
<cac:TaxSubtotal>
<cbc:TaxableAmount currencyID="EUR">50.00</cbc:TaxableAmount>
<cbc:TaxAmount currencyID="EUR">10.00</cbc:TaxAmount>
<cac:TaxCategory>
<cbc:Percent>20</cbc:Percent>
<cac:TaxScheme>
<cbc:TaxTypeCode>Dom-H</cbc:TaxTypeCode>
</cac:TaxScheme>
</cac:TaxCategory>
</cac:TaxSubtotal>
</cac:TaxTotal>
<cac:AnticipatedMonetaryTotal>
<cbc:LineExtensionAmount currencyID="EUR">100.00</cbc:LineExtensionAmount>
<cbc:TaxExclusiveAmount currencyID="EUR">50.00</cbc:TaxExclusiveAmount>
<cbc:TaxInclusiveAmount currencyID="EUR">60.00</cbc:TaxInclusiveAmount>
<cbc:AllowanceTotalAmount currencyID="EUR">60.00</cbc:AllowanceTotalAmount>
<cbc:ChargeTotalAmount currencyID="EUR">10.00</cbc:ChargeTotalAmount>
<cbc:PayableAmount currencyID="GBP">60.00</cbc:PayableAmount>
</cac:AnticipatedMonetaryTotal>
<cac:OrderLine>
<cbc:Note>goods</cbc:Note>
<cac:LineItem>
<cbc:ID>1</cbc:ID>
<cbc:SalesOrderID>A</cbc:SalesOrderID>
<cbc:LineStatusCode>NoStatus</cbc:LineStatusCode>
<cbc:Quantity unitCode="KM">1</cbc:Quantity>
<cbc:LineExtensionAmount currencyID="EUR">100.00</cbc:LineExtensionAmount>
<cbc:TotalTaxAmount currencyID="EUR">8</cbc:TotalTaxAmount>
<cac:Price>
<cbc:PriceAmount currencyID="EUR">100.00</cbc:PriceAmount>
<cac:AllowanceCharge>
<cbc:ChargeIndicator>false</cbc:ChargeIndicator>
<cbc:Amount currencyID="EUR">60.00</cbc:Amount>
</cac:AllowanceCharge>
</cac:Price>
<cac:Item>
<cbc:Description>Item A</cbc:Description>
</cac:Item>
</cac:LineItem>
</cac:OrderLine>

 ...

 

Best regards

 

Steve

---

Stephen D Green

 

 

 

On 15 December 2011 10:33, Duvekot, Kees <kduvekot@wehkamp.nl> wrote:

> UBL enthusiasts,

> We are working on implementing a UBL order document for internal use at

> wehkamp.nl. I have some questions about how to handle discounts in relation

> to VAT calculations.

> Here is the simple order I want to handle in a UBL order document. (this is

> just an example expressing the most important parts, not the actual order)

> A customer wants to buy a single “Item A”. The normal price for this article

> is 100 EUR ex VAT for a single Item. With this buyer we have agreed a

> discount of 60 EUR ex VAT. So the buyer needs to pay 40 EUR ex VAT for this

> article. The VAT category on this item is Domestic-High and the VAT

> percentage is 20%.

> For every “Item A” that is sold we also need to charge the customer for a

> “Disposal Charge”. This is 10 EUR ex VAT. For this charge the VAT category

> is also Domestic-High and the VAT percentage is 20%.

> So the orderline on the order should look like this to me:

> Article Unit    Price           Discount        Net     VAT     %       VAT

> Amt

> Item A  1Pc     100 EUR -60 EUR 40 EUR  Dom-H   20%     8 EUR

>         Disposal charge                 10 EUR  Dom-H   20%     2 EUR

> Now I am trying to bring all this information into the OrderLine/LineItem

> component.

> The Article and Quantity ordered can be place inside the Item component

> under the LineItem component

> The Disposal charge can be placed in a AllowanceCharge component directly

> under the LineItem component. The VAT of this disposal charge can be

> specified inside the AllowanceCharge component under the TaxTotal and

> TaxCategory components.

> Now the “problem” starts with the price component. If I look at this

> component I could place the net amount of 40 EUR in the PriceAmount

> component and the 60 EUR discount as an Allowance under the AllowanceCharge

> component. But where do I leave the VAT over the 40 EUR? And where do I

> place the standard price of 100 EUR of the item?

> Any help and guidance is appreciated.

> Regards,

> Kees Duvekot

> IT Business Consultant

 

 

 

 






[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]