Get SalesShipment from the SalesInvoice g/l accounts

gonzy1981gonzy1981 Member Posts: 156
Hi there,
I've been trying to sort out this issue, but it's been impossible to find out with my little experience in Nav. ;(

Firstly, I've created a Sales shipment with this posting date 01/01/2012, in this sales shipment there is just a line of a g/l account.

Secondly, I've create the invoice (of the previous sales shipment) but with different posting date 01/02/2012.

From the Posting Sales Invoice how can i get Sales Shipment?? Because i haven't find out any relation betwean them when there are g/l accounts in the lines.

I've got it just when i'm posting lines with items, of this way:

ValueEntry.RESET;
ValueEntry.SETRANGE("Item No.",InvLine."No.");
ValueEntry.SETRANGE("Document Line No.",InvLine."Line No.");
ValueEntry.SETRANGE("Document No.",InvLine."Document No.");
ValueEntry.SETRANGE("Document Type",ValueEntry."Document Type"::"Sales Invoice");
IF ValueEntry.FINDFIRST THEN
IF ItemLedgEntry.GET(ValueEntry."Item Ledger Entry No.") THEN BEGIN
SalesShipNo := ItemLedgEntry."Document No.";
SalesShiPostDate := ItemLedgEntry."Posting Date"; //This date is what a need for my client!!
END

Do you know how to help me with this issue???
Thank you.

Bye

Comments

  • vijay_gvijay_g Member Posts: 884
    Why don't you use order no. field that will meet same(should not be partial shipment and invoice) in both posted shipment and posted invoice header?
  • gonzy1981gonzy1981 Member Posts: 156
    I see what you mean, but in my case "Order No." is empty because my client is using the funcionality in the invoices of "Get Shipment Lines". And when we do of that way "Order No." isn't filled up.

    Please more advices #-o #-o #-o #-o
  • vijay_gvijay_g Member Posts: 884
    Check "Shipment no." and "Shipment line no." fields in invoice line.
  • gonzy1981gonzy1981 Member Posts: 156
    Yeahhh, that's it!!!! =D> =D> =D>
  • gonzy1981gonzy1981 Member Posts: 156
    I did it in the Sales, but not in the purchases, do you know, why in the "Purch. Inv Lines" there aren't those two fields???
    I can't get the Posted Purchase Receipt from the Posted purchase invoice, when i'm posting g/l account.
    ](*,) ](*,) ](*,) ](*,)
  • dansdans Member Posts: 148
    gonzy1981 wrote:
    I did it in the Sales, but not in the purchases, do you know, why in the "Purch. Inv Lines" there aren't those two fields???
    I can't get the Posted Purchase Receipt from the Posted purchase invoice, when i'm posting g/l account.
    ](*,) ](*,) ](*,) ](*,)

    Because the relation between Receipt and Invoice is not one to one (in case of partial). Usually Order No. (or additional field) is used to link them both.
    Microsoft Certified IT Professional for Microsoft Dynamics NAV

    Just a happy frood who knows where his towel is
  • lavanyaballurgilavanyaballurgi Member Posts: 235
    May be you can use this "Receipt Document No." field in Posted purchase invoices lines...
  • gonzy1981gonzy1981 Member Posts: 156
    I think it'll be the best to create two new fields in the posted invoice lines: "Receipt No." and "Receipt Line No.".

    And in the codeunit 90 in the transferfields, these fields automatically will be fill up, if i use the same numeration for this new fields than in the "Purchase line", because these two fields exist in the "Purchase line".

    \:D/ \:D/ \:D/
  • vijay_gvijay_g Member Posts: 884
    I wonder that why MS has not created these two fields in posted invoice line. even when we do get receipt line while creating invoice the invoice line contain value for both field.
Sign In or Register to comment.