<?php
namespace App\Amadeus\FileParser; class Line_KFT extends \App\Amadeus\FileParser\LineAbstract { protected $structure = [ ['name'=> 'MSGTAG', 'val' => 'KFT', '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_min' =>1, 'rep_max' =>198, 'childs' => [ ['name'=> 'OTAXI', 'type' => 'S:trim', 'len' => 1,], ['name'=> 'TCURR', 'type' => 'AN', 'len' => 3,], ['name'=> 'TAXA', 'type' => 'S:trim', 'len' => 9,], ['name'=> 'TAXC', 'type' => 'S:trim', 'requires' => ['TAXA'], 'len' => 3,], ['name'=> 'TAXN', 'type' => 'AN', 'requires' => ['TAXC'], 'len' => 2,], ['name'=> 'DELIM', 'val' => ';', 'type' => 'AN', 'req' => 'M', 'len' => 1,], ]], ]; protected function postParse() { parent::postParse(); if($this->tree['TAXFLD']){ $this->tree['TAXFLD'] = self::rtrimArrDeep($this->tree['TAXFLD']); $this->tree['TAXFLD'] = self::extractTaxNameFromCode($this->tree['TAXFLD']); $this->tree['TAXFLD'] = self::fillTAXA($this->tree['TAXFLD']); $this->computeStats_taxes(); } } } 