Report for Sales Partner Commission

Hi,

I am trying to make a report on commission for a Sales Partner something similar to the Sales Person wise Transaction Summary

The report that I am trying to make is here on this link: https://github.com/adityaduggal/rigpl-erpnext/tree/comm/rigpl_erpnext/rigpl_erpnext/report/transaction_details


Now the problem is that I am trying to give a Select Field where the users could define whether they want the Sales Partner to be based on Transaction or Master, this is the problem where I am unable to find a way to join the tables and get the results based on Master instead of the Transaction.

Let me explain a bit more:

Suppose the Sales Partner is defined in customer master ABC but before that there were few invoices made in that period then the problem comes that it becomes difficult to find the commission since the Sales Invoice would not have the Sales partner and hence the option is there to choose whether to define the sales partner from Customer or Transaction.

Kindly please help me add the report.



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/fac0cf8d-0f00-4340-b786-23c7c3fbbacf%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
Aditya,

Remove that”Based On” filter and instead fetch sales partner and commission from customer if those are not defined in invoice.

I have given some hints in https://gist.github.com/nabinhait/beea6032804bb4282f71, check get_entries() function.

On Aug 7, 2014, at 11:38 AM, Aditya Duggal <ad...@gmail.com> wrote:

Hi,

I am trying to make a report on commission for a Sales Partner something similar to the Sales Person wise Transaction Summary



Now the problem is that I am trying to give a Select Field where the users could define whether they want the Sales Partner to be based on Transaction or Master, this is the problem where I am unable to find a way to join the tables and get the results based on Master instead of the Transaction.

Let me explain a bit more:

Suppose the Sales Partner is defined in customer master ABC but before that there were few invoices made in that period then the problem comes that it becomes difficult to find the commission since the Sales Invoice would not have the Sales partner and hence the option is there to choose whether to define the sales partner from Customer or Transaction.

Kindly please help me add the report.



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/fac0cf8d-0f00-4340-b786-23c7c3fbbacf%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/EA220484-56BE-46EC-8BC2-5B663BA4BE75%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.