{extends file=$smarty.const.SMARTY_LAYOUT_CONTENT_LIST_TABLE_CURRENT_DATA}

{block name="listing-td-content-serviceCode"}
	{if $rowFields['entity']->transactionStatus!='new'}
		{$rowFields['entity']->transactionStatus} ({$rowFields['entity']->serviceCode})
	{else}
		{$rowFields['entity']->serviceCode}
	{/if}
{/block}

{block name="listing-td-content-docNumber"}
	<div>{$rowFields['entity']->transactionData->documents->docNumber}</div>
	<div>{apolloServiceLabel ref=$rowFields['id']}</div>
{/block}

{block name="listing-td-content-passengerName"}
	{nameFormat firstName=$rowFields['entity']->transactionData->passengers->passengers[0]->firstName lastName=$rowFields['entity']->transactionData->passengers->passengers[0]->lastName}
{/block}

{block name="listing-td-content-user"}
	{$rowFields['entity']->transactionData->agent->issuingAgent->idSystemUser}/{$rowFields['entity']->transactionData->agent->issuingAgent->idSystemOffice}
{/block}

{block name="listing-td-content-prices"}
	{function name="printPrice" label="" currency="" amount="" VAT="" total=false highlight=false}
		{if $amount}
			<div class="row {if $total}total{/if}">
				<span class="label">{$label}</span><span class="amount">{$amount|priceFormat:$currency:1}</span><span class="currency">{$currency}</span>
			</div>
		{/if}
	{/function}

	<div class="pricesContainer">
		<div class="row total">
			<span class="label">
				{$lang['index']['listing']['prices']['total']}
				{if $rowFields['entity']->transactionData->price->formOfPayment && $rowFields['entity']->transactionData->price->formOfPayment->getShortNotation()}
					<span class="formOfPayment">({$rowFields['entity']->transactionData->price->formOfPayment->getShortNotation()})</span>
				{/if}
			</span>
			<span class="amount">{($rowFields['entity']->transactionData->price->total)|priceFormat:$rowFields['entity']->transactionData->price->totalCurrency:1}</span>
			<span class="currency">{$rowFields['entity']->transactionData->price->totalCurrency}</span>
		</div>

		{printPrice label=$lang['index']['listing']['prices']['supplier']
			amount=$rowFields['entity']->transactionData->price->supplier
			VAT=$rowFields['entity']->transactionData->price->supplierVAT
			currency=$rowFields['entity']->transactionData->price->supplierCurrency}

		{if $rowFields['entity']->transactionData->price->tax}
			{printPrice label=$lang['index']['listing']['prices']['tax']
				amount=$rowFields['entity']->transactionData->price->tax->getAmount()
				VAT=$rowFields['entity']->transactionData->price->tax->getVAT()
				currency=$rowFields['entity']->transactionData->price->tax->getCurrency()}
		{/if}

		{printPrice label=$lang['index']['listing']['prices']['commission']
			amount=$rowFields['entity']->transactionData->price->commission
			VAT=$rowFields['entity']->transactionData->price->commissionVAT
			currency=$rowFields['entity']->transactionData->price->commissionCurrency}

		{printPrice label=$lang['index']['listing']['prices']['serviceFee']
			amount=$rowFields['entity']->transactionData->price->serviceFee
			VAT=$rowFields['entity']->transactionData->price->serviceFeeVAT
			currency=$rowFields['entity']->transactionData->price->serviceFeeCurrency}

		{printPrice label=$lang['index']['listing']['prices']['penalty']
			amount=$rowFields['entity']->transactionData->price->penalty
			VAT=$rowFields['entity']->transactionData->price->penaltyVAT
			currency=$rowFields['entity']->transactionData->price->penaltyCurrency}

		{printPrice label=$lang['index']['listing']['prices']['discount']
			amount=$rowFields['entity']->transactionData->price->discount
			VAT=$rowFields['entity']->transactionData->price->discountVAT
			currency=$rowFields['entity']->transactionData->price->discountCurrency}
	</div>
{/block}

