when we change the Expected quantity in return order the Discount and Percentage is reset to '0'

When we change the Expected quantity in return Sales order the Discount and Percentage is reset to ‘0’

I found the standard Code where its reseting the Discount and Percentage is reset to ‘0’ ?

case fieldNum(SalesLine, ExpectedRetQty):

SalesLine::modifyExpectedRetQty(this, this.inventDim());

static void modifyExpectedRetQty(SalesLine _salesLine,

InventDim _inventDim,

boolean _resetPrice = true)

{

Qty transQty = _salesLine.ExpectedRetQty;

transQty = decRound(transQty, UnitOfMeasure::unitOfMeasureDecimalPrecision(

UnitOfMeasure::unitOfMeasureIdBySymbol(_salesLine.SalesUnit)));

if (transQty != _salesLine.ExpectedRetQty)

{

_salesLine.ExpectedRetQty = transQty;

}

if (_resetPrice)

{

_salesLine.SalesPurchLine::resetPriceAgreement();

_salesLine.setPriceDisc(_inventDim);

}

}

Quantity is a calculation re-trigger so it will re-read and if the discount was manually added onto the sales order it would reset. Why are you not bringing in the correct quantity on the copy, or closing short? What version?

Thanks for quick reply,

User wants to update some orders through manually so user requested do the modification.

Then I would suggest you get all of the details to specify the customization. If you struggle with teh code post a request in the developer forum.

Thanks,

I am using the Dynamic AX 2012 R7 :

Can you please tell me how we can add discount to the return order.(Its not taking from the Trade agreement Screen)

I think its not same as the sales order?

You cannot add discount, any adjustment to the credited cost from the invoice has to be processed through miscellaneous charges.