ivylabs / suitecrm-analytics

4 stars 4 forks source link

Service Line Items - Service Lines do not display Quantity / Discount on the "Agent Sales" or "Periodic Agent Country Sales" Reports #299

Closed johnM2401 closed 3 years ago

johnM2401 commented 3 years ago

Hi, I'm not 100% sure if this would be more suited for the Data Integration board. Please let me know if so, I'll move this over there.


Describe the bug When Service Line Items are used on an Invoice in the CRM, the Quantity/Discount values are not detailed on either of the above reports.

See screenshots for examples

Component What component does this bug relate to?

  1. Report - Agent Sales Report & Periodic Agent Country Sales report

Solution File PeriodicAgentCountrySales.prpt & AgentSalesReport.prpt


To Reproduce Steps to reproduce the behavior:

  1. Create an Invoice in the CRM, and add some Service Lines.

  2. On these Service Lines, add a Discount

  3. Pull this to the CRM with the ./run script

  4. View the "Agent Sales" report, and filter down to view this Invoice.

  5. See that the Service Line Item shows a Quantity of 0, a Discount of 0. However, the "Total Revenue" still calculates correctly.

  6. (See Screenshot 2 for an example)

  7. View the Periodic Agent Country Sales Report, and filter down to see this invoice.

  8. See that neither the "Quantity Sold" nor the "Total Discount" columns appear to take the Service Line Items into consideration

  9. However, see that the "Total Revenue" column DOES include Service Line Items, which may mislead some users.

  10. (See screenshot 3)

Expected behavior The Quantity value will indicate how many Service Lines are on the Invoice, (if possible) The Discount value will be pulled into Analytics for more accurate reporting.


Screenshots

Invoice Created: image

However, Agent Sales Report shows as: image

And Periodic Agent Country Sales shows as: image


Desktop (please complete the following information):

harrisward commented 3 years ago

@johnM2401 This looks like a data issue. In the source system if we have a Service Line then no quantity is set so we pull through 0. It sounds like what we might di is set the quantity to 1 to represent one service line sold. With this value we would multiply the quantity by discount which would then also return the discount value.

Can we confirm that we should set adhoc service line items in out data warehouse to a default quantity of 1?

johnM2401 commented 3 years ago

Hey @harrisward

Having a Quantity of 1 makes sense to me.

I don't believe Service Lines have a Quantity value in the CRM, so defaulting to a Quantity of 1 per line for calculation purposes sounds like the best way forward.

harrisward commented 3 years ago

@johnM2401 Agreed. I will raise a ticket in SuiteCRM Data Integration as its an ETL issue and refer to this one which I will close.

The ticket in SuiteCRM Data Integration is https://github.com/ivylabs/suitecrm-data-integration/issues/176