<?php
namespace App\Amadeus\FileParser; class Line_KRF extends \App\Amadeus\FileParser\LineAbstract { protected $structure = [ ['name'=> 'MSGTAG', 'val' => 'KRF', 'type' => 'AN', 'req' => 'M', 'len' => 3,], ['name'=> 'ISSUE', 'type' => 'AN', 'req' => 'M', 'len' => 1,], ['name'=> 'DELIM', 'val' => ';', 'type' => 'AN', 'req' => 'M', 'len' => 1,], ['name' => 'TAXFLD', 'type' =>'composite', 'rep'=> 198, 'childs' => [ ['name'=> 'OTAXI', 'type' => 'S:trim', 'len' => 1,], ['name'=> 'TCURRAC', 'type' => 'AN', 'len' => 3,], ['name'=> 'TAXA', 'type' => 'S:trim', 'len' => 9,], ['name'=> 'TAXC', 'type' => 'S:trim', 'len' => 3,], ['name'=> 'TAXN', 'type' => 'S:trim', 'len' => 2,], ['name'=> 'DELIM', 'val' => ';', 'type' => 'AN', 'len' => 1,], ]], ]; protected function postParse() { parent::postParse(); if($this->tree['TAXFLD']){ $this->tree['TAXFLD'] = self::rtrimArrDeep($this->tree['TAXFLD'], 2); $this->tree['TAXFLD'] = self::extractTaxNameFromCode($this->tree['TAXFLD']); $this->tree['TAXFLD'] = self::fillTAXA($this->tree['TAXFLD']); $this->computeStats_taxes(); } } } 