Report problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • peterberlin
    Active Community Member
    • Mar 2015
    • 1004

    Report problem

    Hi,
    For reports that access "Event" modules, you can evaluate the duration. You can not sum the duration.
    peter
  • yuri
    Member
    • Mar 2014
    • 8501

    #2
    Hi Peter,

    In entityDefs of your entity (in custom dir) you need to append to duration field definition:

    PHP Code:
    ,
                "select": "TIMESTAMPDIFF(SECOND, date_start, date_end)",
                "orderBy": "duration {direction}" 
    
    It will look like
    PHP Code:
            "duration": {
                "type": "duration",
                "start": "dateStart",
                "end": "dateEnd",
                "options": [900, 1800, 3600, 7200, 10800, 86400],
                "default": 3600,
                "notStorable": true,
                "select": "TIMESTAMPDIFF(SECOND, date_start, date_end)",
                "orderBy": "duration {direction}"
            }, 
    
    In the next advanced pack release it will work. But duration sum will be displayed in seconds
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • peterberlin
      Active Community Member
      • Mar 2015
      • 1004

      #3
      Thank you very much

      Comment

      Working...