To implement this hotfix, you must have a developer license.
You do not have to have rights to the data stores unless you have to perform data repair.
...
SalesInvLine.SETRANGE("Document No.","No.");
SalesInvLine.SETFILTER(Type,'>%1',0);
SalesInvLine.SETFILTER("No.",'<>%1',' ');
IF NOT SalesInvLine.FINDSET THEN
EXIT;
...
...
SalesInvLine.SETRANGE("Document No.","No.");
SalesInvLine.SETFILTER(Type,'>%1',0);
SalesInvLine.SETFILTER("No.",'<>%1',' ');
// Add the following line.
SalesInvLine.SETFILTER(Quantity, '<>0');
// End of the added line.
IF NOT SalesInvLine.FINDSET THEN
EXIT;
...
...
SalesInvLine2.COPY(SalesInvLine);
SalesInvLine2.SETRANGE(Type);
SalesInvLine2.SETRANGE("No.");
SalesInvLine2.CALCSUMS(Amount,"Amount Including VAT","Inv. Discount Amount");
...
...
SalesInvLine2.COPY(SalesInvLine);
SalesInvLine2.SETRANGE(Type);
SalesInvLine2.SETRANGE("No.");
// Add the following line.
SalesInvLine2.SETRANGE(Quantity);
// End of the added line.
SalesInvLine2.CALCSUMS(Amount,"Amount Including VAT","Inv. Discount Amount");
...