{extends file=$smarty.const.SMARTY_LAYOUT_DASHBOARD_WIDGET_DEFAULT}

{block name="content"}
	{if $widget['data']['errorMessage']}
		<div class="messageDivContainer layout-inline">
			{message type='warning' message=$widget['data']['errorMessage']}
		</div>
	{else}
		{$financialData = $widget['data']['financialData']}
		<table class="simpleList entityData w100p">
			<tbody>
				<tr>
					<td>
						{***************** INCOME *********************}
						<table class="tableBox w100p">
							<thead>
								<tr>
									<th colspan="3" class="generalInfo">{$widgetLang['columnsList']['income']}</th>
								</tr>
							</thead>

							<tbody>
								{***************** ESTIMATED INCOME *************************************}
								<tr>
									<td class="label">{$widgetLang['columnsList']['estimatedIncome']}</td>
									<td class="label bold">
										{$currency=sprintf("%s (%s)", $financialData['defaultCurrency'], $widgetLang['columnsList']['equivalent'])}
										&raquo; {$currency}
									</td>
									<td class="value bold">{$financialData['estimatedIncomeDefCurr']|priceFormat:$financialData['defaultCurrency']:true}</td>
								</tr>
								{foreach $financialData['estimatedIncome'] as $currency => $value}
									<tr>
										<td class="label">&nbsp;</td>
										<td class="label bold"><b>&raquo; {$currency}:</b></td>
										<td class="value">{$value|priceFormat:$currency:1}</td>
									</tr>
								{/foreach}

								{***************** REAL INCOME *************************************}
								<tr>
									<td class="label">{$widgetLang['columnsList']['realIncome']}</td>
									<td class="label bold">
										{$currency=sprintf("%s (%s)", $financialData['defaultCurrency'], $widgetLang['columnsList']['equivalent'])}
										&raquo; {$currency}
									</td>
									<td class="value bold">{$financialData['realIncomeDefCurr']|priceFormat:$financialData['defaultCurrency']:true}</td>
								</tr>
								{foreach $financialData['realIncome'] as $currency => $value}
									<tr>
										<td class="label">&nbsp;</td>
										<td class="label bold"><b>&raquo; {$currency}:</b></td>
										<td class="value">{$value|priceFormat:$currency:1}</td>
									</tr>
								{/foreach}

								{***************** VALUE TO BE PAID BY CUSTOMER *************************************}
								<tr>
									<td class="label">{$widgetLang['columnsList']['valueToBePaidByCustomer']}</td>
									<td class="label bold">
										{$currency=sprintf("%s (%s)", $financialData['defaultCurrency'], $widgetLang['columnsList']['equivalent'])}
										&raquo; {$currency}
									</td>
									<td class="value bold">{$financialData['valueToBePaidByCustomerDefCurr']|priceFormat:$financialData['defaultCurrency']:true}</td>
								</tr>
								{foreach $financialData['valueToBePaidByCustomer'] as $currency => $value}
									<tr>
										<td class="label">&nbsp;</td>
										<td class="label bold"><b>&raquo; {$currency}:</b></td>
										<td class="value">{$value|priceFormat:$currency:1}</td>
									</tr>
								{/foreach}

							</tbody>
						</table>
					</td>
				</tr>
			</tbody>
		</table>
	{/if}
{/block}
