You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by David E Jones <jo...@undersunconsulting.com> on 2007/05/20 05:17:48 UTC

Re: svn commit: r539814 - in /ofbiz/trunk/applications/accounting: data/ script/org/ofbiz/accounting/admin/ servicedef/ webapp/accounting/WEB-INF/ webapp/accounting/admin/

Hans,

Please reverse this commit, or adjust according to comments ASAP.

We should probably have a comment about it, but we intentionally do NOT have a service to update these preferences. Doing so can have an impact on quite a few things and break a lot of stuff so a simple update service that doesn't go through and adjust other things for the changes can cause big problems.

The other option would be to limit which fields can be updated, which is easily done by using explicit attribute definitions in the service def for the update rather than doing a general auto-attributes element.

-David


hansbak@apache.org wrote:
> Author: hansbak
> Date: Sat May 19 18:30:28 2007
> New Revision: 539814
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=539814
> Log:
> added a very limited acctPreference update possibility inclusive separate security
> 
> Modified:
>     ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml
>     ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/AcctgAdminServices.xml
>     ofbiz/trunk/applications/accounting/servicedef/services_admin.xml
>     ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
>     ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.xml
> 
> Modified: ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml?view=diff&rev=539814&r1=539813&r2=539814
> ==============================================================================
> --- ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml (original)
> +++ ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml Sat May 19 18:30:28 2007
> @@ -80,6 +80,9 @@
>      <SecurityPermission description="Set organization accounting preferences" permissionId="ACCTG_PREF_CREATE"/>
>      <SecurityGroupPermission groupId="FULLADMIN" permissionId="ACCTG_PREF_CREATE"/>
>      <SecurityGroupPermission groupId="BIZADMIN" permissionId="ACCTG_PREF_CREATE"/>
> +    <SecurityPermission description="Update organization accounting preferences" permissionId="ACCTG_PREF_UPDATE"/>
> +    <SecurityGroupPermission groupId="FULLADMIN" permissionId="ACCTG_PREF_UPDATE"/>
> +    <SecurityGroupPermission groupId="BIZADMIN" permissionId="ACCTG_PREF_UPDATE"/>
>      
>      <SecurityPermission description="Set foreign exchange rates" permissionId="ACCTG_FX_ENTRY"/>
>      <SecurityGroupPermission groupId="FULLADMIN" permissionId="ACCTG_FX_ENTRY"/>
> 
> Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/AcctgAdminServices.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/AcctgAdminServices.xml?view=diff&rev=539814&r1=539813&r2=539814
> ==============================================================================
> --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/AcctgAdminServices.xml (original)
> +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/AcctgAdminServices.xml Sat May 19 18:30:28 2007
> @@ -41,6 +41,14 @@
>          <create-value value-name="newEntity"/>
>      </simple-method>
>      
> +    <simple-method method-name="updatePartyAcctgPreference"
> +        short-description="Update the accounting preference settings for a party">
> +        <!-- permission checking is done in the services definition file (services_other.xml) -->
> +        <entity-one entity-name="PartyAcctgPreference" value-name="newEntity"/>
> +        <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
> +        <store-value value-name="newEntity"/>
> +    </simple-method>
> +    
>      <!-- update currency conversion rates in the UomConversionDated entity -->
>      <simple-method method-name="updateFXConversion" short-description="Update Foreign Exchange conversion rate">
>          <!-- set the FX rate changes as of now -->
> 
> Modified: ofbiz/trunk/applications/accounting/servicedef/services_admin.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_admin.xml?view=diff&rev=539814&r1=539813&r2=539814
> ==============================================================================
> --- ofbiz/trunk/applications/accounting/servicedef/services_admin.xml (original)
> +++ ofbiz/trunk/applications/accounting/servicedef/services_admin.xml Sat May 19 18:30:28 2007
> @@ -32,6 +32,15 @@
>          <auto-attributes include="pk" mode="IN" optional="false"/>
>          <auto-attributes include="nonpk" mode="IN" optional="true"/>
>      </service>
> +    <service name="updatePartyAcctgPreference" default-entity-name="PartyAcctgPreference" engine="simple"
> +        location="org/ofbiz/accounting/admin/AcctgAdminServices.xml" invoke="updatePartyAcctgPreference" auth="true">
> +        <description>Update accounting preferences for a party (organization)</description>
> +        <required-permissions join-type="OR">
> +            <check-permission permission="ACCTG_PREF_UPDATE"/>
> +        </required-permissions>
> +        <auto-attributes include="pk" mode="IN" optional="false"/>
> +        <auto-attributes include="nonpk" mode="IN" optional="true"/>
> +    </service>
>      
>      <service name="updateFXConversion" engine="simple" 
>          location="org/ofbiz/accounting/admin/AcctgAdminServices.xml" invoke="updateFXConversion">
> 
> 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?view=diff&rev=539814&r1=539813&r2=539814
> ==============================================================================
> --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original)
> +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Sat May 19 18:30:28 2007
> @@ -1075,6 +1075,13 @@
>          <response name="error" type="view" value="PartyAcctgPreference"/>
>      </request-map>
>      
> +    <request-map uri="updatePartyAcctgPreference">
> +        <security https="true" auth="true"/>
> +        <event type="service" invoke="updatePartyAcctgPreference"/>
> +        <response name="success" type="view" value="PartyAcctgPreference"/>
> +        <response name="error" type="view" value="PartyAcctgPreference"/>
> +    </request-map>
> +    
>      <request-map uri="GlAccountAssignment">
>          <security https="true" auth="true"/>
>          <response name="success" type="view" value="GlAccountSalInvoice"/>
> 
> Modified: ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.xml?view=diff&rev=539814&r1=539813&r2=539814
> ==============================================================================
> --- ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.xml (original)
> +++ ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.xml Sat May 19 18:30:28 2007
> @@ -28,6 +28,7 @@
>      </form>
>      
>      <form name="PartyAcctgPreference" type="single" target="createPartyAcctgPreference" default-service-name="createPartyAcctgPreference" default-map-name="partyAcctgPreference">
> +        <alt-target use-when="partyAcctgPreference!=null" target="updatePartyAcctgPreference"/>
>          <auto-fields-service service-name="createPartyAcctgPreference"/>
>          <field name="organizationPartyId"><hidden value="${parameters.organizationPartyId}"/></field>
>          <!-- the partyId is always displayed -->
> @@ -118,7 +119,8 @@
>                  </entity-options>
>              </drop-down>
>          </field>
> -        <field name="submitButton" title="${uiLabelMap.CommonCreate}" use-when="partyAcctgPreference==null"><submit/></field>
> +        <field name="createButton" use-when="partyAcctgPreference==null"><submit/></field>
> +        <field name="updateButton" use-when="partyAcctgPreference!=null"><submit/></field>
>          
>          <!-- otherwise, we just display the fields.  there is no submit button because we shouldn't try to create it again and don't support an update option right now-->
>          <field name="fiscalYearStartMonth" use-when="partyAcctgPreference!=null"><display/></field>
> @@ -147,6 +149,14 @@
>          <!-- these 2 are ONLY displayed, never allow manual editing -->
>          <field name="lastInvoiceNumber"><display/></field>
>          <field name="lastInvoiceRestartDate"><display/></field>
> +        
> +        <field name="refundPaymentMethodId">
> +            <drop-down>
> +                <entity-options entity-name="PaymentMethod" description="${description}" key-field-name="paymentMethodId">
> +                    <entity-constraint name="partyId" operator="equals" env-name="organizationPartyId"/>
> +                </entity-options>
> +            </drop-down>
> +        </field>
>      </form>
>      
>      <form name="ListUnpostedAcctgTrans" type="list" title="Unposted Accounting Transactions" list-name="transactions">
> 
> 

