Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help with report sql
#4
in payments I have tree user fields

created by
related user
assigned to

I do a link with modules, but user in modules not returned right

this command appears  something wrong, field at cbemployees return null
SELECT vtiger_cobropago.reference, vtiger_cobropago.cyp_no, vtiger_cobropago.amount, vtiger_cobropago.cost, vtiger_cobropago.benefit, vtiger_cobropago.paid, vtiger_crmentity.smownerid, vtiger_cbemployeeparent_id.userid as cbemployeeuserid, vtiger_cobropago.comercialid, vtiger_crmentity.smcreatorid, vtiger_cbemployeeparent_id.nombre as cbemployeenombre, vtiger_crmentityparent_id.smownerid as smownercbemployee, vtiger_cobropago.cobropagoid FROM vtiger_cobropago INNER JOIN vtiger_crmentity ON vtiger_cobropago.cobropagoid = vtiger_crmentity.crmid LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid = vtiger_users.id LEFT JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid LEFT JOIN vtiger_users AS vtiger_usersreports_to_id ON vtiger_cobropago.comercialid = vtiger_usersreports_to_id.id LEFT JOIN vtiger_groups AS vtiger_groupsreports_to_id ON vtiger_cobropago.comercialid = vtiger_groupsreports_to_id.groupid LEFT JOIN vtiger_users AS vtiger_userscreated_user_id ON vtiger_crmentity.smcreatorid = vtiger_userscreated_user_id.id LEFT JOIN vtiger_groups AS vtiger_groupscreated_user_id ON vtiger_crmentity.smcreatorid = vtiger_groupscreated_user_id.groupid LEFT JOIN vtiger_cbemployee AS vtiger_cbemployeeparent_id ON vtiger_cbemployeeparent_id.cbemployeeid=vtiger_cobropago.parent_id LEFT JOIN vtiger_crmentity AS vtiger_crmentityparent_id ON vtiger_crmentityparent_id.crmid=vtiger_cobropago.parent_id WHERE vtiger_crmentity.deleted=0 AND vtiger_cobropago.cobropagoid > 0 ORDER BY CONCAT(vtiger_usersreports_to_id.first_name,' ',vtiger_usersreports_to_id.last_name) ASC


Attached Files Image(s)
       
Ranieri
eCRM Web
Reply


Messages In This Thread
help with report sql - rslemer - 01-29-2020, 09:44 PM
RE: help with report sql - joebordes - 01-29-2020, 10:15 PM
RE: help with report sql - rslemer - 01-29-2020, 10:35 PM
RE: help with report sql - rslemer - 01-30-2020, 12:22 AM
RE: help with report sql - joebordes - 01-30-2020, 08:56 AM
RE: help with report sql - rslemer - 01-30-2020, 03:08 PM
RE: help with report sql - joebordes - 01-31-2020, 12:30 AM
RE: help with report sql - rslemer - 01-31-2020, 11:53 AM
RE: help with report sql - joebordes - 01-31-2020, 12:07 PM
RE: help with report sql - rslemer - 01-31-2020, 12:19 PM
RE: help with report sql - joebordes - 02-02-2020, 10:46 PM
RE: help with report sql - rslemer - 02-03-2020, 11:49 AM
RE: help with report sql - rslemer - 03-03-2020, 12:57 AM
RE: help with report sql - joebordes - 03-03-2020, 05:44 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)