Files
ofbiz-framework/applications/accounting/entitydef/entitymodel_olap.xml
T
Jacques Le Roux 2a1a5aee14 We don't need
<copyright>Copyright 2001-.* The Apache Software Foundation</copyright>
<copyright><year>.*</year><holder>Apache Foundation</holder></copyright>
<copyright><year>.*</year><holder>Apache Foundation.</holder></copyright>
<owner>Copyright 2001-.* The Apache Software Foundation</owner>

Less to update every year!

Thanks to BJ 1st effort at "update files from 2009 to 2010" (https://issues.apache.org/jira/browse/OFBIZ-3783) - OFBIZ-3783

Note: there are been a lot of efforts in 2009: there are plenty of data dated from this year!

I hope I did not broke anything (should not, but of course I did not try all changes...) Anyway, this can be easily reverted...

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@948846 13f79535-47bb-0310-9956-ffa450edef68
2010-05-27 14:23:22 +00:00

165 lines
8.3 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
<!-- ========================================================= -->
<!-- ======================== Defaults ======================= -->
<!-- ========================================================= -->
<title>OLAP entities for the Accounting component</title>
<description>None</description>
<!-- ========================================================= -->
<!-- Facts -->
<!-- ========================================================= -->
<entity entity-name="SalesInvoiceItemFact" package-name="org.ofbiz.bi.fact.accounting" title="Sales Invoice Item Fact">
<description>A transaction fact entity with invoice item grain.</description>
<field name="invoiceId" type="id-ne"></field> <!-- degenerate dimension -->
<field name="invoiceItemSeqId" type="id-ne"></field> <!-- degenerate dimension -->
<field name="orderId" type="id-ne"></field> <!-- degenerate dimension -->
<field name="invoiceDateDimId" type="id-ne"></field>
<field name="productDimId" type="id-ne"></field>
<field name="billToCustomerDimId" type="id-ne"></field> <!-- TODO: implement the dimension -->
<field name="origCurrencyDimId" type="id-ne"></field>
<field name="quantity" type="fixed-point">
<description>Quantity invoiced. From InvoiceItem.quantity</description>
</field>
<field name="extGrossAmount" type="currency-precise">
<description>Extended gross amount: quantity invoiced multiplied by the list unit price.</description>
</field>
<field name="extDiscountAmount" type="currency-precise">
<description>Extended discount amount.</description>
</field>
<field name="extNetAmount" type="currency-precise">
<description>Extended net amount: gross amount less discounts.</description>
</field>
<field name="extTaxAmount" type="currency-precise">
<description>Extended tax amount.</description>
</field>
<field name="extManFixedCost" type="currency-precise">
<description>Extended manufacturing fixed cost.</description>
</field>
<field name="extManVarCost" type="currency-precise">
<description>Extended manufacturing variable cost.</description>
</field>
<field name="extStorageCost" type="currency-precise">
<description>Extended storage cost.</description>
</field>
<field name="extDistributionCost" type="currency-precise">
<description>Extended distribution cost.</description>
</field>
<field name="contributionAmount" type="currency-precise">
<description>Extended net amount less all the costs.</description>
</field>
<!--
TODO: implement multi-currency fields
<field name="extGrossAmountOrig" type="currency-precise">
<description>Extended gross amount in the original currency: quantity invoiced multiplied by the list unit price.</description>
</field>
<field name="extDiscountAmountOrig" type="currency-precise">
<description>Extended discount amount in the original currency.</description>
</field>
<field name="extNetAmountOrig" type="currency-precise">
<description>Extended net amount in the original currency: gross amount less discounts.</description>
</field>
<field name="extManFixedCostOrig" type="currency-precise">
<description>Extended manufacturing fixed cost in the original currency.</description>
</field>
<field name="extManVarCostOrig" type="currency-precise">
<description>Extended manufacturing variable cost in the original currency.</description>
</field>
<field name="extStorageCostOrig" type="currency-precise">
<description>Extended storage cost in the original currency.</description>
</field>
<field name="extDistributionCostOrig" type="currency-precise">
<description>Extended distribution cost in the original currency.</description>
</field>
<field name="contributionAmountOrig" type="currency-precise">
<description>Extended net amount less all the costs in the original currency.</description>
</field>
-->
<prim-key field="invoiceId"/>
<prim-key field="invoiceItemSeqId"/>
<relation type="one" fk-name="SIIF_INVDATE" rel-entity-name="DateDimension">
<key-map field-name="invoiceDateDimId" rel-field-name="dimensionId"/>
</relation>
<relation type="one" fk-name="SIIF_CURRENCY" rel-entity-name="CurrencyDimension">
<key-map field-name="origCurrencyDimId" rel-field-name="dimensionId"/>
</relation>
<relation type="one" fk-name="SIIF_PRODUCT" rel-entity-name="ProductDimension">
<key-map field-name="productDimId" rel-field-name="dimensionId"/>
</relation>
</entity>
<!-- ========================================================= -->
<!-- Star Schemas -->
<!-- ========================================================= -->
<view-entity entity-name="SalesInvoiceItemStarSchema" package-name="org.ofbiz.bi.starschema.accounting" title="Sales Invoice Item Star Schema">
<description>Invoice Item star schema (Profit and Loss Statement).</description>
<member-entity entity-alias="SIIF" entity-name="SalesInvoiceItemFact"/>
<member-entity entity-alias="IDD" entity-name="DateDimension"/>
<member-entity entity-alias="PD" entity-name="ProductDimension"/>
<member-entity entity-alias="CD" entity-name="CurrencyDimension"/>
<alias-all entity-alias="IDD" prefix="invoiceDate" group-by="true">
<exclude field="dimensionId"/>
</alias-all>
<alias-all entity-alias="PD" prefix="product" group-by="true">
<exclude field="dimensionId"/>
</alias-all>
<alias-all entity-alias="CD" prefix="currency" group-by="true">
<exclude field="dimensionId"/>
</alias-all>
<alias-all entity-alias="SIIF" function="sum">
<exclude field="invoiceItemSeqId"/>
<exclude field="invoiceDateDimId"/>
<exclude field="productDimId"/>
<exclude field="billToCustomerDimId"/>
<exclude field="origCurrencyDimId"/>
<exclude field="orderId"/>
<exclude field="invoiceId"/>
<exclude field="invoiceItemSeqId"/>
</alias-all>
<alias entity-alias="SIIF" name="invoiceId" group-by="true">
<description>Invoice id</description>
</alias>
<alias entity-alias="SIIF" name="invoiceItemSeqId" group-by="true"/>
<alias entity-alias="SIIF" name="orderId" group-by="true"/>
<view-link entity-alias="SIIF" rel-entity-alias="IDD">
<key-map field-name="invoiceDateDimId" rel-field-name="dimensionId"/>
</view-link>
<view-link entity-alias="SIIF" rel-entity-alias="PD">
<key-map field-name="productDimId" rel-field-name="dimensionId"/>
</view-link>
<view-link entity-alias="SIIF" rel-entity-alias="CD">
<key-map field-name="origCurrencyDimId" rel-field-name="dimensionId"/>
</view-link>
</view-entity>
</entitymodel>