Problem with posted Voucher Report (16567)

mkpjsrmkpjsr Member Posts: 587
Hi all,

I want to customize the Posted Voucher report (16567) to have invoice details also(against which the payment is made), like "Invoice No." "posting Date" And "Invoice Amount". How should I go for it.

Actually when we post any Cash/bank payment voucher then with the help of function->Apply Entries option we enter the "External Document no." into Cash/Bank payment voucher.

So, i have written the following code under OnAfterGetRecord of G/L Entry DataItem but its not working,
VendorLedgerEntry.RESET;
VendorLedgerEntry.SETRANGE(VendorLedgerEntry."Document No.","External Document No.");
VendorLedgerEntry.SETRANGE(VendorLedgerEntry."Posting Date","Posting Date");
if VendorLedgerEntry.FIND('-') Then
BillNo:=VendorLedgerEntry."Document No.";
Billdate:=VendorLedgerEntry."Posting Date";
BillAmount:=VendorLedgerEntry."Original Amount";

Can anybody guide me.

Comments

  • vijay_gvijay_g Member Posts: 884
    Why don't you write
    VendorLedgerEntry.SETRANGE(VendorLedgerEntry."Document No.","Document No.";
    
    instead of
    VendorLedgerEntry.SETRANGE(VendorLedgerEntry."Document No.","External Document No.";
    

    try to debug the code.
  • mkpjsrmkpjsr Member Posts: 587
    vijay_g wrote:
    Why don't you write
    VendorLedgerEntry.SETRANGE(VendorLedgerEntry."Document No.","Document No.";
    
    instead of
    VendorLedgerEntry.SETRANGE(VendorLedgerEntry."Document No.","External Document No.";
    

    try to debug the code.

    Thanx for the reply, i have chaged the code as you said but still i am not able to find the coreect data:
    VendorLedgerEntry.RESET;
    VendorLedgerEntry.SETRANGE(VendorLedgerEntry."Document No.","Document No.");
    VendorLedgerEntry.SETRANGE(VendorLedgerEntry."Posting Date","Posting Date");
    IF VendorLedgerEntry.FIND('-') THEN
          VendorLedgerEntry.SETRANGE(VendorLedgerEntry."External Document No.",VendorLedgerEntry."Document No.");
          IF VendorLedgerEntry.FIND('-') THEN
          BillNo:=VendorLedgerEntry."Document No.";
          BillDate:=VendorLedgerEntry."Posting Date";
          BillAmount:=VendorLedgerEntry."Original Amount";
    
  • vijay_gvijay_g Member Posts: 884
    VendorLedgerEntry.SETRANGE(VendorLedgerEntry."External Document No.",VendorLedgerEntry."Document No.");
    

    why you setrange "extrnal doc" to "Document no."?
  • mkpjsrmkpjsr Member Posts: 587
    vijay_g wrote:
    VendorLedgerEntry.SETRANGE(VendorLedgerEntry."External Document No.",VendorLedgerEntry."Document No.");
    

    why you setrange "extrnal doc" to "Document no."?

    If u see the vendor ledger entry table, it contains the "External Document No." that we enter manually while posting cash/bank payment voucher.

    Actually the first two SETRANGE gives me the record from vendor ledger entry table but this record is not having that data what i am trying to fetch, so i am trying another filter on the same table whose document no is equal to the external document no of Cash/Bank payment voucher.

    it may be wrong, my requirement is to fetch the Invoice No, Date and Amount of that particular invoice that i am entering with Cash/bank Payment voucher.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    so i am trying another filter on the same table whose document no is equal to the external document no of Cash/Bank payment voucher.

    First, it does not work..

    try removing that line and try...

    explain the complete scenario...
  • mkpjsrmkpjsr Member Posts: 587
    so i am trying another filter on the same table whose document no is equal to the external document no of Cash/Bank payment voucher.

    First, it does not work..

    try removing that line and try...

    explain the complete scenario...

    thanx for the reply,

    Actually what i want is to print the invoice details(invoice no,date and amount) on posted voucher report. In our case,When we pass any cash/bank payment voucher then we take reference of the posted purchase invoice for that vendor by Function->Apply Entries and pressing f9.

    My requirement is to print the invoice details on the posted voucher report, so from where i can get these details.
  • ssinglassingla Member Posts: 2,973
    Why don't u use the standard way of doing this. The name of the vendor is printed in the voucher. Check how NAV arrives on it. Then find the link between that G/L Entry and Vendor/Customer Ledger Entry. Then you can very easily find the applied entries for the vendor/customer ledger entry.
    CA Sandeep Singla
    http://ssdynamics.co.in
  • mkpjsrmkpjsr Member Posts: 587
    ssingla wrote:
    Why don't u use the standard way of doing this. The name of the vendor is printed in the voucher. Check how NAV arrives on it. Then find the link between that G/L Entry and Vendor/Customer Ledger Entry. Then you can very easily find the applied entries for the vendor/customer ledger entry.


    actually I am not able to locate where is the reference of the applied entries. NAV is fetching Vendor name from "Vendor" table based on some links through "Vendor Ledger Entry".
Sign In or Register to comment.