Re: svn commit: r791389 - in /ofbiz/trunk/specialpurpose/projectmgr: webapp/projectmgr/WEB-INF/actions/ProjectIsBillable.groovy widget/forms/ProjectForms.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r791389 - in /ofbiz/trunk/specialpurpose/projectmgr: webapp/projectmgr/WEB-INF/actions/ProjectIsBillable.groovy widget/forms/ProjectForms.xml

Ashish Vijaywargiya
Hello Hans,

Isn't it good to use some verbose name for variables?

For ex: The following statement:
+ <entity-and entity-name="WorkEffortPartyAssignment" list="assigns"
filter-by-date="true">

can be changed to

 + <entity-and entity-name="WorkEffortPartyAssignment"
list="workEffortPartyAssignments" filter-by-date="true">

or

 + <entity-and entity-name="WorkEffortPartyAssignment"
list="workEffortPartyAssignmentList" filter-by-date="true">

or if you want to keep your list name client specific then you can use:

 + <entity-and entity-name="WorkEffortPartyAssignment"
list="workEffortPartyAssignmentClients" filter-by-date="true">


Another issue is with your another condition:
+            <entity-and entity-name="WorkEffortPartyAssignment"
list="assignsOrg" filter-by-date="true">

Is "assignsOrg" good name for a list?
Please refer above options for its name.

Please try to use more verbose variable name as this will help to see
consistent and good quality code from the community member if someone is
adding new feature around your work. And if they do copy paste then we will
be fine if consistent and good quality code is available in advance for
them.

--
Ashish


On Mon, Jul 6, 2009 at 11:30 AM, <[hidden email]> wrote:

> Author: hansbak
> Date: Mon Jul  6 06:00:54 2009
> New Revision: 791389
>
> URL: http://svn.apache.org/viewvc?rev=791389&view=rev
> Log:
> edit project did not show the client billing partyId, also do not show
> nonbilled hours when either billing partyId or organization party is missing
>
> Modified:
>
>  ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ProjectIsBillable.groovy
>    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml
>
> Modified:
> ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ProjectIsBillable.groovy
> URL:
> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ProjectIsBillable.groovy?rev=791389&r1=791388&r2=791389&view=diff
>
> ==============================================================================
> ---
> ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ProjectIsBillable.groovy
> (original)
> +++
> ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ProjectIsBillable.groovy
> Mon Jul  6 06:00:54 2009
> @@ -33,7 +33,9 @@
>        }
>        if (fromPartyId && toPartyId && fromPartyId.equals(toPartyId)) {
>                context.isBillable = false;
> -       } else {
> +       } else if (!toPartyId || !fromPartyId){
> +        context.isBillable = false;
> +       } else {
>                context.isBillable = true;
>        }
>  }
>
> Modified:
> ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml
> URL:
> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml?rev=791389&r1=791388&r2=791389&view=diff
>
> ==============================================================================
> --- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml
> (original)
> +++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml Mon
> Jul  6 06:00:54 2009
> @@ -25,6 +25,16 @@
>             <entity-one entity-name="PartyGroup" value-field="partyGroup">
>                 <field-map field-name="partyId" from-field="partyId"/>
>             </entity-one>
> +            <entity-and entity-name="WorkEffortPartyAssignment"
> list="assigns" filter-by-date="true">
> +                <field-map field-name="workEffortId"
> from-field="parameters.projectId"/>
> +                <field-map field-name="roleTypeId"
> value="CLIENT_BILLING"/>
> +            </entity-and>
> +            <set field="project.clientBillingPartyId"
> from-field="assigns[0].partyId"/>
> +            <entity-and entity-name="WorkEffortPartyAssignment"
> list="assignsOrg" filter-by-date="true">
> +                <field-map field-name="workEffortId"
> from-field="parameters.projectId"/>
> +                <field-map field-name="roleTypeId"
> value="INTERNAL_ORGANIZATIO"/>
> +            </entity-and>
> +            <set field="project.organizationPartyId"
> from-field="assignsOrg[0].partyId"/>
>         </actions>
>         <alt-target use-when="project==null" target="createProject"/>
>         <field use-when="project==null" name="templateId">
>
>
>