purchaseorder and margin input fields sequence number is not updated when new rows are added
I was very frustrated when i saw that only the first product item is saving the purchase cost while the other items are getting a zero value when creating a purchase order from a quote or salesorder. After some debugging i found that edit.js file is missing a the code that updates the rownumber for 'nameFields' which include the Purchasecost and margin. by adding the below code in the 'updateRowNumberForRow' function the problem is fixed:
for(var nameIndex in nameFields){
var elementName = nameFields[nameIndex];
var actualElementName = elementName + currentSequenceNumber;
var expectedElementName = elementName + expectedSequenceNumber;
lineItemRow.find('[name="'+actualElementName+'"]').attr('name',expectedElementName);
}
I am not very good with pull requests so please add this to the edit.js file in /layouts\v7\modules\Inventory\resources