<?xml version="1.0" encoding="UTF-8" ?>
<ActiveReportsLayout 
	GUIDLIB="{A17C4A82-60FE-4620-9EC4-30B1399CB9A8}" GUIDREP="{A7F1A70F-7A09-4CBC-B68D-0BC58604DCB9}" 
	LICENSE="10000000"
	PrintWidth="11000"
	ShowParamUI="0"
	DocumentName="Payment Schedule"
	ScriptLang="VBScript"
>
<Watermark
		>
</Watermark>
<Script>
<![CDATA[option explicit

private mCounter
private mPayments

Sub OnReportStart
	
dim rst 
dim ContractType

	' Hide columns for Variable Loans
	rpt.lblOpening.Visible = (Not Loan.IsLoanVariable)
	rpt.numOpening.Visible = (Not Loan.IsLoanVariable)
	rpt.lblClosing.Visible = (Not Loan.IsLoanVariable)
	rpt.numClosing.Visible = (Not Loan.IsLoanVariable)

	' Reset balance
	mcounter = 1
	rpt.Sections("Detail").backstyle = 1
	
	' Get payments
	set mPayments = Loan.PaymentViews

	' Hide if nothing to show
	rpt.GroupHeader1.visible = (mPayments.count <> 0)
	rpt.Detail.Visible = rpt.GroupHeader1.visible
	rpt.GroupFooter1.visible = rpt.GroupHeader1.visible

End Sub

Sub OnDataInitialize
	
	if rpt.fields.count = 0 then
		rpt.fields.add "DateDue"
      	rpt.fields.add "Note"
	      rpt.fields.add "PLValue"
      	rpt.fields.add "Opening"
	      rpt.fields.add "Value"
      	rpt.fields.add "Closing"
	      rpt.fields.add "Overdue"
	end if

End Sub

Sub OnFetchData(eof)
	
	if mcounter <= mpayments.count then
		eof = false
		
		with mpayments(mcounter)
	            rpt.fields("DateDue").Value = .DateDue
      	      rpt.fields("Note").Value = .Note
			if .IsOverdue then
		            rpt.fields("PLValue").Value = " "
			else
				rpt.fields("PLValue").Value = .PLValue
			end if
      	      rpt.fields("Opening").Value = .Value + .Closing
	            rpt.fields("Value").Value = .Value
      	      rpt.fields("Closing").Value = .Closing
			if .IsOverdue then
		            rpt.fields("Overdue").Value = .ValueTotal
			else
		            rpt.fields("Overdue").Value = " "
			end if
		end with

		mcounter = mcounter + 1
		
		rpt.data.recordset.movefirst
	else
		eof = true
	end if

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="585"
	>
		<Control 
		Type="AR.Label"
		Name="lblHeading"
		Left="30"
		Top="30"
		Width="10910"
		Height="255"
		BorderTopStyle="1"
		BorderTopColor="0"
		BorderLeftStyle="1"
		BorderLeftColor="0"
		BorderRightStyle="1"
		BorderRightColor="0"
		BorderBottomStyle="1"
		BorderBottomColor="0"
		BorderShadow="1"
		Caption="Payment Schedule"
		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="lblNote"
		Left="1005"
		Top="360"
		Width="5550"
		Height="195"
		Caption="Note"
		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="lblOpening"
		Left="6605"
		Top="360"
		Width="1100"
		Height="195"
		Caption="Opening"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblPayment"
		Left="7705"
		Top="360"
		Width="1100"
		Height="195"
		Caption="Payment"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblClosing"
		Left="8805"
		Top="360"
		Width="1100"
		Height="195"
		Caption="Closing"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Label"
		Name="lblOverdue"
		Left="9900"
		Top="360"
		Width="1095"
		Height="195"
		Caption="Overdue"
		ClassName="Normal"
		Style="font-size: 8pt; font-weight: bold; text-align: right; "
		>
		</Control>
<Script>
<![CDATA[
Sub OnFormat

End Sub
]]></Script>
	</Section>
	<Section Type="Detail" Name="Detail"
		Height="200"
		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 FROM Contract WHERE ContractId=&apos;&lt;%ContractId%&gt;&apos;"
		LockType="1"
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="txtDate"
		DataField="Datedue"
		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="txtNote"
		DataField="Note"
		Left="1005"
		Top="0"
		Width="5550"
		Height="195"
		Text="Note"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; "
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="numOpening"
		DataField="Opening"
		Left="6605"
		Top="0"
		Width="1100"
		Height="190"
		Text="Opening"
		OutputFormat="#,##0.00"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="numPayment"
		DataField="Value"
		Left="7705"
		Top="0"
		Width="1100"
		Height="195"
		Text="Payment"
		OutputFormat="#,##0.00"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="numClosing"
		DataField="Closing"
		Left="8805"
		Top="0"
		Width="1100"
		Height="190"
		Text="Closing"
		OutputFormat="#,##0.00"
		CanShrink="-1"
		ClassName="Normal"
		Style="font-size: 8pt; text-align: right; "
		>
		</Control>
		<Control 
		Type="AR.Field"
		Name="numOverdue"
		DataField="Overdue"
		Left="9900"
		Top="0"
		Width="1095"
		Height="195"
		Text="Overdue"
		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="0"
	>
<Script>
<![CDATA[
Sub OnFormat

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