Invoice SO direct delivery credit note

Hi All,

I have created a program to create direct delivery sales order for credit note (sales line with negative qty). The sales order will create a purchase order. Now for credit note, SO should be invoiced first. For this Ax is check for delivered qty or salesLine.RemainSalesFinancial qty as shown below,

case SalesUpdate::All : if (salesLine.DeliveryType == TradeLineDlvType::DropShip && calcRemaining)

{

if (this.salesDeliverNow(salesLine))

qtyUpdate = this.salesDeliverNow(salesLine);

else

qtyUpdate = salesLine.RemainSalesFinancial;

}

else

{

if (salesLine.RemainSalesFinancial * salesLine.RemainSalesPhysical < 0)

qtyUpdate = salesLine.RemainSalesFinancial;

else

qtyUpdate = salesLine.RemainSalesPhysical + salesLine.RemainSalesFinancial;

}

break;

. Both the quantities are zero. Hence, the SO invoice is not posted. What is the best way to set the qty so that SO invoice (credit note) will be posted.

Regards,

Raghavendra