Example #1
0
<?php

# This form allows to enter a date. After submitting, all Bank and Cash Account-balances get
# printed seperated by Projects.
session_start();
require "accrp.php";
require "security/secure.php";
beginDocument("list Cash and Bank", $sess_user);
if ($date) {
    $ac1 = get_ac_array(1);
    foreach ($ac1 as $key => $prj_desc) {
        $accounts = new BankAndCashAccounts_byProject($key, $date, "c");
        beginPrettyTable(4, "{$prj_desc}");
        printRow(array("Account", "Balance"));
        while ($row = $accounts->getNext()) {
            printRow(array($row["AC5_DESC"], $accounts->getActualBalance() . "&nbsp;"), "irgendwas");
        }
        printRow(array("Sum", $accounts->getSum()));
        endPrettyTable();
    }
} else {
    openForm("enter Date", $PHP_SELF);
    beginPrettyTable("2", "list bank and cash");
    makeTextField("date", get_today_hrd_string(), "Date:");
    makeSubmitter();
    endPrettyTable();
    closeForm();
}
endDocument();
Example #2
0
    } elseif ($vr_tp == "CR") {
        $type_of_voucher = "Credit ";
        $dr_cr = "D";
        $ac_array = get_ac5_sc_array("5(1)", "B");
    } elseif ($vr_tp == "JV") {
        $type_of_voucher = "Journal ";
        $dr_cr = "C";
        $ac_array = get_ac5_sc_array("5(1)", "B");
    } else {
        die("Unknown Voucher-type: ({$vr_tp})");
    }
    $dept_array = get_dept_array();
    if (!isset($ac_count)) {
        $ac_count = 3;
    }
    $today = get_today_hrd_string();
    ?>
 
	<table cellpadding=5 cellspacing=0 border=0 width='100%'>
	 <tr>
          <td valign=top align=center width='65%'>
	     <?php 
    openForm("transaction", $PHP_SELF, "onSubmit='return checkBeforeSubmit()'");
    beginPrettyTable("2", "enter {$type_of_voucher} Voucher");
    makeHiddenField("ac_count", "{$ac_count}");
    makeHiddenField("submitnow", "");
    makeHiddenField("vr_tp", $vr_tp);
    makePlainDropBox("ac_name", $ac_array, "Ac_Name");
    makePlainStaticField("t_dt", $today, "         ", 10);
    startRow();
    makePlainStaticField("dr_cr", $dr_cr, "DR./CR", 2);
Example #3
0
    $orderby = "EMP_ID3";
}
# calculate received money by Employees
$result = mysql_query("select SUM(AMOUNT),AC_ID5 from TRANS WHERE AC_ID3=30 AND DR_CR='C' GROUP BY AC_ID5 order by PARTY", $db);
checkMySQLError();
while ($row = mysql_fetch_array($result)) {
    $receive_array[$row["AC_ID5"]] = $row["SUM(AMOUNT)"];
}
# calculate paid_back money
$result = mysql_query("select SUM(AMOUNT),PARTY, AC_ID5 from TRANS WHERE AC_ID3=30 AND DR_CR='D' GROUP BY PARTY order by PARTY", $db);
checkMySQLError();
while ($row = mysql_fetch_array($result)) {
    if (array_key_exists($row["AC_ID5"], $receive_array)) {
        $receive_array[$row["AC_ID5"]] -= $row["SUM(AMOUNT)"];
    }
}
beginPrettyTable("1", "Schedule of Advance as on " . get_today_hrd_string());
if (isset($receive_array)) {
    printRow(array("Code", "Employer's name", "Amount"));
    foreach ($receive_array as $key => $value) {
        if ($value != 0) {
            printRow(array("{$key}", get_ac5_desc_of($key), 0 - $value), "something");
        }
        $sum += 0 - $value;
    }
    printRow(array("", "Sum", $sum));
} else {
    printRow(array("No Advance-money at anybody!"), "");
}
endPrettyTable();
endDocument();
    }
    printRow(array("", "<b>total Receipts<b>", "<b>" . $transactions->getTotalReceipts() . "</b>"));
    endPrettyTable();
    # Payments
    # generate Transaction-object
    if ($ac_id1 != 0) {
        $transactions = new Transactions($ac_id1, $startdate, $enddate);
    } else {
        $transactions = new Transactions_byProject("1", $startdate, $enddate);
    }
    beginPrettyTable("4", "Payments");
    printRow(array("Code Number", "Description", "Amount", "VR-Type"));
    while ($row = $transactions->getNextPayment()) {
        printRow($row, "fluct");
    }
    printRow(array("", "<b>total Payments</b>", "<b>" . $transactions->getTotalPayments() . "</b>"));
    printRow(array("", "<b>closing Balance:</b> ", "<b>" . $transactions->getClosingBalance() . "</b>"));
    endPrettyTable();
} else {
    $ac_array = get_ac_array(1);
    $ac_array[0] = "ALL PROJECTS";
    openForm("enter Date", $PHP_SELF);
    beginPrettyTable("2", "Project Transactions");
    makeDropBox("ac_id1", $ac_array, "Project");
    makeTextField("startdate", get_today_hrd_string(), "Start Date:");
    makeTextField("enddate", get_today_hrd_string(), "End Date:");
    makeSubmitter();
    endPrettyTable();
    closeForm();
}
endDocument();
Example #5
0
        die("more than one Voucher found! Database-integrity is in Danger! Call your System-maintainer!");
    }
    if ($row["VR_TP"] != "CR") {
        die("The given Voucher-No is not a CreditVoucher !");
    }
    for ($i = 0; $i < 2; $i++) {
        ?>
	<div align="center">
	<h1>Centre For The Rehabilitation Of The Paralysed (CRP)</h1>
	crp-Chapain, Savar, Dhaka-1343<br>
	Tel:7710464-5, Fax:7710069<br>
	Email: info@crp-bangladesh.org<br>
	<h2>MONEY RECEIPT</h2>
	</div>
	<div align="right">Date: <?php 
        echo get_today_hrd_string();
        ?>
 </div>

	<div align="left"> <?php 
        echo $row["VR_NO"];
        ?>
 </div>
	
	<div align="center"> Received with thanks an amount of Taka <?php 
        echo $row["AMOUNT"];
        ?>
<br>
	( in words: <?php 
        echo get_number_wording($row["AMOUNT"]);
        ?>