You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2012/05/23 09:22:30 UTC

svn commit: r1341765 - in /ofbiz/trunk/applications/accounting: data/AccountingTypeData.xml entitydef/entitymodel.xml script/org/ofbiz/accounting/invoice/InvoiceServices.xml servicedef/services_invoice.xml

Author: hansbak
Date: Wed May 23 07:22:30 2012
New Revision: 1341765

URL: http://svn.apache.org/viewvc?rev=1341765&view=rev
Log:
add entities and services to be able to add content and notes to invoices

Modified:
    ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml
    ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml
    ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml

Modified: ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml?rev=1341765&r1=1341764&r2=1341765&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml (original)
+++ ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml Wed May 23 07:22:30 2012
@@ -386,6 +386,9 @@ under the License.
 
     <GlAccountCategoryType glAccountCategoryTypeId="COST_CENTER" description="Cost Center Category"/>
 
+    <!-- Invoice content type-->
+    <InvoiceContentType invoiceContentTypeId="COMMENTS" description="comments" hasTable="N" parentTypeId=""/>
+    
     <!-- invoice item types tree for adjustments -->
     <InvoiceItemType description="Invoice Adjustment" hasTable="N" invoiceItemTypeId="INVOICE_ADJ" parentTypeId=""/>
     <InvoiceItemType description="Invoice Header Adjustment" hasTable="N" invoiceItemTypeId="INVOICE_HEAD_ADJ" parentTypeId="INVOICE_ADJ"/>

Modified: ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml?rev=1341765&r1=1341764&r2=1341765&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml Wed May 23 07:22:30 2012
@@ -1209,6 +1209,40 @@ under the License.
         <key-map field-name="attrName"/>
       </relation>
     </entity>
+    <entity entity-name="InvoiceContent" 
+            package-name="org.ofbiz.accounting.invoice" 
+            title="Invoice Content Entity">
+        <field name="invoiceId" type="id-ne"></field>
+        <field name="invoiceContentTypeId" type="id-ne"></field>
+        <field name="contentId" type="id-ne"></field>
+        <field name="fromDate" type="date-time"></field>
+        <field name="thruDate" type="date-time"></field>
+        <prim-key field="contentId"/>
+        <prim-key field="invoiceId"/>
+        <prim-key field="invoiceContentTypeId"/>
+        <prim-key field="fromDate"/>
+        <relation type="one" fk-name="INV_CNT_PROD" rel-entity-name="Invoice">
+            <key-map field-name="invoiceId"/>
+        </relation>
+        <relation type="one" fk-name="INV_CNT_CNT" rel-entity-name="Content">
+            <key-map field-name="contentId"/>
+        </relation>
+        <relation type="one" fk-name="INV_CNT_TYPE" rel-entity-name="InvoiceContentType">
+            <key-map field-name="invoiceContentTypeId"/>
+        </relation>
+    </entity>
+    <entity entity-name="InvoiceContentType" 
+            package-name="org.ofbiz.accounting.invoice"
+            title="Invoice Content Type Entity">
+        <field name="invoiceContentTypeId" type="id-ne"></field>
+        <field name="parentTypeId" type="id"></field>
+        <field name="hasTable" type="indicator"></field>
+        <field name="description" type="description"></field>
+        <prim-key field="invoiceContentTypeId"/>
+        <relation type="one" fk-name="INVCT_TYP_PARENT" title="Parent" rel-entity-name="InvoiceContentType">
+            <key-map field-name="parentTypeId" rel-field-name="invoiceContentTypeId"/>
+        </relation>
+    </entity>
     <entity entity-name="InvoiceContactMech"
             package-name="org.ofbiz.accounting.invoice"
             never-cache="true"
@@ -1550,6 +1584,20 @@ under the License.
         <key-map field-name="invoiceTypeId"/>
       </relation>
     </entity>
