<<

members/statistics.pl

  Generate statistic issues for a member

FUNCTIONS

add_actual_state

  Add a 'count_actual_state' key in all hashes
  count_actual_state = count_precedent_state - count_total_issues_returned_today + count_total_issues_today

build_array

  Build a new array containing values of hashes.
  It used by template whitch display silly values.
  ex:
    $array = [
      {
        'count_total_issues_returned_today' => 1,
        'ccode' => 'ccode',
        'count_actual_state' => 1,
        'count_precedent_state' => 1,
        'homebranch' => 'homebranch',
        'count_total_issues_today' => 1,
        'itype' => 'itype'
      }
    ];
  and returns:
    [
      [
        'homebranch',
        'itype',
        'ccode',
        1,
        1,
        1,
        1
      ]
    ];

merge

  Merge hashes with the same statistic column names into one
  param: array, a arrayref of arrayrefs
  ex:
  @array = (
     {
       'ccode' => 'ccode',
       'count_precedent_state' => '1',
       'homebranch' => 'homebranch',
       'itype' => 'itype'
     },
     {
       'count_total_issues_returned_today' => '1',
       'ccode' => 'ccode',
       'homebranch' => 'homebranch',
       'itype' => 'itype'
     }
   );
   and returns:
   [
     {
       'count_total_issues_returned_today' => '1',
       'ccode' => 'ccode',
       'count_precedent_state' => '1',
       'homebranch' => 'homebranch',
       'itype' => 'itype'
     }
   ];

<<