Re: svn commit: r539814 - in /ofbiz/trunk/applications/accounting: data/ script/org/ofbiz/accounting/admin/ servicedef/ webapp/accounting/WEB-INF/ webapp/accounting/admin/

Posted by Hans Bakker <ma...@antwebsystems.com>.
David,

I agree with you, it is a matter of choice. However adding a field should not 
be done easily and the implications (especially here) should be well thought 
out. If you would like to extend the entity the field will appear on the 
screen, however the  system will contain examples now how to limit the update 
if you do not want this. 

The reason i implemented this change is that i want a number of preferences 
stored for the sharedOfbiz system. I have a VAT report and i need to know 
which invoiceItemType is the incoming- and which is the outgoing 'VAT' 
invoiceItemType. I have different invoiceItemTypes for different organizing 
companies.

regards,
Hans

On Sunday 20 May 2007 13:08, David E Jones wrote:
> What if we want to default on the side of caution where new fields are not
> included and change-able by default?
>
> Hans Bakker wrote:
> > In this case exclude is better, because it allows entity extensions which
> > will show on the related screens.....
> >
> > On Sunday 20 May 2007 12:13, David E Jones wrote:
> >> Thanks Hans, that looks fine. It might have been easier to include than
> >> exclude, but it's fine as is now.
> >>
> >> Eventually it would be cool to write stuff to allow updating more
> >> settings and then fixing all of the existing data accordingly, but for
> >> now this is good enough.
> >>
> >> -David
> >>
> >> Hans Bakker wrote:
> >>> Hi David,
> >>>
> >>> your suggestions implemented.
> >>>
> >>> Hans
> >>>
> >>> On Sunday 20 May 2007 10:17, David E Jones wrote:
> >>>> Hans,
> >>>>
> >>>> Please reverse this commit, or adjust according to comments ASAP.
> >>>>
> >>>> We should probably have a comment about it, but we intentionally do
> >>>> NOT have a service to update these preferences. Doing so can have an
> >>>> impact on quite a few things and break a lot of stuff so a simple
> >>>> update service that doesn't go through and adjust other things for the
> >>>> changes can cause big problems.
> >>>>
> >>>> The other option would be to limit which fields can be updated, which
> >>>> is easily done by using explicit attribute definitions in the service
> >>>> def for the update rather than doing a general auto-attributes
> >>>> element.
> >>>>
> >>>> -David
> >>>>
> >>>> hansbak@apache.org wrote:
> >>>>> Author: hansbak
> >>>>> Date: Sat May 19 18:30:28 2007
> >>>>> New Revision: 539814
> >>>>>
> >>>>> URL: http://svn.apache.org/viewvc?view=rev&rev=539814
> >>>>> Log:
> >>>>> added a very limited acctPreference update possibility inclusive
> >>>>> separate security
> >>>>>
> >>>>> Modified:
> >>>>>    
> >>>>> ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml
> >>>>>
> >>>>> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin
> >>>>>/A cc tgAdminServices.xml
> >>>>> ofbiz/trunk/applications/accounting/servicedef/services_admin.xml
> >>>>> ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/control
> >>>>>le r. xml
> >>>>> ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForm
> >>>>>s. xm l
> >>>>>
> >>>>> Modified:
> >>>>> ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml
> >>>>> URL:
> >>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data
> >>>>>/A cc ountingSecurityData.xml?view=diff&rev=539814&r1=539813&r2=539814
> >>>>> =====================================================================
> >>>>>== == ===== ---
> >>>>> ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml
> >>>>> (original) +++
> >>>>> ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml
> >>>>> Sat May 19 18:30:28 2007 @@ -80,6 +80,9 @@
> >>>>>      <SecurityPermission description="Set organization accounting
> >>>>> preferences" permissionId="ACCTG_PREF_CREATE"/>
> >>>>> <SecurityGroupPermission groupId="FULLADMIN"
> >>>>> permissionId="ACCTG_PREF_CREATE"/>
> >>>>> <SecurityGroupPermission groupId="BIZADMIN"
> >>>>> permissionId="ACCTG_PREF_CREATE"/> +    <SecurityPermission
> >>>>> description="Update organization accounting preferences"
> >>>>> permissionId="ACCTG_PREF_UPDATE"/> +    <SecurityGroupPermission
> >>>>> groupId="FULLADMIN" permissionId="ACCTG_PREF_UPDATE"/> +
> >>>>> <SecurityGroupPermission groupId="BIZADMIN"
> >>>>> permissionId="ACCTG_PREF_UPDATE"/>
> >>>>>
> >>>>>      <SecurityPermission description="Set foreign exchange rates"
> >>>>> permissionId="ACCTG_FX_ENTRY"/> <SecurityGroupPermission
> >>>>> groupId="FULLADMIN" permissionId="ACCTG_FX_ENTRY"/>
> >>>>>
> >>>>> Modified:
> >>>>> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin
> >>>>>/A cc tgAdminServices.xml URL:
> >>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/scri
> >>>>>pt /o
> >>>>> rg/ofbiz/accounting/admin/AcctgAdminServices.xml?view=diff&rev=539814
> >>>>>&r 1=5 39813&r2=539814
> >>>>> =====================================================================
> >>>>>== == ===== ---
> >>>>> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin
> >>>>>/A cc tgAdminServices.xml (original) +++
> >>>>> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin
> >>>>>/A cc tgAdminServices.xml Sat May 19 18:30:28 2007 @@ -41,6 +41,14 @@
> >>>>> <create-value value-name="newEntity"/>
> >>>>>      </simple-method>
> >>>>>
> >>>>> +    <simple-method method-name="updatePartyAcctgPreference"
> >>>>> +        short-description="Update the accounting preference settings
> >>>>> for a party"> +        <!-- permission checking is done in the
> >>>>> services definition file (services_other.xml) --> +       
> >>>>> <entity-one entity-name="PartyAcctgPreference"
> >>>>> value-name="newEntity"/> + <set-nonpk-fields map-name="parameters"
> >>>>> value-name="newEntity"/> + <store-value value-name="newEntity"/>
> >>>>> +    </simple-method>
> >>>>> +
> >>>>>      <!-- update currency conversion rates in the UomConversionDated
> >>>>> entity --> <simple-method method-name="updateFXConversion"
> >>>>> short-description="Update Foreign Exchange conversion rate"> <!-- set
> >>>>> the FX rate changes as of now -->
> >>>>>
> >>>>> Modified:
> >>>>> ofbiz/trunk/applications/accounting/servicedef/services_admin.xml
> >>>>> URL:
> >>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/serv
> >>>>>ic ed ef/services_admin.xml?view=diff&rev=539814&r1=539813&r2=539814
> >>>>> =====================================================================
> >>>>>== == ===== ---
> >>>>> ofbiz/trunk/applications/accounting/servicedef/services_admin.xml
> >>>>> (original) +++
> >>>>> ofbiz/trunk/applications/accounting/servicedef/services_admin.xml Sat
> >>>>> May 19 18:30:28 2007 @@ -32,6 +32,15 @@
> >>>>>          <auto-attributes include="pk" mode="IN" optional="false"/>
> >>>>>          <auto-attributes include="nonpk" mode="IN" optional="true"/>
> >>>>>      </service>
> >>>>> +    <service name="updatePartyAcctgPreference"
> >>>>> default-entity-name="PartyAcctgPreference" engine="simple" +
> >>>>> location="org/ofbiz/accounting/admin/AcctgAdminServices.xml"
> >>>>> invoke="updatePartyAcctgPreference" auth="true"> +
> >>>>> <description>Update accounting preferences for a party
> >>>>> (organization)</description> +        <required-permissions
> >>>>> join-type="OR">
> >>>>> +            <check-permission permission="ACCTG_PREF_UPDATE"/>
> >>>>> +        </required-permissions>
> >>>>> +        <auto-attributes include="pk" mode="IN" optional="false"/>
> >>>>> +        <auto-attributes include="nonpk" mode="IN" optional="true"/>
> >>>>> +    </service>
> >>>>>
> >>>>>      <service name="updateFXConversion" engine="simple"
> >>>>>          location="org/ofbiz/accounting/admin/AcctgAdminServices.xml"
> >>>>> invoke="updateFXConversion">
> >>>>>
> >>>>> Modified:
> >>>>> ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/control
> >>>>>le r. xml URL:
> >>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/weba
> >>>>>pp /a
> >>>>> ccounting/WEB-INF/controller.xml?view=diff&rev=539814&r1=539813&r2=53
> >>>>>98 14
> >>>>> =====================================================================
> >>>>>== == ===== ---
> >>>>> ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/control
> >>>>>le r. xml (original) +++
> >>>>> ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/control
> >>>>>le r. xml Sat May 19 18:30:28 2007 @@ -1075,6 +1075,13 @@
> >>>>>          <response name="error" type="view"
> >>>>> value="PartyAcctgPreference"/> </request-map>
> >>>>>
> >>>>> +    <request-map uri="updatePartyAcctgPreference">
> >>>>> +        <security https="true" auth="true"/>
> >>>>> +        <event type="service" invoke="updatePartyAcctgPreference"/>
> >>>>> +        <response name="success" type="view"
> >>>>> value="PartyAcctgPreference"/> +        <response name="error"
> >>>>> type="view" value="PartyAcctgPreference"/> +    </request-map>
> >>>>> +
> >>>>>      <request-map uri="GlAccountAssignment">
> >>>>>          <security https="true" auth="true"/>
> >>>>>          <response name="success" type="view"
> >>>>> value="GlAccountSalInvoice"/>
> >>>>>
> >>>>> Modified:
> >>>>> ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForm
> >>>>>s. xm l URL:
> >>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/weba
> >>>>>pp /a
> >>>>> ccounting/admin/AdminForms.xml?view=diff&rev=539814&r1=539813&r2=5398
> >>>>>14
> >>>>> =====================================================================
> >>>>>== == ===== ---
> >>>>> ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForm
> >>>>>s. xm l (original) +++
> >>>>> ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForm
> >>>>>s. xm l Sat May 19 18:30:28 2007 @@ -28,6 +28,7 @@
> >>>>>      </form>
> >>>>>
> >>>>>      <form name="PartyAcctgPreference" type="single"
> >>>>> target="createPartyAcctgPreference"
> >>>>> default-service-name="createPartyAcctgPreference"
> >>>>> default-map-name="partyAcctgPreference"> +        <alt-target
> >>>>> use-when="partyAcctgPreference!=null"
> >>>>> target="updatePartyAcctgPreference"/> <auto-fields-service
> >>>>> service-name="createPartyAcctgPreference"/> <field
> >>>>> name="organizationPartyId"><hidden
> >>>>> value="${parameters.organizationPartyId}"/></field> <!-- the partyId
> >>>>> is always displayed -->
> >>>>> @@ -118,7 +119,8 @@
> >>>>>                  </entity-options>
> >>>>>              </drop-down>
> >>>>>          </field>
> >>>>> -        <field name="submitButton"
> >>>>> title="${uiLabelMap.CommonCreate}"
> >>>>> use-when="partyAcctgPreference==null"><submit/></field> +       
> >>>>> <field name="createButton"
> >>>>> use-when="partyAcctgPreference==null"><submit/></field> +       
> >>>>> <field name="updateButton"
> >>>>> use-when="partyAcctgPreference!=null"><submit/></field>
> >>>>>
> >>>>>          <!-- otherwise, we just display the fields.  there is no
> >>>>> submit button because we shouldn't try to create it again and don't
> >>>>> support an update option right now--> <field
> >>>>> name="fiscalYearStartMonth"
> >>>>> use-when="partyAcctgPreference!=null"><display/></field> @@ -147,6
> >>>>> +149,14 @@
> >>>>>          <!-- these 2 are ONLY displayed, never allow manual editing
> >>>>> --> <field name="lastInvoiceNumber"><display/></field>
> >>>>>          <field name="lastInvoiceRestartDate"><display/></field>
> >>>>> +
> >>>>> +        <field name="refundPaymentMethodId">
> >>>>> +            <drop-down>
> >>>>> +                <entity-options entity-name="PaymentMethod"
> >>>>> description="${description}" key-field-name="paymentMethodId"> +
> >>>>>           <entity-constraint name="partyId" operator="equals"
> >>>>> env-name="organizationPartyId"/> +                </entity-options>
> >>>>> +            </drop-down>
> >>>>> +        </field>
> >>>>>      </form>
> >>>>>
> >>>>>      <form name="ListUnpostedAcctgTrans" type="list" title="Unposted
> >>>>> Accounting Transactions" list-name="transactions">
-- 

