{extends file=$smarty.const.SMARTY_LAYOUT_CONTENT_LIST_TABLE_CURRENT_DATA}

{block name=preRender}
	{function compareCurrency status=[] serv=null BSP=null}
		<div class='currency source-serv {if $serv}value-set{else}value-notSet{/if} {if $serv===$BSP}value-equal{else}value-diff{/if}'>{$serv|default:'-'}</div>
		<div class='currency source-BSP {if $BSP}value-set{else}value-notSet{/if} {if $serv===$BSP}value-equal{else}value-diff{/if}'>{$BSP|default:'-'}</div>
	{/function}

	{function displayPrice source='' isPriceEqual=false price=null extraCssClass=""}
		{if $price===null}
			<div class='value value-notSet source-{$source} {if $isPriceEqual!==null}{if $isPriceEqual}value-equal{else}value-diff{/if}{/if} {$extraCssClass}'>-</div>
		{else}
			<div class='value value-set source-{$source} {if $isPriceEqual!==null}{if $isPriceEqual}value-equal{else}value-diff{/if}{/if} {$extraCssClass}'>{$price|priceFormat}</div>
		{/if}
	{/function}

	{function comparePriceStructured isPriceEqual=false serv=null BSP=null extraCssClass=""}
		{if $isPriceEqual && ($serv==0.0 || $BSP==0.0)}
			{$serv=null}
			{$BSP=null}
		{/if}
		{call name='displayPrice' price=$serv source='serv' isPriceEqual=$isPriceEqual extraCssClass=$extraCssClass}
		{call name='displayPrice' price=$BSP source='BSP' isPriceEqual=$isPriceEqual extraCssClass=$extraCssClass}
	{/function}

	{function displayGeneralValue source='' value=null extraCssClass=""}
		{if $value===null}
			<div class='value-notSet source-{$source} {$extraCssClass}'>-</div>
		{elseif $value===true}
			<div class='value-set source-{$source} {$extraCssClass}'>yes</div>
		{elseif $value===false}
			<div class='value-set source-{$source} {$extraCssClass}'>no</div>
		{elseif is_float($value) || is_int($value)}
			{call name='displayPrice' price=$value source=$source isPriceEqual=null extraCssClass=$extraCssClass}
		{else}
			<div class='value-set source-{$source} {$extraCssClass}'>{$value}</div>
		{/if}
	{/function}
{/block}



{block name="listing-tr-class"}
	balanceStatus-{$rowFields['status'][0]|replace:":":"_"}
{/block}


{block name="listing-td-content-balanceStatus"}
	{$s=""}
	{foreach $rowFields['status'] as $status}
		{$bstatus="balanceStatus_{$status}"}
		{$s} {$lang['index']['listingColumns'][$bstatus]|default:$status}
		{$s="<br/>"}
	{/foreach}

	{if $rowFields['operationalStatus']}
		<div style="color: #888; margin-top: 1em;">
			{$opstatus="operationalStatus_{$rowFields['operationalStatus']}"}
			{$lang['index']['listingTable'][$opstatus]}

			<br/>
			{userLabel ref=$rowFields['operationalUser']}

			<br/>
			{$rowFields['operationalDateTime']}
		</div>
	{/if}
{/block}

