Posting sales invoice

RitzVRitzV Member Posts: 13
Which function post sales invoice in code unit 80 when we create sales order and post it with ship and invoice

Answers

  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    OnRun trigger.
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • RitzVRitzV Member Posts: 13
    So if I will restrict that trigger,that means it will not post sales invoice.if I want to create sales invoice just
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    Yes, the Sales Header record has 2 flags fields "Invoice" and "Ship", they are telling Cu80 what to post.
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • David_SingletonDavid_Singleton Member Posts: 5,479
    RitzV wrote: »
    So if I will restrict that trigger,that means it will not post sales invoice.if I want to create sales invoice just

    Do you mean that you want to Create a Posted Sales Invoice document without posting to the Ledgers?
    David Singleton
  • RitzVRitzV Member Posts: 13
    No , I mean that I only want to create Sales invoice not posted sales invoice when we select post in RTC.I want that it just create a sales invoice but doesn't post it.what should I do for that?
  • JuhlJuhl Member Posts: 724
    Sounds like a strange request.
    Whats the use case?

    Do you just need to print an invoice?
    Follow me on my blog juhl.blog
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    edited 2018-01-19
    You create a Sales Invoice by keying in values on a Sales Invoice page, or programmatically by filling in relevant/required fields in Sales Header / Sales Lines records, field by field, and inserting records when all required fields are populated.

    You create Posted Sales invoices by posting Sales Invoice. Codeunit 80 will post the Sales Invoice, creating relevant ledger entries and creating Posted Sales Invoice and/or Posted Sales Shipment.

    You cannot have a Posted Sales Invoice created in the system without actually posting the Sales Invoice.

    If you need such a document as "Posted Sales Invoice" without actually posting anything you have to code that all by yourself. System does not expose any functions which excplicitly create Posted Sales Invoice from a Sales Invoice - this operation is embedded in the posting code.
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • David_SingletonDavid_Singleton Member Posts: 5,479
    RitzV wrote: »
    Which function post sales invoice in code unit 80 when we create sales order and post it with ship and invoice

    I think you need to start all over and explain what you want. It seems you are coming from a different system and using terminology from that product and trying to do the same in Navision but using the wrong terminology. That means that no one really has a clue what you are trying to do.

    So start from the start.

    - Are you the partner just trying to do what the customer wants? Or are you the one that made the request?
    - If you are the customer, then what are you trying to achieve? What is the final outcome that you need?
    - - If you are the partner, then get on the phone call the customer and find out what they want.
    David Singleton
  • RitzVRitzV Member Posts: 13
    Hello experts.....Actually this comes as a requirement to me.yes I am just trying to do what a customer wants.
    Requirement is that...."With a single click on post shipment(while posting sales order)the Sales invoice automatically gets created.
    Just a simple sales invoice gets created not posted sales invoice.

    So I am going with the approach that I will restrict the function that is posting sales invoice so that it stops at the 'creation of sales invoice'.
    But not able to achieve that,plz suggest something..
    Thanks
  • RitzVRitzV Member Posts: 13
    It's use will be like that if someone wants to change something in invoice(may be costs),they will change it in sales invoice and then from there they will post the invoice.
  • JuhlJuhl Member Posts: 724
    Sounds like an order confirmation....
    Follow me on my blog juhl.blog
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    In NAV you do not have to have a separate Sales Invoice document in order to post and invoice for shipped goods. You noramlly do that from Sales Order

    Sales Order ->(post shipment) -> Posted Sales Shipment
    Sales Order - >(post invoice) -> Posted Sales Invoice

    You get two separate documents from one Sales Order.

    But if you want to have a separate Sales Invoice document you can have it. You can do this by creating an empty Sales Invoice document, populating Customer No, then in lines use function Copy Shipment Lines - this will show you a page where you will be able to select your posted shipment.

    Knowing how to do this from UI you can trace thge code in debugger to learn how to code it.

    Personally I'd question the customer why this is neccessary, what problem does they try to solve, explain the existing solutions in NAV, rather than trying to code what they asked for. Once you have full understanding of the actual problem you can propose a solution.



    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
  • David_SingletonDavid_Singleton Member Posts: 5,479
    RitzV wrote: »
    Hello experts.....Actually this comes as a requirement to me.yes I am just trying to do what a customer wants.
    Requirement is that...."With a single click on post shipment(while posting sales order)the Sales invoice automatically gets created.
    Just a simple sales invoice gets created not posted sales invoice.

    So I am going with the approach that I will restrict the function that is posting sales invoice so that it stops at the 'creation of sales invoice'.
    But not able to achieve that,plz suggest something..
    Thanks

    It looks like the customer has some concept in their head but doesn't know how to put it in Navision terminology.

    This is the point where you get the functional consultant to sit with the client and write out a proper spec.

    Keep in mind that the customer is not always right, so it is the job of the functional consultant to tell the customer they are wrong and show them the correct way to fulfill the requirement.
    David Singleton
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Juhl wrote: »
    Sounds like an order confirmation....

    or a proforma invoice.

    Or something else, but it is most definitely NOT an invoice.
    David Singleton
  • RitzVRitzV Member Posts: 13
    Actually it's like they want to just have a sales invoice created while posting shipment so that they can modify the sales invoice and then post it.
    As when we post shipment,the data flows to posted sales shipments.
    Similarly,i want when we post shipment data also flows to sales invoice.(where sales invoice gets created).so that we can post invoice from sales invoice page
  • JuhlJuhl Member Posts: 724
    Then print a shipment with caption set to Invoice, and show prices.
    Follow me on my blog juhl.blog
  • RitzVRitzV Member Posts: 13
    Will you please elaborate
  • JuhlJuhl Member Posts: 724
    Make a copy of shipment report, and give it some makeup to make it look like a invoice, but run it of the posted shipment.
    Or the same with order confirmation to make it run on table 36 and 37.
    Follow me on my blog juhl.blog
  • David_SingletonDavid_Singleton Member Posts: 5,479
    RitzV wrote: »
    Actually it's like they want to just have a sales invoice created while posting shipment so that they can modify the sales invoice and then post it.
    As when we post shipment,the data flows to posted sales shipments.
    Similarly,i want when we post shipment data also flows to sales invoice.(where sales invoice gets created).so that we can post invoice from sales invoice page

    This is EXACTLY how standard Navision works. The only thing that seems different is that the customer is obsessed with using the word INVOICE instead of ORDER.

    You need to contact the Functional consultant and get them to discuss this with the client and have them understand how Navision world. If you don't do this, then eventually you will just rewrite their previous system in Navision.

    When this happens prepare to hear very often the statement "But our old system did that and you told me Navision was better, so this should be FREE".
    David Singleton
Sign In or Register to comment.