...
STaxPostingBuffer2.RESET;
STaxPostingBuffer2.SETRANGE("Service Tax Group Code",ServiceTaxEntry."Service Tax Group Code");
STaxPostingBuffer2.SETRANGE("Service Tax Registration No.",ServiceTaxEntry."Service Tax Registration No.");
// Delete the following lines.
IF STaxPostingBuffer2.FINDFIRST THEN BEGIN
IF OldVendLedgEntry."Amount to Apply" > STaxPostingBuffer2.Amount THEN
ERROR(Text16520,OldVendLedgEntry."Document No.",STaxPostingBuffer2.Amount)
IF STaxPostingBuffer2.FINDFIRST THEN BEGIN
IF OldVendLedgEntry."Amount to Apply" > STaxPostingBuffer2.Amount THEN
ERROR(Text16520,OldVendLedgEntry."Document No.",STaxPostingBuffer2.Amount)
ELSE
STaxPostingBuffer2.Amount -= OldVendLedgEntry."Amount to Apply";
STaxPostingBuffer2.MODIFY;
END
ELSE
STaxPostingBuffer2.Amount -= OldVendLedgEntry."Amount to Apply";
STaxPostingBuffer2.MODIFY;
// End of the lines.
END
...
...
STaxPostingBuffer2.RESET;
STaxPostingBuffer2.SETRANGE("Service Tax Group Code",ServiceTaxEntry."Service Tax Group Code");
STaxPostingBuffer2.SETRANGE("Service Tax Registration No.",ServiceTaxEntry."Service Tax Registration No.");
// Add the following lines.
IF STaxPostingBuffer2.FINDSET THEN BEGIN
REPEAT
STAmount += STaxPostingBuffer2.Amount;
STaxPostingBuffer2.MODIFY;
UNTIL STaxPostingBuffer2.NEXT = 0;
IF OldVendLedgEntry."Amount to Apply" > STAmount THEN
ERROR(Text16520,OldVendLedgEntry."Document No.",STAmount)
ELSE
STaxPostingBuffer2.Amount -= OldVendLedgEntry."Amount to Apply";
// End of the lines.
END
...