locked
Many Sales Order but one Invoice!!!! RRS feed

  • Question

  • We have a scenario where multiple  Sale Order but one Invoice to be generated.

    Can you suggest a good approach?

     Option 1.

    1.       Remove 1 to 1 relation between Order and Invoice

    2.       Add 1 to Many relation between Invoice and Order

    Disadvantage is  programmatically Invoice Product has to be populated from Order Product.

    Option 2.

    Provisioning a field in Sales Order that can hold a unique no across all the orders to group them together, even though each order would have its own invoice.

    With the Unique no being generate a group Invoice report can be produced.


    Hari Prabhu
    Thursday, August 4, 2011 10:03 PM

Answers

  • I will go with the first one. It is much more cleaner. Do not delete the inbuilt relationship, It may stuff something else up. I m sure that the system relationship and you cannot delete that anyway.

    1.  Create a new one to many relationship. Hide the button "Create Invoice" order entity

    2.  Create a plugin on post update event of an order and create the invoice products based on the order products.

     

     


    Amreek singh Senior CRM Consultant CDC Praxa Sydney,Australia http://mscrmshop.blogspot.com/
    • Marked as answer by Hari Prabhu Friday, August 5, 2011 6:38 AM
    Thursday, August 4, 2011 11:55 PM
  • I don't think you'll be able to remove the out-of-box relationship between Order and Invoice, but you could probably conceal (with a lot of scripting) it in favor of a custom 1:N relationship from Invoice to Order.  That would probably be the best bet for your scenario.  However, you should consider what to do with Order Products from multiple Orders that identify identical Products--should they be rolled up and summed, or appear as distinct lines?  Also, be careful of the Price List association of the Invoice--you won't be able to sanely map Orders with different Price Lists into the same Invoice record.  To accomplish that, I suggest a variation of your second option:

    If I had your requirement, I'd think about using a custom "Invoice Batch" entity that maintains a 1:N relationship to Invoices, from which you could run a report that jackhammers together all the necessary information from the individual Invoices.  It'd be a lot easier to manage than a uniform order number for grouping.


    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com Please follow the forum guidelines when inquiring of the dedicated CRM community for assistance.
    • Marked as answer by Hari Prabhu Friday, August 5, 2011 6:38 AM
    Thursday, August 4, 2011 11:55 PM
    Moderator

All replies

  • I will go with the first one. It is much more cleaner. Do not delete the inbuilt relationship, It may stuff something else up. I m sure that the system relationship and you cannot delete that anyway.

    1.  Create a new one to many relationship. Hide the button "Create Invoice" order entity

    2.  Create a plugin on post update event of an order and create the invoice products based on the order products.

     

     


    Amreek singh Senior CRM Consultant CDC Praxa Sydney,Australia http://mscrmshop.blogspot.com/
    • Marked as answer by Hari Prabhu Friday, August 5, 2011 6:38 AM
    Thursday, August 4, 2011 11:55 PM
  • I don't think you'll be able to remove the out-of-box relationship between Order and Invoice, but you could probably conceal (with a lot of scripting) it in favor of a custom 1:N relationship from Invoice to Order.  That would probably be the best bet for your scenario.  However, you should consider what to do with Order Products from multiple Orders that identify identical Products--should they be rolled up and summed, or appear as distinct lines?  Also, be careful of the Price List association of the Invoice--you won't be able to sanely map Orders with different Price Lists into the same Invoice record.  To accomplish that, I suggest a variation of your second option:

    If I had your requirement, I'd think about using a custom "Invoice Batch" entity that maintains a 1:N relationship to Invoices, from which you could run a report that jackhammers together all the necessary information from the individual Invoices.  It'd be a lot easier to manage than a uniform order number for grouping.


    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com Please follow the forum guidelines when inquiring of the dedicated CRM community for assistance.
    • Marked as answer by Hari Prabhu Friday, August 5, 2011 6:38 AM
    Thursday, August 4, 2011 11:55 PM
    Moderator