function BankAndCashAccounts_byProject($prjNo, $enddate, $open_or_close_bal) { $this->prjNo = $prjNo; parent::BankAndCashAccounts("AC_ID1={$prjNo}", $enddate, $open_or_close_bal); }
<?php # enter_openingbalance.php displays a form that allows the entry of a opening balance # All Accounts which have BANK or CASH in their AC3 get listed require "accrp.php"; session_start(); require "security/secure.php"; pt_register('POST', 'submitnow'); # others are not needed, they get accessed by $_POST (see line 33) beginDocument("Enter OpeningBalance", $sess_user); if ($submitnow == 1) { $db = getDBConnection(); $query_part1 = "INSERT INTO TRANS (VR_NO, VR_DT, VR_TP, AC_ID1, AC_ID2, AC_ID3, AC_ID4, AC_ID5, DR_CR, CHQ_NO, AMOUNT, PARTY, REMARKS, T_DT, DEPT) VALUES "; $today = get_today_srd_string(); $accounts = new BankAndCashAccounts("1", "0000-00-00", "c"); while ($row = $accounts->getNext()) { $ac1 = $row["AC_ID1"]; $ac2 = $row["AC_ID2"]; $ac3 = $row["AC_ID3"]; $ac4 = $row["AC_ID4"]; $ac5 = $row["AC_ID5"]; $field_name = "account_field_" . $ac5; $field_desc = $accounts->getActualCodeName(); $amount = $_POST[$field_name]; if ($amount == "") { echo "Warning: Field {$field_desc} has zero Amount!<br>"; continue; } $amount = $_POST[$field_name]; $vr_no = get_new_vrno(); # insert voucher
require "accrp.php"; require "security/secure.php"; beginDocument("list project Balance", $sess_user); if (isset($ac_id1)) { print_project_transactions_head($ac_id1, $startdate, $enddate, $ac_name); # generate account-objects if ($ac_id1 != 0) { $openingAccounts = new BankAndCashAccounts_byProject($ac_id1, $startdate, "o"); $paymentsAccounts = new Accounts_byProject($ac_id1, $startdate, $enddate, "Ea"); $receiptsAccounts = new Accounts_byProject($ac_id1, $startdate, $enddate, "LI"); $closingAccounts = new BankAndCashAccounts_byProject($ac_id1, $enddate, "c"); } else { $openingAccounts = new BankAndCashAccounts("1", $startdate, "o"); $paymentsAccounts = new Accounts("1", $startdate, $enddate, "Ea"); $receiptsAccounts = new Accounts("1", $startdate, $enddate, "LI"); $closingAccounts = new BankAndCashAccounts("1", $enddate, "c"); } # Opening Balance beginPrettyTable("4", "Opening Balance"); printRow(array("Code Number", "Description", "Amount")); while ($openingAccounts->getNext()) { printRow(array($openingAccounts->getActualCodeString(), $openingAccounts->getActualCodeName(), $openingAccounts->getActualBalance()), "abwechselnd"); } printRow(array("", "Total", $openingAccounts->getSum())); endPrettyTable(); # Payments beginPrettyTable("4", "Payments"); printRow(array("Code Number", "Description", "Amount")); while ($paymentsAccounts->getNext()) { if ($paymentsAccounts->getActualBalance() == "") { continue;