1
0
mirror of https://github.com/fspc/Yellow-Bike-Database.git synced 2025-02-22 17:03:22 -05:00

initial templating of gnucash csv creation

This commit is contained in:
Jonathan Rosenbaum 2015-04-03 06:54:16 +00:00
parent 81fdd2c518
commit c5443438f9
2 changed files with 41 additions and 3 deletions

View File

@ -380,6 +380,8 @@ $(function() {
// produce a GnuCash CSV file on submit // produce a GnuCash CSV file on submit
gnucash_csv_submit();
function gnucash_csv_submit() { function gnucash_csv_submit() {
// grab values // grab values
@ -405,8 +407,7 @@ $(function() {
} }
gnucash_csv_submit();
// null or real number // null or real number
function payment_result(result) { function payment_result(result) {
if (result == null) { if (result == null) {
@ -417,7 +418,6 @@ $(function() {
}; };
// Deposit Calculator function // Deposit Calculator function
function deposit_calculator() { function deposit_calculator() {

View File

@ -5,6 +5,7 @@ require_once('../Connections/YBDB.php');
mysql_select_db($database_YBDB, $YBDB); mysql_select_db($database_YBDB, $YBDB);
$change_fund = CHANGE_FUND; $change_fund = CHANGE_FUND;
$csv_directory = CSV_DIRECTORY;
// Is there a current shop? // Is there a current shop?
if(isset($_POST['shop_exist'])) { if(isset($_POST['shop_exist'])) {
@ -190,6 +191,43 @@ $change_fund = CHANGE_FUND;
} }
} }
// Create csv file(s) for GnuCash with this format:
if(isset($_POST['gnucash_account_type'])) {
$transaction_range = $_POST['transaction_range'];
$account_type = $_POST['gnucash_account_type'];
// Date (yyyy-mm-dd), Num, Description, Deposit, Account
// checking (check or cash) || credit
// transaction has been 1) paid and is 2) cash & check [checking] or credit and 3) deposited
if( $account_type === 'checking' ) {
}
if ( $account_type === 'credit' ) {
}
/*
SELECT SUBSTRING_INDEX(date, ' ', 1) AS 'date', transaction_id, transaction_type, description, amount
FROM transaction_log WHERE paid=1 AND date!='NULL'
AND (payment_type="cash" OR payment_type="check")
AND (transaction_id>256 AND transaction_id<259);
*/
/*
require_once('../php-console/src/PhpConsole/__autoload.php');
$handler = PhpConsole\Handler::getInstance();
$handler->start();
$handler->debug($transaction_range[0]);
*/
}
// Deposit Calculator // Deposit Calculator
if (isset($_POST['deposit'])) { if (isset($_POST['deposit'])) {