Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes & cleanup #320

Open
wants to merge 49 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
39b0ecf
Update README.md with fork info
mc2contributor Feb 2, 2023
72d7123
Added DepositAdd and DepositMod.
stackpr Oct 2, 2014
b6e251c
Use a transaction when initializing the database.
stackpr Oct 2, 2014
635ae4d
Add basic support for DepositQuery.
stackpr Oct 2, 2014
fef2cb8
Use the map array provided as basis for sql_map.
stackpr Oct 3, 2014
1c0327c
Treat 'no object found' info codes as empty sets.
stackpr Oct 3, 2014
074de99
Added JournalEntry. Adjusted DepositQuery.
stackpr Oct 3, 2014
e76ff9d
Remove trailing whitespace
Feb 3, 2023
92219ef
Simplify script directory lookup
Feb 2, 2023
e284edd
Fix null string errors in PHP 8
Feb 2, 2023
d7e5b56
Log requests during development
Feb 2, 2023
4903580
Added Mysqli error() method
Feb 2, 2023
eb8cccb
Simplify XML generation with wrapper method
Feb 2, 2023
6a6c1b7
Fix deprecated use of mysql_ functions, debug logging, refactoring
Feb 2, 2023
2fcd9af
Replace obsolete use of {} for arrays
Feb 2, 2023
db2e2f9
Refactor request functions in WC import example
Feb 2, 2023
0c6a222
Refactor WC import example, creating queueRequest() function
Feb 2, 2023
04e7670
Log failed queries
Feb 2, 2023
4ce0093
Refactored data retrieval in WC import example, added tables for Purc…
Feb 2, 2023
04c655c
Fix invalid argument null to strtolower()
Feb 3, 2023
a532872
Fix escaping of SQL values
Feb 3, 2023
8278719
Fix 2 bugs & simplify code
Feb 3, 2023
fec51b7
Fix bug from switch to heredoc, broken in 5311be8
Feb 3, 2023
93856af
Add missing QuickStart file to replace broken link
mc2contributor Feb 6, 2023
e983d6f
Add missing IPP QuickStart file to fix broken link
mc2contributor Feb 6, 2023
d8d4aba
Fix broken links in README
mc2contributor Feb 6, 2023
e379f54
Fix invalid iteratorID error
Mar 9, 2023
9251865
Fix SQL mirroring bugs
Mar 21, 2023
f7d0e55
Refactor redundant code
Mar 21, 2023
99f44d3
Fix rate value storage
Mar 22, 2023
b86c00a
Move qbsql_ fields to separate table; simplify code
Mar 22, 2023
e7f1bd7
Update README.md
mc2contributor Mar 23, 2023
1e9a252
Method to succinctly show caller location
Mar 27, 2023
0fc0b50
Enlarge database fields as needed to fit data with mysqli
mc2contributor May 16, 2023
d126164
Fix class name typo
mc2contributor May 16, 2023
6cd2609
Fix get_row() and get_var()
mc2contributor May 16, 2023
a844fac
Catch null argument earlier by enforcing argument types
mc2contributor Jun 27, 2023
c7ce2bf
Update on duplicate key; small fixes
mc2contributor Jan 9, 2024
021467d
Add timestamp to dev log
mc2contributor Jan 9, 2024
95534ce
Fix SQL for saving boolean values
mc2contributor Jan 16, 2024
0dcd523
Add handlers for CurrencyImport
mc2contributor Jan 16, 2024
777e9be
Use generic import handler to simplify coding
mc2contributor Jan 16, 2024
d9637fa
refreshed xml schema files
mc2rcanarslan Jan 16, 2024
20d166d
Use generic import the missing import actions we need
mc2contributor Jan 16, 2024
32fef3b
Documentation on use of SQL Mirror import
mc2contributor Jan 16, 2024
c778ac8
added: constant for checking extra xml elements on request
mc2rcanarslan Jan 16, 2024
50f655e
Customize import request XML for generic handler as needed
mc2contributor Jan 17, 2024
fef6fd7
fix: deprecated warnings
mc2rcanarslan Feb 15, 2024
074d2d9
fix: update without where clause
mc2rcanarslan Feb 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
244 changes: 122 additions & 122 deletions LICENSE.TXT

Large diffs are not rendered by default.

116 changes: 58 additions & 58 deletions QuickBooks.php
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
<?php