http://Antwebsystems.com: Quality OFBiz support with competitive rates.

Re: svn commit: r539814 - in /ofbiz/trunk/applications/accounting: data/ script/org/ofbiz/accounting/admin/ servicedef/ webapp/accounting/WEB-INF/ webapp/accounting/admin/

Posted by David E Jones <jo...@hotwaxmedia.com>.
What if we want to default on the side of caution where new fields are not included and change-able by default?

Hans Bakker wrote:
> In this case exclude is better, because it allows entity extensions which will 
> show on the related screens.....
> 
> On Sunday 20 May 2007 12:13, David E Jones wrote:
>> Thanks Hans, that looks fine. It might have been easier to include than
>> exclude, but it's fine as is now.
>>
>> Eventually it would be cool to write stuff to allow updating more settings
>> and then fixing all of the existing data accordingly, but for now this is
>> good enough.
>>
>> -David
>>
>> Hans Bakker wrote:
>>> Hi David,
>>>
>>> your suggestions implemented.
>>>
>>> Hans
>>>
>>> On Sunday 20 May 2007 10:17, David E Jones wrote:
>>>> Hans,
>>>>
>>>> Please reverse this commit, or adjust according to comments ASAP.
>>>>
>>>> We should probably have a comment about it, but we intentionally do NOT
>>>> have a service to update these preferences. Doing so can have an impact
>>>> on quite a few things and break a lot of stuff so a simple update
>>>> service that doesn't go through and adjust other things for the changes
>>>> can cause big problems.
>>>>
>>>> The other option would be to limit which fields can be updated, which is
>>>> easily done by using explicit attribute definitions in the service def
>>>> for the update rather than doing a general auto-attributes element.
>>>>
>>>> -David
>>>>
>>>> hansbak@apache.org wrote:
>>>>> Author: hansbak
>>>>> Date: Sat May 19 18:30:28 2007
>>>>> New Revision: 539814
>>>>>
>>>>> URL: http://svn.apache.org/viewvc?view=rev&rev=539814
>>>>> Log:
>>>>> added a very limited acctPreference update possibility inclusive
>>>>> separate security
>>>>>
>>>>> Modified:
>>>>>     ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml
>>>>>
>>>>> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/A
>>>>> cc tgAdminServices.xml
>>>>> ofbiz/trunk/applications/accounting/servicedef/services_admin.xml
>>>>> ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controlle
>>>>> r. xml
>>>>> ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.
>>>>> xm l
>>>>>
>>>>> Modified:
>>>>> ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml
>>>>> URL:
>>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/A
>>>>> cc ountingSecurityData.xml?view=diff&rev=539814&r1=539813&r2=539814
>>>>> =======================================================================
>>>>> == ===== ---
>>>>> ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml
>>>>> (original) +++
>>>>> ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml Sat
>>>>> May 19 18:30:28 2007 @@ -80,6 +80,9 @@
>>>>>      <SecurityPermission description="Set organization accounting
>>>>> preferences" permissionId="ACCTG_PREF_CREATE"/>
>>>>> <SecurityGroupPermission groupId="FULLADMIN"
>>>>> permissionId="ACCTG_PREF_CREATE"/>
>>>>> <SecurityGroupPermission groupId="BIZADMIN"
>>>>> permissionId="ACCTG_PREF_CREATE"/> +    <SecurityPermission
>>>>> description="Update organization accounting preferences"
>>>>> permissionId="ACCTG_PREF_UPDATE"/> +    <SecurityGroupPermission
>>>>> groupId="FULLADMIN" permissionId="ACCTG_PREF_UPDATE"/> +
>>>>> <SecurityGroupPermission groupId="BIZADMIN"
>>>>> permissionId="ACCTG_PREF_UPDATE"/>
>>>>>
>>>>>      <SecurityPermission description="Set foreign exchange rates"
>>>>> permissionId="ACCTG_FX_ENTRY"/> <SecurityGroupPermission
>>>>> groupId="FULLADMIN" permissionId="ACCTG_FX_ENTRY"/>
>>>>>
>>>>> Modified:
>>>>> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/A
>>>>> cc tgAdminServices.xml URL:
>>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script
>>>>> /o
>>>>> rg/ofbiz/accounting/admin/AcctgAdminServices.xml?view=diff&rev=539814&r
>>>>> 1=5 39813&r2=539814
>>>>> =======================================================================
>>>>> == ===== ---
>>>>> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/A
>>>>> cc tgAdminServices.xml (original) +++
>>>>> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/A
>>>>> cc tgAdminServices.xml Sat May 19 18:30:28 2007 @@ -41,6 +41,14 @@
>>>>> <create-value value-name="newEntity"/>
>>>>>      </simple-method>
>>>>>
>>>>> +    <simple-method method-name="updatePartyAcctgPreference"
>>>>> +        short-description="Update the accounting preference settings
>>>>> for a party"> +        <!-- permission checking is done in the services
>>>>> definition file (services_other.xml) --> +        <entity-one
>>>>> entity-name="PartyAcctgPreference" value-name="newEntity"/> +
>>>>> <set-nonpk-fields map-name="parameters" value-name="newEntity"/> +
>>>>> <store-value value-name="newEntity"/>
>>>>> +    </simple-method>
>>>>> +
>>>>>      <!-- update currency conversion rates in the UomConversionDated
>>>>> entity --> <simple-method method-name="updateFXConversion"
>>>>> short-description="Update Foreign Exchange conversion rate"> <!-- set
>>>>> the FX rate changes as of now -->
>>>>>
>>>>> Modified:
>>>>> ofbiz/trunk/applications/accounting/servicedef/services_admin.xml URL:
>>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servic
>>>>> ed ef/services_admin.xml?view=diff&rev=539814&r1=539813&r2=539814
>>>>> =======================================================================
>>>>> == ===== ---
>>>>> ofbiz/trunk/applications/accounting/servicedef/services_admin.xml
>>>>> (original) +++
>>>>> ofbiz/trunk/applications/accounting/servicedef/services_admin.xml Sat
>>>>> May 19 18:30:28 2007 @@ -32,6 +32,15 @@
>>>>>          <auto-attributes include="pk" mode="IN" optional="false"/>
>>>>>          <auto-attributes include="nonpk" mode="IN" optional="true"/>
>>>>>      </service>
>>>>> +    <service name="updatePartyAcctgPreference"
>>>>> default-entity-name="PartyAcctgPreference" engine="simple" +
>>>>> location="org/ofbiz/accounting/admin/AcctgAdminServices.xml"
>>>>> invoke="updatePartyAcctgPreference" auth="true"> +
>>>>> <description>Update accounting preferences for a party
>>>>> (organization)</description> +        <required-permissions
>>>>> join-type="OR">
>>>>> +            <check-permission permission="ACCTG_PREF_UPDATE"/>
>>>>> +        </required-permissions>
>>>>> +        <auto-attributes include="pk" mode="IN" optional="false"/>
>>>>> +        <auto-attributes include="nonpk" mode="IN" optional="true"/>
>>>>> +    </service>
>>>>>
>>>>>      <service name="updateFXConversion" engine="simple"
>>>>>          location="org/ofbiz/accounting/admin/AcctgAdminServices.xml"
>>>>> invoke="updateFXConversion">
>>>>>
>>>>> Modified:
>>>>> ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controlle
>>>>> r. xml URL:
>>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp
>>>>> /a
>>>>> ccounting/WEB-INF/controller.xml?view=diff&rev=539814&r1=539813&r2=5398
>>>>> 14
>>>>> =======================================================================
>>>>> == ===== ---
>>>>> ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controlle
>>>>> r. xml (original) +++
>>>>> ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controlle
>>>>> r. xml Sat May 19 18:30:28 2007 @@ -1075,6 +1075,13 @@
>>>>>          <response name="error" type="view"
>>>>> value="PartyAcctgPreference"/> </request-map>
>>>>>
>>>>> +    <request-map uri="updatePartyAcctgPreference">
>>>>> +        <security https="true" auth="true"/>
>>>>> +        <event type="service" invoke="updatePartyAcctgPreference"/>
>>>>> +        <response name="success" type="view"
>>>>> value="PartyAcctgPreference"/> +        <response name="error"
>>>>> type="view" value="PartyAcctgPreference"/> +    </request-map>
>>>>> +
>>>>>      <request-map uri="GlAccountAssignment">
>>>>>          <security https="true" auth="true"/>
>>>>>          <response name="success" type="view"
>>>>> value="GlAccountSalInvoice"/>
>>>>>
>>>>> Modified:
>>>>> ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.
>>>>> xm l URL:
>>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp
>>>>> /a
>>>>> ccounting/admin/AdminForms.xml?view=diff&rev=539814&r1=539813&r2=539814
>>>>> =======================================================================
>>>>> == ===== ---
>>>>> ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.
>>>>> xm l (original) +++
>>>>> ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.
>>>>> xm l Sat May 19 18:30:28 2007 @@ -28,6 +28,7 @@
>>>>>      </form>
>>>>>
>>>>>      <form name="PartyAcctgPreference" type="single"
>>>>> target="createPartyAcctgPreference"
>>>>> default-service-name="createPartyAcctgPreference"
>>>>> default-map-name="partyAcctgPreference"> +        <alt-target
>>>>> use-when="partyAcctgPreference!=null"
>>>>> target="updatePartyAcctgPreference"/> <auto-fields-service
>>>>> service-name="createPartyAcctgPreference"/> <field
>>>>> name="organizationPartyId"><hidden
>>>>> value="${parameters.organizationPartyId}"/></field> <!-- the partyId is
>>>>> always displayed -->
>>>>> @@ -118,7 +119,8 @@
>>>>>                  </entity-options>
>>>>>              </drop-down>
>>>>>          </field>
>>>>> -        <field name="submitButton" title="${uiLabelMap.CommonCreate}"
>>>>> use-when="partyAcctgPreference==null"><submit/></field> +        <field
>>>>> name="createButton"
>>>>> use-when="partyAcctgPreference==null"><submit/></field> +        <field
>>>>> name="updateButton"
>>>>> use-when="partyAcctgPreference!=null"><submit/></field>
>>>>>
>>>>>          <!-- otherwise, we just display the fields.  there is no
>>>>> submit button because we shouldn't try to create it again and don't
>>>>> support an update option right now--> <field
>>>>> name="fiscalYearStartMonth"
>>>>> use-when="partyAcctgPreference!=null"><display/></field> @@ -147,6
>>>>> +149,14 @@
>>>>>          <!-- these 2 are ONLY displayed, never allow manual editing
>>>>> --> <field name="lastInvoiceNumber"><display/></field>
>>>>>          <field name="lastInvoiceRestartDate"><display/></field>
>>>>> +
>>>>> +        <field name="refundPaymentMethodId">
>>>>> +            <drop-down>
>>>>> +                <entity-options entity-name="PaymentMethod"
>>>>> description="${description}" key-field-name="paymentMethodId"> +
>>>>>           <entity-constraint name="partyId" operator="equals"
>>>>> env-name="organizationPartyId"/> +                </entity-options>
>>>>> +            </drop-down>
>>>>> +        </field>
>>>>>      </form>
>>>>>
>>>>>      <form name="ListUnpostedAcctgTrans" type="list" title="Unposted
>>>>> Accounting Transactions" list-name="transactions">

