1<?php
2
3class BankStatement {
4	var $ReportCreated;
5	var $AccountNumber;
6	var $AccountName;
7	var $StatementNumber;
8	var $AccountOwner;
9	var $CurrCode;
10	var $OpeningDate;
11	var $OpeningBalance;
12	var $ClosingDate;
13	var $ClosingBalance;
14	var $BankGLAccount;
15	var $BankAccountName;
16	var $CurrDecimalPlaces;
17	var $ExchangeRate;
18	var $Trans;
19
20	function __construct () {
21		$this->ReportCreated = '';
22		$this->AccountNumber = '';
23		$this->AccountName = '';
24		$this->StatementNumber = '';
25		$this->AccountOwner = '';
26		$this->CurrCode = '';
27		$this->ClosingBalance = 0;
28		$this->OpeningBalance = 0;
29		$this->BankGLAccount = '';
30		$this->BankAccountName = '';
31		$this->CurrDecimalPlaces = 2;
32		$this->ExchangeRate = 1;
33	}
34	function BankStatement() {
35		self::__construct();
36	}
37}
38
39class BankTrans {
40	var $ValueDate;
41	var $Amount;
42	var $Code;
43	var $Description;
44	var $BankTransID;
45	var $GLEntries;
46	var $DebtorNo;
47	var $SupplierID;
48	var $GLItemID;
49	var $GLTotal;
50
51	function __construct ($ValueDate, $Amount) {
52		$this->ValueDate = $ValueDate;
53		$this->Amount = $Amount;
54		$this->GLEntries = array();
55		$this->DebtorNo = '';
56		$this->SupplierID = '';
57		$this->GLItemID = 0;
58		$this->GLTotal = 0;
59		$this->BankTransID = 0;
60	}
61	function BankTrans($ValueDate, $Amount) {
62		self::__construct($ValueDate, $Amount);
63	}
64
65	function Add_To_GLAnalysis($Amount, $Narrative, $GLCode, $GLAccountName, $Tag){
66		if (isset($GLCode) AND $Amount!=0){
67			$this->GLEntries[$this->GLItemID] = new GLAnalysis($Amount, $Narrative, $this->GLItemID, $GLCode, $GLAccountName, $Tag);
68			$this->GLItemID++;
69			$this->GLTotal += $Amount;
70
71			Return 1;
72		}
73		Return 0;
74	}
75
76	function Remove_GLEntry($GL_ID){
77		$this->GLTotal -= $this->GLEntries[$GL_ID]->Amount;
78		unset($this->GLEntries[$GL_ID]);
79		$this->GLItemCounter--;
80	}
81}
82
83
84Class GLAnalysis {
85
86	Var $Amount;
87	Var $Narrative;
88	Var $GLCode;
89	var $GLAccountName;
90	Var $ID;
91	var $Tag;
92
93	function __construct ($Amount, $Narrative, $ID, $GLCode, $GLAccountName, $Tag){
94
95/* Constructor function to add a new JournalGLAnalysis object with passed params */
96		$this->Amount =$Amount;
97		$this->Narrative = $Narrative;
98		$this->GLCode = $GLCode;
99		$this->GLAccountName = $GLAccountName;
100		$this->ID = $ID;
101		$this->Tag = $Tag;
102	}
103	function GLAnalysis($Amount, $Narrative, $ID, $GLCode, $GLAccountName, $Tag){
104		self::__construct($Amount, $Narrative, $ID, $GLCode, $GLAccountName, $Tag);
105	}
106}
107
108?>
109