-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better expected sales calculation #33
Conversation
This only makes a difference for server add-ons. |
Thank you @rachetfoot I will have a detailed look during this weekend |
Expected amount of sales is different for my vendor (Cloud Add-Ons only). Could you please explain the logic of "guessing"? In my current version it simply takes the last sale by a license (either monthly or annually) and projects it to the current month. For example, in this month there are 5 expiring licenses: 4 monthly subscriptions and 1 annual. The logic takes last sales of those licenses (4 monthly + 1 annual). How does it work exactly in the proposed solution? |
Well, I haven't properly handled the case of annual cloud licenses (I don't The proposed solution is unified for cloud and server versions, expect for The reason for guessing is that only about 1% of my server users renew On Sun, Mar 20, 2016 at 7:50 PM Vitaliy Zurian notifications@github.com
|
I made a few updates and tested it for the past few months. The estimates looked fairly good. Let me know if it fixed the discrepancy you saw. I also don't know whether the distribution parameters and renewal rate I selected are suitable for all vendors. They could potentially be a input parameter instead of constants. |
@rachetfoot I am waiting until this issue is resolved: Then I could test it properly. At this moment, I cannot rely on the AMKT data I will merge it once I am able to get "clean" results. So far even my local version is different from what I have in production |
I guess you have sales with a null maintenance end date. Is that expected? On Sat, Apr 2, 2016 at 10:41 AM Vitaliy Zurian notifications@github.com
|
$total = 0; | ||
foreach ($licenses as $license) { | ||
$lastSales = $this->getEntityManager()->getRepository('AppBundle:Sale')->findLastSalesByLicenses(array($license)); | ||
$lastSale = reset($lastSales); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When $lastSales
is empty array, reset()
returns false.
The login then fails later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I've fixed it now.
Hey @rachetfoot I've checked the forecast today (first day of the month). I definitely like the latter :D But it seems that there is a problem somewhere I have only cloud Add-Ons |
$userCnt = $lastSale['licenseSize']; | ||
if ($lastSale['maintenanceEndDate']->diff($lastSale['maintenanceStartDate'])->days < 45) { | ||
$renewalLength = 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing that the wrong estimate you see is due to reading the wrong renewalLength here. My php installation is messed up at the moment, so I can't look at this now, but this is where I think you should look if you have time.
Outdated |
This solves #4