From 9362a8b954a93094a433530a076d64bbd2b374d5 Mon Sep 17 00:00:00 2001 From: Joe Murray Date: Tue, 8 Aug 2023 09:39:35 -0400 Subject: [PATCH 1/2] Copy edits, added that QBO Canada works --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9447b3c..3bf5ccb 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ extension has been developed and tested with: 1. QuickBooks Online, Australia (AU) 2. QuickBooks Online, United States (USA) 3. QuickBooks Online, United Kingdom (UK) +4. QuickBooks Online, Canada (CA) CiviQuickBooks will only synchronise contacts to Quickbooks Online from your CiviCRM when a Contribution is added to them, either through online payments or @@ -76,11 +77,11 @@ CiviQuickBooks Online Settings page is shown below. ### Map your QuickBooks product/service to CiviCRM Financial account codes Each QuickBooks Product/Service has a unique name. This is used in the CiviCRM -Financial account codes to correctly code each Invoice in QuickBooks Online. +Financial Account codes to correctly code each Invoice in QuickBooks Online. 1. Open the QuickBooks Company, go to product/service settings page - ([https://sandbox.qbo.intuit.com/app/items](https://sandbox.qbo.intuit.com/app/items)) -2. Identify each QuickBooks Product/Service that you what to sync with CiviCRM + ([https://sandbox.qbo.intuit.com/app/items](https://sandbox.qbo.intuit.com/app/items)). +2. Identify each QuickBooks Product/Service that you want to sync with CiviCRM. 3. Open the CiviCRM Financial Account setting page (civicrm/admin/financial/financialAccount) and update the `Acctg Code` of corresponding Financial account to be the same as each QuickBooks @@ -92,7 +93,7 @@ Financial account codes to correctly code each Invoice in QuickBooks Online. 5. During sync, the Contribution line item will be set to the corresponding QuickBooks Product/Service. 6. When a CiviCRM `Acctg Code` does not match any QuickBooks Product/Service - name, which means that the there is no product/service in QuickBooks has the + name, which means that no product/service in QuickBooks has the same name, that particular line item will **NOT** be pushed through the invoice. @@ -171,9 +172,9 @@ For more details on the QuickBooks Online environments, see: have even one item in it after the filtering, the invoice will not be pushed successfully. 2. As long as an invoice has at least one item in it after filtering, the - information about those none-pushed items will be noted down as `customer + information about those non-pushed items will be noted down as `customer memo` field. The `id` of the problematic financial type and its `acctg code` - will be listed. In that case, you need to manually fix the invoice manually. + will be listed. In that case, you need to fix the invoice manually. # Funding for this CiviCRM extension From e490e3fc45d7ea985dcdc023c68c337292d34823 Mon Sep 17 00:00:00 2001 From: JoeMurray Date: Tue, 8 Aug 2023 15:15:20 +0000 Subject: [PATCH 2/2] CIVIBLD-287 [AUTO] civix upgraded Files changed: M civiquickbooks.civix.php M civiquickbooks.php M info.xml A mixin/smarty-v2@1.0.1.mixin.php --- civiquickbooks.civix.php | 20 ++----------- civiquickbooks.php | 9 ------ info.xml | 4 ++- mixin/smarty-v2@1.0.1.mixin.php | 51 +++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 28 deletions(-) create mode 100644 mixin/smarty-v2@1.0.1.mixin.php diff --git a/civiquickbooks.civix.php b/civiquickbooks.civix.php index fbbc739..7e7015d 100644 --- a/civiquickbooks.civix.php +++ b/civiquickbooks.civix.php @@ -99,11 +99,6 @@ function _civiquickbooks_civix_civicrm_config($config = NULL) { $configured = TRUE; $extRoot = __DIR__ . DIRECTORY_SEPARATOR; - $extDir = $extRoot . 'templates'; - if (file_exists($extDir)) { - CRM_Core_Smarty::singleton()->addTemplateDir($extDir); - } - $include_path = $extRoot . PATH_SEPARATOR . get_include_path(); set_include_path($include_path); _civiquickbooks_civix_mixin_polyfill(); @@ -145,8 +140,8 @@ function _civiquickbooks_civix_insert_navigation_menu(&$menu, $path, $item) { if (empty($path)) { $menu[] = [ 'attributes' => array_merge([ - 'label' => CRM_Utils_Array::value('name', $item), - 'active' => 1, + 'label' => $item['name'] ?? NULL, + 'active' => 1, ], $item), ]; return TRUE; @@ -210,14 +205,3 @@ function _civiquickbooks_civix_fixNavigationMenuItems(&$nodes, &$maxNavID, $pare } } } - -/** - * (Delegated) Implements hook_civicrm_entityTypes(). - * - * Find any *.entityType.php files, merge their content, and return. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_entityTypes - */ -function _civiquickbooks_civix_civicrm_entityTypes(&$entityTypes) { - $entityTypes = array_merge($entityTypes, []); -} diff --git a/civiquickbooks.php b/civiquickbooks.php index ff781b4..be9e7b7 100644 --- a/civiquickbooks.php +++ b/civiquickbooks.php @@ -270,12 +270,3 @@ function civiquickbooks_civicrm_pageRun(&$page) { ]); } } - -/** - * Implements hook_civicrm_entityTypes(). - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_entityTypes - */ -function civiquickbooks_civicrm_entityTypes(&$entityTypes) { - _civiquickbooks_civix_civicrm_entityTypes($entityTypes); -} diff --git a/info.xml b/info.xml index 02c078e..593a5ae 100644 --- a/info.xml +++ b/info.xml @@ -26,15 +26,17 @@ Development and support for this Extension is funded solely by Agileware and CiviCRM community contributions. Agileware does not receive any funding at all for this Extension from the CiviCRM Partner program or CiviCRM LLC. Agileware welcome any funding to help continue paying Agileware staff to continue contributing to the CiviCRM community and Extensions. You can donate to Agileware using https://www.paypal.me/agileware CRM/Civiquickbooks - 22.12.1 + 23.02.1 menu-xml@1.0.0 mgd-php@1.0.0 setting-php@1.0.0 + smarty-v2@1.0.1 + CRM_Civiquickbooks_Upgrader diff --git a/mixin/smarty-v2@1.0.1.mixin.php b/mixin/smarty-v2@1.0.1.mixin.php new file mode 100644 index 0000000..5972dbd --- /dev/null +++ b/mixin/smarty-v2@1.0.1.mixin.php @@ -0,0 +1,51 @@ +getPath('templates'); + if (!file_exists($dir)) { + return; + } + + $register = function() use ($dir) { + // This implementation has a theoretical edge-case bug on older versions of CiviCRM where a template could + // be registered more than once. + CRM_Core_Smarty::singleton()->addTemplateDir($dir); + }; + + // Let's figure out what environment we're in -- so that we know the best way to call $register(). + + if (!empty($GLOBALS['_CIVIX_MIXIN_POLYFILL'])) { + // Polyfill Loader (v<=5.45): We're already in the middle of firing `hook_config`. + if ($mixInfo->isActive()) { + $register(); + } + return; + } + + if (CRM_Extension_System::singleton()->getManager()->extensionIsBeingInstalledOrEnabled($mixInfo->longName)) { + // New Install, Standard Loader: The extension has just been enabled, and we're now setting it up. + // System has already booted. New templates may be needed for upcoming installation steps. + $register(); + return; + } + + // Typical Pageview, Standard Loader: Defer the actual registration for a moment -- to ensure that Smarty is online. + \Civi::dispatcher()->addListener('hook_civicrm_config', function() use ($mixInfo, $register) { + if ($mixInfo->isActive()) { + $register(); + } + }); + +};