forked from science-ation/science-ation
Add todo list for receipts and database to track receipts
This commit is contained in:
parent
ee995654b3
commit
ac3f5f9eb4
@ -124,7 +124,7 @@ $q=mysql_query("SELECT * FROM fundraising_goals WHERE fiscalyear='{$config['FISC
|
|||||||
<h3><?=i18n("To Do List")?></h3>
|
<h3><?=i18n("To Do List")?></h3>
|
||||||
<h4><?=i18n("Thank You's")?></h4>
|
<h4><?=i18n("Thank You's")?></h4>
|
||||||
<?
|
<?
|
||||||
$q=mysql_query("SELECT value, thanked, status, users_uid, sponsors_id, datereceived,
|
$q=mysql_query("SELECT value, thanked, status, sponsors_id, datereceived,
|
||||||
DATE_ADD(datereceived, INTERVAL 1 MONTH) < NOW() AS onemonth,
|
DATE_ADD(datereceived, INTERVAL 1 MONTH) < NOW() AS onemonth,
|
||||||
DATE_ADD(datereceived, INTERVAL 2 MONTH) < NOW() AS twomonth
|
DATE_ADD(datereceived, INTERVAL 2 MONTH) < NOW() AS twomonth
|
||||||
FROM fundraising_donations
|
FROM fundraising_donations
|
||||||
@ -132,7 +132,6 @@ $q=mysql_query("SELECT value, thanked, status, users_uid, sponsors_id, daterecei
|
|||||||
AND fiscalyear='{$config['FISCALYEAR']}'
|
AND fiscalyear='{$config['FISCALYEAR']}'
|
||||||
ORDER BY datereceived
|
ORDER BY datereceived
|
||||||
");
|
");
|
||||||
//AND (users.year IS NULL OR users.year='{$config['FISCALYEAR']}')
|
|
||||||
echo mysql_error();
|
echo mysql_error();
|
||||||
if(mysql_num_rows($q)) {
|
if(mysql_num_rows($q)) {
|
||||||
echo "<table class=\"tableview\">";
|
echo "<table class=\"tableview\">";
|
||||||
@ -143,14 +142,7 @@ if(mysql_num_rows($q)) {
|
|||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
|
|
||||||
while($r=mysql_fetch_object($q)) {
|
while($r=mysql_fetch_object($q)) {
|
||||||
/*
|
$dq=mysql_query("SELECT organization AS name FROM sponsors WHERE id='$r->sponsors_id'");
|
||||||
if($r->users_uid) {
|
|
||||||
$dq=mysql_query("SELECT CONCAT(firstname,' ',lastname) AS name FROM users WHERE uid='$r->users_uid' ORDER BY fairyear DESC LIMIT 1");
|
|
||||||
}
|
|
||||||
else if ($r->sponsors_id) {
|
|
||||||
*/
|
|
||||||
$dq=mysql_query("SELECT organization AS name FROM sponsors WHERE id='$r->sponsors_id'");
|
|
||||||
// }
|
|
||||||
$dr=mysql_fetch_object($dq);
|
$dr=mysql_fetch_object($dq);
|
||||||
if($r->twomonth) $s="style=\"background-color: ".colour_to_percent(0).";\"";
|
if($r->twomonth) $s="style=\"background-color: ".colour_to_percent(0).";\"";
|
||||||
else if($r->onemonth) $s="style=\"background-color: ".colour_to_percent(50).";\"";
|
else if($r->onemonth) $s="style=\"background-color: ".colour_to_percent(50).";\"";
|
||||||
@ -171,6 +163,48 @@ if(mysql_num_rows($q)) {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
<h4><?=i18n("Receipts to Issue")?></h4>
|
||||||
|
<?
|
||||||
|
$q=mysql_query("SELECT value, receiptrequired, receiptsent, status, sponsors_id, datereceived,
|
||||||
|
DATE_ADD(datereceived, INTERVAL 1 MONTH) < NOW() AS onemonth,
|
||||||
|
DATE_ADD(datereceived, INTERVAL 2 MONTH) < NOW() AS twomonth
|
||||||
|
FROM fundraising_donations
|
||||||
|
WHERE (receiptrequired='yes' AND receiptsent='no') AND status='received'
|
||||||
|
AND fiscalyear='{$config['FISCALYEAR']}'
|
||||||
|
ORDER BY datereceived
|
||||||
|
");
|
||||||
|
echo mysql_error();
|
||||||
|
if(mysql_num_rows($q)) {
|
||||||
|
echo "<table class=\"tableview\">";
|
||||||
|
echo "<tr><th>".i18n("Name")."</th>\n";
|
||||||
|
echo "<th>".i18n("Date Received")."</th>\n";
|
||||||
|
echo "<th>".i18n("Amount")."</th>\n";
|
||||||
|
echo "<th>".i18n("Generate Receipt")."</th>\n";
|
||||||
|
echo "</tr>\n";
|
||||||
|
|
||||||
|
while($r=mysql_fetch_object($q)) {
|
||||||
|
$dq=mysql_query("SELECT organization AS name FROM sponsors WHERE id='$r->sponsors_id'");
|
||||||
|
$dr=mysql_fetch_object($dq);
|
||||||
|
if($r->twomonth) $s="style=\"background-color: ".colour_to_percent(0).";\"";
|
||||||
|
else if($r->onemonth) $s="style=\"background-color: ".colour_to_percent(50).";\"";
|
||||||
|
else $s="";
|
||||||
|
|
||||||
|
echo "<tr $s>";
|
||||||
|
echo " <td>$dr->name</td>";
|
||||||
|
echo " <td>".format_date($r->datereceived)."</td>";
|
||||||
|
echo " <td style=\"text-align: right;\">".format_money($r->value)."</td>";
|
||||||
|
echo " <td style=\"text-align: center;\">";
|
||||||
|
echo "<a href=\"#\" onclick=\"return false;\">".i18n("Generate Receipt")."</a></td>";
|
||||||
|
echo "</tr>\n";
|
||||||
|
}
|
||||||
|
echo "</table>\n";
|
||||||
|
}else {
|
||||||
|
echo i18n("No Receipts pending");
|
||||||
|
echo "<br />\n";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<h4><?=i18n("Appeal Follow-Ups")?></h4>
|
<h4><?=i18n("Appeal Follow-Ups")?></h4>
|
||||||
<?
|
<?
|
||||||
@ -202,13 +236,13 @@ if(mysql_num_rows($q)) {
|
|||||||
echo "<table class=\"tableview\">";
|
echo "<table class=\"tableview\">";
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
echo " <th>".i18n("Name")."</th>\n";
|
echo " <th>".i18n("Name")."</th>\n";
|
||||||
echo " <th>".i18n("Funding Selection Date")."</th>\n";
|
|
||||||
echo " <th>".i18n("Proposal Submission Date")."</th>\n";
|
echo " <th>".i18n("Proposal Submission Date")."</th>\n";
|
||||||
|
echo " <th>".i18n("Funding Selection Date")."</th>\n";
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
while($r=mysql_fetch_object($q)) {
|
while($r=mysql_fetch_object($q)) {
|
||||||
echo "<tr><td>$r->organization</td>";
|
echo "<tr><td>$r->organization</td>";
|
||||||
echo "<td>".format_date($r->fundingselectiondate)."</td>";
|
|
||||||
echo "<td>".format_date($r->proposalsubmissiondate)."</td>";
|
echo "<td>".format_date($r->proposalsubmissiondate)."</td>";
|
||||||
|
echo "<td>".format_date($r->fundingselectiondate)."</td>";
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
}
|
}
|
||||||
echo "</table>\n";
|
echo "</table>\n";
|
||||||
|
@ -1 +1 @@
|
|||||||
147
|
148
|
||||||
|
4
db/db.update.148.sql
Normal file
4
db/db.update.148.sql
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
ALTER TABLE `fundraising_donations` DROP `users_uid` ;
|
||||||
|
ALTER TABLE `fundraising_donations` ADD `receiptrequired` ENUM( 'no', 'yes' ) NOT NULL AFTER `thanked` ;
|
||||||
|
ALTER TABLE `fundraising_donations` ADD `receiptsent` ENUM( 'no', 'yes' ) NOT NULL AFTER `receiptrequired` ;
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user