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] Modeling question re: multifaceted price calculation


At 2008-04-26 09:07 -0400, I wrote:
>So ... if I take a stab at this below using facets of the item 
>description, perhaps folks could comment collaboratively on how this 
>would work.

I've received feedback off list and a revised suggestion for comment 
is at the end of this message.

Here are the original requirements:

>-----Original Message-----
>From: G. Ken Holman [mailto:gkholman@CraneSoftwrights.com]
>Sent: Friday, April 25, 2008 12:49 AM
>To: UBL-Dev
>Subject: [ubl-dev] Modeling question re: multifaceted price calculation
>...
>Invoice period:    April 1, 2008 to April 30, 2008
>
>Item:              1
>Description:       Thing-one
>Quantity:          7
>Base cost:         $1000.
>Rental rate each:  2.5% per month
>Shipped to site:   April 15, 2008
>Removed from site: April 20, 2008
>Days on site:      5
>Rental fee:        $29.17      (=1000*.025/30*5*7)
>
>Item:              2
>Description:       Thing-two
>Quantity:          3
>Base cost each:    $2000.
>Rental rate:       $30 per month
>Shipped to site:   April 10, 2008
>Removed from site: N/A (still on site)
>Days on site:      20
>Rental fee:        $60         (=30/30*20*3)
>
>Item:              3
>Description:       Thing-three
>Quantity:          1
>Base cost each:    $5000.
>Rental rate:       .5% per day (was 1% per month, but changed for the example)
>Shipped to site:   N/A (was on site)
>Removed from site: N/A (still on site)
>Days on site:      30
>Rental fee:        $750        (=5000*.005*30*1)
>-----End Original Message-----
>...
>For those items with "Monthly Rental Rate", the unit price is calculated as:
>
>     Base Cost Amount
>   * Monthly Rental Rate
>   / Monthly Days Applicable
>   * Monthly Rental Rate DurationMeasure in days
>
>For those items with "Monthly Rental Fee", the unit price is calculated as:
>
>     Monthly Rental Fee
>   / Monthly Days Applicable
>   * Monthly Rental Fee DurationMeasure in days
>
>For those items with "Daily Rental Rate", the unit price is calculated as:
>
>     Base Cost Amount
>   * Daily Rental Rate
>   * Daily Rental Rate DurationMeasure in days

Based on the feedback I changed the following:

  - moved AdditionalItemProperty to Item instead of being a child of 
ItemInstance
  - indicated the BaseQuantity for the price determination is "each" 
indicating each unit counted in InvoicedQuantity
  - added cbc:PriceType as a property of the price to document how 
the price was calculated

Would anyone disagree with these changes or think this instance is 
worse off than the earlier one?

Thanks again for any feedback!

. . . . . . . . . . . . . Ken

<?xml version="1.0" encoding="UTF-8"?>
<Invoice  xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" 

xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" 
xmlns:udt="urn:un:unece:uncefact:data:draft:UnqualifiedDataTypesSchemaModule:2">
   <cbc:ID>A123</cbc:ID>
   <cbc:CopyIndicator>false</cbc:CopyIndicator>
   <cbc:IssueDate>2008-04-30</cbc:IssueDate>
   <cbc:DocumentCurrencyCode>CAD</cbc:DocumentCurrencyCode>
   <cac:InvoicePeriod>
     <cbc:StartDate>2008-04-01</cbc:StartDate>
     <cbc:EndDate>2008-04-30</cbc:EndDate>
   </cac:InvoicePeriod>
   <cac:AccountingSupplierParty>
     <cac:Party>
       <cac:PartyName>
         <cbc:Name>The supplier</cbc:Name>
       </cac:PartyName>
     </cac:Party>
   </cac:AccountingSupplierParty>
   <cac:AccountingCustomerParty>
     <cac:Party>
       <cac:PartyName>
         <cbc:Name>The buyer</cbc:Name>
       </cac:PartyName>
     </cac:Party>
   </cac:AccountingCustomerParty>
   <cac:LegalMonetaryTotal>
     <cbc:PayableAmount currencyID="CAD">839.17</cbc:PayableAmount>
   </cac:LegalMonetaryTotal>
   <cac:InvoiceLine>
     <cbc:ID>1</cbc:ID>
     <cbc:InvoicedQuantity>7</cbc:InvoicedQuantity>
     <cbc:LineExtensionAmount currencyID="CAD">29.17</cbc:LineExtensionAmount>
     <cac:Item>
       <cbc:Description>Thing-one</cbc:Description>
       <cac:AdditionalItemProperty>
         <cbc:Name>Base Cost Currency</cbc:Name>
         <cbc:Value>CAD</cbc:Value>
       </cac:AdditionalItemProperty>
       <cac:AdditionalItemProperty>
         <cbc:Name>Base Cost Amount</cbc:Name>
         <cbc:Value>1000</cbc:Value>
       </cac:AdditionalItemProperty>
       <cac:AdditionalItemProperty>
         <cbc:Name>Monthly Days Applicable</cbc:Name>
         <cbc:Value>30</cbc:Value>
       </cac:AdditionalItemProperty>
       <cac:AdditionalItemProperty>
         <cbc:Name>Monthly Rental Rate</cbc:Name>
         <cbc:Value>.025</cbc:Value>
         <cac:UsabilityPeriod>
           <cbc:StartDate>2008-04-15</cbc:StartDate>
           <cbc:EndDate>2008-04-20</cbc:EndDate>
           <cbc:DurationMeasure unitCode="DAY">5</cbc:DurationMeasure>
         </cac:UsabilityPeriod>
       </cac:AdditionalItemProperty>
     </cac:Item>
     <cac:Price>
       <cbc:PriceAmount currencyID="CAD">4.17</cbc:PriceAmount>
       <cbc:BaseQuantity unitCode="EA">1</cbc:BaseQuantity>
       <cbc:PriceType>Calculated as base * monthly rate / monthly 
