mibuso.com

Microsoft Business Solutions online community
It is currently Sun Apr 20, 2014 2:55 am

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: G/L description to contain same text as Invoice Line
PostPosted: Thu Nov 22, 2007 12:02 pm 
Offline

Joined: Tue Oct 30, 2007 5:39 pm
Posts: 13
Location: Malta
Country: Malta (mt)
I have a client that wants the following customization:
- When the user posts an Invoice he inputs a particular description in the Invoice line.
- When the invoice is posted and the user goes to 'Navigate' and chooses to see G/L entries, in the description field there is something like 'Invoice SIV07000010'.
- This client wants the description he first inputted in the invoice lines to be also shown in the G/L entries instead of the 'Invoice SIV07000010'.

Any ideas anyone?

Thanks and regards.


Top
 Profile  
 
 Post subject: Re: G/L description to contain same text as Invoice Line
PostPosted: Thu Nov 22, 2007 12:33 pm 
Online
Moderator
MVP Microsoft Dynamics NAV
NAV TechDays 2014 attendee

Joined: Wed Jul 02, 2003 10:13 am
Posts: 7649
Location: Milan
Country: Italy (it)
carl wrote:
- This client wants the description he first inputted in the invoice lines to be also shown in the G/L entries instead of the 'Invoice SIV07000010'.

And what does he want in case he has 2 invoice lines with different descriptions that arrive in the same G/L Account No.? Navision totals lines with the same characteristics into 1 G/L entry to avoid creating too many records.

_________________
Regards,Alain Krikilion
Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title! || Read Forum Rules before making a posting

»»» Mark your calendar: NAV TechDays 2014 - 20 & 21 November 2014 ««« Visit the conference website: http://www.navtechdays.com


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 22, 2007 12:39 pm 
Offline

Joined: Tue Oct 30, 2007 5:39 pm
Posts: 13
Location: Malta
Country: Malta (mt)
In that case the client has agreed that the FIRST description is taken into consideration to avoid confusion.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 22, 2007 2:50 pm 
Online
Moderator
MVP Microsoft Dynamics NAV
NAV TechDays 2014 attendee

Joined: Wed Jul 02, 2003 10:13 am
Posts: 7649
Location: Milan
Country: Italy (it)
You need to check codeunit 80 (for sales) or 90 (for purchase) where the temptable is filled to be used to post in G/L.

_________________
Regards,Alain Krikilion
Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title! || Read Forum Rules before making a posting

»»» Mark your calendar: NAV TechDays 2014 - 20 & 21 November 2014 ««« Visit the conference website: http://www.navtechdays.com


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 22, 2007 5:21 pm 
Offline

Joined: Mon Nov 29, 2004 2:51 pm
Posts: 291
Location: Slovenia
Country: Slovenia (si)
Show Posting Description field.
Or you can use Posting Desc. Code


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 22, 2007 6:22 pm 
Offline

Joined: Tue Oct 30, 2007 5:39 pm
Posts: 13
Location: Malta
Country: Malta (mt)
I tried using TempSalesLine.Description. It works fine when I have just one invoice line. When i have more than 1 invoice line all the descriptions are set to the description of the LAST invoice line.

What is needed is that if for example you have 2 invoice lines (2 seperate G/L accounts), the G/L Entries should hold both descriptions of Invoice Line 1(firs account) and Invoice Line 2(second account). Thanks all for your help and time!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 22, 2007 8:24 pm 
Offline

Joined: Wed Aug 25, 2004 11:45 am
Posts: 339
Location: Derby
Country: United Kingdom (uk)
Hi,

This is a very common modification request from customers and we always apply it. See code below :
Code: Select all
Custom Code To Replace G/L Entry Descriptions With The Sales/Purchase Invoice Line Description
==============================================================================================

Table 49 - Invoice Post. Buffer
===============================

New Fields
----------
50000 Posting Description   (Text 50)
50001 Line No.              (Integer)


CodeUnit 90 - Purch.-Post
=========================

