You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mo...@apache.org on 2008/01/19 14:36:44 UTC

svn commit: r613389 - in /ofbiz/trunk/applications/accounting: config/ entitydef/ script/org/ofbiz/accounting/ledger/ servicedef/ webapp/accounting/WEB-INF/ widget/

Author: mor
Date: Sat Jan 19 05:36:42 2008
New Revision: 613389

URL: http://svn.apache.org/viewvc?rev=613389&view=rev
Log:
Implement ability to map parties to GlAccounts

Applied patch from Shankar Soni, part of the issue OFBIZ-1541 (https://issues.apache.org/jira/browse/OFBIZ-1541) 

Thanks to Shankar Soni for the patch and Jacopo, Ashish for there help.

Modified:
    ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties
    ofbiz/trunk/applications/accounting/entitydef/entitygroup.xml
    ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml
    ofbiz/trunk/applications/accounting/servicedef/services_ledger.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
    ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml
    ofbiz/trunk/applications/accounting/widget/GlSetupScreens.xml
    ofbiz/trunk/applications/accounting/widget/Menus.xml

Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties?rev=613389&r1=613388&r2=613389&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties Sat Jan 19 05:36:42 2008
@@ -62,6 +62,7 @@
 AccountingAddNewCreditCard=Add New Credit Card
 AccountingAddNewEftAccount=Add New EFT Account
 AccountingAddCategoryGlAccount = Add Category GL Account
+AccountingAddPartyGlAccount=Add Party Gl Account
 AccountingAgreementAvailable=List Available Agreements
 AccountingAgreement=Agreement
 AccountingAgreementDate=Agreement Date
@@ -342,6 +343,7 @@
 AccountingPartyBilledFrom=Party Billed From
 AccountingPartyBilledTo=Party Billed To
 AccountingPartyFixedAssetAssignments=Assignments
+AccountingPartyGlAccounts=Party Gl Accounts
 AccountingPartyIdFrom=Party Id From
 AccountingPartyIdTo=Party Id To
 AccountingPartyMustBeInternalOrganization=Party must be an Internal Organization (set in PartyRole)
@@ -535,6 +537,7 @@
 
 PageTitleEditFixedAssetStdCosts=Edit Standard Cost
 PageTitleEditPartyFixedAssetAssignments=Edit Party Fixed Asset Assignments
+PageTitleEditPartyGlAccounts=Edit Party Gl Accounts
 PageTitleFindTaxAuthority=Find Tax Authority
 PageTitleEditTaxAuthority=Edit Tax Authority
 PageTitleEditTaxAuthorityCategories=Edit Tax Authority Product Categories

Modified: ofbiz/trunk/applications/accounting/entitydef/entitygroup.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/entitydef/entitygroup.xml?rev=613389&r1=613388&r2=613389&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/entitydef/entitygroup.xml (original)
+++ ofbiz/trunk/applications/accounting/entitydef/entitygroup.xml Sat Jan 19 05:36:42 2008
@@ -136,6 +136,7 @@
     <entity-group group="org.ofbiz" entity="GlResourceType" />
     <entity-group group="org.ofbiz" entity="GlXbrlClass" />
     <entity-group group="org.ofbiz" entity="PartyAcctgPreference" />
+    <entity-group group="org.ofbiz" entity="PartyGlAccount" />
     <entity-group group="org.ofbiz" entity="ProductAverageCost" />
     <entity-group group="org.ofbiz" entity="SettlementTerm" />
     <entity-group group="org.ofbiz" entity="VarianceReasonGlAccount" />

Modified: ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml?rev=613389&r1=613388&r2=613389&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml Sat Jan 19 05:36:42 2008
@@ -3117,4 +3117,35 @@
         <prim-key field="county"/>
         <prim-key field="fromDate"/>
     </entity>
+	
+    <entity entity-name="PartyGlAccount" package-name="org.ofbiz.accounting.ledger" title="Party Gl Account Entity">
+        <field name="organizationPartyId" type="id-ne"/>
+        <field name="partyId" type="id-ne"/>
+        <field name="roleTypeId" type="id-ne"/>
+        <field name="glAccountTypeId" type="id-ne"/>
+        <field name="glAccountId" type="id-ne"/>
+        <prim-key field="organizationPartyId"/>
+        <prim-key field="partyId"/>
+        <prim-key field="roleTypeId"/>
+        <prim-key field="glAccountTypeId"/>
+        <relation type="one" fk-name="PRTYGLACCT_ORGPRTY" title="Organization" rel-entity-name="Party">
+            <key-map field-name="organizationPartyId" rel-field-name="partyId"/>
+        </relation>
+        <relation type="one" fk-name="PRTYGLACCT_PRTY" rel-entity-name="Party">
+            <key-map field-name="partyId"/>
+        </relation>
+        <relation type="one-nofk" rel-entity-name="RoleType">
+            <key-map field-name="roleTypeId"/>
+        </relation>
+        <relation type="one" fk-name="PRTYGLACCT_PTRL" rel-entity-name="PartyRole">
+            <key-map field-name="partyId"/>
+            <key-map field-name="roleTypeId"/>
+        </relation>
+        <relation type="one" fk-name="PRTYGLACCT_GLAT" rel-entity-name="GlAccountType">
+            <key-map field-name="glAccountTypeId"/>
+        </relation>		
+        <relation type="one" fk-name="PRTYGLACCT_GLACCT" rel-entity-name="GlAccount">
+            <key-map field-name="glAccountId"/>
+        </relation>
+    </entity>
 </entitymodel>

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml?rev=613389&r1=613388&r2=613389&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml Sat Jan 19 05:36:42 2008
@@ -2208,5 +2208,23 @@
         </call-service>
         <field-to-result field-name="acctgTransId" result-name="acctgTransId"/>
     </simple-method>    
-    
+
+	<!-- Party GlAccount services -->
+     <simple-method method-name="createPartyGlAccount" short-description="Associate a party to a General Ledger Account">
+        <make-value entity-name="PartyGlAccount" value-name="newEntity"/>
+        <set-pk-fields map-name="parameters" value-name="newEntity"/>
+        <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
+        <create-value value-name="newEntity"/>
+    </simple-method>
+
+    <simple-method method-name="updatePartyGlAccount" short-description="Update an existing General Ledger Account of a Party">
+        <entity-one entity-name="PartyGlAccount" value-name="lookedUpValue"/>
+        <set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/>
+        <store-value value-name="lookedUpValue"/>
+    </simple-method>
+
+    <simple-method method-name="deletePartyGlAccount" short-description="Delete an existing General Ledger Account of a Party">
+        <entity-one entity-name="PartyGlAccount" value-name="lookedUpValue"/>
+        <remove-value value-name="lookedUpValue"/>
+    </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/applications/accounting/servicedef/services_ledger.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_ledger.xml?rev=613389&r1=613388&r2=613389&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_ledger.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_ledger.xml Sat Jan 19 05:36:42 2008
@@ -508,5 +508,25 @@
         <attribute name="paymentApplicationId" type="String" mode="IN" optional="false"/>
         <attribute name="acctgTransId" type="String" mode="OUT" optional="true"/>
     </service>
-    
+
+	<!-- Party GlAccount services -->
+    <service name="createPartyGlAccount" default-entity-name="PartyGlAccount" engine="simple"
+        location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="createPartyGlAccount" auth="true">
+        <description>Associate a party to a General Ledger Account</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <attribute name="glAccountId" type="String" mode="IN" optional="false"/>
+    </service>
+
+    <service name="updatePartyGlAccount" default-entity-name="PartyGlAccount" engine="simple"
+        location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="updatePartyGlAccount" auth="true">
+        <description>Update an existing General Ledger Account of a Party</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <attribute name="glAccountId" type="String" mode="IN" optional="false"/>
+    </service>
+
+    <service name="deletePartyGlAccount" default-entity-name="PartyGlAccount" engine="simple" 
+        location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" invoke="deletePartyGlAccount" auth="true">
+        <description>Delete an existing General Ledger Account of a Party</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>		
+    </service>
 </services>

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml?rev=613389&r1=613388&r2=613389&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Sat Jan 19 05:36:42 2008
@@ -613,6 +613,34 @@
         <response name="error" type="view" value="SetupGlJournals"/>
     </request-map>
 
+    <!-- PartyGlAccount Requests--> 
+    <request-map uri="editPartyGlAccounts">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="EditPartyGlAccount"/>
+        <response name="error" type="view" value="EditPartyGlAccount"/>
+    </request-map> 
+
+    <request-map uri="createPartyGlAccount">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="createPartyGlAccount"/>
+        <response name="success" type="view" value="EditPartyGlAccount"/>
+        <response name="error" type="view" value="EditPartyGlAccount"/>
+     </request-map>
+
+    <request-map uri="updatePartyGlAccount">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="updatePartyGlAccount"/>
+        <response name="success" type="view" value="EditPartyGlAccount"/>
+        <response name="error" type="view" value="EditPartyGlAccount"/>
+    </request-map>
+
+    <request-map uri="deletePartyGlAccount">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="deletePartyGlAccount"/>
+        <response name="success" type="view" value="EditPartyGlAccount"/>
+        <response name="error" type="view" value="EditPartyGlAccount"/>
+    </request-map>	
+	
     <!-- =============== Fixed Asset mapping =================-->
     <request-map uri="ListFixedAssets"><security https="true" auth="true"/><response name="success" type="view" value="ListFixedAssets"/></request-map>
     <request-map uri="EditFixedAsset"><security https="true" auth="true"/><response name="success" type="view" value="EditFixedAsset"/></request-map>
@@ -1840,7 +1868,8 @@
 
     <view-map name="ListGlAccountEntries" type="screen" page="component://accounting/widget/GlobalGlAccountsScreens.xml#ListGlAccountEntries"/>
     <view-map name="ListAcctgTransEntries" type="screen" page="component://accounting/widget/GlobalGlAccountsScreens.xml#ListAcctgTransEntries"/>
-    
+    <view-map name="EditPartyGlAccount" type="screen" page="component://accounting/widget/GlSetupScreens.xml#EditPartyGlAccount"/>
+	
     <!-- FinAccount -->
     <view-map name="FindFinAccount" type="screen" page="component://accounting/widget/FinAccountScreens.xml#FindFinAccount"/>
     <view-map name="ListFinAccount" type="screen" page="component://accounting/widget/FinAccountScreens.xml#ListFinAccount"/>    

Modified: ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml?rev=613389&r1=613388&r2=613389&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml Sat Jan 19 05:36:42 2008
@@ -704,4 +704,44 @@
         </field>
         <field name="submitButton" title="${uiLabelMap.CommonAdd}"><submit button-type="button"/></field>
     </form>
+
+    <form name="ListPartyGlAccounts" type="list" target="updatePartyGlAccount" list-name="partyGlAccounts">
+        <auto-fields-service service-name="updatePartyGlAccount" default-field-type="display"/>
+        <field name="organizationPartyId"><hidden/></field>       
+        <field name="glAccountId" title="${uiLabelMap.AccountingGlAccountId}">
+            <drop-down allow-empty="false">                
+                <list-options key-name="accountCode" list-name="glAccounts" description="${accountCode} ${accountName}"/>
+            </drop-down>
+        </field>     
+        <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+            <hyperlink target="deletePartyGlAccount?organizationPartyId=${organizationPartyId}&amp;partyId=${partyId}&amp;glAccountId=${glAccountId}&amp;roleTypeId=${roleTypeId}&amp;glAccountTypeId=${glAccountTypeId}" description="${uiLabelMap.CommonDelete}"/>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
+
+    <form name="AddPartyGlAccount" type="single" target="createPartyGlAccount">
+        <auto-fields-service service-name="createPartyGlAccount" default-field-type="display"/>
+        <field name="organizationPartyId"><hidden/></field>
+        <field name="partyId" title="${uiLabelMap.PartyPartyId}"><lookup target-form-name="LookupPartyName"/></field>
+        <field name="roleTypeId" title="${uiLabelMap.FormFieldTitle_roleTypeId}">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="RoleType" key-field-name="roleTypeId" description="${description}">
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="glAccountTypeId" title="${uiLabelMap.FormFieldTitle_glAccountTypeId}">
+            <drop-down>
+                <entity-options entity-name="GlAccountType" description="${description}" key-field-name="glAccountTypeId">
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="glAccountId" title="${uiLabelMap.AccountingGlAccountId}">
+            <drop-down allow-empty="false">
+                <list-options key-name="accountCode" list-name="glAccounts" description="${accountCode} ${accountName}"/>
+            </drop-down>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonAdd}"><submit button-type="button"/></field>
+    </form>
 </forms>

Modified: ofbiz/trunk/applications/accounting/widget/GlSetupScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/GlSetupScreens.xml?rev=613389&r1=613388&r2=613389&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/GlSetupScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/GlSetupScreens.xml Sat Jan 19 05:36:42 2008
@@ -546,5 +546,38 @@
             </widgets>    
         </section>
     </screen>
-    
+
+    <screen name="EditPartyGlAccount">
+        <section>
+            <actions>
+                <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
+                <set field="titleProperty" value="PageTitleEditPartyGlAccounts"/>
+                <set field="labelTitleProperty" value="${uiLabelMap.PageTitleEditPartyGlAccounts}"/>
+                <set field="tabButtonItem" value="GlAccountAssignment"/>
+                <set field="tabButtonItem2" value="PartyGlAccounts"/>
+                <set field="organizationPartyId" from-field="parameters.organizationPartyId"/>
+                <entity-condition entity-name="PartyGlAccount" list-name="partyGlAccounts">
+                    <condition-expr field-name="organizationPartyId" env-name="organizationPartyId"/>
+                    <order-by field-name="partyId"/>
+                </entity-condition>
+                <entity-condition entity-name="GlAccountOrganizationAndClass" list-name="glAccounts">
+                    <condition-expr field-name="organizationPartyId" env-name="organizationPartyId"/>
+                    <order-by field-name="accountCode"/>
+                </entity-condition>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonAdminDecorator">
+                    <decorator-section name="body">
+                        <container>
+                            <include-form name="ListPartyGlAccounts" location="component://accounting/widget/GlSetupForms.xml"/>
+                            <container>
+                                <label style="head2">${uiLabelMap.AccountingAddPartyGlAccount}</label>
+                            </container>
+                            <include-form name="AddPartyGlAccount" location="component://accounting/widget/GlSetupForms.xml"/>
+                        </container>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>

Modified: ofbiz/trunk/applications/accounting/widget/Menus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/Menus.xml?rev=613389&r1=613388&r2=613389&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/Menus.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/Menus.xml Sat Jan 19 05:36:42 2008
@@ -524,6 +524,9 @@
         <menu-item name="TaxAuthorityGlAccounts" title="${uiLabelMap.AccountingTaxAuthorityGlAccounts}">
             <link target="editOrganizationTaxAuthorityGlAccount?organizationPartyId=${organizationPartyId}"/>
         </menu-item>
+        <menu-item name="PartyGlAccounts" title="${uiLabelMap.AccountingPartyGlAccounts}">
+            <link target="editPartyGlAccounts?organizationPartyId=${organizationPartyId}"/>
+        </menu-item>
     </menu>
     <menu name="PartyAccountingChecksTabBar" selected-menuitem-context-field-name="tabButtonItem2" default-menu-item-name="GlAccountSalInvoice" default-selected-style="selected"
         menu-container-style="button-bar tab-bar" type="simple">