Function tfgGetReportFiles

Generates TFG/UFG "wykaz umΓ³w" JSON files (channel PORTAL) for manual upload in the TFG portal. It selects reservations in scope (contracts concluded from 1 July 2026, not older than 28 months), determines the correct operation (NOWEDANE / KOREKTA / ROZWIAZANIE) for each one, builds the TFG contract objects from the latest R2_LOG_ZMIAN snapshot, groups them by operationType, and writes chunked JSON files (max 1000 contracts per file) to udds/static/tfgReports/. State is persisted in R2_TFG_REPORTS and each call is logged in TFG_REPORTS_HISTORY (TYP=GET_FILES).

ℹ️
Prerequisite

Run reservationLog for the reservations first β€” the report is built from the latest snapshot in R2_LOG_ZMIAN.

Arguments

  • params :
        array (
              [ 'idCompany' ]      = ''          // REQUIRED, branch id (= R2.ID_FIRMY)
              [ 'idReservations' ] = array(...)  // OPTIONAL, narrow scope to given ID_R2
            )
        

Returns

  • status - OK | PARTIAL | FAIL
  • idCompany - the branch id used
  • summary - counters: NOWEDANE / KOREKTA / ROZWIAZANIE / USUNIECIE / POMIN / ERROR
  • files - list of generated files (name, relPath, operationType, correctionReason, liczbaUmow, umowy)
  • warnings - soft warnings (e.g. missing IATAβ†’ICAO mapping)
  • errors - array of error records (code, message)

Example


  require_once ( 'classUddsOx.php' ) ;

  $udds = new classUddsOx ;
  $udds->customerCode = [your_customerCode] ;
  $udds->login = [your_login] ;
  $udds->password = [your_password] ;
  $udds->serverUrl = 'http://api.dlaoperatora.pl/udds/' ;

  $yourParams = array();
  $yourParams [ 'idCompany' ] = '21624' ;
  $ret = $udds->tfgGetReportFiles ( $yourParams ) ;


Returns $ret =
array ( 'status' => 'OK', 'idCompany' => '21624', 'summary' => array ( 'NOWEDANE'=>2, 'KOREKTA'=>1, 'ROZWIAZANIE'=>0, 'USUNIECIE'=>0, 'POMIN'=>3, 'ERROR'=>0 ), 'files' => array ( array ( 'name'=>'tfg_NOWEDANE_20260709_030700_1.json', 'operationType'=>'NOWEDANE', 'liczbaUmow'=>2, ... ) ), 'errors' => array (), )