Options

Creating a GL entry?

nazunazu Member Posts: 70
Hi Experts,

I have a sales order where I calculate a tradingdiscount amount.

When Tradingdiscount >0 then i want to debit to trading account & credit to customer account.

I checked in codeunit 80-where I found this fucntion as FillInvoicePostingbuffer.I wrote the code there but it is showing some wrong figures.

Can anyone help me out with this?

Comments

  • Options
    SogSog Member Posts: 1,023
    Could you tell me what a trading discount is?
    If it has something to do with an actual discount, can't financial discount, line discount, ... fullfill the requirement?
    If it has to do something with multicurrency operations, can't the rouding and differences accounts fullfill the requirement?

    But please don't go modifying posting routines unless you understand the total impact on the system.
    I hope you'll test your solution with every possible sales scenario.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • Options
    nazunazu Member Posts: 70
    Hi Sog,

    Thank you for the answer.
    Actuallly tradingdisocunt is calculated on some setup.It has nothing to do with the currency or the standard sales line amount.

    So i just want to create a GL entry of tradingdisocunt with debit to tradingdiscountaccount(mapped in posting setup) & credit to customer.
  • Options
    SogSog Member Posts: 1,023
    So you'll need 2 G/L entries, one for the customer and one for the trading discount.
    Best is to prepare one or 2 general journal lines during the posting routine and post them with gen. jrnl post with check codeunit. If you generate them in the invpostingbuffer then it's equally good.
    But I would suggest to calculate the discount on the document itself. And based on that you can add line(s) to the invpostingbuffer trough your own function.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • Options
    DenSterDenSter Member Posts: 8,304
    You never, never, NEVER create G/L Entries yourself. The ONLY way to post anything to the General Ledger is by creating a journal line and letting the posting routine do its work.
  • Options
    Alex_ChowAlex_Chow Member Posts: 5,063
    nazu wrote:
    Hi Sog,

    Thank you for the answer.
    Actuallly tradingdisocunt is calculated on some setup.It has nothing to do with the currency or the standard sales line amount.

    So i just want to create a GL entry of tradingdisocunt with debit to tradingdiscountaccount(mapped in posting setup) & credit to customer.

    The trade discount you're speaking of can be setup in the standard Navision. If not, you're doing something wrong.
Sign In or Register to comment.