diff --git a/Connections/database_functions.php b/Connections/database_functions.php index 92c4758..fb9b7e6 100644 --- a/Connections/database_functions.php +++ b/Connections/database_functions.php @@ -155,12 +155,19 @@ define("CSV_DIRECTORY","csv"); // chmod 0700 csv // 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 +// 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 +// 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", "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 diff --git a/css/transactions.css b/css/transactions.css index 12a8809..fa4501b 100644 --- a/css/transactions.css +++ b/css/transactions.css @@ -58,8 +58,9 @@ input[value=Save]:focus, input[value=Close]:focus { width: 80px; } +/* was 351 */ #gnucash_csv_range { - width: 351px; + width: 496px; } #range_slider { @@ -71,6 +72,10 @@ input[value=Save]:focus, input[value=Close]:focus { vertical-align: middle; } +#slider_upper { + margin-left: 147px; +} + /* errors */ #current_shop > a, #date_error, #transaction_start_error, diff --git a/js/transaction.js b/js/transaction.js index b172645..84b314a 100644 --- a/js/transaction.js +++ b/js/transaction.js @@ -379,6 +379,8 @@ $(function() { $("[name='gnucash_csv_year']").chosen(); + // produce a GnuCash CSV file on submit + // null or real number function payment_result(result) { if (result == null) { @@ -387,6 +389,8 @@ $(function() { return Number(result).toFixed(2); } }; + + // Deposit Calculator function function deposit_calculator() { diff --git a/json/transaction.php b/json/transaction.php index e118a1a..b2b1336 100644 --- a/json/transaction.php +++ b/json/transaction.php @@ -150,12 +150,13 @@ $change_fund = CHANGE_FUND; // 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) // which would be useful to record in an accounting program. // 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 - // 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'])) { $query = 'SELECT transaction_id, IF(amount >= 0, "yes", "no") AS "deposited", date FROM transaction_log WHERE transaction_type= "Deposit";'; diff --git a/transaction_log.php b/transaction_log.php index 59bae18..9b4d926 100644 --- a/transaction_log.php +++ b/transaction_log.php @@ -817,11 +817,12 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) { echo ""; // range bar - echo " + echo "
"; echo "
"; - echo "
    "; + echo "
    "; + echo ""; ?>