<?php
namespace App\Amadeus\FileParser; class Line_KTR extends \App\Amadeus\FileParser\LineAbstract { protected $structure = [ ['name'=> 'MSGTAG', 'val' => 'KTR-', 'type' => 'AN', 'req' => 'M', 'len' => 4,], ['name' => 'TAXFLD', 'type' =>'composite', 'rep'=> 198, 'childs' => [ ['name'=> 'TRCURR', 'type' => 'S:trim', 'len' => 3,], ['name'=> 'TAXA', 'type' => 'S:trim', 'len' => 9,], ['name'=> 'TAXC', 'type' => 'S:trim', 'len' => 3,], ['name'=> 'TAXN', 'type' => 'S:trim', 'len' => 2,], ['name'=> 'TIND', 'val'=>'T', 'type' => 'S:trim', 'len' => 2,], ['name'=> 'TAXNAME', 'type' => 'S:trim', 'len_min' => 1, 'len_max' => 25,], ['name'=> 'DELIM', 'val' => ';', 'type' => 'AN', 'len' => 1,], ]], ['name'=> 'TSCURR', 'type' => 'S:trim', 'len' => 3,], ['name'=> 'TAXSUM', 'type' => 'S:trim', 'len' => 9,], ]; 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']); } } } 