Change the code in the Create Intrastat Decl. Disk Report (11413) as follows:
Existing code 1...
SpecialUnit@1000002 : Decimal;
RoundedWeight@1000001 : Integer;
ItemDirection@1000004 : Integer;
BEGIN
TESTFIELD("Item No.");
TESTFIELD("Tariff No.");
...
Replacement code 1...
SpecialUnit@1000002 : Decimal;
RoundedWeight@1000001 : Integer;
ItemDirection@1000004 : Integer;
// Add the following line
IsCorrection@1000005 : Boolean;
// End of the added line.
BEGIN
TESTFIELD("Item No.");
TESTFIELD("Tariff No.");
...
Existing code 2...
ZeroShipment := FALSE;
END;
END;
Write(FORMAT(Date, 0, '<Year4><Month,2>'));
Write(FORMAT(ItemDirection));
...
Replacement code 2...
ZeroShipment := FALSE;
END;
END;
// Add the following line.
IsCorrection := CheckCorrection("Source Entry No.",ItemDirection);
// End of the added line.
Write(FORMAT(Date, 0, '<Year4><Month,2>'));
Write(FORMAT(ItemDirection));
...
Existing code 3...
Write(PADSTR2("Transaction Type", 1, '', '>'));
Write(PADSTR2(DELCHR("Tariff No."), 8, '0', '<'));
Write('00');
Write(Sign(RoundedWeight)); // DELETED
Write(PADSTR2(FORMAT(RoundedWeight, 0, '<Integer>'), 10, ' ', '<'));
...
Replacement code 3...
Write(PADSTR2("Transaction Type", 1, '', '>'));
Write(PADSTR2(DELCHR("Tariff No."), 8, '0', '<'));
Write('00');
// Add the following line.
Write(Sign(RoundedWeight,IsCorrection));
// End of the added line.
Write(PADSTR2(FORMAT(RoundedWeight, 0, '<Integer>'), 10, ' ', '<'));
...
Existing code 4...
Write(PADSTR2(FORMAT(RoundedWeight, 0, '<Integer>'), 10, ' ', '<'));
// Delete the following line.
Write(Sign(SpecialUnit));
// End of the deleted line.
Write(PADSTR2(FORMAT(SpecialUnit, 0, '<Integer>'), 10, ' ', '<'));
...
Replacement code 4...
Write(PADSTR2(FORMAT(RoundedWeight, 0, '<Integer>'), 10, ' ', '<'));
// Add the following line.
Write(Sign(SpecialUnit,IsCorrection));
// End of the added line.
Write(PADSTR2(FORMAT(SpecialUnit, 0, '<Integer>'), 10, ' ', '<'));
...
Existing code 5...
Write(PADSTR2(FORMAT(SpecialUnit, 0, '<Integer>'), 10, ' ', '<'));
// Delete the following line.
Write(Sign(Amount));
// End of the deleted line.
Write(PADSTR2(FORMAT(Amount, 0, '<Integer>'), 10, ' ', '<'));
...
Replacement code 5...
Write(PADSTR2(FORMAT(SpecialUnit, 0, '<Integer>'), 10, ' ', '<'));
// Add the following line.
Write(Sign(Amount,IsCorrection));
// End of the added line.
Write(PADSTR2(FORMAT(Amount, 0, '<Integer>'), 10, ' ', '<'));
...
Existing code 6...
Write(PADSTR2(FORMAT(Amount, 0, '<Integer>'), 10, ' ', '<'));
// Delete the following line.
Write('+');
// End of the deleted line.
Write(PADSTR2('0', 10, ' ', '<'));
Write(PADSTR2("Document No.", 10, ' ', '<'));
...
Replacement code 6...
Write(PADSTR2(FORMAT(Amount, 0, '<Integer>'), 10, ' ', '<'));
// Add the following lines.
IF IsCorrection THEN
Write('-')
ELSE // ADDED
Write('+');
// End of the added lines.
Write(PADSTR2('0', 10, ' ', '<'));
Write(PADSTR2("Document No.", 10, ' ', '<'));
...
Existing code 7...
Write(PADSTR2('0', 10, ' ', '<'));
Write(PADSTR2("Document No.", 10, ' ', '<'));
// Delete the following line.
Write(PADSTR2('', 4, ' ', '>'));
// End of the deleted line.
Write('000');
Write(PADSTR2("Intrastat Jnl. Batch"."Currency Identifier", 1, ' ', '>'));
Write(PADSTR2('', 6, ' ', '>'));
...
Replacement code 7...
Write(PADSTR2('0', 10, ' ', '<'));
Write(PADSTR2("Document No.", 10, ' ', '<'));
// Add the following lines.
Write(PADSTR2('', 3, ' ', '>'));
IF IsCorrection THEN
Write('C')
ELSE
Write(' ');
// End of the added lines.
Write('000');
Write(PADSTR2("Intrastat Jnl. Batch"."Currency Identifier", 1, ' ', '>'));
Write(PADSTR2('', 6, ' ', '>'));
...