+    <entity entity-name="InvoiceNote"
+            package-name="org.ofbiz.accounting.invoice"
+            title="Invoice Note Entity">
+      <field name="invoiceId" type="id-ne"></field>
+      <field name="noteId" type="id-ne"></field>
+      <prim-key field="invoiceId"/>
+      <prim-key field="noteId"/>
+      <relation type="one" fk-name="INVOICE_NOTE_INVOICE" rel-entity-name="Invoice">
+        <key-map field-name="invoiceId"/>
+      </relation>
+      <relation type="one" fk-name="INVOICE_NOTE_NOTE" rel-entity-name="NoteData">
+        <key-map field-name="noteId"/>
+      </relation>
+    </entity>
 
   <view-entity entity-name="InvoiceAndApplAndPayment" package-name="org.ofbiz.accounting.invoice" title="Invoice and related applications and payments">
     <member-entity entity-alias="INV" entity-name="Invoice"/>
@@ -1621,6 +1669,38 @@ under the License.
             <key-map field-name="productId"/>
         </view-link>
     </view-entity>
+
+    <view-entity entity-name="InvoiceContentAndInfo"
+            package-name="org.ofbiz.accounting.invoice"
+            title="InvoiceContent Content and DataResource View Entity">
+      <member-entity entity-alias="INVC" entity-name="InvoiceContent"/>
+      <member-entity entity-alias="CO" entity-name="Content"/>
+      <member-entity entity-alias="DR" entity-name="DataResource"/>
+      <alias-all entity-alias="INVC"/>
+      <alias-all entity-alias="CO"/>
+      <alias-all entity-alias="DR" prefix="dr"/>
+      <view-link entity-alias="INVC" rel-entity-alias="CO">
+        <key-map field-name="contentId"/>
+      </view-link>
+      <view-link entity-alias="CO" rel-entity-alias="DR">
+        <key-map field-name="dataResourceId"/>
+      </view-link>
+      <relation type="one-nofk" rel-entity-name="ElectronicText">
+        <key-map field-name="dataResourceId"/>
+      </relation>
+      <relation type="one-nofk" rel-entity-name="ImageDataResource">
+        <key-map field-name="dataResourceId"/>
+      </relation>
+      <relation type="one-nofk" rel-entity-name="OtherDataResource">
+        <key-map field-name="dataResourceId"/>
+      </relation>
+      <relation type="many" rel-entity-name="ContentAssocDataResourceViewFrom">
+        <key-map field-name="contentId" rel-field-name="contentIdStart"/>
+      </relation>
+      <relation type="many" rel-entity-name="ContentAssocDataResourceViewTo">
+        <key-map field-name="contentId" rel-field-name="contentIdStart"/>
+      </relation>
+    </view-entity>
   <!-- ========================================================= -->
   <!-- org.ofbiz.accounting.ledger -->
   <!-- ========================================================= -->

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml?rev=1341765&r1=1341764&r2=1341765&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml Wed May 23 07:22:30 2012
@@ -944,4 +944,57 @@ under the License.
             <field-to-result field="invoiceId" result-name="invoiceId"/>
         </if-compare>
     </simple-method>