{block name="listing-td-content-ticketNumber"}
	<div>
		{$rowFields['comparison']->supplierCode3->getAny()}-{$rowFields['ticketNumber']}
		{if $rowFields['isRefund']}
			<span class="isRefund">({$lang['index']['listingTable']['isRefund']})</span>
		{/if}
		{if $rowFields['isVoid']}
			<span class="isVoid">({$lang['index']['listingTable']['isVoid']})</span>
		{/if}
		{if $rowFields['isAdm']}
			<span class="isAdm">({$lang['index']['listingTable']['isAdm']})</span>
		{/if}
	</div>
	<div>
		{if $rowFields['importedService']->recordExists()}
			<div>
				{$lang['index']['listingTable']['importedService']}: {importedServiceLabel ref=$rowFields['importedService']->getId()},
				{$_LANG['importedService']['systemStatusName'][$rowFields['importedService']->systemStatus]}
			</div>
			{if $rowFields['importedService']->idServiceTina}
				<div>
					{$lang['index']['listingTable']['service']}: {serviceLabel ref=$rowFields['importedService']->idServiceTina}
				</div>
			{/if}
		{else}
			<div>{$lang['index']['listingTable']['notInTINA']}</div>
		{/if}

		{if !$rowFields['bspRecord']->recordExists()}
			<div>{$lang['index']['listingTable']['notInBSP']}</div>
		{/if}

		{if $rowFields['comparisonInProgress']}
			<div><i>{$lang['index']['listingTable']['comparisonInProgress']}</i></div>
		{/if}
	</div>

	{if $rowFields['messages']}
		{foreach $rowFields['messages'] as $message}
			<div class="messageDiv {$message->getType()}">
				{$message->getText()}
			</div>
		{/foreach}
	{/if}
{/block}

{block name="listing-td-originalTicketNumber"}
	{$originalTicketNumber=null}
	{if $rowFields['importedService']->idReissuedImportedService}
		{$originalTicketNumber=$rowFields['importedService']->reissuedImportedService->offerConfirmationNumber}
	{else}
		{$originalTicketNumber=$rowFields['ticketNumber']}
	{/if}

	<td class="originalTicketNumber" style="background-color:{pickUniqueColor key=$originalTicketNumber cycles=9};">
		<div class="originalTicketNumber">
			{$originalTicketNumber}
		</div>
	</td>
{/block}

{block name="listing-td-content-ticketDate"}
	<div>{$rowFields['ticketDate']}</div>
{/block}

{block name="listing-td-content-inlineHeader"}
	<div class='label source-TINA'>
		{$lang['index']['listingTable']['TINA']}
	</div>
	<div class='label source-BSP'>
		{$lang['index']['listingTable']['BSP']}
	</div>
{/block}

{block name="listing-td-content-formOfPayment"}
	<div class='currency source-serv'>
		{if $rowFields['importedService']->recordExists() && $rowFields['importedService']->object->chosenOffer && $rowFields['importedService']->object->chosenOffer->formOfPayment}
			{$rowFields['importedService']->object->chosenOffer->formOfPayment|upper}
		{else}
			-
		{/if}
	</div>
	<div class='currency source-BSP'>
		{if $rowFields['bspRecord']->recordExists() && $rowFields['bspRecord']->data->formOfPayments}
			{$s=''}
			{foreach $rowFields['bspRecord']->data->formOfPayments as $fop}
				{$s}
				{$fop->type|upper}
				{$s=', '}
			{/foreach}
		{else}
			-
		{/if}
	</div>
{/block}

{block name="listing-td-content-priceCurrency"}
	{if $rowFields['importedService']->recordExists() && $rowFields['bspRecord']->recordExists()}
		{compareCurrency status=$rowFields['status'] serv=$rowFields['importedService']->object->chosenOffer->totalCurrency BSP=$rowFields['bspRecord']->data->priceBalancePayable->currency}
	{elseif $rowFields['importedService']->recordExists()}
		{compareCurrency status=$rowFields['status'] serv=$rowFields['importedService']->object->chosenOffer->totalCurrency BSP=null}
	{elseif $rowFields['bspRecord']->recordExists()}
		{compareCurrency status=$rowFields['status'] serv=null                                                                   BSP=$rowFields['bspRecord']->data->priceBalancePayable->currency}
	{/if}
{/block}

{block name="listing-td-content-priceSupplier"}
	<div class="cell-50p">
		{comparePriceStructured
			isPriceEqual=!$rowFields['comparison']->priceServiceCash->hasDifferences()
			serv=$rowFields['comparison']->priceServiceCash->importedService
			BSP=$rowFields['comparison']->priceServiceCash->bspRow}
	</div>
	<div class="cell-50p">
		{comparePriceStructured
			isPriceEqual=!$rowFields['comparison']->priceServiceCc->hasDifferences()
			serv=$rowFields['comparison']->priceServiceCc->importedService
			BSP=$rowFields['comparison']->priceServiceCc->bspRow}
	</div>
{/block}

{block name="listing-td-content-priceTaxes"}
	<div class="cell-50p">
		{comparePriceStructured
			isPriceEqual=!$rowFields['comparison']->priceTaxCash->hasDifferences()
			serv=$rowFields['comparison']->priceTaxCash->importedService
			BSP=$rowFields['comparison']->priceTaxCash->bspRow}
	</div>
	<div class="cell-50p">
		{comparePriceStructured
			isPriceEqual=!$rowFields['comparison']->priceTaxCc->hasDifferences()
			serv=$rowFields['comparison']->priceTaxCc->importedService
			BSP=$rowFields['comparison']->priceTaxCc->bspRow}
	</div>
{/block}

{block name="listing-td-content-priceCommission"}
	{$hasDifferences=($rowFields['comparison']->priceCommissionCash->hasDifferences()||$rowFields['comparison']->priceCommissionCc->hasDifferences())}
	<div class="cell-50p">
		<div class='value {if !$hasDifferences}value-equal{else}value-diff{/if}'>-</div>
		{if $rowFields['bspRecord']->recordExists() && $rowFields['bspRecord']->data->priceCommissionPercent}
			<div class='value {if !$hasDifferences}value-equal{else}value-diff{/if}'>{$rowFields['bspRecord']->data->priceCommissionPercent|priceFormat}%</div>
		{else}
			<div class='value {if !$hasDifferences}value-equal{else}value-diff{/if}'>-</div>
		{/if}
	</div>
	<div class="cell-50p">
		{$price0=$rowFields['comparison']->priceCommissionCash->importedService+$rowFields['comparison']->priceCommissionCc->importedService}

		{$price1=$rowFields['comparison']->priceCommissionCash->bspRow+$rowFields['comparison']->priceCommissionCc->bspRow}
		{$price2=$rowFields['comparison']->priceCommissionVATCash->bspRow+$rowFields['comparison']->priceCommissionVATCc->bspRow}

		{if $hasDifferences || ($price0!=0 || $price1!=0 || $price2!=0) || ($rowFields['bspRecord']->recordExists() && $rowFields['bspRecord']->data->priceCommissionPercent)}
			{call name='displayPrice' source='serv'
				isPriceEqual=!$hasDifferences
				price=$price0}

			{$source='BSP'}
			{if $price1===null && $price2===null}
				<div class='value value-notSet source-{$source} {if !$hasDifferences}value-equal{else}value-diff{/if}'>-</div>
			{else}
				<div class='value value-set source-{$source} {if !$hasDifferences}value-equal{else}value-diff{/if}'>
					<span tooltip="commission">{$price1|priceFormat}</span>
					{if $price2}
						+ <span tooltip="vat">{$price2|priceFormat}</span>
					{/if}

					{if $rowFields['bspRecord']->data->priceCommissionSupplementary->amount}
						<span class="info" tooltip="supplementary commission">+ {$rowFields['bspRecord']->data->priceCommissionSupplementary->amount}</span>
					{/if}
				</div>
			{/if}
		{else}
			<div class='value value-notSet'>-</div>
			<div class='value value-notSet'>-</div>
		{/if}
	</div>

{/block}

{block name="listing-td-content-balance"}
	{if $rowFields['comparison']->priceBalancePayable->hasStatusRaw('identical')}
		{comparePriceStructured
			isPriceEqual=true
			extraCssClass="priceBalancePayable identical"
			serv=$rowFields['comparison']->priceBalancePayable->importedService
			BSP=$rowFields['comparison']->priceBalancePayable->bspRow}
	{else}
		{comparePriceStructured
			isPriceEqual=!$rowFields['comparison']->priceBalancePayable->hasDifferences()
			serv=$rowFields['comparison']->priceBalancePayable->importedService
			BSP=$rowFields['comparison']->priceBalancePayable->bspRow}
	{/if}
{/block}

{block name="listing-td-content-rowType"}
	<div class='source-serv value-set value-diff'>
		{if $rowFields['importedService']->recordExists() && $rowFields['importedService']->object->chosenOffer}
			{$rowFields['importedService']->object->serviceType->codeSystem}
		{else}
			-
		{/if}
	</div>
	<div class='source-BSP value-set value-diff'>
		{if $rowFields['bspRecord']->recordExists()}
			{$rowFields['bspRecord']->data->extraData->rowType}
		{else}
			-
		{/if}
	</div>
{/block}

{block name="listing-td-content-balanceDifference"}
	{if $rowFields['importedService']->recordExists() && $rowFields['bspRecord']->recordExists()}
		{$diff=$rowFields['comparison']->priceBalancePayable->importedService - $rowFields['comparison']->priceBalancePayable->bspRow}
	{elseif $rowFields['importedService']->recordExists()}
		{$diff=$rowFields['comparison']->priceBalancePayable->importedService - 0}
	{elseif $rowFields['bspRecord']->recordExists()}
		{$diff=0 - $rowFields['comparison']->priceBalancePayable->bspRow}
	{/if}

	{if abs($diff)<0.01}
		<div class='source-both value value-notSet'>
			-
		</div>
	{elseif $diff<0}
		<div class='source-both value value-set value-diff'>
			{$diff|priceFormat}
		</div>
	{elseif $diff>0}
		<div class='source-both value value-set value-equal'>
			{$diff|priceFormat}
		</div>
	{/if}
{/block}







{block name="listing-td-content-detailedComparison"}
	<div class="container-header">
		<div class="header cell-33p">field</div>
		<div class="value header cell-33p">TINA</div>
		<div class="value header cell-33p">BSP</div>
	</div>

	{foreach $rowFields['comparison']->getAllMembers() as $key=>$member}
		{$hasDifferences=$member->hasDifferences()}
		<div class="row">
			<div class="label {if !$hasDifferences}value-equal{else}value-diff{/if} cell-33p cell-bordered">
				{$key}
			</div>
			<div class="value {if !$hasDifferences}value-equal{else}value-diff{/if} cell-33p cell-bordered">
				{call displayGeneralValue source='serv' value=$member->importedService}
			</div>
			<div class="value {if !$hasDifferences}value-equal{else}value-diff{/if} cell-33p cell-bordered">
				{call displayGeneralValue source='BSP' value=$member->bspRow}
			</div>
		</div>
	{/foreach}
	<br/>
{/block}


{block name="listing-td-content-detailedImportedOrder"}
	{if $rowFields['importedService']->recordExists() && $rowFields['importedService']->object->chosenOffer}
		{$service=$rowFields['importedService']->object}
		{$offer=$rowFields['importedService']->object->chosenOffer}
		{$refund=$rowFields['importedService']->object->refundDetails}

		<div class="row">
			<div class="row">
				<div class="label cell-bordered">imported from <b>{$rowFields['externalSystem']->name}</b></div>
			</div>

			<div class="label cell-50p cell-bordered">ticket</div>
			<div class="value cell-50p cell-bordered">
				{if $rowFields['externalSystem']->code=='amadeus'}
					<span class="remoteLoadLink remoteLoad-attached" onclick="RemoteLoad.loadEntity(this, 'amadeusService', {$service->auxReference});">{$offer->confirmationNumber}</span>
				{elseif $rowFields['externalSystem']->code=='sabre'}
					<span class="remoteLoadLink remoteLoad-attached" onclick="RemoteLoad.loadEntity(this, 'sabreService', {$service->auxReference});">{$offer->confirmationNumber}</span>
				{elseif $rowFields['externalSystem']->code=='galileo'}
					<span class="remoteLoadLink remoteLoad-attached" onclick="RemoteLoad.loadEntity(this, 'galileoService', {$service->auxReference});">{$offer->confirmationNumber}</span>
				{elseif $rowFields['externalSystem']->code=='apollo'}
					<span class="remoteLoadLink remoteLoad-attached" onclick="RemoteLoad.loadEntity(this, 'apolloService', {$service->auxReference});">{$offer->confirmationNumber}</span>
				{elseif $rowFields['externalSystem']->code=='worldspan'}
					<span class="remoteLoadLink remoteLoad-attached" onclick="RemoteLoad.loadEntity(this, 'worldspanService', {$service->auxReference});">{$offer->confirmationNumber}</span>
				{else}
					{$offer->confirmationNumber}
				{/if}
			</div>
		</div>

		{if $rowFields['isRefund']}
			<div class="row">
				<div class="label cell-33p cell-bordered">date</div>
				<div class="value cell-33p cell-bordered">{$offer->date}</div>
				<div class="value cell-33p cell-bordered">{$refund->date}</div>
			</div>
		{else}
			<div class="row">
				<div class="label cell-50p cell-bordered">date</div>
				<div class="value cell-50p cell-bordered">{$offer->date}</div>
			</div>
		{/if}
		<div class="row">
			<div class="label cell-50p cell-bordered">RECLOC</div>
			<div class="value cell-50p cell-bordered">{$offer->externalSystemReservationId}</div>
		</div>


		<div class="row">
			<div class="label cell-50p cell-bordered">id</div>
			<div class="value cell-50p cell-bordered">{$service->idSystem}</div>
		</div>
		<div class="row">
			<div class="label cell-50p cell-bordered">supplier</div>
			<div class="value cell-50p cell-bordered">
				{if $offer->supplier && $offer->supplier->codes}
					<div>
						{$s=""}
						{foreach $offer->supplier->codes as $code=>$value}
							{$s} {$code}:{$value}
							{$s=","}
						{/foreach}
					</div>
				{/if}
			</div>
		</div>

		<hr class="inline-delimiter" />

		{*** prices ***}
		{if $rowFields['isRefund']}
			{*** ISSUE & REFUND ***}
			<div class="row">
				<div class="header cell-33p cell-bordered"></div>
				<div class="header cell-33p cell-bordered">{$offer->formOfPayment}</div>
				<div class="header cell-33p cell-bordered">refund</div>
			</div>

			<div class="row">
				<div class="label cell-33p cell-bordered">supplier</div>
				<div class="value cell-33p cell-bordered">{call name=displayPrice price=$offer->servicePriceTotal source='serv' isPriceEqual=null}</div>
				<div class="value cell-33p cell-bordered">{call name=displayPrice price=$refund->fareUsedSupplierValue source='serv' isPriceEqual=null}</div>
			</div>

			<div class="row">
				<div class="label cell-33p cell-bordered">commission</div>
				<div class="value cell-33p cell-bordered">{call name=displayPrice price=$offer->commissionTotal source='serv' isPriceEqual=null}</div>
				<div class="value cell-33p cell-bordered">{call name=displayPrice price=$refund->fareUsedCommissionValue source='serv' isPriceEqual=null}</div>
			</div>

			<div class="row">
				<div class="label cell-33p cell-bordered">tax</div>
				<div class="value cell-33p cell-bordered">{call name=displayPrice price=$offer->taxTotal source='serv' isPriceEqual=null}</div>
				<div class="value cell-33p cell-bordered">{call name=displayPrice price=$refund->fareUsedTaxValue source='serv' isPriceEqual=null}</div>
			</div>

			<div class="row">
				<div class="label cell-33p cell-bordered"></div>
				<div class="value cell-33p cell-bordered">
					{foreach $offer->taxCodes as $tax}
						<div class="row" style="margin-right: -0.5em;">
							<div class="label cell-50p cell-bordered">{$tax['code']}</div>
							<div class="value cell-50p cell-bordered">{call name=displayPrice price=$tax['value'] source='serv' isPriceEqual=null}</div>
						</div>
					{/foreach}
				</div>
				<div class="value cell-33p cell-bordered">-</div>
			</div>

			<div class="row">
				<div class="label cell-33p cell-bordered">serviceFee</div>
				<div class="value cell-33p cell-bordered">{call name=displayPrice price=$offer->serviceFeeTotal source='serv' isPriceEqual=null}</div>
				<div class="value cell-33p cell-bordered">{call name=displayPrice price=$refund->serviceFeeValue source='serv' isPriceEqual=null}</div>
			</div>

			<div class="row">
				<div class="label cell-33p cell-bordered">discount</div>
				<div class="value cell-33p cell-bordered">{call name=displayPrice price=$offer->discountTotal source='serv' isPriceEqual=null}</div>
				<div class="value cell-33p cell-bordered">-</div>
			</div>

			<div class="row">
				<div class="label cell-33p cell-bordered">penalty</div>
				<div class="value cell-33p cell-bordered">-</div>
				<div class="value cell-33p cell-bordered">{call name=displayPrice price=$refund->penaltyValue source='serv' isPriceEqual=null}</div>
			</div>
		{else}
			{*** ISSUE ***}
			<div class="row">
				<div class="header cell-50p cell-bordered"></div>
				<div class="header cell-50p cell-bordered">{$offer->formOfPayment}</div>
			</div>

			<div class="row">
				<div class="label cell-50p cell-bordered">supplier</div>
				<div class="value cell-50p cell-bordered">{call name=displayPrice price=$offer->servicePriceTotal source='serv' isPriceEqual=null}</div>
			</div>

			<div class="row">
				<div class="label cell-50p cell-bordered">commission</div>
				<div class="value cell-50p cell-bordered">{call name=displayPrice price=$offer->commissionTotal source='serv' isPriceEqual=null}</div>
			</div>

			<div class="row">
				<div class="label cell-50p cell-bordered">tax</div>
				<div class="value cell-50p cell-bordered">{call name=displayPrice price=$offer->taxTotal source='serv' isPriceEqual=null}</div>
			</div>

			<div class="row">
				<div class="label cell-50p cell-bordered"></div>
				<div class="value cell-50p cell-bordered">
					{foreach $offer->taxCodes as $tax}
						<div class="row" style="margin-right: -0.5em;">
							<div class="label cell-50p cell-bordered">{$tax['code']}</div>
							<div class="value cell-50p cell-bordered">{call name=displayPrice price=$tax['value'] source='serv' isPriceEqual=null}</div>
						</div>
					{/foreach}
				</div>
			</div>

			<div class="row">
				<div class="label cell-50p cell-bordered">serviceFee</div>
				<div class="value cell-50p cell-bordered">{call name=displayPrice price=$offer->serviceFeeTotal source='serv' isPriceEqual=null}</div>
			</div>

			<div class="row">
				<div class="label cell-50p cell-bordered">discount</div>
				<div class="value cell-50p cell-bordered">{call name=displayPrice price=$offer->discountTotal source='serv' isPriceEqual=null}</div>
			</div>

			<div class="row">
				&nbsp;
			</div>

		{/if}
		<br/>
	{/if}
{/block}

{block name="listing-td-content-detailedBSP"}
	{if $rowFields['bspRecord']->recordExists()}
		<div class="row">
			<div class="row">
				<div class="label cell-bordered">imported from
					<a href="{appUrl module='Modules/Bsp/Listing' action="download" params=["file"=>"{$rowFields['bspRecord']->period->filename}"]}" class="link" target="_blank">{$rowFields['bspRecord']->period->filename|truncate:32}</a>
				</div>
			</div>

			<div class="label cell-50p cell-bordered">ticket</div>
			<div class="value cell-50p cell-bordered">{$rowFields['bspRecord']->data->ticketNumber}</div>
		</div>
		<div class="row">
			<div class="label cell-50p cell-bordered">date</div>
			<div class="value cell-50p cell-bordered">{$rowFields['bspRecord']->data->ticketDate}</div>
		</div>
		<div class="row">
			&nbsp;
		</div>

		<div class="row">
			<div class="label cell-50p cell-bordered">id</div>
			<div class="value cell-50p cell-bordered">{$rowFields['bspRecord']->getId()}</div>
		</div>
		<div class="row">
			<div class="label cell-50p cell-bordered">supplier</div>
			<div class="value cell-50p cell-bordered">{$rowFields['bspRecord']->data->supplierCode3}</div>
		</div>

		<hr class="inline-delimiter" />

		{*** prices ***}
		<div class="row">
			<div class="header cell-33p cell-bordered"></div>
			<div class="header cell-33p cell-bordered">cash</div>
			<div class="header cell-33p cell-bordered">cc</div>
		</div>

		<div class="row">
			<div class="label cell-33p cell-bordered">supplier</div>
			<div class="value cell-33p cell-bordered">{call name=displayPrice price=$rowFields['bspRecord']->data->priceSupplierCash->amount source='BSP' isPriceEqual=null}</div>
			<div class="value cell-33p cell-bordered">{call name=displayPrice price=$rowFields['bspRecord']->data->priceSupplierCc->amount source='BSP' isPriceEqual=null}</div>
		</div>

		<div class="row">
			<div class="label cell-50p cell-bordered">commission</div>
			<div class="value median cell-50p cell-bordered">{call name=displayPrice price=$rowFields['bspRecord']->data->priceCommission->amount source='BSP' isPriceEqual=null}</div>
		</div>

		<div class="row">
			<div class="label cell-33p cell-bordered">tax</div>
			<div class="value cell-33p cell-bordered">{call name=displayPrice price=$rowFields['bspRecord']->data->priceTaxCash->amount source='BSP' isPriceEqual=null}</div>
			<div class="value cell-33p cell-bordered">{call name=displayPrice price=$rowFields['bspRecord']->data->priceTaxCc->amount source='BSP' isPriceEqual=null}</div>
		</div>

		<div class="row">
			<div class="label cell-33p cell-bordered"></div>
			<div class="label cell-33p cell-bordered">
				{foreach $rowFields['bspRecord']->data->priceTaxCash->getAll() as $tax}
					<div class="row" style="margin-right: -0.5em;">
						<div class="label cell-50p cell-bordered">{$tax['code']}</div>
						<div class="value cell-50p cell-bordered">{call name=displayPrice price=$tax['amount'] source='BSP' isPriceEqual=null}</div>
					</div>
				{/foreach}
			</div>
			<div class="label cell-33p cell-bordered">
				{foreach $rowFields['bspRecord']->data->priceTaxCc->getAll() as $tax}
					<div class="row" style="margin-right: -0.5em;">
						<div class="label cell-50p cell-bordered">{$tax['code']}</div>
						<div class="value cell-50p cell-bordered">{call name=displayPrice price=$tax['amount'] source='BSP' isPriceEqual=null}</div>
					</div>
				{/foreach}
			</div>
		</div>

		<div class="row">
			&nbsp;
		</div>

		<div class="row">
			&nbsp;
		</div>

		<div class="row">
			<div class="label cell-50p cell-bordered">commission VAT</div>
			<div class="median cell-50p cell-bordered">{call name=displayPrice price=$rowFields['bspRecord']->data->priceCommissionVat->amount source='BSP' isPriceEqual=null}</div>
		</div>


		<div class="row">
			<div class="label cell-50p cell-bordered">commission, supplementary</div>
			<div class="median cell-50p cell-bordered">{call name=displayPrice price=$rowFields['bspRecord']->data->priceCommissionSupplementary->amount source='BSP' isPriceEqual=null}</div>
		</div>

		<div class="row">
			<div class="label cell-50p cell-bordered">balance</div>
			<div class="median cell-50p cell-bordered">{call name=displayPrice price=$rowFields['bspRecord']->data->priceBalancePayable->amount source='BSP' isPriceEqual=null}</div>
		</div>

		<br/>
	{/if}
{/block}



{block name="listing-td-content-responsibleUser"}
	<div>
		{if $rowFields['importedService']->recordExists() && $rowFields['importedService']->idUser}
			{* user-related fields:  idUser, idBookUser, idIssueUser, idProcessUser, idBlockUser *}
			{userLabel ref=$rowFields['importedService']->idUser}
		{else}
			-
		{/if}
	</div>

	<div>
		{if $rowFields['issueOfficeIataCode']}
			IATA: {$rowFields['issueOfficeIataCode']}
		{else}
			-
		{/if}
	</div>
{/block}