Browse Source

send values for processing individual csv files for each selected account type

devel
Jonathan Rosenbaum 10 years ago
parent
commit
81fdd2c518
  1. 2
      Connections/database_functions.php
  2. 26
      js/transaction.js
  3. 2
      transaction_log.php

2
Connections/database_functions.php

@ -164,7 +164,7 @@ define("CSV_DIRECTORY","csv");
// 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 Account" => "checking",
"Assets:Current Assets:PayPal" => "credit",
"Assets:Account Receivable" => "account_receivable",
"Assets:Donations" => "donation"

26
js/transaction.js

@ -380,6 +380,32 @@ $(function() {
// produce a GnuCash CSV file on submit
function gnucash_csv_submit() {
// grab values
$("#gnucash_csv_submit").on("click keypress",function() {
event.preventDefault();
var Format = wNumb({decimals:0});
var transaction_range = [];
var gnucash_accounts = [];
$.each($("#gnucash_csv_range").val(), function(k,v) {
transaction_range.push(Format.from(v));
});
gnucash_accounts = $("#gnucash_csv_accounts").val();
// send values for processing individual csv files for each selected account type
if (gnucash_accounts) {
$.each(gnucash_accounts, function(k,v) {
$.post("json/transaction.php",{ gnucash_account_type: v, transaction_range: transaction_range});
});
}
});
}
gnucash_csv_submit();
// null or real number
function payment_result(result) {

2
transaction_log.php

@ -822,7 +822,7 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) {
echo "<div id='range_slider'><div id='gnucash_csv_range'></div></div>";
echo "<br \><input type='text' id='slider_lower'>&nbsp;&nbsp;&nbsp;&nbsp;<input type='text' id='slider_upper'></td>";
echo "<td td style='vertical-align:inherit;'><input type='submit' name='Submit' /></td></tr></table></form>";
echo "<td td style='vertical-align:inherit;'><input id='gnucash_csv_submit' type='submit' name='Submit' /></td></tr></table></form>";
?>
</td>

Loading…
Cancel
Save