mirror of
https://github.com/fspc/Yellow-Bike-Database.git
synced 2025-02-22 00:53:22 -05:00
send values for processing individual csv files for each selected account type
This commit is contained in:
parent
45b71aca5c
commit
81fdd2c518
@ -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"
|
||||
|
@ -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) {
|
||||
|
@ -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'> <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…
x
Reference in New Issue
Block a user