...
GenJnlLine2."Account No." := "VAT Posting Setup"."Reverse Chrg. VAT Acc.";
GenJnlLine2.VALIDATE(
// Delete the following lines.
Amount,
Amount,VATEntryAmount);
// End of the lines.
GenJnlLine2."Source Currency Code" := GLSetup."Additional Reporting Currency";
GenJnlLine2."Source Currency Amount" := VATEntry."Additional-Currency Amount";
IF PostSettlement AND (GenJnlLine2.Amount <> 0) THEN
PostGenJnlLine(GenJnlLine2);
VATAmount :=
// Delete the following line.
VATAmount - GenJnlLine2.Amount + VATEntry.Amount; // PT0001
VATAmountAddCurr :=
// PT0001.begin
VATAmountAddCurr - VATEntry."Additional-Currency Base" * (VATEntry."ND %" + VATEntry."VAT %") / 100 +
VATEntry."Additional-Currency Amount";
// PT0001.end
//--C. Memo accepted--
VATEntry.SETFILTER("Document Type",'%1|%2',
VATEntry."Document Type"::"Credit Memo",
VATEntry."Document Type"::Payment);
VATEntry.SETFILTER("UE Aquisition Not Accep.",'%1',FALSE);
VATEntry.CALCSUMS(
Base,Amount,
"Additional-Currency Base","Additional-Currency Amount");
"VAT Posting Setup".TESTFIELD("Return VAT account (Sales)");
CLEAR(GenJnlLine2);
GenJnlLine2."System-Created Entry" := TRUE;
GenJnlLine2."Account Type" := GenJnlLine2."Account Type"::"G/L Account";
GenJnlLine2.Description := GenJnlLine.Description;
GenJnlLine2."Posting Date" := PostingDate;
GenJnlLine2."Document Type" := 0;
GenJnlLine2."Document No." := DocNo;
GenJnlLine2."Source Code" := SourceCodeSetup."VAT Settlement";
GenJnlLine2."VAT Posting" := GenJnlLine2."VAT Posting"::"Manual VAT Entry";
GenJnlLine2."Account No." := "VAT Posting Setup"."Return VAT account (Sales)";
GenJnlLine2.VALIDATE(
// Delete the following lines.
Amount,
Amount,VATEntryAmount);
// End of the lines.
GenJnlLine2."Source Currency Code" := GLSetup."Additional Reporting Currency";
GenJnlLine2."Source Currency Amount" := VATEntry."Additional-Currency Amount";
IF PostSettlement AND (GenJnlLine2.Amount <> 0) THEN
PostGenJnlLine(GenJnlLine2);
VATAmount :=
// Delete the following line.
VATAmount - GenJnlLine2.Amount + VATEntry.Amount; // PT0001
VATAmountAddCurr :=
// PT0001.begin
VATAmountAddCurr - VATEntry."Additional-Currency Base" * (VATEntry."ND %" + VATEntry."VAT %") / 100 +
VATEntry."Additional-Currency Amount";
// PT0001.end
...
...
GenJnlLine2."Account No." := "VAT Posting Setup"."Reverse Chrg. VAT Acc.";
GenJnlLine2.VALIDATE(
// Add the following line.
Amount,CalcVATEntryAmount(TRUE,FALSE));
GenJnlLine2."Source Currency Code" := GLSetup."Additional Reporting Currency";
GenJnlLine2."Source Currency Amount" := VATEntry."Additional-Currency Amount";
IF PostSettlement AND (GenJnlLine2.Amount <> 0) THEN
PostGenJnlLine(GenJnlLine2);
VATAmount :=
// Add the following line.
VATAmount - GenJnlLine2.Amount + VATEntry.Amount;
VATAmountAddCurr :=
// PT0001.begin
VATAmountAddCurr - VATEntry."Additional-Currency Base" * (VATEntry."ND %" + VATEntry."VAT %") / 100 +
VATEntry."Additional-Currency Amount";
// PT0001.end
//--C. Memo accepted--
VATEntry.SETFILTER("Document Type",'%1|%2',
VATEntry."Document Type"::"Credit Memo",
VATEntry."Document Type"::Payment);
VATEntry.SETFILTER("UE Aquisition Not Accep.",'%1',FALSE);
VATEntry.CALCSUMS(
Base,Amount,
"Additional-Currency Base","Additional-Currency Amount");
"VAT Posting Setup".TESTFIELD("Return VAT account (Sales)");
CLEAR(GenJnlLine2);
GenJnlLine2."System-Created Entry" := TRUE;
GenJnlLine2."Account Type" := GenJnlLine2."Account Type"::"G/L Account";
GenJnlLine2.Description := GenJnlLine.Description;
GenJnlLine2."Posting Date" := PostingDate;
GenJnlLine2."Document Type" := 0;
GenJnlLine2."Document No." := DocNo;
GenJnlLine2."Source Code" := SourceCodeSetup."VAT Settlement";
GenJnlLine2."VAT Posting" := GenJnlLine2."VAT Posting"::"Manual VAT Entry";
GenJnlLine2."Account No." := "VAT Posting Setup"."Return VAT account (Sales)";
GenJnlLine2.VALIDATE(
// Add the following line.
Amount,CalcVATEntryAmount(FALSE,TRUE));
GenJnlLine2."Source Currency Code" := GLSetup."Additional Reporting Currency";
GenJnlLine2."Source Currency Amount" := VATEntry."Additional-Currency Amount";
IF PostSettlement AND (GenJnlLine2.Amount <> 0) THEN
PostGenJnlLine(GenJnlLine2);
VATAmount :=
// Add the following line.
VATAmount - GenJnlLine2.Amount + VATEntry.Amount;
VATAmountAddCurr :=
// PT0001.begin
VATAmountAddCurr - VATEntry."Additional-Currency Base" * (VATEntry."ND %" + VATEntry."VAT %") / 100 +
VATEntry."Additional-Currency Amount";
// PT0001.end
...