mirror of
https://github.com/fspc/Yellow-Bike-Database.git
synced 2025-02-22 17:03:22 -05:00
Adds submit button and improves gui.
1) Adds more text explanation .. although NULL transactions are just an experimental idea. 2) beginnings of submit code
This commit is contained in:
parent
bae4030274
commit
45b71aca5c
@ -155,12 +155,19 @@ define("CSV_DIRECTORY","csv");
|
|||||||
// chmod 0700 csv
|
// chmod 0700 csv
|
||||||
|
|
||||||
// Define array mapping for Accounts. Usually Asset Accounts since Income is generally the main type of transaction.
|
// Define array mapping for Accounts. Usually Asset Accounts since Income is generally the main type of transaction.
|
||||||
// Currently three types of accounts are supported: checking, credit, account_receivable
|
// Currently four types of accounts are supported: checking, credit, account_receivable, donation
|
||||||
// checking/credit = transaction has been 1) paid and is 2) cash & check [checking] or a credit card [credit] and 3) deposited
|
// checking/credit = transaction has been 1) paid and is 2) cash & check [checking] or a credit card [credit] and 3) deposited
|
||||||
|
// note: checking type may include $0 transactions, e.g. earn-a-bike
|
||||||
// account_receivable = there is an 1). account receivable invoice and it has been 2) paid and 3) deposited
|
// account_receivable = there is an 1). account receivable invoice and it has been 2) paid and 3) deposited
|
||||||
|
// donation = transaction that currently has no assessed monetary amount (NULL),
|
||||||
|
// e.g. shop item giveaway or patron non-monetary donation
|
||||||
|
// note: this is a hack for record keeping in an accounting program, and not recommended;
|
||||||
|
// bike donations/giveaways should be handled in a better way like using BikeBinder,
|
||||||
|
// an inventory system application,that may be tied into YBDB someday
|
||||||
$gnucash_accounts = array( "Assets:Current Assets:Checking" => "checking",
|
$gnucash_accounts = array( "Assets:Current Assets:Checking" => "checking",
|
||||||
"Assets:Current Assets:PayPal" => "credit",
|
"Assets:Current Assets:PayPal" => "credit",
|
||||||
"Assets:Account Receivable" => "account_receivable"
|
"Assets:Account Receivable" => "account_receivable",
|
||||||
|
"Assets:Donations" => "donation"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Most collectives require only one shop at a time, but YBDB provides a way to handle 2 concurrent
|
// Most collectives require only one shop at a time, but YBDB provides a way to handle 2 concurrent
|
||||||
|
@ -58,8 +58,9 @@ input[value=Save]:focus, input[value=Close]:focus {
|
|||||||
width: 80px;
|
width: 80px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* was 351 */
|
||||||
#gnucash_csv_range {
|
#gnucash_csv_range {
|
||||||
width: 351px;
|
width: 496px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#range_slider {
|
#range_slider {
|
||||||
@ -71,6 +72,10 @@ input[value=Save]:focus, input[value=Close]:focus {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#slider_upper {
|
||||||
|
margin-left: 147px;
|
||||||
|
}
|
||||||
|
|
||||||
/* errors */
|
/* errors */
|
||||||
#current_shop > a, #date_error,
|
#current_shop > a, #date_error,
|
||||||
#transaction_start_error,
|
#transaction_start_error,
|
||||||
|
@ -379,6 +379,8 @@ $(function() {
|
|||||||
$("[name='gnucash_csv_year']").chosen();
|
$("[name='gnucash_csv_year']").chosen();
|
||||||
|
|
||||||
|
|
||||||
|
// produce a GnuCash CSV file on submit
|
||||||
|
|
||||||
// null or real number
|
// null or real number
|
||||||
function payment_result(result) {
|
function payment_result(result) {
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
@ -387,6 +389,8 @@ $(function() {
|
|||||||
return Number(result).toFixed(2);
|
return Number(result).toFixed(2);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Deposit Calculator function
|
// Deposit Calculator function
|
||||||
function deposit_calculator() {
|
function deposit_calculator() {
|
||||||
|
@ -150,12 +150,13 @@ $change_fund = CHANGE_FUND;
|
|||||||
|
|
||||||
// populate transaction slider for accounting programs
|
// populate transaction slider for accounting programs
|
||||||
|
|
||||||
// Originally wasn't going to include deposits of $0 (amount > 0), however,
|
// Originally, deposits of $0 (amount > 0) would not be considered real deposits, however,
|
||||||
// there may be shops where only non-monetary transactions occurred (amount >= 0)
|
// there may be shops where only non-monetary transactions occurred (amount >= 0)
|
||||||
// which would be useful to record in an accounting program.
|
// which would be useful to record in an accounting program.
|
||||||
// One caveat, if a monetary transaction is recorded, but the depositor only
|
// One caveat, if a monetary transaction is recorded, but the depositor only
|
||||||
// enters $0, the deposit will show "Difference: n/a", however this should be a cue
|
// enters $0, the deposit will show "Difference: n/a", however this should be a cue
|
||||||
// since obvious a real world $0 deposit wouldn't be recorded.
|
// since it should be obvious that a real world deposit of $0
|
||||||
|
// would not be made at a bank.
|
||||||
if (isset($_POST['transaction_slider'])) {
|
if (isset($_POST['transaction_slider'])) {
|
||||||
$query = 'SELECT transaction_id, IF(amount >= 0, "yes", "no") AS "deposited", date
|
$query = 'SELECT transaction_id, IF(amount >= 0, "yes", "no") AS "deposited", date
|
||||||
FROM transaction_log WHERE transaction_type= "Deposit";';
|
FROM transaction_log WHERE transaction_type= "Deposit";';
|
||||||
|
@ -817,11 +817,12 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) {
|
|||||||
echo "</select>";
|
echo "</select>";
|
||||||
|
|
||||||
// range bar
|
// range bar
|
||||||
echo "<td style='vertical-align:top; padding-left:10px; padding-right:10px; padding-bottom:10px;'>
|
echo "<td style='vertical-align:top; padding-left:10px; padding-right:2px; padding-bottom:10px;'>
|
||||||
<label class='gnucash_csv' for='gnucash_csv_range'>Deposit Range</label><br \>";
|
<label class='gnucash_csv' for='gnucash_csv_range'>Deposit Range</label><br \>";
|
||||||
echo "<div id='range_slider'><div id='gnucash_csv_range'></div></div>";
|
echo "<div id='range_slider'><div id='gnucash_csv_range'></div></div>";
|
||||||
|
|
||||||
echo "<br \><input type='text' id='slider_lower'> <input type='text' id='slider_upper'></td></tr></table></form>";
|
echo "<br \><input type='text' id='slider_lower'> <input type='text' id='slider_upper'></td>";
|
||||||
|
echo "<td td style='vertical-align:inherit;'><input type='submit' name='Submit' /></td></tr></table></form>";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user