Re: svn commit: r539814 - in /ofbiz/trunk/applications/accounting: data/ script/org/ofbiz/accounting/admin/ servicedef/ webapp/accounting/WEB-INF/ webapp/accounting/admin/

Posted by Hans Bakker <ma...@antwebsystems.com>.
In this case exclude is better, because it allows entity extensions which will 
show on the related screens.....

On Sunday 20 May 2007 12:13, David E Jones wrote:
> Thanks Hans, that looks fine. It might have been easier to include than
> exclude, but it's fine as is now.
>
> Eventually it would be cool to write stuff to allow updating more settings
> and then fixing all of the existing data accordingly, but for now this is
> good enough.
>
> -David
>
> Hans Bakker wrote:
> > Hi David,
> >
> > your suggestions implemented.
> >
> > Hans
> >
> > On Sunday 20 May 2007 10:17, David E Jones wrote:
> >> Hans,
> >>
> >> Please reverse this commit, or adjust according to comments ASAP.
> >>
> >> We should probably have a comment about it, but we intentionally do NOT
> >> have a service to update these preferences. Doing so can have an impact
> >> on quite a few things and break a lot of stuff so a simple update
> >> service that doesn't go through and adjust other things for the changes
> >> can cause big problems.
> >>
> >> The other option would be to limit which fields can be updated, which is
> >> easily done by using explicit attribute definitions in the service def
> >> for the update rather than doing a general auto-attributes element.
> >>
> >> -David
> >>
> >> hansbak@apache.org wrote:
> >>> Author: hansbak
> >>> Date: Sat May 19 18:30:28 2007
> >>> New Revision: 539814
> >>>
> >>> URL: http://svn.apache.org/viewvc?view=rev&rev=539814
> >>> Log:
> >>> added a very limited acctPreference update possibility inclusive
> >>> separate security
> >>>
> >>> Modified:
> >>>     ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml
> >>>
> >>> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/A
> >>>cc tgAdminServices.xml
> >>> ofbiz/trunk/applications/accounting/servicedef/services_admin.xml
> >>> ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controlle
> >>>r. xml
> >>> ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.
> >>>xm l
> >>>
> >>> Modified:
> >>> ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml
> >>> URL:
> >>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/A
> >>>cc ountingSecurityData.xml?view=diff&rev=539814&r1=539813&r2=539814
> >>> =======================================================================
> >>>== ===== ---
> >>> ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml
> >>> (original) +++
> >>> ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml Sat
> >>> May 19 18:30:28 2007 @@ -80,6 +80,9 @@
> >>>      <SecurityPermission description="Set organization accounting
> >>> preferences" permissionId="ACCTG_PREF_CREATE"/>
> >>> <SecurityGroupPermission groupId="FULLADMIN"
> >>> permissionId="ACCTG_PREF_CREATE"/>
> >>> <SecurityGroupPermission groupId="BIZADMIN"
> >>> permissionId="ACCTG_PREF_CREATE"/> +    <SecurityPermission
> >>> description="Update organization accounting preferences"
> >>> permissionId="ACCTG_PREF_UPDATE"/> +    <SecurityGroupPermission
> >>> groupId="FULLADMIN" permissionId="ACCTG_PREF_UPDATE"/> +
> >>> <SecurityGroupPermission groupId="BIZADMIN"
> >>> permissionId="ACCTG_PREF_UPDATE"/>
> >>>
> >>>      <SecurityPermission description="Set foreign exchange rates"
> >>> permissionId="ACCTG_FX_ENTRY"/> <SecurityGroupPermission
> >>> groupId="FULLADMIN" permissionId="ACCTG_FX_ENTRY"/>
> >>>
> >>> Modified:
> >>> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/A
> >>>cc tgAdminServices.xml URL:
> >>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script
> >>>/o
> >>> rg/ofbiz/accounting/admin/AcctgAdminServices.xml?view=diff&rev=539814&r
> >>>1=5 39813&r2=539814
> >>> =======================================================================
> >>>== ===== ---
> >>> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/A
> >>>cc tgAdminServices.xml (original) +++
> >>> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/A
> >>>cc tgAdminServices.xml Sat May 19 18:30:28 2007 @@ -41,6 +41,14 @@
> >>> <create-value value-name="newEntity"/>
> >>>      </simple-method>
> >>>
> >>> +    <simple-method method-name="updatePartyAcctgPreference"
> >>> +        short-description="Update the accounting preference settings
> >>> for a party"> +        <!-- permission checking is done in the services
> >>> definition file (services_other.xml) --> +        <entity-one
> >>> entity-name="PartyAcctgPreference" value-name="newEntity"/> +
> >>> <set-nonpk-fields map-name="parameters" value-name="newEntity"/> +
> >>> <store-value value-name="newEntity"/>
> >>> +    </simple-method>
> >>> +
> >>>      <!-- update currency conversion rates in the UomConversionDated
> >>> entity --> <simple-method method-name="updateFXConversion"
> >>> short-description="Update Foreign Exchange conversion rate"> <!-- set
> >>> the FX rate changes as of now -->
> >>>
> >>> Modified:
> >>> ofbiz/trunk/applications/accounting/servicedef/services_admin.xml URL:
> >>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servic
> >>>ed ef/services_admin.xml?view=diff&rev=539814&r1=539813&r2=539814
> >>> =======================================================================
> >>>== ===== ---
> >>> ofbiz/trunk/applications/accounting/servicedef/services_admin.xml
> >>> (original) +++
> >>> ofbiz/trunk/applications/accounting/servicedef/services_admin.xml Sat
> >>> May 19 18:30:28 2007 @@ -32,6 +32,15 @@
> >>>          <auto-attributes include="pk" mode="IN" optional="false"/>
> >>>          <auto-attributes include="nonpk" mode="IN" optional="true"/>
> >>>      </service>
> >>> +    <service name="updatePartyAcctgPreference"
> >>> default-entity-name="PartyAcctgPreference" engine="simple" +
> >>> location="org/ofbiz/accounting/admin/AcctgAdminServices.xml"
> >>> invoke="updatePartyAcctgPreference" auth="true"> +
> >>> <description>Update accounting preferences for a party
> >>> (organization)</description> +        <required-permissions
> >>> join-type="OR">
> >>> +            <check-permission permission="ACCTG_PREF_UPDATE"/>
> >>> +        </required-permissions>
> >>> +        <auto-attributes include="pk" mode="IN" optional="false"/>
> >>> +        <auto-attributes include="nonpk" mode="IN" optional="true"/>
> >>> +    </service>
> >>>
> >>>      <service name="updateFXConversion" engine="simple"
> >>>          location="org/ofbiz/accounting/admin/AcctgAdminServices.xml"
> >>> invoke="updateFXConversion">
> >>>
> >>> Modified:
> >>> ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controlle
> >>>r. xml URL:
> >>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp
> >>>/a
> >>> ccounting/WEB-INF/controller.xml?view=diff&rev=539814&r1=539813&r2=5398
> >>>14
> >>> =======================================================================
> >>>== ===== ---
> >>> ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controlle
> >>>r. xml (original) +++
> >>> ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controlle
> >>>r. xml Sat May 19 18:30:28 2007 @@ -1075,6 +1075,13 @@
> >>>          <response name="error" type="view"
> >>> value="PartyAcctgPreference"/> </request-map>
> >>>
> >>> +    <request-map uri="updatePartyAcctgPreference">
> >>> +        <security https="true" auth="true"/>
> >>> +        <event type="service" invoke="updatePartyAcctgPreference"/>
> >>> +        <response name="success" type="view"
> >>> value="PartyAcctgPreference"/> +        <response name="error"
> >>> type="view" value="PartyAcctgPreference"/> +    </request-map>
> >>> +
> >>>      <request-map uri="GlAccountAssignment">
> >>>          <security https="true" auth="true"/>
> >>>          <response name="success" type="view"
> >>> value="GlAccountSalInvoice"/>
> >>>
> >>> Modified:
> >>> ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.
> >>>xm l URL:
> >>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp
> >>>/a
> >>> ccounting/admin/AdminForms.xml?view=diff&rev=539814&r1=539813&r2=539814
> >>> =======================================================================
> >>>== ===== ---
> >>> ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.
> >>>xm l (original) +++
> >>> ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.
> >>>xm l Sat May 19 18:30:28 2007 @@ -28,6 +28,7 @@
> >>>      </form>
> >>>
> >>>      <form name="PartyAcctgPreference" type="single"
> >>> target="createPartyAcctgPreference"
> >>> default-service-name="createPartyAcctgPreference"
> >>> default-map-name="partyAcctgPreference"> +        <alt-target
> >>> use-when="partyAcctgPreference!=null"
> >>> target="updatePartyAcctgPreference"/> <auto-fields-service
> >>> service-name="createPartyAcctgPreference"/> <field
> >>> name="organizationPartyId"><hidden
> >>> value="${parameters.organizationPartyId}"/></field> <!-- the partyId is
> >>> always displayed -->
> >>> @@ -118,7 +119,8 @@
> >>>                  </entity-options>
> >>>              </drop-down>
> >>>          </field>
> >>> -        <field name="submitButton" title="${uiLabelMap.CommonCreate}"
> >>> use-when="partyAcctgPreference==null"><submit/></field> +        <field
> >>> name="createButton"
> >>> use-when="partyAcctgPreference==null"><submit/></field> +        <field
> >>> name="updateButton"
> >>> use-when="partyAcctgPreference!=null"><submit/></field>
> >>>
> >>>          <!-- otherwise, we just display the fields.  there is no
> >>> submit button because we shouldn't try to create it again and don't
> >>> support an update option right now--> <field
> >>> name="fiscalYearStartMonth"
> >>> use-when="partyAcctgPreference!=null"><display/></field> @@ -147,6
> >>> +149,14 @@
> >>>          <!-- these 2 are ONLY displayed, never allow manual editing
> >>> --> <field name="lastInvoiceNumber"><display/></field>
> >>>          <field name="lastInvoiceRestartDate"><display/></field>
> >>> +
> >>> +        <field name="refundPaymentMethodId">
> >>> +            <drop-down>
> >>> +                <entity-options entity-name="PaymentMethod"
> >>> description="${description}" key-field-name="paymentMethodId"> +
> >>>           <entity-constraint name="partyId" operator="equals"
> >>> env-name="organizationPartyId"/> +                </entity-options>
> >>> +            </drop-down>
> >>> +        </field>
> >>>      </form>
> >>>
> >>>      <form name="ListUnpostedAcctgTrans" type="list" title="Unposted
> >>> Accounting Transactions" list-name="transactions">
-- 

