Author: ashish Date: Sun Jul 3 05:16:56 2016 New Revision: 1751109 URL: http://svn.apache.org/viewvc?rev=1751109&view=rev Log: Applied patch from jira issue - OFBIZ-7143 - Error on cancelling agreement. Thanks Ravi for the contribution. Thanks Montalbano for the discussion.
Added: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/agreement/ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/agreement/GetPartyNameForDate.groovy Modified: ofbiz/trunk/applications/accounting/widget/AgreementForms.xml Added: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/agreement/GetPartyNameForDate.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/agreement/GetPartyNameForDate.groovy?rev=1751109&view=auto ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/agreement/GetPartyNameForDate.groovy (added) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/agreement/GetPartyNameForDate.groovy Sun Jul 3 05:16:56 2016 @@ -0,0 +1,8 @@ +partyIdFrom = parameters.partyIdFrom; +partyIdTo = parameters.partyIdTo; +if (partyIdFrom) { + context.partyNameResultFrom = runService("getPartyNameForDate", [partyId: partyIdFrom, compareDate: agreementDate, lastNameFirst: "Y"]) +} +if (partyIdTo) { + context.partyNameResultTo = runService("getPartyNameForDate", [partyId: partyIdTo, compareDate: agreementDate, lastNameFirst: "Y"]) +} \ No newline at end of file Modified: ofbiz/trunk/applications/accounting/widget/AgreementForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/AgreementForms.xml?rev=1751109&r1=1751108&r2=1751109&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/AgreementForms.xml (original) +++ ofbiz/trunk/applications/accounting/widget/AgreementForms.xml Sun Jul 3 05:16:56 2016 @@ -60,23 +60,9 @@ under the License. <field-map field-name="viewIndex" from-field="viewIndex"/> <field-map field-name="viewSize" from-field="viewSize"/> </service> - - <!--Fallback if partyIdFrom or partyIdTo is empty, at this time it is not possible to add is-empty condition in widgets (in this case to prevent service call)--> - <set field="partyIdFromTmp" from-field="parameters.partyIdFrom" default-value=""/> - <set field="partyIdToTmp" from-field="parameters.partyIdTo" default-value=""/> - </actions> <row-actions> - <service service-name="getPartyNameForDate" result-map="partyNameResultFrom"> - <field-map field-name="partyId" from-field="partyIdFromTmp"/> - <field-map field-name="compareDate" from-field="agreementDate"/> - <field-map field-name="lastNameFirst" value="Y"/> - </service> - <service service-name="getPartyNameForDate" result-map="partyNameResultTo"> - <field-map field-name="partyId" from-field="partyIdToTmp"/> - <field-map field-name="compareDate" from-field="agreementDate"/> - <field-map field-name="lastNameFirst" value="Y"/> - </service> + <script location="component://accounting/webapp/accounting/WEB-INF/actions/agreement/GetPartyNameForDate.groovy"/> </row-actions> <auto-fields-entity entity-name="Agreement" default-field-type="display"/> <field name="agreementId" title="${uiLabelMap.CommonEdit}" widget-style="buttontext" sort-field="true">