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.SETFILTER("No.",'<>%1',' ');
IF NOT SalesInvLine.FINDSET THEN
...
...
SalesInvLine.SETFILTER("No.",'<>%1',' ');
// Adde the following line.
SalesInvLine.SETFILTER(Quantity, '<>0');
IF NOT SalesInvLine.FINDSET THEN
...
...
SalesInvLine2.SETRANGE("No.");
SalesInvLine2.CALCSUMS(Amount,"Amount Including VAT","Inv. Discount Amount");
AddElement(XMLCurrNode,'PaymentTerms','',DocNameSpace2,XMLNewChild,Prefix2);
...
...
SalesInvLine2.SETRANGE("No.");
// Add the following line.
SalesInvLine2.SETRANGE(Quantity);
SalesInvLine2.CALCSUMS(Amount,"Amount Including VAT","Inv. Discount Amount");
AddElement(XMLCurrNode,'PaymentTerms','',DocNameSpace2,XMLNewChild,Prefix2);
...