Describe the issue
The procedure GetLastLineNo() used in CreateSalesLines() in codeunit 30246 "Shpfy Create Sales Doc. Refund" returns the highest existing Sales Line "Line No." in the related "Sales Header". That is OK, but the value is used to create the next "Sales Line" as is, and if a "Sales Line" already exists on the Sales Header (maybe an automatically created comment line or similar), the procedure CreateSalesLines() will fail.
Expected behavior
10000 should be added to the returned value from GetLastLineNo() before being used to insert a new "Sales Line".
Steps to reproduce
Install an extension of some sort that creates a comment line when "Sales Header - OnInsert()" is triggered.
Tick "Shopify Order No. on Doc. Line" i Shop Setup.
Create a refund ...
Additional context
No response
I will provide a fix for a bug