Options

Voucher

klumklum Member Posts: 102
Hi All,

I have question about output on Voucher so I will change it for all voucher in system. I will show output like this.
LineNo. AccNo. Description/Descriptin 2
1000 11000 AAAAAAA /aaaaaaaaaaa
2000 21000 BBBBBBB/bbbbbbbbbbb
3000 11000 AAAAAAA/ccccccccccccc

Problem is description 2 not corrent by AccNo. in each line.
Description 2 on line 3000 at AccNo. show on Voucher is AAAAAAA/aaaaaaa is not show correct output is AAAAAAA/ ccccccccccc


I will show what codes that I use. so still incorrect on Description 2.


CLEAR(AccNo);
CLEAR(Desc);
CLEAR(Desc2);
CLEAR(AccDesc);

PurchInvLine.RESET;
PurchInvLine.SETRANGE("Document No.","Document No.");
PurchInvLine.SETRANGE(Type,Type::"G/L Account");
PurchInvLine.SETRANGE("No.","No.");
IF PurchInvLine.FIND('-') THEN BEGIN
   Desc := PurchInvLine.Description;
   Desc2 := PurchInvLine."Description 2";
END;


IF GLAcc.GET(AccNo) THEN BEGIN
   IF  Desc2  <> '' THEN
       AccDesc := Desc + '/' + Desc2;
END;

IF GLAcc.GET(AccNo) THEN BEGIN
   IF  Desc2  = '' THEN
       AccDesc := Desc;
END;




Can anybody help me please? give me a solution for this.


thank for advance

klum

[/quote]

Comments

  • Options
    AlbertvhAlbertvh Member Posts: 516
    Hi

    You would need to change the statement
    IF GLAcc.GET(AccNo) THEN BEGIN 
       IF  Desc2  <> '' THEN 
           AccDesc := Desc + '/' + Desc2; 
    END; 
    
    IF GLAcc.GET(AccNo) THEN BEGIN 
       IF  Desc2  = '' THEN 
           AccDesc := Desc; 
    END; 
    

    to this
    IF GLAcc.GET(AccNo) THEN BEGIN 
       IF  Desc2  <> '' THEN 
           AccDesc := Desc + '/' + Desc2
       ELSE
           AccDesc := Desc + '/' + GLAcc.Name; 
    END; 
    

    This will add the description from the GLAcc table to yoyr description. :lol:

    Albert
Sign In or Register to comment.