Journal Inserting where it is not suppouse to

matias_jaurematias_jaure Member Posts: 157
Hi people! I have a problem while trying to post a Journal Line to insert some lines in GL entry.
The thing is that the code below somehow is also inserting in the table VAT Entry and I can't figure out why...
Any Idea could Help
Thanks for your Time!!!
     l_recgjLine.INIT;
     l_recgjLine."Posting Date":= p_recSalesInvHeader."Posting Date";
     l_recgjLine."Document Date":=p_recSalesInvHeader."Document Date";
     l_recgjLine.VALIDATE("Line No.",10000);
     l_recgjLine.VALIDATE("Currency Code",p_recSalesInvHeader."Currency Code");
     l_recgjLine."Source Currency Code":=p_recSalesInvHeader."Currency Code";
     l_recgjLine."Source Currency Amount":=p_decTotalAmount;
     l_recgjLine.VALIDATE(Amount,p_decTotalAmount);
     l_recgjLine."Additional-Currency Posting":=l_recgjLine."Additional-Currency Posting"::"Amount Only";
     IF (p_recSalesInvHeader."Currency Code"<>'') THEN BEGIN
       l_recgjLine."Currency Factor":=p_recSalesInvHeader."Currency Factor";
       l_recgjLine."FA Add.-Currency Factor"    :=p_recSalesInvHeader."Currency Factor";
       l_recgjLine.VALIDATE(Amount,p_decTotalAmount/p_recSalesInvHeader."Currency Factor");
     END ELSE
           l_recgjLine."Currency Factor":=1;
     l_recgjLine.VALIDATE("Document No.",p_recSalesInvHeader."No.");
     l_recgjLine.VALIDATE("Account No.",p_recSalesInvLine."Deferred Rev. Account");
     l_recgjLine.VALIDATE("Document Type",l_recgjLine."Document Type"::Invoice);
     l_recgjLine."Gen. Prod. Posting Group":=p_recSalesInvLine."Gen. Prod. Posting Group";
     l_recgjLine."Gen. Bus. Posting Group" := p_recSalesInvLine."Gen. Bus. Posting Group";
     l_recgjLine."Gen. Posting Type" := l_recgjLine."Gen. Posting Type"::Sale;
     l_recgjLine.Description:= p_recSalesInvHeader."Posting Description";
     l_recgjLine."Shortcut Dimension 1 Code":=p_recSalesInvLine."Shortcut Dimension 1 Code";
     l_recgjLine."External Document No." := FORMAT(p_recSalesInvLine."Line No.");
     l_recTempJnlLineDim.DELETEALL;
     l_recTempDocDim.RESET;
     l_recTempDocDim.SETRANGE("Table ID",DATABASE::"Sales Header");
     l_cduDimMgt.CopyDocDimToJnlLineDim(l_recTempDocDim,l_recTempJnlLineDim);
     l_cduGenJnlPostLine.RunWithCheck(l_recgjLine,l_recTempJnlLineDim);

Comments

  • tinoruijstinoruijs Member Posts: 1,226
    You could check the boolean "Copy VAT Setup to Jnl. Lines" on the General Journal Batch you're using. Maybe it should be FALSE?

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • TrippyZTrippyZ Member Posts: 87
    You get a VAT entry if you have set "Gen. Posting Type". Is it set on any of the line?
    Professional Navision Developer
  • matias_jaurematias_jaure Member Posts: 157
    Thanks for the anwsers!... I will try your suggestion and give you a feedback in a while
  • matias_jaurematias_jaure Member Posts: 157
    TrippyZ wrote:
    You get a VAT entry if you have set "Gen. Posting Type". Is it set on any of the line?

    Yes it's set to "Sale", but if I put '' Navision gives me an error
  • matias_jaurematias_jaure Member Posts: 157
    TrippyZ wrote:
    You get a VAT entry if you have set "Gen. Posting Type". Is it set on any of the line?

    Yes it's set to "Sale", but if I put '' Navision gives me an error
    It was because I also had set up Gen. Bus. Posting Setup and Gen. Prod Bus. Setup. Now is OK! Thanks to you both!
Sign In or Register to comment.