OnRun() Trigger
---------------
....

GenJnlLine.INIT;
GenJnlLine."Posting Date" := "Posting Date";
GenJnlLine."Document Date" := "Document Date";
// *************************************************************************************************
// Following Field Assignment Modified By J.Wareham 21/09/2004 To Post Actual Line Description To GL
IF InvPostingBuffer[1]."Posting Description" <> '' THEN
   GenJnlLine.Description := InvPostingBuffer[1]."Posting Description"
ELSE
   GenJnlLine.Description := "Posting Description";
// *************************************************************************************************
GenJnlLine."Reason Code" := "Reason Code";
GenJnlLine."Document Type" := GenJnlLineDocType;
GenJnlLine."Document No." := GenJnlLineDocNo;
GenJnlLine."External Document No." := GenJnlLineExtDocNo;

....

FillInvPostingBuffer() Trigger
------------------------------
...
  // *************************************************************************************************
  // Following Code Added By J.Wareham 21/09/2004 To Pass Actual Line Description Through To GL Entry
  IF (PurchLine.Type = PurchLine.Type::"G/L Account") OR (PurchLine.Type = PurchLine.Type::Item) THEN BEGIN
     InvPostingBuffer[1]."Posting Description" := PurchLine.Description;
     InvPostingBuffer[1]."Line No." := PurchLine."Line No.";
  END;
  // *************************************************************************************************

  TempDocDim.SETRANGE("Table ID",DATABASE::"Purchase Line");
  TempDocDim.SETRANGE("Line No.","Line No.");
  UpdInvPostingBuffer;
END;


CodeUnit 80 - Sales-Post
=========================

OnRun() Trigger
---------------
....

GenJnlLine.INIT;
GenJnlLine."Posting Date" := "Posting Date";
GenJnlLine."Document Date" := "Document Date";
// *************************************************************************************************
// Following Field Assignment Modified By J.Wareham 21/09/2004 To Post Actual Line Description To GL
IF InvPostingBuffer[1]."Posting Description" <> '' THEN
   GenJnlLine.Description := InvPostingBuffer[1]."Posting Description"
ELSE
   GenJnlLine.Description := "Posting Description";
// *************************************************************************************************
GenJnlLine."Reason Code" := "Reason Code";
GenJnlLine."Document Type" := GenJnlLineDocType;
GenJnlLine."Document No." := GenJnlLineDocNo;
GenJnlLine."External Document No." := GenJnlLineExtDocNo;

....

FillInvPostingBuffer() Trigger
------------------------------
...
  // *************************************************************************************************
  // Following Code Added By J.Wareham 21/09/2004 To Pass Actual Line Description Through To GL Entry
  IF SalesLine.Type = SalesLine.Type::"G/L Account" THEN BEGIN
     InvPostingBuffer[1]."Posting Description" := SalesLine.Description;
     InvPostingBuffer[1]."Line No." := SalesLine."Line No.";
  END; 
  // *************************************************************************************************

  TempDocDim.SETRANGE("Table ID",DATABASE::"Purchase Line");
  TempDocDim.SETRANGE("Line No.","Line No.");
  UpdInvPostingBuffer;
END;


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 23, 2007 8:30 am 
Online
Moderator
MVP Microsoft Dynamics NAV
NAV TechDays 2014 attendee

Joined: Wed Jul 02, 2003 10:13 am
Posts: 7649
Location: Milan
Country: Italy (it)
[Topic moved from Navision forum to Navision Tips & Tricks forum]

_________________
Regards,Alain Krikilion
Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title! || Read Forum Rules before making a posting

»»» Mark your calendar: NAV TechDays 2014 - 20 & 21 November 2014 ««« Visit the conference website: http://www.navtechdays.com


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 23, 2007 11:11 am 
Offline

Joined: Tue Oct 30, 2007 5:39 pm
Posts: 13
Location: Malta
Country: Malta (mt)
Solved as per Jonathan2708's code. Thanks all for your help and time.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: