<?xml version="1.0" encoding="UTF-8" ?>
<ActiveReportsLayout 
	GUIDLIB="{90AA5044-2BC3-4958-A32A-35F734EBBBD2}" GUIDREP="{2FA9CC47-666F-4CDC-B2FC-9582F753E551}" 
	LICENSE="10000000"
	PrintWidth="11000"
	ShowParamUI="0"
	DocumentName="Loan Ledger (Sub)"
	ScriptLang="VBScript"
>
<Watermark
		>
</Watermark>
<Script>
<![CDATA[option explicit

private mBalance

Sub OnReportStart

	' Reset balance
	mBalance = 0
	rpt.Sections("Detail").backstyle = 1

	rpt.sections("GroupHeader1").Visible = Not rpt.data.Recordset.EOF 
	rpt.sections("Detail").Visible = rpt.sections("GroupHeader1").Visible
	
End Sub

Sub OnDataInitialize
	
	' Create Fields for Debit/ Credit, check count as this will cause error
	' the second and subsequent times the Sub Report is generated.
	if rpt.fields.count = 0 then
		rpt.Fields.Add "Gross"
		rpt.Fields.Add "Balance"
	end if

End Sub

Sub OnFetchData(eof)

	' Set Field Values.
	If rpt.data.Recordset.EOF then 
 		exit sub
	Elseif isnull(rpt.data.Recordset.Fields("TaxAmount").Value) then
		rpt.Fields("Gross").Value = " "
	Else
		rpt.Fields("Gross").Value = rpt.data.Recordset.Fields("Amount").Value + rpt.data.Recordset.Fields("TaxAmount").Value
	End If
	
	' Running balance.
	mbalance = mbalance + rpt.data.Recordset.Fields("Amount").Value
	rpt.fields("Balance").Value = mbalance

End Sub
]]></Script>
<PageSettings>
</PageSettings>
<StyleSheet>
	<Style Name="Normal"
	Value="font-family: Arial; font-style: normal; font-variant: inherit; font-weight: normal; font-size: 10pt; font-size-adjust: inherit; font-stretch: inherit; color: rgb(0,0,0); background-color: rgb(255,255,255); background-image: inherit; background-repeat: inherit; background-attachment: inherit; background-x-position: inherit; background-y-position: inherit; opacity: inherit; word-spacing: inherit; letter-spacing: inherit; text-decoration: none; vertical-align: inherit; text-transform: inherit; text-align: inherit; text-indent: inherit; unicode-bidi: inherit; line-height: inherit; white-space: inherit; ddo-can-grow: inherit; ddo-can-shrink: inherit; ddo-char-set: 0; "
	/>
	<Style Name="Heading1"
	Value="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: bold; font-size: 16pt; font-size-adjust: inherit; font-stretch: inherit; "
	/>
	<Style Name="Heading2"
	Value="font-family: Times New Roman; font-style: italic; font-variant: inherit; font-weight: bold; font-size: 14pt; font-size-adjust: inherit; font-stretch: inherit; "
	/>
	<Style Name="Heading3"
	Value="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: bold; font-size: 13pt; font-size-adjust: inherit; font-stretch: inherit; "
	/>
	<Style Name="Heading4"
	/>