/**
* QuickBooks PHP DevKit
*
*
* Copyright (c) 2010 Keith Palmer / ConsoliBYTE, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.opensource.org/licenses/eclipse-1.0.php
*
*
* See also:
* http://wiki.consolibyte.com/
*
*
* Some notes:
* - Go download the QuickBooks SDK (it has lots of helpful stuff in it)
* - Go download the QuickBooks SDK (it has lots of helpful stuff in it)
* - Onscreen Reference (shows all of the XML commands)
* - Tools > qbXML Validator (the QuickBooks Web Connector error log shows almost no debugging information, run your XML through the Validator and it will tell you *exactly* what the error in your XML stream is)
* - Your version of QuickBooks might not support the latest version of the qbXML SDK, so you might have to set the qbXML message version with: <?qbxml version="x.y"?> (try 2.0 or another low number if you get error messages about versions)
* - Check our the QuickBooks_Utilities class, it contains a few helpful static methods
*
*
* @author Keith Palmer <[email protected]>
* @license LICENSE.txt
*
* @license LICENSE.txt
*
* @package QuickBooks
*/

/**
*
*
*/
define('QUICKBOOKS_TIMESTAMP', microtime(true));

/**
*
*
*/
define('QUICKBOOKS_BASEDIR', dirname(__FILE__));

