<?php
namespace App\Galileo\StructureParser\Structures\Car;

class Documents extends \App\Galileo\StructureParser\Structures\Base\Documents
{
	protected function _getData()
	{
		list($parsedStructure, $transactionType, $transactionIndexes) = $this->getTransactionDetails();

		$item = new \App\Galileo\StructureParser\Types\Document();

		$A16 = $parsedStructure['A168'][0];

		$item->docType =	$A16['A168']['A16STA_'];
		$item->docDate =	$parsedStructure['header']['line2']['T50PNR'];

		$item->docNumber = 	$A16['A168CF']['A16CFD'];
		$item->transactionCode = $this->populateTransactionCode($parsedStructure, [$transactionIndexes['k02'], ], [$A16['A168']['A16NUM'], ]);

		$this->populate($item, $parsedStructure, $transactionType, $transactionIndexes);

		return $item;
	}
}
