Jump to content

gutterboy

Members
  • Posts

    284
  • Joined

  • Last visited

Everything posted by gutterboy

  1. Hello, I'm attempting to edit users via the API and the source docs seem to be lacking a little in this area compared to the create user, so not sure if I have done something wrong...... but I'm basically doing this: if (empty($user_data['country_iso'])) { // We can't pass in a state without a country, so make the state code empty as well $user_data['state_iso'] = ''; } $data = array ( 'client_id' => $user_data['blesta_id'], 'vars' => array ( 'company' => $user_data['tax_company_name'], 'first_name' => $user_data['first_name'], 'last_name' => $user_data['last_name'], 'address1' => $user_data['address'], 'city' => $user_data['city'], 'zip' => $user_data['zip_code'], 'email' => $user_data['email'], 'numbers' => array ( 0 => array ( 'number' => $user_data['phone'] ) ) ) ); if (!empty($user_data['country_iso'])) { // Add country $data['vars']['country'] = $user_data['country_iso']; } if (!empty($user_data['state_iso'])) { // Add country $data['vars']['state'] = $user_data['state_iso']; } $this->api->put("clients", "edit", $data); $this->api points to the Blesta SDK. This is the error output I get back: object(stdClass)[9] public 'error' => object(stdClass)[10] public 'message' => string 'An unexpected error occured.' (length=28) public 'response' => string 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `id` = '16'' at line 1' (length=219) Am I passing in the data wrong or doing something incorrectly? Is there a way I can make Blesta output the query it is trying to run? Thanks!
  2. I tried that and added a: return; but all it did was remove the paypal button on the payment page.
  3. Just got around to doing this - where do I put that code exactly?
  4. I need to get the users total overdue amount - is there a quick way to do this via the API or do I need to use something like the getAll method and do my own calculations? Thanks!
  5. Nothing to see here. Moving along....... seems to have fixed itself now.
  6. Ok, support updated my details and I changed my root web dir under Settings -> System -> General. The site works on the new location and the top links (My Info / Settings / Logout + all the pages within settings link to the correct place; however the links in the NAV BAR (Home / Clients / Billing etc) all still link to the OLD directory?
  7. Ok, no worries. Thanks for the response.
  8. I'm wanting to get their most overdue invoice, don't care about any other invoices, just their most overdue one (cause basically I'm just trying to find out if they have ANY invoices overdue by 'x' amount of time). Currently I am getting this data by doing something like this: $vars = array('client_id' => $blesta_id, 'status' => 'past_due', 'page' => 1, 'order_by' => array('date_due' => 'ASC')); $response = $this->api->get('invoices', 'getList', $vars); if ($response->response()) { // This will be an array of invoices $invoices = $response->response(); // Get timestamp of the invoice that is most overdue - dates are stored in the database as UTC $most_overdue_date = strtotime($invoices[0]->date_due . " UTC"); /* Now check to see if their most overdue invoice is >= to the days passed in */ // Set date to check for.. $date_check = strtotime("-" . $days . " Days"); if ($most_overdue_date <= $date_check) { } } Is there a better method to use other than "getList" - just seems unnecessary to get a whole page of invoices when I only need one. FTR: $this->api points to the Blesta SDK.
  9. I just noticed that the dates that are being stored in the database differ slightly to those I select in admin. For example I have a date due of "2014-08-03" within admin, but in the database it shows as "2014-08-02 14:00:00". Something going wrong with the timezone settings somewhere?
  10. No worries. Haven't renamed it yet, just checking what to do before I rename it. But I have replied to my old ticket to get it sorted, so all good.
  11. Check my post just above yours; I clarified it a bit more.
  12. Reading the ticket again it may be because I have a LOCAL install and a TEST server install; basically it will clear any custom set locations.
  13. Pretty sure I was told in a ticket not to do that for dev licenses.
  14. I want to change the install path on my installation on my local environment but I'm not sure what all the procedures are for this? Other than changing the name of the directory itself, what else needs to be changed? Thanks!
  15. Thanks. I might do it a bit different as I am using the SDK. But I'm good now as I know the correct method to use. Cheers!
  16. Probably not, that's why I I used the WHERE filter.
  17. It is, but I've already been through all the settings and don't wanna do it again. Looked at the database and this seems like it would do the trick: UPDATE `emails` SET `from`='myemail@mydomain.com' WHERE `from`='myemail@www.mydomain.com' Just not sure if anything else would need to be updated as well?
  18. Damn.... how annoying! I assume it can be done via the database via a SQL query?
  19. What is the easiest way to find out if a certain user (based on their client id) has overdue invoices via the API? Thanks!
  20. Ok, I updated my hostname under Settings -> System -> Companies but the email templates still are showing the old email.
  21. Where in the settings do I find that? Thanks!
  22. Just wondering, why does Blesta show our from address by default as: "billing@www.mydomain.com.au" Shouldn't it strip out the "www." portion?
×
×
  • Create New...