days * days</cbc:PriceType>
     </cac:Price>
   </cac:InvoiceLine>
   <cac:InvoiceLine>
     <cbc:ID>2</cbc:ID>
     <cbc:InvoicedQuantity>3</cbc:InvoicedQuantity>
     <cbc:LineExtensionAmount currencyID="CAD">60</cbc:LineExtensionAmount>
     <cac:Item>
       <cbc:Description>Thing-two</cbc:Description>
       <cac:AdditionalItemProperty>
         <cbc:Name>Base Cost Currency</cbc:Name>
         <cbc:Value>CAD</cbc:Value>
       </cac:AdditionalItemProperty>
       <cac:AdditionalItemProperty>
         <cbc:Name>Base Cost Amount</cbc:Name>
         <cbc:Value>2000</cbc:Value>
       </cac:AdditionalItemProperty>
       <cac:AdditionalItemProperty>
         <cbc:Name>Monthly Days Applicable</cbc:Name>
         <cbc:Value>30</cbc:Value>
       </cac:AdditionalItemProperty>
       <cac:AdditionalItemProperty>
         <cbc:Name>Monthly Rental Fee</cbc:Name>
         <cbc:Value>30</cbc:Value>
         <cac:UsabilityPeriod>
           <cbc:StartDate>2008-04-10</cbc:StartDate>
           <cbc:EndDate>2008-04-30</cbc:EndDate>
           <cbc:DurationMeasure unitCode="DAY">20</cbc:DurationMeasure>
         </cac:UsabilityPeriod>
       </cac:AdditionalItemProperty>
     </cac:Item>
     <cac:Price>
       <cbc:PriceAmount currencyID="CAD">20</cbc:PriceAmount>
       <cbc:BaseQuantity unitCode="EA">1</cbc:BaseQuantity>
       <cbc:PriceType>Calculated as monthly fee / monthly days * 
days</cbc:PriceType>
     </cac:Price>
   </cac:InvoiceLine>
   <cac:InvoiceLine>
     <cbc:ID>3</cbc:ID>
     <cbc:InvoicedQuantity>1</cbc:InvoicedQuantity>
     <cbc:LineExtensionAmount currencyID="CAD">750</cbc:LineExtensionAmount>
     <cac:Item>
       <cbc:Description>Thing-one</cbc:Description>
       <cac:AdditionalItemProperty>
         <cbc:Name>Base Cost Currency</cbc:Name>
         <cbc:Value>CAD</cbc:Value>
       </cac:AdditionalItemProperty>
       <cac:AdditionalItemProperty>
         <cbc:Name>Base Cost Amount</cbc:Name>
         <cbc:Value>5000</cbc:Value>
       </cac:AdditionalItemProperty>
       <cac:AdditionalItemProperty>
         <cbc:Name>Daily Rental Rate</cbc:Name>
         <cbc:Value>.005</cbc:Value>
         <cac:UsabilityPeriod>
           <cbc:StartDate>2008-04-01</cbc:StartDate>
           <cbc:EndDate>2008-04-30</cbc:EndDate>
           <cbc:DurationMeasure unitCode="DAY">30</cbc:DurationMeasure>
         </cac:UsabilityPeriod>
       </cac:AdditionalItemProperty>
     </cac:Item>
     <cac:Price>
       <cbc:PriceAmount currencyID="CAD">750</cbc:PriceAmount>
       <cbc:BaseQuantity unitCode="EA">1</cbc:BaseQuantity>
       <cbc:PriceType>Calculated as base * daily rate * days</cbc:PriceType>
     </cac:Price>
   </cac:InvoiceLine>
</Invoice>


--
World-wide corporate, govt. & user group XML, XSL and UBL training
RSS feeds:     publicly-available developer resources and training
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/u/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/u/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal



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