Author: jacopoc
Date: Tue Jun 16 14:54:11 2009 New Revision: 785241 URL: http://svn.apache.org/viewvc?rev=785241&view=rev Log: Misc fixes for commission creation for sales reps: small improvements to the ui of the agreement screens, small fixes for the 'set party role' checkout screen but most of all now commissions are created only for the sales reps associated to the order/invoice. Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementForms.xml ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java ofbiz/trunk/applications/order/webapp/ordermgr/entry/additionalPartyListing.ftl Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=785241&r1=785240&r2=785241&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original) +++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Tue Jun 16 14:54:11 2009 @@ -5388,6 +5388,14 @@ <value xml:lang="th">ยà¸à¹à¸¥à¸´à¸à¸£à¸²à¸¢à¹à¸à¹à¸à¸±à¸à¸à¸µà¹à¸¢à¸à¸à¸£à¸°à¹à¸ à¸à¸à¸±à¹à¸§à¹à¸</value> <value xml:lang="zh">è¦çæ¶å ¥æ»è´¦è´¦æ·æ è¯</value> </property> + <property key="AccountingPostedTransactionTotals"> + <value xml:lang="en">Posted Totals</value> + <value xml:lang="it">Totali Contabilizzati</value> + </property> + <property key="AccountingPostedAndUnpostedTransactionTotals"> + <value xml:lang="en">Posted And Unposted Totals</value> + <value xml:lang="it">Totali contabilizzati e non</value> + </property> <property key="AccountingPIN"> <value xml:lang="cs">PIN</value> <value xml:lang="de">PIN</value> Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java?rev=785241&r1=785240&r2=785241&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java Tue Jun 16 14:54:11 2009 @@ -853,6 +853,11 @@ } try { + List billFromVendorInvoiceRoles = EntityUtil.getFieldListFromEntityList(delegator.findByAnd("InvoiceRole", UtilMisc.<String, Object>toMap("invoiceId", invoiceIdIn, "roleTypeId", "BILL_FROM_VENDOR")), "partyId", true); + List salesRepInvoiceRoles = EntityUtil.getFieldListFromEntityList(delegator.findByAnd("InvoiceRole", UtilMisc.<String, Object>toMap("invoiceId", invoiceIdIn, "roleTypeId", "SALES_REP")), "partyId", true); + if (UtilValidate.isEmpty(billFromVendorInvoiceRoles) || UtilValidate.isEmpty(salesRepInvoiceRoles)) { + return ServiceUtil.returnSuccess(); + } // Change this when amountApplied is BigDecimal, 18 digit scale to keep all the precision BigDecimal appliedFraction = ((BigDecimal)context.get("amountApplied")).divide(amountTotal, 12, rounding); Map inMap = UtilMisc.toMap("invoiceId", invoiceIdIn); @@ -907,6 +912,9 @@ Iterator it = itemComms.iterator(); while (it.hasNext()) { Map commMap = (Map)it.next(); + if (!billFromVendorInvoiceRoles.contains(commMap.get("partyIdFrom")) || !salesRepInvoiceRoles.contains(commMap.get("partyIdTo"))) { + continue; + } String partyIdFromTo = (String) commMap.get("partyIdFrom") + (String) commMap.get("partyIdTo"); if (!commissionParties.containsKey(partyIdFromTo)) { commissionParties.put(partyIdFromTo, UtilMisc.toList(commMap)); Modified: ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementForms.xml?rev=785241&r1=785240&r2=785241&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementForms.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementForms.xml Tue Jun 16 14:54:11 2009 @@ -206,7 +206,7 @@ <auto-fields-service service-name="updateAgreementTerm"/> <field name="agreementId" title="${uiLabelMap.AccountingAgreementId}"><hidden/></field> <field name="agreementTermId" ><hidden/></field> - <field name="agreementItemSeqId" title="${uiLabelMap.AccountingAgreementItemSeqId}"><hidden/></field> + <field name="agreementItemSeqId" title="${uiLabelMap.AccountingAgreementItemSeqId}"><display/></field> <field name="termTypeId" title="${uiLabelMap.AccountingTermTypeId}"> <display-entity entity-name="TermType"/> </field> Modified: ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml?rev=785241&r1=785240&r2=785241&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml Tue Jun 16 14:54:11 2009 @@ -152,7 +152,7 @@ <section> <actions> <set field="titleProperty" value="PageTitleListAgreementItems"/> - <set field="headerItem" value="agreement"/> + <set field="headerItem" value="agreements"/> <set field="tabButtonItem" value="AgreementItems"/> <entity-one entity-name="Agreement" value-field="agreement" auto-field-map="true"/> <entity-and entity-name="AgreementItem" list="agreementItems"> @@ -191,7 +191,7 @@ <section> <actions> <set field="titleProperty" value="PageTitleEditAgreementItem"/> - <set field="headerItem" value="agreement"/> + <set field="headerItem" value="agreements"/> <set field="tabButtonItem" value="AgreementItems"/> <set field="buttonBarItem" value="EditAgreementItem"/> <property-to-field field="defaultCurrencyUomId" resource="general" property="currency.uom.id.default" default="USD"/> @@ -232,7 +232,7 @@ <section> <actions> <set field="titleProperty" value="PageTitleEditAgreementTerm"/> - <set field="headerItem" value="agreement"/> + <set field="headerItem" value="agreements"/> <set field="tabButtonItem" value="AgreementTerms"/> <set field="buttonBarItem" value="EditAgreementTerms"/> <set field="agreementId" from-field="parameters.agreementId"/> @@ -255,7 +255,7 @@ <section> <actions> <set field="titleProperty" value="PageTitleListAgreementPromoAppls"/> - <set field="headerItem" value="agreement"/> + <set field="headerItem" value="agreements"/> <set field="tabButtonItem" value="AgreementItems"/> <set field="buttonBarItem" value="ListAgreementPromoAppls"/> <entity-one entity-name="Agreement" value-field="agreement" auto-field-map="true"/> @@ -299,7 +299,7 @@ <section> <actions> <set field="titleProperty" value="PageTitleEditAgreementPromoAppl"/> - <set field="headerItem" value="agreement"/> + <set field="headerItem" value="agreements"/> <set field="tabButtonItem" value="AgreementItems"/> <set field="buttonBarItem" value="ListAgreementPromoAppls"/> <set field="agreementId" from-field="parameters.agreementId"/> @@ -341,7 +341,7 @@ <section> <actions> <set field="titleProperty" value="PageTitleListAgreementItemTerms"/> - <set field="headerItem" value="agreement"/> + <set field="headerItem" value="agreements"/> <set field="tabButtonItem" value="AgreementItems"/> <set field="buttonBarItem" value="ListAgreementItemTerms"/> <entity-one entity-name="Agreement" value-field="agreement" auto-field-map="true"/> @@ -384,7 +384,7 @@ <section> <actions> <set field="titleProperty" value="PageTitleEditAgreementItemTerm"/> - <set field="headerItem" value="agreement"/> + <set field="headerItem" value="agreements"/> <set field="tabButtonItem" value="AgreementItems"/> <set field="buttonBarItem" value="ListAgreementItemTerms"/> <set field="agreementId" from-field="parameters.agreementId"/> @@ -427,7 +427,7 @@ <section> <actions> <set field="titleProperty" value="PageTitleListAgreementItemProducts"/> - <set field="headerItem" value="agreement"/> + <set field="headerItem" value="agreements"/> <set field="tabButtonItem" value="AgreementItems"/> <set field="buttonBarItem" value="ListAgreementItemProducts"/> <entity-one entity-name="Agreement" value-field="agreement" auto-field-map="true"/> @@ -539,7 +539,7 @@ <section> <actions> <set field="titleProperty" value="PageTitleEditAgreementItemProduct"/> - <set field="headerItem" value="agreement"/> + <set field="headerItem" value="agreements"/> <set field="tabButtonItem" value="AgreementItems"/> <set field="agreementId" from-field="parameters.agreementId"/> @@ -583,7 +583,7 @@ <section> <actions> <set field="titleProperty" value="PageTitleListAgreementItemProducts"/> - <set field="headerItem" value="agreement"/> + <set field="headerItem" value="agreements"/> <set field="tabButtonItem" value="AgreementItems"/> <set field="buttonBarItem" value="ListAgreementItemSupplierProducts"/> <entity-one entity-name="Agreement" value-field="agreement" auto-field-map="true"/> @@ -695,7 +695,7 @@ <section> <actions> <set field="titleProperty" value="PageTitleEditAgreementItemProduct"/> - <set field="headerItem" value="agreement"/> + <set field="headerItem" value="agreements"/> <set field="tabButtonItem" value="AgreementItems"/> <set field="buttonBarItem" value="ListAgreementItemSupplierProducts"/> <set field="agreementId" from-field="parameters.agreementId"/> @@ -757,7 +757,7 @@ <section> <actions> <set field="titleProperty" value="PageTitleListAgreementItemParties"/> - <set field="headerItem" value="agreement"/> + <set field="headerItem" value="agreements"/> <set field="tabButtonItem" value="AgreementItems"/> <set field="buttonBarItem" value="ListAgreementItemParties"/> <entity-one entity-name="Agreement" value-field="agreement" auto-field-map="true"/> @@ -800,7 +800,7 @@ <section> <actions> <set field="titleProperty" value="PageTitleEditAgreementItemParty"/> - <set field="headerItem" value="agreement"/> + <set field="headerItem" value="agreements"/> <set field="tabButtonItem" value="AgreementItems"/> <set field="buttonBarItem" value="ListAgreementItemParties"/> <set field="agreementId" from-field="parameters.agreementId"/> @@ -843,7 +843,7 @@ <section> <actions> <set field="titleProperty" value="PageTitleListAgreementGeographicalApplic"/> - <set field="headerItem" value="agreement"/> + <set field="headerItem" value="agreements"/> <set field="tabButtonItem" value="AgreementItems"/> <set field="buttonBarItem" value="ListAgreementGeographicalApplic"/> <entity-one entity-name="Agreement" value-field="agreement" auto-field-map="true"/> @@ -886,7 +886,7 @@ <section> <actions> <set field="titleProperty" value="PageTitleEditAgreementGeographicalApplic"/> - <set field="headerItem" value="agreement"/> + <set field="headerItem" value="agreements"/> <set field="tabButtonItem" value="AgreementItems"/> <set field="buttonBarItem" value="ListAgreementGeographicalApplic"/> <set field="agreementId" from-field="parameters.agreementId"/> @@ -929,7 +929,7 @@ <section> <actions> <set field="titleProperty" value="PageTitleEditAgreementWorkEffortAppls"/> - <set field="headerItem" value="agreement"/> + <set field="headerItem" value="agreements"/> <set field="tabButtonItem" value="AgreementWorkEffortAppls"/> <set field="agreementId" from-field="parameters.agreementId"/> <entity-one entity-name="Agreement" value-field="agreement" auto-field-map="true"/> @@ -950,7 +950,7 @@ <section> <actions> <set field="titleProperty" value="PageTitleFindAgreementRoles"/> - <set field="headerItem" value="agreement"/> + <set field="headerItem" value="agreements"/> <set field="tabButtonItem" value="AgreementRoles"/> <set field="agreementId" from-field="parameters.agreementId"/> <entity-one entity-name="Agreement" value-field="agreement" auto-field-map="true"/> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java?rev=785241&r1=785240&r2=785241&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java Tue Jun 16 14:54:11 2009 @@ -1018,7 +1018,7 @@ Locale locale = UtilHttp.getLocale(request); int i; - if (UtilValidate.isEmpty(partyId) || roleTypeId.length < 1) { + if (UtilValidate.isEmpty(partyId) || UtilValidate.isEmpty(roleTypeId) || roleTypeId.length < 1) { request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage(resource_error,"OrderPartyIdAndOrRoleTypeIdNotDefined", locale)); return "error"; } Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/additionalPartyListing.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/additionalPartyListing.ftl?rev=785241&r1=785240&r2=785241&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/entry/additionalPartyListing.ftl (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/additionalPartyListing.ftl Tue Jun 16 14:54:11 2009 @@ -27,7 +27,7 @@ <table border="0" width="100%" cellpadding="0"> <#list roleList as role> <tr> - <td valign="bottom"><div>${roleData[role].get("description",locale)}</div></td> + <td valign="bottom"><div>${roleData[role].get("description", locale)}</div></td> </tr> <tr> <td colspan="4"><hr/></td> |
Free forum by Nabble | Edit this page |