Author: hansbak
Date: Fri Dec 26 20:20:08 2008 New Revision: 729591 URL: http://svn.apache.org/viewvc?rev=729591&view=rev Log: can now specify billfrom(organizationParty) and billTo(clientBilling) on the project and use for invoice generation and show separated in the project resource list Modified: ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml Modified: ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml?rev=729591&r1=729590&r2=729591&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml Fri Dec 26 20:20:08 2008 @@ -30,6 +30,69 @@ <call-simple-method method-name="createWorkEffort" xml-resource="component://workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml"/> </else> </if-not-empty> + <set field="parameters.workEffortId" from-field="newEntity.workEffortId"/> + <if-not-empty field="parameters.organizationPartyId"> + <set field="updProjectRole.newPartyId" from-field="parameters.organizationPartyId"/> + <set field="updProjectRole.roleTypeId" value="INTERNAL_ORGANIZATIO"/> + <call-simple-method method-name="updProjectRole"/> + </if-not-empty> + <if-not-empty field="parameters.clientBillingPartyId"> + <set field="updProjectRole.newPartyId" from-field="parameters.clientBillingPartyId"/> + <set field="updProjectRole.roleTypeId" value="CLIENT_BILLING"/> + <call-simple-method method-name="updProjectRole"/> + </if-not-empty> + </simple-method> + + <simple-method method-name="updateProject" short-description="Update a project"> + <set-service-fields service-name="updateWorkEffort" map-name="parameters" to-map-name="updWorkEffort"/> + <call-service service-name="updateWorkEffort" in-map-name="updWorkEffort"/> + <if-not-empty field="parameters.organizationPartyId"> + <set field="updProjectRole.newPartyId" from-field="parameters.organizationPartyId"/> + <set field="updProjectRole.roleTypeId" value="INTERNAL_ORGANIZATIO"/> + <call-simple-method method-name="updProjectRole"/> + </if-not-empty> + <if-not-empty field="parameters.clientBillingPartyId"> + <set field="updProjectRole.newPartyId" from-field="parameters.clientBillingPartyId"/> + <set field="updProjectRole.roleTypeId" value="CLIENT_BILLING"/> + <call-simple-method method-name="updProjectRole"/> + </if-not-empty> + </simple-method> + + <simple-method method-name="updProjectRole" + short-description="update/create a specif role and type for a project + input map: updProjectRole.newPartyId, updProjectRole.roleTypeId"> + <entity-and entity-name="WorkEffortPartyAssignment" list-name="workEffortPartyAssignments" filter-by-date="true"> + <field-map field-name="workEffortId" env-name="parameters.workEffortId"/> + <field-map field-name="roleTypeId" value="updProjectRole.roleTypeId"/> + </entity-and> + <!-- end current record if required --> + <if-not-empty field="workEffortPartyAssignments"> + <first-from-list entry-name="workEffortPartyAssignment" list-name="workEffortPartyAssignments"/> + <if-compare-field field="updProjectRole.newPartyId" operator="not-equals" to-field="workEffortPartyAssignment.partyId"> + <now-timestamp-to-env env-name="workEffortPartyAssignment.thruDate"/> + <store-value value-name="workEffortPartyAssignment"/> + </if-compare-field> + </if-not-empty> + <!-- create new record if required --> + <if> + <condition> + <or> + <if-empty field="workEffortPartyAssignments"/> + <and> + <not><if-empty field="workEffortPartyAssignments"/></not> + <if-compare-field field="updProjectRole.newPartyId" operator="not-equals" to-field="workEffortPartyAssignment.partyId"/> + </and> + </or> + </condition> + <then> + <make-value value-name="workEffortPartyAssignment" entity-name="WorkEffortPartyAssignment"/> + <set field="workEffortPartyAssignment.workEffortId" from-field="parameters.workEffortId"/> + <set field="workEffortPartyAssignment.partyId" from-field="updProjectRole.newPartyId"/> + <set field="workEffortPartyAssignment.roleTypeId" from-field="updProjectRole.roleTypeId"/> + <now-timestamp-to-env env-name="workEffortPartyAssignment.fromDate"/> + <create-value value-name="workEffortPartyAssignment"/> + </then> + </if> </simple-method> <simple-method method-name="createProjectTask" short-description="Create a project task and optionally assign"> Modified: ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml?rev=729591&r1=729590&r2=729591&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml Fri Dec 26 20:20:08 2008 @@ -57,15 +57,6 @@ <attribute name="timeEntryId" type="String" mode="IN" optional="true"/> </service> - <!-- TO BE REMOVED - <service name="updateTaskStatus" engine="simple" - location="org/ofbiz/project/ProjectServices.xml" invoke="updateTaskStatus"> - <description>Update task status if required</description> - <permission-service service-name="projectMgrPermission" main-action="UPDATE"/> - <attribute name="workEffortId" type="String" mode="IN"/> - </service> - --> - <service name="updateTimeEntryByWorkeffort" engine="simple" location="org/ofbiz/project/ProjectServices.xml" invoke="updateTimeEntryByWorkeffort"> <description>Update workeffort by workeffortId and timesheetId </description> @@ -106,11 +97,23 @@ <attribute name="quickAssignPartyId" type="String" mode="IN" optional="true"/> <attribute name="requirementId" type="String" mode="IN" optional="true"/> <attribute name="communicationEventId" type="String" mode="IN" optional="true"/> + <attribute name="organizationPartyId" type="String" mode="IN" optional="true"/> + <attribute name="clientBillingPartyId" type="String" mode="IN" optional="true"/> <override name="workEffortTypeId" optional="false"/> <override name="workEffortName" optional="false"/> <override name="currentStatusId" optional="false"/> </service> + <service name="updateProject" default-entity-name="WorkEffort" engine="simple" + location="org/ofbiz/project/ProjectServices.xml" invoke="updateProject"> + <description>Update a Project</description> + <permission-service service-name="projectMgrPermission" main-action="UPDATE"/> + <implements service="interfaceWorkEffort"/> + <auto-attributes mode="IN" include="pk" optional="false"/> + <attribute name="organizationPartyId" type="String" mode="IN" optional="true"/> + <attribute name="clientBillingPartyId" type="String" mode="IN" optional="true"/> + </service> + <service name="createProjectTask" engine="simple" default-entity-name="WorkEffort" location="org/ofbiz/project/ProjectServices.xml" invoke="createProjectTask"> <description>Create a new task and optionally assign to a resource.</description> Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml?rev=729591&r1=729590&r2=729591&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml Fri Dec 26 20:20:08 2008 @@ -79,7 +79,7 @@ </request-map> <request-map uri="updateProject"> <security https="true" auth="true"/> - <event type="service" invoke="updateWorkEffort"/> + <event type="service" invoke="updateProject"/> <response name="success" type="view" value="projectView"/> <response name="error" type="view" value="EditProject"/> </request-map> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml?rev=729591&r1=729590&r2=729591&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml Fri Dec 26 20:20:08 2008 @@ -578,9 +578,64 @@ </screen> <screen name="PartiesInfo"> <section> + <actions> + <entity-condition entity-name="WorkEffortPartyAssignView" list-name="clientAssigns" distinct="true"> + <condition-list combine="and"> + <condition-expr field-name="workEffortId" env-name="parameters.projectId" operator="equals"/> + <condition-expr field-name="roleTypeId" value="CLIENT%" operator="like"/> + <condition-expr field-name="roleTypeId" value="CLIENT_BILLING" operator="not-equals"/> + </condition-list> + <select-field field-name="partyId"/> + <select-field field-name="firstName"/> + <select-field field-name="lastName"/> + <select-field field-name="middleName"/> + <select-field field-name="groupName"/> + <select-field field-name="roleTypeId"/> + <order-by field-name="lastName"/> + <order-by field-name="firstName"/> + <order-by field-name="groupName"/> + </entity-condition> + <entity-condition entity-name="WorkEffortPartyAssignView" list-name="companyAssigns" distinct="true"> + <condition-list combine="and"> + <condition-expr field-name="workEffortId" env-name="parameters.projectId" operator="equals"/> + <condition-list combine="or"> + <condition-expr field-name="roleTypeId" value="INTERNAL_ORGANIZATIO" operator="equals"/> + <condition-expr field-name="roleTypeId" value="CLIENT_BILLING" operator="equals"/> + </condition-list> + </condition-list> + <select-field field-name="partyId"/> + <select-field field-name="firstName"/> + <select-field field-name="lastName"/> + <select-field field-name="middleName"/> + <select-field field-name="groupName"/> + <select-field field-name="roleTypeId"/> + <order-by field-name="lastName"/> + <order-by field-name="firstName"/> + <order-by field-name="groupName"/> + </entity-condition> + </actions> <widgets> <screenlet title="${uiLabelMap.ProjectMgrResources}"> - <include-form name="ListProjectParties" location="component://projectmgr/widget/forms/ProjectForms.xml"/> + <label style="h3" text="Providers"></label> + <include-form name="ListProjectProviderParties" location="component://projectmgr/widget/forms/ProjectForms.xml"/> + <section> + <condition> + <not><if-empty field-name="clientAssigns"/></not> + </condition> + <widgets> + <label style="h3" text="ClientContacts"></label> + <include-form name="ListProjectClientParties" location="component://projectmgr/widget/forms/ProjectForms.xml"/> + </widgets> + </section> + <section> + <condition> + <not><if-empty field-name="companyAssigns"/></not> + </condition> + <widgets> + <label style="h3" text="Companies"></label> + <include-form name="ListProjectCompanyParties" location="component://projectmgr/widget/forms/ProjectForms.xml"/> + </widgets> + </section> </screenlet> </widgets> </section> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml?rev=729591&r1=729590&r2=729591&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml (original) +++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml Fri Dec 26 20:20:08 2008 @@ -21,6 +21,11 @@ xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd"> <form name="EditProject" type="single" target="updateProject" default-map-name="project" header-row-style="header-row" default-table-style="basic-table"> + <actions> + <entity-one entity-name="PartyGroup" value-name="partyGroup"> + <field-map field-name="partyId" env-name="partyId"/> + </entity-one> + </actions> <alt-target use-when="project==null" target="createProject"/> <field use-when="project==null" name="templateId"> <drop-down allow-empty="true"> @@ -36,6 +41,12 @@ <field name="projectDescription" parameter-name="description" title="${uiLabelMap.CommonDescription}"><text/></field> <field use-when="project!=null" name="currentStatusId" title="${uiLabelMap.CommonStatus}" parameter-name="dummy"><display-entity entity-name="StatusItem" key-field-name="statusId"/></field> <field use-when="project==null" name="currentStatusId"><hidden value="_NA_"/></field> + <field name="clientBillingPartyId"><lookup target-form-name="LookupPartyGroup"><sub-hyperlink target="viewprofile?partyId=${partyId}" description="${partyGroup.groupName}"/></lookup></field> + <field name="organizationPartyId"> + <drop-down no-current-selected-key="defaultOrganizationPartyId"> + <entity-options entity-name="PartyAcctgPrefAndGroup" description="${groupName}" key-field-name="partyId"/> + </drop-down> + </field> <field name="priority" title="${uiLabelMap.CommonPriority}"><display/></field> <field name="scopeEnumId" title="${uiLabelMap.ProjectMgrWorkEffortScopeEnumId}"> <drop-down allow-empty="false"> @@ -329,16 +340,20 @@ <field name="plannedHours"><display/></field> <field name="actualHours"><display/></field> </form> - <form name="ListProjectParties" type="list" list-name="assigns" + <form name="ListProjectProviderParties" type="list" list-name="assigns" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <actions> <entity-condition entity-name="WorkEffortPartyAssignView" list-name="assigns" distinct="true"> - <condition-expr field-name="workEffortId" env-name="parameters.projectId"/> + <condition-list combine="and"> + <condition-expr field-name="workEffortId" env-name="parameters.projectId" operator="equals"/> + <condition-expr field-name="roleTypeId" value="PROVIDER%" operator="like"/> + </condition-list> <select-field field-name="partyId"/> <select-field field-name="firstName"/> <select-field field-name="lastName"/> <select-field field-name="middleName"/> <select-field field-name="groupName"/> + <select-field field-name="roleTypeId"/> <order-by field-name="lastName"/> <order-by field-name="firstName"/> <order-by field-name="groupName"/> @@ -354,9 +369,26 @@ <field name="partyName" title="${uiLabelMap.CommonName}"> <hyperlink target="viewprofile?partyId=${partyId}" description="${lastName}, ${firstName} ${middleName} ${groupName} [${partyId}]"/> </field> + <field name="roleTypeId"><display-entity entity-name="RoleType" description="${description}"/></field> <field name="actualHours" entry-name="actualHours" map-name="result.projectInfo"><display/></field> <field name="nonBilledHours" entry-name="actualNonBilledHours" map-name="result.projectInfo"><display/></field> </form> + <form name="ListProjectClientParties" type="list" list-name="clientAssigns" + odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> + <field name="projectId"><hidden/></field> + <field name="partyName" title="${uiLabelMap.CommonName}"> + <hyperlink target="viewprofile?partyId=${partyId}" description="${lastName}, ${firstName} ${middleName} ${groupName} [${partyId}]"/> + </field> + <field name="roleTypeId"><display-entity entity-name="RoleType" description="${description}"/></field> + </form> + <form name="ListProjectCompanyParties" type="list" list-name="companyAssigns" + odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> + <field name="projectId"><hidden/></field> + <field name="partyName" title="${uiLabelMap.CommonName}"> + <hyperlink target="viewprofile?partyId=${partyId}" description="${groupName} [${partyId}]"/> + </field> + <field name="roleTypeId"><display-entity entity-name="RoleType" description="${description}"/></field> + </form> <form name="EditProjectSkills" type="list" target="updateProjectSkillStandard" list-name="workEffortSkillStandardList" paginate-target="EditProjectSkills" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <field name="workEffortId" title="${uiLabelMap.ProjectMgrWorkEffortId}"> @@ -574,9 +606,21 @@ <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field> </form> <form name="AddProjectTimeToNewInvoice" target="addProjectTimeToNewInvoice" title="" type="single"> + <actions> + <entity-and entity-name="WorkEffortPartyAssignment" list-name="assignOrg" filter-by-date="true"> + <field-map field-name="workEffortId" env-name="parameters.projectId"/> + <field-map field-name="roleTypeId" value="INTERNAL_ORGANIZATIO"/> + </entity-and> + <set field="partyIdFrom" value="${assignOrg[0].partyId}"/> + <entity-and entity-name="WorkEffortPartyAssignment" list-name="assignBilling" filter-by-date="true"> + <field-map field-name="workEffortId" env-name="parameters.projectId"/> + <field-map field-name="roleTypeId" value="CLIENT_BILLING"/> + </entity-and> + <set field="partyId" value="${assignBilling[0].partyId}"/> + </actions> <field name="projectId"><hidden value="${parameters.projectId}"/></field> - <field name="partyIdFrom" title="${uiLabelMap.WorkEffortTimeBillFromParty}"><lookup target-form-name="LookupPartyName"/></field> - <field name="partyId" title="${uiLabelMap.WorkEffortTimeBillToParty}"><lookup target-form-name="LookupPartyName" default-value="${timesheet.clientPartyId}"/></field> + <field name="partyIdFrom" title="${uiLabelMap.WorkEffortTimeBillFromParty}"><display-entity entity-name="PartyNameView" key-field-name="partyId" description="${groupName}"/></field> + <field name="partyId" title="${uiLabelMap.WorkEffortTimeBillToParty}"><display-entity entity-name="PartyNameView" key-field-name="partyId" description="${groupName}"/></field> <field name="thruDate" title="${uiLabelMap.CommonThruDate}"><date-time type="timestamp"/></field> <field name="invoiceId"><hidden/></field> <field name="reCreate" position="1" title="re-create Invoice: ${invoiceId}" use-when="context.get("invoiceId")!=null"> |
Free forum by Nabble | Edit this page |