svn commit: r438976 - in /incubator/ofbiz/trunk/applications/accounting: servicedef/secas.xml src/org/ofbiz/accounting/agreement/AgreementServices.java

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

svn commit: r438976 - in /incubator/ofbiz/trunk/applications/accounting: servicedef/secas.xml src/org/ofbiz/accounting/agreement/AgreementServices.java

sichen
Author: sichen
Date: Thu Aug 31 09:27:22 2006
New Revision: 438976

URL: http://svn.apache.org/viewvc?rev=438976&view=rev
Log:
Fixed bug with generating sales commission invoices.  Patch from Vinay Agarwal.  OFBIZ-80

Modified:
    incubator/ofbiz/trunk/applications/accounting/servicedef/secas.xml
    incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java

Modified: incubator/ofbiz/trunk/applications/accounting/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/accounting/servicedef/secas.xml?rev=438976&r1=438975&r2=438976&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/accounting/servicedef/secas.xml (original)
+++ incubator/ofbiz/trunk/applications/accounting/servicedef/secas.xml Thu Aug 31 09:27:22 2006
@@ -24,7 +24,7 @@
     <eca service="createPaymentApplication" event="commit">
         <condition field-name="invoiceId" operator="is-not-empty"/>
         <action service="checkInvoicePaymentApplications" mode="sync"/>
-        <!-- commission code not working right now for digital products; for details see Jira issue: #OFBIZ-80; <action service="createCommissionInvoices" mode="sync"/> -->
+        <action service="createCommissionInvoices" mode="sync"/>
     </eca>
     <eca service="createCommissionInvoices" event="commit">
         <condition field-name="invoicesCreated" operator="is-not-empty"/>

Modified: incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java?rev=438976&r1=438975&r2=438976&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java (original)
+++ incubator/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java Thu Aug 31 09:27:22 2006
@@ -86,9 +86,12 @@
         List commissions = FastList.newInstance();
         
         // either ACCOUNTING_COMM_VIEW or ACCOUNTING_MANAGER should be allowed to see commission amounts
-        String partyId = ServiceUtil.getPartyIdCheckSecurity(userLogin, security, context, result, "ACCOUNTING", "_COMM_VIEW");
-        if (result.size() > 0)
+        if (!security.hasEntityPermission("ACCOUNTING", "_COMM_VIEW", userLogin)) {
+            result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_ERROR);
+            errMsg = UtilProperties.getMessage(ServiceUtil.resource, "serviceUtil.no_permission_to_operation", locale) + ".";
+            result.put(ModelService.ERROR_MESSAGE, errMsg);
             return result;
+        }
         try {
             BigDecimal amount = ((BigDecimal)context.get("amount"));
             BigDecimal quantity = (BigDecimal)context.get("quantity");