http://Antwebsystems.com: Quality OFBiz support with competitive rates.

Re: svn commit: r539814 - in /ofbiz/trunk/applications/accounting: data/ script/org/ofbiz/accounting/admin/ servicedef/ webapp/accounting/WEB-INF/ webapp/accounting/admin/

Posted by David E Jones <jo...@hotwaxmedia.com>.
Thanks Hans, that looks fine. It might have been easier to include than exclude, but it's fine as is now.

Eventually it would be cool to write stuff to allow updating more settings and then fixing all of the existing data accordingly, but for now this is good enough.

-David


Hans Bakker wrote:
> Hi David,
> 
> your suggestions implemented.
> 
> Hans
> 
> On Sunday 20 May 2007 10:17, David E Jones wrote:
>> Hans,
>>
>> Please reverse this commit, or adjust according to comments ASAP.
>>
>> We should probably have a comment about it, but we intentionally do NOT
>> have a service to update these preferences. Doing so can have an impact on
>> quite a few things and break a lot of stuff so a simple update service that
>> doesn't go through and adjust other things for the changes can cause big
>> problems.
>>
>> The other option would be to limit which fields can be updated, which is
>> easily done by using explicit attribute definitions in the service def for
>> the update rather than doing a general auto-attributes element.
>>
>> -David
>>
>> hansbak@apache.org wrote:
>>> Author: hansbak
>>> Date: Sat May 19 18:30:28 2007
>>> New Revision: 539814
>>>
>>> URL: http://svn.apache.org/viewvc?view=rev&rev=539814
>>> Log:
>>> added a very limited acctPreference update possibility inclusive separate
>>> security
>>>
>>> Modified:
>>>     ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml
>>>    
>>> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/Acc
>>> tgAdminServices.xml
>>> ofbiz/trunk/applications/accounting/servicedef/services_admin.xml
>>> ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.
>>> xml
>>> ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.xm
>>> l
>>>
>>> Modified:
>>> ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/Acc
>>> ountingSecurityData.xml?view=diff&rev=539814&r1=539813&r2=539814
>>> =========================================================================
>>> ===== ---
>>> ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml
>>> (original) +++
>>> ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml Sat
>>> May 19 18:30:28 2007 @@ -80,6 +80,9 @@
>>>      <SecurityPermission description="Set organization accounting
>>> preferences" permissionId="ACCTG_PREF_CREATE"/> <SecurityGroupPermission
>>> groupId="FULLADMIN" permissionId="ACCTG_PREF_CREATE"/>
>>> <SecurityGroupPermission groupId="BIZADMIN"
>>> permissionId="ACCTG_PREF_CREATE"/> +    <SecurityPermission
>>> description="Update organization accounting preferences"
>>> permissionId="ACCTG_PREF_UPDATE"/> +    <SecurityGroupPermission
>>> groupId="FULLADMIN" permissionId="ACCTG_PREF_UPDATE"/> +   
>>> <SecurityGroupPermission groupId="BIZADMIN"
>>> permissionId="ACCTG_PREF_UPDATE"/>
>>>
>>>      <SecurityPermission description="Set foreign exchange rates"
>>> permissionId="ACCTG_FX_ENTRY"/> <SecurityGroupPermission
>>> groupId="FULLADMIN" permissionId="ACCTG_FX_ENTRY"/>
>>>
>>> Modified:
>>> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/Acc
>>> tgAdminServices.xml URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/o
>>> rg/ofbiz/accounting/admin/AcctgAdminServices.xml?view=diff&rev=539814&r1=5
>>> 39813&r2=539814
>>> =========================================================================
>>> ===== ---
>>> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/Acc
>>> tgAdminServices.xml (original) +++
>>> ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/Acc
>>> tgAdminServices.xml Sat May 19 18:30:28 2007 @@ -41,6 +41,14 @@
>>>          <create-value value-name="newEntity"/>
>>>      </simple-method>
>>>
>>> +    <simple-method method-name="updatePartyAcctgPreference"
>>> +        short-description="Update the accounting preference settings for
>>> a party"> +        <!-- permission checking is done in the services
>>> definition file (services_other.xml) --> +        <entity-one
>>> entity-name="PartyAcctgPreference" value-name="newEntity"/> +       
>>> <set-nonpk-fields map-name="parameters" value-name="newEntity"/> +       
>>> <store-value value-name="newEntity"/>
>>> +    </simple-method>
>>> +
>>>      <!-- update currency conversion rates in the UomConversionDated
>>> entity --> <simple-method method-name="updateFXConversion"
>>> short-description="Update Foreign Exchange conversion rate"> <!-- set the
>>> FX rate changes as of now -->
>>>
>>> Modified:
>>> ofbiz/trunk/applications/accounting/servicedef/services_admin.xml URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/serviced
>>> ef/services_admin.xml?view=diff&rev=539814&r1=539813&r2=539814
>>> =========================================================================
>>> ===== ---
>>> ofbiz/trunk/applications/accounting/servicedef/services_admin.xml
>>> (original) +++
>>> ofbiz/trunk/applications/accounting/servicedef/services_admin.xml Sat May
>>> 19 18:30:28 2007 @@ -32,6 +32,15 @@
>>>          <auto-attributes include="pk" mode="IN" optional="false"/>
>>>          <auto-attributes include="nonpk" mode="IN" optional="true"/>
>>>      </service>
>>> +    <service name="updatePartyAcctgPreference"
>>> default-entity-name="PartyAcctgPreference" engine="simple" +       
>>> location="org/ofbiz/accounting/admin/AcctgAdminServices.xml"
>>> invoke="updatePartyAcctgPreference" auth="true"> +       
>>> <description>Update accounting preferences for a party
>>> (organization)</description> +        <required-permissions
>>> join-type="OR">
>>> +            <check-permission permission="ACCTG_PREF_UPDATE"/>
>>> +        </required-permissions>
>>> +        <auto-attributes include="pk" mode="IN" optional="false"/>
>>> +        <auto-attributes include="nonpk" mode="IN" optional="true"/>
>>> +    </service>
>>>
>>>      <service name="updateFXConversion" engine="simple"
>>>          location="org/ofbiz/accounting/admin/AcctgAdminServices.xml"
>>> invoke="updateFXConversion">
>>>
>>> Modified:
>>> ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.
>>> xml URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/a
>>> ccounting/WEB-INF/controller.xml?view=diff&rev=539814&r1=539813&r2=539814
>>> =========================================================================
>>> ===== ---
>>> ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.
>>> xml (original) +++
>>> ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.
>>> xml Sat May 19 18:30:28 2007 @@ -1075,6 +1075,13 @@
>>>          <response name="error" type="view"
>>> value="PartyAcctgPreference"/> </request-map>
>>>
>>> +    <request-map uri="updatePartyAcctgPreference">
>>> +        <security https="true" auth="true"/>
>>> +        <event type="service" invoke="updatePartyAcctgPreference"/>
>>> +        <response name="success" type="view"
>>> value="PartyAcctgPreference"/> +        <response name="error"
>>> type="view" value="PartyAcctgPreference"/> +    </request-map>
>>> +
>>>      <request-map uri="GlAccountAssignment">
>>>          <security https="true" auth="true"/>
>>>          <response name="success" type="view"
>>> value="GlAccountSalInvoice"/>
>>>
>>> Modified:
>>> ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.xm
>>> l URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/a
>>> ccounting/admin/AdminForms.xml?view=diff&rev=539814&r1=539813&r2=539814
>>> =========================================================================
>>> ===== ---
>>> ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.xm
>>> l (original) +++
>>> ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.xm
>>> l Sat May 19 18:30:28 2007 @@ -28,6 +28,7 @@
>>>      </form>
>>>
>>>      <form name="PartyAcctgPreference" type="single"
>>> target="createPartyAcctgPreference"
>>> default-service-name="createPartyAcctgPreference"
>>> default-map-name="partyAcctgPreference"> +        <alt-target
>>> use-when="partyAcctgPreference!=null"
>>> target="updatePartyAcctgPreference"/> <auto-fields-service
>>> service-name="createPartyAcctgPreference"/> <field
>>> name="organizationPartyId"><hidden
>>> value="${parameters.organizationPartyId}"/></field> <!-- the partyId is
>>> always displayed -->
>>> @@ -118,7 +119,8 @@
>>>                  </entity-options>
>>>              </drop-down>
>>>          </field>
>>> -        <field name="submitButton" title="${uiLabelMap.CommonCreate}"
>>> use-when="partyAcctgPreference==null"><submit/></field> +        <field
>>> name="createButton"
>>> use-when="partyAcctgPreference==null"><submit/></field> +        <field
>>> name="updateButton"
>>> use-when="partyAcctgPreference!=null"><submit/></field>
>>>
>>>          <!-- otherwise, we just display the fields.  there is no submit
>>> button because we shouldn't try to create it again and don't support an
>>> update option right now--> <field name="fiscalYearStartMonth"
>>> use-when="partyAcctgPreference!=null"><display/></field> @@ -147,6
>>> +149,14 @@
>>>          <!-- these 2 are ONLY displayed, never allow manual editing -->
>>>          <field name="lastInvoiceNumber"><display/></field>
>>>          <field name="lastInvoiceRestartDate"><display/></field>
>>> +
>>> +        <field name="refundPaymentMethodId">
>>> +            <drop-down>
>>> +                <entity-options entity-name="PaymentMethod"
>>> description="${description}" key-field-name="paymentMethodId"> +         
>>>           <entity-constraint name="partyId" operator="equals"
>>> env-name="organizationPartyId"/> +                </entity-options>
>>> +            </drop-down>
>>> +        </field>
>>>      </form>
>>>
>>>      <form name="ListUnpostedAcctgTrans" type="list" title="Unposted
>>> Accounting Transactions" list-name="transactions">

