codym Posted June 14, 2020 Author Report Share Posted June 14, 2020 On 6/11/2020 at 7:36 PM, Jono said: try ServiceChanges::getItems(). I know it's deprecated but I believe it will get the results you want in a way that can be sent to node. I see why ServiceChanges::getItems() endpoint was deprecated... it sucks. I can't really use it at all to calculate the prorated charges for a service change and create an invoice unless I write a bunch of regex to match descriptions for each possible configurable option. I'm not sure why this endpoint doesn't return actual line items with corresponding config options, must have been in use to have service changes in a pretty format for Blesta invoices huh? Quote Link to comment Share on other sites More sharing options...
Jono Posted June 15, 2020 Report Share Posted June 15, 2020 The other option here is to make a custom edit to your Blesta installation. Something like ServiceChanges::getLineItems() that makes the line items, similar to the controller method AdminClients::makeLineItems()? This seems to be a total pain so I'm thinking about how we can make this work better for API user in the future. Quote Link to comment Share on other sites More sharing options...
codym Posted June 15, 2020 Author Report Share Posted June 15, 2020 I don't see a custom edit to the Blesta installation happening. Too much of a headache... especially when we upgrade in the future. 18 hours ago, Jono said: This seems to be a total pain so I'm thinking about how we can make this work better for API user in the future. You're totally right. The easiest way on dev side would be to fix the encoding on ServiceChanges::getPresenter(), since that should return everything needed so that I can manually create an invoice for a service upgrade/downgrade. The easiest thing for the customer (me) would be for Services::edit() to automatically create a prorated invoice for the change. However, you said previously that is a purposeful design consideration. Possibly for admin functions? I'm not sure. If that's the case, then having an endpoint we can hit that returns the prorated differences according to line item (in JSON encoding) would be the most helpful. In that case, I could easily create a manual invoice from that using the Invoices::add() endpoint. However, (as I haven't gotten this far in testing yet) I'm not sure if the subsequent recurring invoice (1 month after the edit) would include the service update (assuming the Services::edit() function is used to change the service). Again, that would all require testing and I'm not quite as experienced with this system as you. Quote Link to comment Share on other sites More sharing options...
coreyman Posted August 10, 2020 Report Share Posted August 10, 2020 On 6/15/2020 at 10:26 AM, Jono said: The other option here is to make a custom edit to your Blesta installation. Something like ServiceChanges::getLineItems() that makes the line items, similar to the controller method AdminClients::makeLineItems()? This seems to be a total pain so I'm thinking about how we can make this work better for API user in the future. Have there been any changes to this in the latest version of Blesta? Quote Link to comment Share on other sites More sharing options...
Jono Posted August 11, 2020 Report Share Posted August 11, 2020 Unfortunately not. Our current priority is on the affiliate system (released in 4.11) and the domain manager (TBD) so some of the dev stuff is taking a bit of a back seat for now though I'd like to make a lot of dev improvements soon. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.