Expand All @@ -47,28 +47,28 @@
if (function_exists('date_default_timezone_get'))
{
@date_default_timezone_get();
if (function_exists('error_get_last') and
$arrerr = error_get_last() and

if (function_exists('error_get_last') and
$arrerr = error_get_last() and
substr($arrerr['message'], 0, strlen('date_default_timezone_get')) == 'date_default_timezone_get')
{
// Ooops, they never set their time-zone and PHP is warning them about
// this! Let's try to auto-set their timezone, and set a flag so that
// they can find out what's going wrong later.
// Ooops, they never set their time-zone and PHP is warning them about
// this! Let's try to auto-set their timezone, and set a flag so that
// they can find out what's going wrong later.

/**
*
*
*/
define('QUICKBOOKS_TIMEZONE_AUTOSET', true);

date_default_timezone_set('America/New_York');
}
}

if (!defined('QUICKBOOKS_TIMEZONE_AUTOSET'))
{
/**
*
*
*/
define('QUICKBOOKS_TIMEZONE_AUTOSET', false);
}
Expand All @@ -92,7 +92,7 @@
define('QUICKBOOKS_PACKAGE_NAME', 'QuickBooks PHP DevKit');

/**
* The version of this QuickBooks package
* The version of this QuickBooks package
* @var string
*/
define('QUICKBOOKS_PACKAGE_VERSION', '3.0');
Expand Down Expand Up @@ -136,10 +136,10 @@
if (!defined('QUICKBOOKS_WSDL'))
{
/**
* Path to the QuickBooks WSDL file (the default WSDL is included with this package, you shouldn't need to override this generally)
* Path to the QuickBooks WSDL file (the default WSDL is included with this package, you shouldn't need to override this generally)
* @var string
*/
define('QUICKBOOKS_WSDL', dirname(__FILE__) . '/QuickBooks/QBWebConnectorSvc.wsdl');
define('QUICKBOOKS_WSDL', __DIR__ . '/QuickBooks/QBWebConnectorSvc.wsdl');
}

if (!defined('QUICKBOOKS_DEBUG'))
Expand All @@ -155,7 +155,7 @@
{
/**
* Debug log (unsupported?)
*
*
* @deprecated
* @var string
*/
Expand Down Expand Up @@ -204,12 +204,12 @@
*/

/**
*
*
*/
define('QUICKBOOKS_TYPE_QBFS', 'QBFS');

/**
*
*
*/
define('QUICKBOOKS_TYPE_QBPOS', 'QBPOS');

Expand All @@ -225,9 +225,9 @@

define('QUICKBOOKS_SUPPORTED_DEFAULT', '');
define('QUICKBOOKS_SUPPORTED_ALL', '0x0');
define('QUICKBOOKS_SUPPORTED_SIMPLESTART', '0x1');
define('QUICKBOOKS_SUPPORTED_PRO', '0x2');
define('QUICKBOOKS_SUPPORTED_PREMIER', '0x4');
define('QUICKBOOKS_SUPPORTED_SIMPLESTART', '0x1');
define('QUICKBOOKS_SUPPORTED_PRO', '0x2');
define('QUICKBOOKS_SUPPORTED_PREMIER', '0x4');
define('QUICKBOOKS_SUPPORTED_ENTERPRISE', '0x8');

define('QUICKBOOKS_PERSONALDATA_DEFAULT', '');
Expand Down Expand Up @@ -267,17 +267,17 @@

/**
* QuickBooks flag to request to enter "Interactive Mode"
*
*
* *** DO NOT CHANGE THIS *** This is a required QuickBooks-defined constant that is neccessary for interactive mode requests
*
*
* @var string
*/
/*
define('QUICKBOOKS_INTERACTIVE_MODE', 'Interactive mode');
*/

/**
*
*
*/
define('QUICKBOOKS_NOOP', 'NoOp');

Expand Down Expand Up @@ -506,10 +506,10 @@

/**
* Job constant in QuickBooks
*
* In actuality, there are no such thing as "Jobs" in QuickBooks. Jobs in
* QuickBooks are handled as customers with parent customers.
*
*
* In actuality, there are no such thing as "Jobs" in QuickBooks. Jobs in
* QuickBooks are handled as customers with parent customers.
*
* @var string
*/
define('QUICKBOOKS_OBJECT_JOB', 'Job');
Expand Down Expand Up @@ -758,7 +758,7 @@
define('QUICKBOOKS_DELETE_LIST', QUICKBOOKS_DEL_LIST);

/**
*
*
*/
define('QUICKBOOKS_OBJECT_TIMETRACKING', 'TimeTracking');
define('QUICKBOOKS_ADD_TIMETRACKING','TimeTrackingAdd');
Expand Down Expand Up @@ -826,15 +826,15 @@
define('QUICKBOOKS_IMPORT_UNITOFMEASURESET', 'UnitOfMeasureSetImport');

/**
* An always-present QuickBooks constant for "TAXABLE" items to embed in "SalesTaxCodeRef FullName" qbXML values
*
* An always-present QuickBooks constant for "TAXABLE" items to embed in "SalesTaxCodeRef FullName" qbXML values
*
* @var string
*/
define('QUICKBOOKS_TAXABLE', 'TAX');

/**
* An always-present QuickBooks constant for "NON-TAXABLE" items to embed in "SalesTaxCodeRef FullName" qbXML values
*
*
* @var string
*/
define('QUICKBOOKS_NONTAXABLE', 'NON');
Expand Down Expand Up @@ -874,10 +874,10 @@
define('QUICKBOOKS_ACCOUNT_SPECIALACCOUNTTYPE_PETTYCASH', 'PettyCash');
define('QUICKBOOKS_ACCOUNT_SPECIALACCOUNTTYPE_PURCHASEORDERS', 'PurchaseOrders');
define('QUICKBOOKS_ACCOUNT_SPECIALACCOUNTTYPE_RECONCILIATIONDIFFERENCES', 'ReconciliationDifferences');
define('QUICKBOOKS_ACCOUNT_SPECIALACCOUNTTYPE_RETAINEDEARNINGS', 'RetainedEarnings');
define('QUICKBOOKS_ACCOUNT_SPECIALACCOUNTTYPE_RETAINEDEARNINGS', 'RetainedEarnings');
define('QUICKBOOKS_ACCOUNT_SPECIALACCOUNTTYPE_SALESORDERS', 'SalesOrders');
define('QUICKBOOKS_ACCOUNT_SPECIALACCOUNTTYPE_SALESTAXPAYABLE', 'SalesTaxPayable');
define('QUICKBOOKS_ACCOUNT_SPECIALACCOUNTTYPE_UNCATEGORIZEDEXPENSES', 'UncategorizedExpenses');
define('QUICKBOOKS_ACCOUNT_SPECIALACCOUNTTYPE_UNCATEGORIZEDEXPENSES', 'UncategorizedExpenses');
define('QUICKBOOKS_ACCOUNT_SPECIALACCOUNTTYPE_UNCATEGORIZEDINCOME', 'UncategorizedIncome');
define('QUICKBOOKS_ACCOUNT_SPECIALACCOUNTTYPE_UNDEPOSITEDFUNDS', 'UndepositedFunds');

Expand All @@ -891,10 +891,10 @@

define('QUICKBOOKS_UNITOFMEASURESET_UNITOFMEASURETYPE_AREA', 'Area');
define('QUICKBOOKS_UNITOFMEASURESET_UNITOFMEASTURETYPE_COUNT', 'Count');
define('QUICKBOOKS_UNITOFMEASURESET_UNITOFMEASTURETYPE_LENGTH', 'Length');
define('QUICKBOOKS_UNITOFMEASURESET_UNITOFMEASTURETYPE_OTHER', 'Other');
define('QUICKBOOKS_UNITOFMEASURESET_UNITOFMEASTURETYPE_LENGTH', 'Length');
define('QUICKBOOKS_UNITOFMEASURESET_UNITOFMEASTURETYPE_OTHER', 'Other');
define('QUICKBOOKS_UNITOFMEASURESET_UNITOFMEASTURETYPE_TIME', 'Time');
define('QUICKBOOKS_UNITOFMEASURESET_UNITOFMEASTURETYPE_VOLUME', 'Volume');
define('QUICKBOOKS_UNITOFMEASURESET_UNITOFMEASTURETYPE_VOLUME', 'Volume');
define('QUICKBOOKS_UNITOFMEASURESET_UNITOFMEASTURETYPE_WEIGHT', 'Weight');

define('QUICKBOOKS_REPORT_GENERAL_SUMMARY', 'GeneralSummaryReportQuery');
Expand Down Expand Up @@ -951,7 +951,7 @@
define('QUICKBOOKS_STATUS_NOOP', 'n');

/**
* Error code for errors that are not really errors...
* Error code for errors that are not really errors...
* @var integer
*/
define('QUICKBOOKS_ERROR_OK', 0);
Expand Down Expand Up @@ -993,7 +993,7 @@
define('QUICKBOOKS_USER_DISABLED', 'd');

/**
*
*
*/
require_once QUICKBOOKS_BASEDIR . '/QuickBooks/Loader.php';

Expand All @@ -1011,7 +1011,7 @@
if (!defined('QUICKBOOKS_FRAMEWORKS'))
{
$all = 0;

$constants = get_defined_constants(true);
foreach ($constants['user'] as $constant => $value)
{
Expand All @@ -1020,19 +1020,19 @@
$all = $all | $value;
}
}

/**
* Determines which frameworks are included (if not defined, this defines it to include *everything*)
* @var integer
*/
define('QUICKBOOKS_FRAMEWORKS', $all);
}

if (QUICKBOOKS_FRAMEWORKS & QUICKBOOKS_FRAMEWORK_QUEUE or
if (QUICKBOOKS_FRAMEWORKS & QUICKBOOKS_FRAMEWORK_QUEUE or
QUICKBOOKS_FRAMEWORKS & QUICKBOOKS_FRAMEWORK_WEBCONNECTOR)
{
/**
* Queue class for QuickBooks queueing
* Queue class for QuickBooks queueing
*/
QuickBooks_Loader::load('/QuickBooks/WebConnector/Queue.php');
}
Expand All @@ -1043,12 +1043,12 @@
* SOAP server for QuickBooks web services
*/
QuickBooks_Loader::load('/QuickBooks/WebConnector/Server.php');

/**
* Web Connector generation
*/
QuickBooks_Loader::load('/QuickBooks/WebConnector/QWC.php');

/**
* Various QuickBooks utility classes
*/
Expand All @@ -1058,13 +1058,13 @@
if (QUICKBOOKS_FRAMEWORKS & QUICKBOOKS_FRAMEWORK_IPP)
{
/**
*
*
*/
QuickBooks_Loader::load('/QuickBooks/IPP.php');
}

if (QUICKBOOKS_FRAMEWORK_MISCELLANEOUS & QUICKBOOKS_FRAMEWORKS or
QUICKBOOKS_FRAMEWORK_ONLINEEDITION & QUICKBOOKS_FRAMEWORKS or
if (QUICKBOOKS_FRAMEWORK_MISCELLANEOUS & QUICKBOOKS_FRAMEWORKS or
QUICKBOOKS_FRAMEWORK_ONLINEEDITION & QUICKBOOKS_FRAMEWORKS or
QUICKBOOKS_FRAMEWORK_MERCHANTSERVICE & QUICKBOOKS_FRAMEWORKS)
{
/**
Expand All @@ -1076,15 +1076,15 @@
if (QUICKBOOKS_FRAMEWORK_CONSTANTS != QUICKBOOKS_FRAMEWORKS)
{
/**
* Functions for calling callback functions
* Functions for calling callback functions
*/
QuickBooks_Loader::load('/QuickBooks/Callbacks.php');
}

if (QUICKBOOKS_FRAMEWORK_MISCELLANEOUS & QUICKBOOKS_FRAMEWORKS)
{
/**
* Utilities for ensuring values fit into qbXML fields
* Utilities for ensuring values fit into qbXML fields
*/
QuickBooks_Loader::load('/QuickBooks/Cast.php');
}
Expand Down
20 changes: 10 additions & 10 deletions QuickBooks/Adapter/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@

/**
* Client adapter base class
*
*
* Copyright (c) 2010 Keith Palmer / ConsoliBYTE, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.opensource.org/licenses/eclipse-1.0.php
*
*
* @author Keith Palmer <[email protected]>
* @license LICENSE.txt
*
*
* @package QuickBooks
* @subpackage Adapter
*/

/**
*
*
*/
interface QuickBooks_Adapter_Client
{
public function __construct($endpoint, $wsdl = QUICKBOOKS_WSDL, $trace = true);

public function authenticate($user, $pass);

public function sendRequestXML($ticket, $hcpresponse, $companyfile, $country, $majorversion, $minorversion);

public function receiveResponseXML($ticket, $response, $hresult, $message);

public function getLastRequest();

public function getLastResponse();

}
Loading