</StyleSheet>
<Sections>
	<Section Type="GroupHeader" Name="GroupHeader1"
		Height="580"
	>
		<Control 
		Type="AR.Label"
		Name="lblHeading"
		Left="30"
		Top="30"
		Width="10930"
		Height="260"
		BorderTopStyle="1"
		BorderTopColor="0"
		BorderLeftStyle="1"
		BorderLeftColor="0"
		BorderRightStyle="1"
		BorderRightColor="0"
		BorderBottomStyle="1"
		BorderBottomColor="0"
		BorderShadow="1"
		Caption="Transactions"
		ClassName="Normal"
		Style="font-weight: bold; ddo-char-set: 1; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblULine"
		Left="0"
		Top="360"
		Width="11000"
		Height="200"
		BorderBottomStyle="1"
		BorderBottomColor="0"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblReference"
		Left="1000"
		Top="360"
		Width="1100"
		Height="200"
		Caption="Reference"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblElement"
		Left="2100"
		Top="360"
		Width="750"
		Height="200"
		Caption="Element"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblComment"
		Left="7300"
		Top="360"
		Width="3700"
		Height="195"
		Caption="Comment"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblDate"
		Left="0"
		Top="360"
		Width="1000"
		Height="195"
		Caption="Date"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblGross"
		Left="2850"
		Top="360"
		Width="1100"
		Height="195"
		Caption="Gross"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblTax"
		Left="3950"
		Top="360"
		Width="1100"
		Height="195"
		Caption="Tax"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblBalance"
		Left="6150"
		Top="360"
		Width="1100"
		Height="195"
		Caption="Balance"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblValue"
		Left="5050"
		Top="360"
		Width="1095"
		Height="195"
		Caption="Value"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; text-align: right; "
		>
		</Control>
	</Section>
	<Section Type="Detail" Name="Detail"
		Height="195"
		CanShrink="1"
	>
		<Control 
		Type="AR.DataControl"
		Name="Data"
		Left="-2000"
		Top="-2000"
		Width="16"
		Height="299"
		Visible="0"
		Tag="C:\Program Files\Intersoft\finPOWER5\SYSTEM.MDW?C:\Program Files\Intersoft\finPOWER5\finDEMO.mdb"
		ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Intersoft\finPOWER5\finDEMO.mdb;User Id=User;Password=user;Jet OLEDB:System database=C:\Program Files\Intersoft\finPOWER5\SYSTEM.MDW"
		RecordSource="SELECT ContractId,Date,ElementId,Reference,-Value AS Amount,-TaxValue AS TaxAmount,Comment FROM Transactions WHERE ContractId=&apos;&lt;%ContractId%&gt;&apos; ORDER BY Date,TransactionId"
		LockType="1"
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="txtElementId"
		DataField="ElementId"
		Left="2100"
		Top="0"
		Width="750"
		Height="190"
		Text="ElementId"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; "
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="txtDate"
		DataField="Date"
		Left="0"
		Top="0"
		Width="1000"
		Height="190"
		Text="Date"
		OutputFormat="d/mm/yyyy"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="txtReference"
		DataField="Reference"
		Left="1000"
		Top="0"
		Width="1100"
		Height="190"
		Text="Reference"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; "
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="numGross"
		DataField="Gross"
		Left="2850"
		Top="0"
		Width="1100"
		Height="190"
		Text="Gross"
		OutputFormat="#,##0.00"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="txtComment"
		DataField="Comment"
		Left="7300"
		Top="0"
		Width="3700"
		Height="190"
		Text="Comment"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; "
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="numTax"
		DataField="TaxAmount"
		Left="3950"
		Top="0"
		Width="1100"
		Height="190"
		Text="Tax"
		OutputFormat="#,##0.00"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="numBalance"
		DataField="Balance"
		Left="6150"
		Top="0"
		Width="1100"
		Height="190"
		Text="Balance"
		OutputFormat="#,##0.00"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="numValue"
		DataField="Amount"
		Left="5050"
		Top="0"
		Width="1095"
		Height="195"
		Text="Value"
		OutputFormat="#,##0.00"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; text-align: right; "
		>
		</Control>
<Script>
<![CDATA[
Sub OnFormat

	' Format oddline feature
	rpt.Sections("Detail").backstyle = 1 - rpt.Sections("Detail").backstyle

End Sub
]]></Script>
	</Section>
	<Section Type="GroupFooter" Name="GroupFooter1"
		Height="60"
		CanGrow="0"
	>
<Script>
<![CDATA[
Sub OnFormat

End Sub
]]></Script>
	</Section>
</Sections>
</ActiveReportsLayout>
