{extends file="layout.html"}
{block name=title}LMS: {$layout.pagetitle|striphtml}{/block}
{block name=module_content}
<!-- $Id$ -->
<H1>{$layout.pagetitle}</H1>
<TABLE class="lmsbox">
    <THEAD>
	<TR>
		<TD WIDTH="1%">
			<IMG SRC="img/payment.gif" ALT="">
		</TD>
		<TD WIDTH="98%" COLSPAN="2">
			<B>{$payment.name} ({$payment.id|string_format:"%04d"})</B>
		</TD>
	</TR>
    </THEAD>
    <TBODY>
	<TR>
		<TD WIDTH="1%">
			<IMG SRC="img/creditor.gif" ALT="">
		</TD>
		<TD WIDTH="1%">
			<B>{trans("Creditor:")}</B>
		</TD>
		<TD WIDTH="98%">
			{$payment.creditor}
		</TD>
	</TR>
	<TR>
		<TD WIDTH="1%">
			<IMG SRC="img/value.gif" ALT="">
		</TD>
		<TD WIDTH="1%" NOWRAP>
			<B>{trans("Value:")}</B>
		</TD>
		<TD WIDTH="98%">
			{$payment.value|money_format}
		</TD>
	</TR>
	<TR>
		<TD WIDTH="1%">
			<IMG SRC="img/calendar.gif" ALT="">
		</TD>
		<TD WIDTH="1%" NOWRAP>
			<B>{trans("Payment day:")}</B>
		</TD>
		<TD WIDTH="98%">
			{$payment.payday}
		</TD>
	</TR>
	{if $payment.description}
	<TR>
		<TD WIDTH="1%">
			<IMG SRC="img/info1.gif" ALT="">
		</TD>
		<TD WIDTH="98%" COLSPAN="2">
			<TABLE WIDTH="100%" CELLPADDING="5">
			    <TR><TD CLASS="fall superlight">
				    {$payment.description|replace:"\n":"<BR>"}
			    </TD></TR>
			</TABLE>
		</TD>
	</TR>
	{/if}
	<TR>
		<TD WIDTH="100%" COLSPAN="3" ALIGN="RIGHT">
			<FORM NAME="addbalance" METHOD="POST" ACTION="?m=balanceadd">
			<INPUT type="submit" class="hiddenbtn">
			<INPUT TYPE="HIDDEN" NAME="m" VALUE="balanceadd">
			<INPUT TYPE="HIDDEN" NAME="addbalance[value]" VALUE="{$payment.value * -1}">
			<INPUT TYPE="HIDDEN" NAME="addbalance[comment]" VALUE="{$payment.name} / {$payment.creditor}">
			<A HREF="javascript:document.addbalance.submit();">{trans("Account payment")} <IMG SRC="img/pay.gif" alt=""></A>
			<A HREF="?m=paymentedit&id={$payment.id}">{trans("Edit")} <IMG SRC="img/edit.gif" alt=""></A>
			<A id="delete-payment" HREF="?m=paymentdel&id={$payment.id}">{trans("Delete")} <IMG SRC="img/delete.gif" ALT=""></A>
			</FORM>
		</TD>
	</TR>
    </TBODY>
</TABLE>
	<script>
		$('#delete-payment').click(function() {
			confirmDialog($t("Are you sure, you want to delete that payment?"), this).done(function() {
				location.href = $(this).attr('href');
			});
			return false;
		});
	</script>
{/block}
