svn commit: r449628 - /incubator/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/SampleCommissionServices.xml

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

svn commit: r449628 - /incubator/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/SampleCommissionServices.xml

jonesde
Author: jonesde
Date: Mon Sep 25 02:56:57 2006
New Revision: 449628

URL: http://svn.apache.org/viewvc?view=rev&rev=449628
Log:
Added invoice creation bit to the affiliate commission sample service

Modified:
    incubator/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/SampleCommissionServices.xml

Modified: incubator/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/SampleCommissionServices.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/SampleCommissionServices.xml?view=diff&rev=449628&r1=449627&r2=449628
==============================================================================
--- incubator/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/SampleCommissionServices.xml (original)
+++ incubator/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/SampleCommissionServices.xml Mon Sep 25 02:56:57 2006
@@ -45,6 +45,7 @@
                     </calculate>
                     
                     <set field="commissionPartyId" from-field="affiliatePartyRelationship.partyIdTo"/>
+                    <call-simple-method method-name="createCommissionInvoiceInline"/>
                 </then>
                 <else-if>
                     <!-- NOTE: this is just an example of another type of commission partner associated with a customer, doesn't really exist -->
@@ -58,5 +59,20 @@
     <simple-method method-name="createCommissionInvoiceInline" short-description="Create Commission Invoice Inline">
         <!-- should have in the context: payment, commissionAmount, commissionPartyId -->
         <!-- this will create an invoice on behalf of the commission party, ie from the commissionPartyId to the company (payment.partyIdTo) -->
+        
+        <set field="createInvoiceMap.invoiceTypeId" value="COMMISSION_INVOICE"/>
+        <set field="createInvoiceMap.statusId" value="INVOICE_RECEIVED"/>
+        <set field="createInvoiceMap.partyIdFrom" from-field="commissionPartyId"/>
+        <set field="createInvoiceMap.partyId" from-field="payment.partyIdTo"/>
+        <call-service service-name="createInvoice" in-map-name="createInvoiceMap">
+            <result-to-field result-name="createdInvoiceId"/>
+        </call-service>
+        
+        <set field="createInvoiceItemMap.invoiceId" from-field="createdInvoiceId"/>
+        <set field="createInvoiceItemMap.invoiceItemTypeId" value="COMM_INV_ITEM"/>
+        <set field="createInvoiceItemMap.amount" from-field="commissionAmount"/>
+        <set field="createInvoiceItemMap.quantity" value="1" type="Double"/>
+        <set field="createInvoiceItemMap.description" value="Commission for Received Customer Payment [${payment.paymentId}]"/>
+        <call-service service-name="createInvoiceItem" in-map-name="createInvoiceItemMap"/>
     </simple-method>
 </simple-methods>