Re: svn commit: r539814 - in /ofbiz/trunk/applications/accounting: data/ script/org/ofbiz/accounting/admin/ servicedef/ webapp/accounting/WEB-INF/ webapp/accounting/admin/

Posted by Hans Bakker <ma...@antwebsystems.com>.
Hi David,

your suggestions implemented.

Hans

On Sunday 20 May 2007 10:17, David E Jones wrote:
> Hans,
>
> Please reverse this commit, or adjust according to comments ASAP.
>
> We should probably have a comment about it, but we intentionally do NOT
> have a service to update these preferences. Doing so can have an impact on
> quite a few things and break a lot of stuff so a simple update service that
> doesn't go through and adjust other things for the changes can cause big
> problems.
>
> The other option would be to limit which fields can be updated, which is
> easily done by using explicit attribute definitions in the service def for
> the update rather than doing a general auto-attributes element.
>
> -David
>
> hansbak@apache.org wrote:
> > Author: hansbak
> > Date: Sat May 19 18:30:28 2007
> > New Revision: 539814
> >
> > URL: http://svn.apache.org/viewvc?view=rev&rev=539814
> > Log:
> > added a very limited acctPreference update possibility inclusive separate
> > security
> >
> > Modified:
> >     ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml
> >    
> > ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/Acc
> >tgAdminServices.xml
> > ofbiz/trunk/applications/accounting/servicedef/services_admin.xml
> > ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.
> >xml
> > ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.xm
> >l
> >
> > Modified:
> > ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml URL:
> > http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/Acc
> >ountingSecurityData.xml?view=diff&rev=539814&r1=539813&r2=539814
> > =========================================================================
> >===== ---
> > ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml
> > (original) +++
> > ofbiz/trunk/applications/accounting/data/AccountingSecurityData.xml Sat
> > May 19 18:30:28 2007 @@ -80,6 +80,9 @@
> >      <SecurityPermission description="Set organization accounting
> > preferences" permissionId="ACCTG_PREF_CREATE"/> <SecurityGroupPermission
> > groupId="FULLADMIN" permissionId="ACCTG_PREF_CREATE"/>
> > <SecurityGroupPermission groupId="BIZADMIN"
> > permissionId="ACCTG_PREF_CREATE"/> +    <SecurityPermission
> > description="Update organization accounting preferences"
> > permissionId="ACCTG_PREF_UPDATE"/> +    <SecurityGroupPermission
> > groupId="FULLADMIN" permissionId="ACCTG_PREF_UPDATE"/> +   
> > <SecurityGroupPermission groupId="BIZADMIN"
> > permissionId="ACCTG_PREF_UPDATE"/>
> >
> >      <SecurityPermission description="Set foreign exchange rates"
> > permissionId="ACCTG_FX_ENTRY"/> <SecurityGroupPermission
> > groupId="FULLADMIN" permissionId="ACCTG_FX_ENTRY"/>
> >
> > Modified:
> > ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/Acc
> >tgAdminServices.xml URL:
> > http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/o
> >rg/ofbiz/accounting/admin/AcctgAdminServices.xml?view=diff&rev=539814&r1=5
> >39813&r2=539814
> > =========================================================================
> >===== ---
> > ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/Acc
> >tgAdminServices.xml (original) +++
> > ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/admin/Acc
> >tgAdminServices.xml Sat May 19 18:30:28 2007 @@ -41,6 +41,14 @@
> >          <create-value value-name="newEntity"/>
> >      </simple-method>
> >
> > +    <simple-method method-name="updatePartyAcctgPreference"
> > +        short-description="Update the accounting preference settings for
> > a party"> +        <!-- permission checking is done in the services
> > definition file (services_other.xml) --> +        <entity-one
> > entity-name="PartyAcctgPreference" value-name="newEntity"/> +       
> > <set-nonpk-fields map-name="parameters" value-name="newEntity"/> +       
> > <store-value value-name="newEntity"/>
> > +    </simple-method>
> > +
> >      <!-- update currency conversion rates in the UomConversionDated
> > entity --> <simple-method method-name="updateFXConversion"
> > short-description="Update Foreign Exchange conversion rate"> <!-- set the
> > FX rate changes as of now -->
> >
> > Modified:
> > ofbiz/trunk/applications/accounting/servicedef/services_admin.xml URL:
> > http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/serviced
> >ef/services_admin.xml?view=diff&rev=539814&r1=539813&r2=539814
> > =========================================================================
> >===== ---
> > ofbiz/trunk/applications/accounting/servicedef/services_admin.xml
> > (original) +++
> > ofbiz/trunk/applications/accounting/servicedef/services_admin.xml Sat May
> > 19 18:30:28 2007 @@ -32,6 +32,15 @@
> >          <auto-attributes include="pk" mode="IN" optional="false"/>
> >          <auto-attributes include="nonpk" mode="IN" optional="true"/>
> >      </service>
> > +    <service name="updatePartyAcctgPreference"
> > default-entity-name="PartyAcctgPreference" engine="simple" +       
> > location="org/ofbiz/accounting/admin/AcctgAdminServices.xml"
> > invoke="updatePartyAcctgPreference" auth="true"> +       
> > <description>Update accounting preferences for a party
> > (organization)</description> +        <required-permissions
> > join-type="OR">
> > +            <check-permission permission="ACCTG_PREF_UPDATE"/>
> > +        </required-permissions>
> > +        <auto-attributes include="pk" mode="IN" optional="false"/>
> > +        <auto-attributes include="nonpk" mode="IN" optional="true"/>
> > +    </service>
> >
> >      <service name="updateFXConversion" engine="simple"
> >          location="org/ofbiz/accounting/admin/AcctgAdminServices.xml"
> > invoke="updateFXConversion">
> >
> > Modified:
> > ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.
> >xml URL:
> > http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/a
> >ccounting/WEB-INF/controller.xml?view=diff&rev=539814&r1=539813&r2=539814
> > =========================================================================
> >===== ---
> > ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.
> >xml (original) +++
> > ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.
> >xml Sat May 19 18:30:28 2007 @@ -1075,6 +1075,13 @@
> >          <response name="error" type="view"
> > value="PartyAcctgPreference"/> </request-map>
> >
> > +    <request-map uri="updatePartyAcctgPreference">
> > +        <security https="true" auth="true"/>
> > +        <event type="service" invoke="updatePartyAcctgPreference"/>
> > +        <response name="success" type="view"
> > value="PartyAcctgPreference"/> +        <response name="error"
> > type="view" value="PartyAcctgPreference"/> +    </request-map>
> > +
> >      <request-map uri="GlAccountAssignment">
> >          <security https="true" auth="true"/>
> >          <response name="success" type="view"
> > value="GlAccountSalInvoice"/>
> >
> > Modified:
> > ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.xm
> >l URL:
> > http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/a
> >ccounting/admin/AdminForms.xml?view=diff&rev=539814&r1=539813&r2=539814
> > =========================================================================
> >===== ---
> > ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.xm
> >l (original) +++
> > ofbiz/trunk/applications/accounting/webapp/accounting/admin/AdminForms.xm
> >l Sat May 19 18:30:28 2007 @@ -28,6 +28,7 @@
> >      </form>
> >
> >      <form name="PartyAcctgPreference" type="single"
> > target="createPartyAcctgPreference"
> > default-service-name="createPartyAcctgPreference"
> > default-map-name="partyAcctgPreference"> +        <alt-target
> > use-when="partyAcctgPreference!=null"
> > target="updatePartyAcctgPreference"/> <auto-fields-service
> > service-name="createPartyAcctgPreference"/> <field
> > name="organizationPartyId"><hidden
> > value="${parameters.organizationPartyId}"/></field> <!-- the partyId is
> > always displayed -->
> > @@ -118,7 +119,8 @@
> >                  </entity-options>
> >              </drop-down>
> >          </field>
> > -        <field name="submitButton" title="${uiLabelMap.CommonCreate}"
> > use-when="partyAcctgPreference==null"><submit/></field> +        <field
> > name="createButton"
> > use-when="partyAcctgPreference==null"><submit/></field> +        <field
> > name="updateButton"
> > use-when="partyAcctgPreference!=null"><submit/></field>
> >
> >          <!-- otherwise, we just display the fields.  there is no submit
> > button because we shouldn't try to create it again and don't support an
> > update option right now--> <field name="fiscalYearStartMonth"
> > use-when="partyAcctgPreference!=null"><display/></field> @@ -147,6
> > +149,14 @@
> >          <!-- these 2 are ONLY displayed, never allow manual editing -->
> >          <field name="lastInvoiceNumber"><display/></field>
> >          <field name="lastInvoiceRestartDate"><display/></field>
> > +
> > +        <field name="refundPaymentMethodId">
> > +            <drop-down>
> > +                <entity-options entity-name="PaymentMethod"
> > description="${description}" key-field-name="paymentMethodId"> +         
> >           <entity-constraint name="partyId" operator="equals"
> > env-name="organizationPartyId"/> +                </entity-options>
> > +            </drop-down>
> > +        </field>
> >      </form>
> >
> >      <form name="ListUnpostedAcctgTrans" type="list" title="Unposted
> > Accounting Transactions" list-name="transactions">
-- 

http://Antwebsystems.com: Quality OFBiz support with competitive rates.