mirror of
https://github.com/fspc/Yellow-Bike-Database.git
synced 2025-02-22 08:53:23 -05:00
initial templating of gnucash csv creation
This commit is contained in:
parent
81fdd2c518
commit
c5443438f9
@ -380,6 +380,8 @@ $(function() {
|
||||
|
||||
|
||||
// produce a GnuCash CSV file on submit
|
||||
gnucash_csv_submit();
|
||||
|
||||
function gnucash_csv_submit() {
|
||||
|
||||
// grab values
|
||||
@ -405,8 +407,7 @@ $(function() {
|
||||
|
||||
}
|
||||
|
||||
gnucash_csv_submit();
|
||||
|
||||
|
||||
// null or real number
|
||||
function payment_result(result) {
|
||||
if (result == null) {
|
||||
@ -417,7 +418,6 @@ $(function() {
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Deposit Calculator function
|
||||
function deposit_calculator() {
|
||||
|
||||
|
@ -5,6 +5,7 @@ require_once('../Connections/YBDB.php');
|
||||
mysql_select_db($database_YBDB, $YBDB);
|
||||
|
||||
$change_fund = CHANGE_FUND;
|
||||
$csv_directory = CSV_DIRECTORY;
|
||||
|
||||
// Is there a current shop?
|
||||
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
|
||||
if (isset($_POST['deposit'])) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user