-- Group: desktop
-- Name:  crmaccounts
-- Notes: 
-- Copyright (c) 1999-2015 by OpenMFG LLC, d/b/a xTuple.
-- See www.xtuple.com/CPAL for the full text of the software license.

SELECT 
  crmacct_id AS id, crmacct_number, crmacct_name,
  cntct.*, addr.*
FROM crmacct 
  LEFT OUTER JOIN cntct ON (crmacct_cntct_id_1=cntct_id) 
  LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) 
WHERE (crmacct_owner_username=getEffectiveXtUser())
ORDER BY crmacct_number;
