In case of Sales return EWB, the dispatch address will either be of the customer or transporter while recipient address will be that of the seller. However, the functionality doesn’t work that way today. It continues to follow the same methodology as for initial sales dispatch.
Also, ewb document type should be Delivery Challan (in case EWB is being generated independently)
Figured out that this is working as intended. When creating a credit note, only einvoice is created with Seller address and billing address.
After the credit note is submitted, ewb have to be generated using ewb generate option. During this action, the dispatch and shipping address is correctly reversed.
My question is, when the inventory is non-zero and there is a movement of goods needed, why can we not chain creating einvoice and ewb generate call back to back in controller?