Creating a GL entry?

nazu
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?
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?
0
Comments
-
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.0 -
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.0 -
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.0 -
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.0
-
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.Confessions of a Dynamics NAV Consultant = my blog
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions