order and invoice

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

order and invoice

salmant
Hello,
I was wondering when (what order status) an invoice was created from an
order and what were the conditions to create automatically the invoice ?

Thanks very much
Reply | Threaded
Open this post in threaded view
|

Re: order and invoice

Bilgin Ibryam
The invoices are created based the order shipments status.
So if you create a shipment for some order items, and
pack(SHIPMENT_PACKED) the shipment, the order items in the shipment will
be invoiced. Here is the seca for it:

    <!-- if new statusId of a SALES_SHIPMENT is SHIPMENT_PACKED, create
invoice -->
    <eca service="updateShipment" event="commit">
        <condition-field field-name="statusId" operator="not-equals"
to-field-name="oldStatusId"/>
        <condition field-name="statusId" operator="equals"
value="SHIPMENT_PACKED"/>
        <condition field-name="shipmentTypeId" operator="equals"
value="SALES_SHIPMENT"/>        
        <action service="createInvoicesFromShipment" mode="sync"
run-as-user="system"/>        
    </eca>

Bilgin