Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
cac0090
Update README.md with fork info
mc2contributor Feb 2, 2023
da180a0
Added DepositAdd and DepositMod.
stackpr Oct 2, 2014
3e9a65a
Use a transaction when initializing the database.
stackpr Oct 2, 2014
ae9da44
Add basic support for DepositQuery.
stackpr Oct 2, 2014
f1955f6
Use the map array provided as basis for sql_map.
stackpr Oct 3, 2014
a75cb78
Treat 'no object found' info codes as empty sets.
stackpr Oct 3, 2014
4fbaa72
Added JournalEntry. Adjusted DepositQuery.
stackpr Oct 3, 2014
7a1c556
Merge some of consolibyte/ PR#56 from cpnporg/quickbooks-php 3.0-extras
Feb 3, 2023
69f8e91
Remove trailing whitespace
Feb 3, 2023
e93146a
Simplify script directory lookup
Feb 2, 2023
8c58409
Fix null string errors in PHP 8
Feb 2, 2023
8ffcbdd
Log requests during development
Feb 2, 2023
36b9a98
Added Mysqli error() method
Feb 2, 2023
5311be8
Simplify XML generation with wrapper method
Feb 2, 2023
ce42518
Fix deprecated use of mysql_ functions, debug logging, refactoring
Feb 2, 2023
d229da4
Replace obsolete use of {} for arrays
Feb 2, 2023
c168c02
Refactor request functions in WC import example
Feb 2, 2023
c07832b
Refactor WC import example, creating queueRequest() function
Feb 2, 2023
a10d134
Log failed queries
Feb 2, 2023
aea74d9
Refactored data retrieval in WC import example, added tables for Purc…
Feb 2, 2023
66c218f
Fix invalid argument null to strtolower()
Feb 3, 2023
05f8725
Fix escaping of SQL values
Feb 3, 2023
ceb9513
Fix 2 bugs & simplify code
Feb 3, 2023
275ed9b
Fix bug from switch to heredoc, broken in 5311be8
Feb 3, 2023
3a844c2
Add missing QuickStart file to replace broken link
mc2contributor Feb 6, 2023
c48faaf
Add missing IPP QuickStart file to fix broken link
mc2contributor Feb 6, 2023
cf68c7b
Fix broken links in README
mc2contributor Feb 6, 2023
11afc2f
Update doc block for central QuickBooks_QBXML_Object::asQBXML().
amorsent Feb 24, 2023
9c8dd59
Remove redundant asQBXML() implementations from subclasses of QuickBo…
amorsent Feb 24, 2023
4db4975
Remove unused $root argument from asQBXML().
amorsent Feb 24, 2023
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 <keith@consolibyte.com>
* @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 <keith@consolibyte.com>
* @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