+    
+    <!-- InvoiceContent -->
+    <simple-method method-name="createInvoiceContent" short-description="Create Content For Invoice">
+        <make-value value-field="newEntity" entity-name="InvoiceContent"/>
+        <set-pk-fields map="parameters" value-field="newEntity"/>
+        <set-nonpk-fields map="parameters" value-field="newEntity"/>
+
+        <if-empty field="newEntity.fromDate">
+            <now-timestamp field="nowTimestamp"/>
+            <set field="newEntity.fromDate" from-field="nowTimestamp"/>
+        </if-empty>
+
+        <create-value value-field="newEntity"/>
+
+        <set-service-fields service-name="updateContent" map="parameters" to-map="updateContent"/>
+        <call-service service-name="updateContent" in-map-name="updateContent"/>
+
+        <field-to-result field="newEntity.contentId" result-name="contentId"/>
+        <field-to-result field="newEntity.invoiceId" result-name="invoiceId"/>
+        <field-to-result field="newEntity.invoiceContentTypeId" result-name="invoiceContentTypeId"/>
+    </simple-method>
+    <simple-method method-name="updateInvoiceContent" short-description="Update Content For Invoice">
+        <make-value value-field="lookupPKMap" entity-name="InvoiceContent"/>
+        <set-pk-fields map="parameters" value-field="lookupPKMap"/>
+        <find-by-primary-key map="lookupPKMap" value-field="lookedUpValue"/>
+        <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>
+        <store-value value-field="lookedUpValue"/>
+
+        <set-service-fields service-name="updateContent" map="parameters" to-map="updateContent"/>
+        <call-service service-name="updateContent" in-map-name="updateContent"/>
+    </simple-method>
+    <simple-method method-name="removeInvoiceContent" short-description="Remove Content From Invoice">
+        <make-value value-field="lookupPKMap" entity-name="InvoiceContent"/>
+        <set-pk-fields map="parameters" value-field="lookupPKMap"/>
+        <find-by-primary-key map="lookupPKMap" value-field="lookedUpValue"/>
+        <remove-value value-field="lookedUpValue"/>
+    </simple-method>
+    
+    <simple-method method-name="createSimpleTextContentForInvoice" short-description="Create Simple Text Content For Invoice">
+        <set-service-fields service-name="createInvoiceContent" map="parameters" to-map="createInvoiceContentMap"/>
+        <set-service-fields service-name="createSimpleTextContent" map="parameters" to-map="createSimpleTextMap"/>
+        <call-service service-name="createSimpleTextContent" in-map-name="createSimpleTextMap">
+            <result-to-field result-name="contentId" field="createInvoiceContentMap.contentId"/>
+        </call-service>
+        <call-service service-name="createInvoiceContent" in-map-name="createInvoiceContentMap"/>
+    </simple-method>
+    <simple-method method-name="updateSimpleTextContentForInvoice" short-description="Update Simple Text Content For Invoice">
+        <set-service-fields service-name="updateInvoiceContent" map="parameters" to-map="updateInvoiceContent"/>
+        <call-service service-name="updateInvoiceContent" in-map-name="updateInvoiceContent"/>
+        <set-service-fields service-name="updateSimpleTextContent" map="parameters" to-map="updateSimpleText"/>
+        <call-service service-name="updateSimpleTextContent" in-map-name="updateSimpleText"/>
+    </simple-method>
+    
 </simple-methods>

Modified: ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml?rev=1341765&r1=1341764&r2=1341765&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml Wed May 23 07:22:30 2012
@@ -384,4 +384,46 @@ under the License.
         <attribute name="invoiceId" type="String" mode="OUT" optional="true"/>
     </service>
     
+    <!-- Invoice content services -->
+    <service name="createInvoiceContent" default-entity-name="InvoiceContent" engine="simple"
+        location="component://accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml" invoke="createInvoiceContent" auth="true">
+        <description>Add Content To Invoice</description>
+        <auto-attributes include="pk" mode="INOUT" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <auto-attributes entity-name="Content" include="nonpk" mode="IN" optional="true"/>
+        <override name="fromDate" optional="true"/>
+        <!--<override name="contentId" optional="true" mode="INOUT"/>-->
+    </service>
+    <service name="updateInvoiceContent" default-entity-name="InvoiceContent" engine="simple"
+        location="component://accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml" invoke="updateInvoiceContent" auth="true">
+        <description>Update Content To Invoice</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <auto-attributes entity-name="Content" include="nonpk" mode="IN" optional="true"/>
+    </service>
+    <service name="removeInvoiceContent" default-entity-name="InvoiceContent" engine="simple"
+        location="component://accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml" invoke="removeInvoiceContent" auth="true">
+        <description>Remove Content From Invoice</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
+    
+    <service name="createSimpleTextContentForInvoice" default-entity-name="InvoiceContent" engine="simple"
+        location="component://accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml" invoke="createSimpleTextContentForInvoice" auth="true">
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <auto-attributes entity-name="Content" include="nonpk" mode="IN" optional="true"/>
+        <attribute name="text" type="String" mode="IN" optional="false" allow-html="safe"/>
+        <override name="contentId" optional="true"/>
+        <override name="fromDate" optional="true"/>
+    </service>
+    <service name="updateSimpleTextContentForInvoice" default-entity-name="InvoiceContent" engine="simple"
+        location="component://accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml" invoke="updateSimpleTextContentForInvoice" auth="true">
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <auto-attributes mode="IN" entity-name="Content" optional="true"/>
+        <attribute name="textDataResourceId" type="String" mode="IN" optional="true"/>
+        <attribute name="text" type="String" mode="IN" optional="true" allow-html="safe"/>
+    </service>
+    
 </services>