Skip to content

Commit

Permalink
CIVIQBO-91 Adjust format of invoice prefix specifier
Browse files Browse the repository at this point in the history
  • Loading branch information
agileware-fj committed Oct 17, 2022
1 parent 93d7944 commit deb1a21
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CRM/Civiquickbooks/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ protected function mapToAccounts($db_contribution, $accountsID, $SyncToken, $qb_
}

if ($whereToGetInvoiceNumber == 'civi') {
$new_invoice['DocNumber'] = $invoice_prefix . sprintf("%07d", $db_contribution['id']);
$new_invoice['DocNumber'] = sprintf($invoice_prefix . '%s', $db_contribution['id'] , '');
}
elseif ($whereToGetInvoiceNumber == 'qb') {
$new_invoice['AutoDocNumber'] = 1;
Expand Down
2 changes: 1 addition & 1 deletion info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2022-10-17</releaseDate>
<version>2.9.1</version>
<version>2.9.2</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.0</ver>
Expand Down
42 changes: 25 additions & 17 deletions settings/civiquickbooks.setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,23 +158,6 @@
],
'quick_form_type' => 'Element',
],
'quickbooks_invoice_prefix' => [
'group_name' => E::ts('QuickBooks Online Settings'),
'group' => 'civiquickbooks',
'name' => 'quickbooks_invoice_prefix',
'type' => 'String',
'default' => 'Civi-',
'title' => E::ts('Invoice Prefix'),
'is_domain' => 1,
'is_contact' => 0,
'description' => E::ts('Will be prefixed to Transaction ID when creating an invoices in QBO.'),
'help_text' => E::ts('Will be prefixed to Transaction ID when creating an invoice in QBO.'),
'html_type' => 'Text',
'html_attributes' => [
'size' => 10,
],
'quick_form_type' => 'Element',
],
'quickbooks_log_dir' => [
'group_name' => E::ts('QuickBooks Online Settings'),
'group' => 'civiquickbooks',
Expand Down Expand Up @@ -263,6 +246,31 @@
],
'quick_form_type' => 'Element',
],
'quickbooks_invoice_prefix' => [
'group_name' => E::ts('QuickBooks Online Settings'),
'group' => 'civiquickbooks',
'name' => 'quickbooks_invoice_prefix',
'type' => 'String',
'default' => 'Civi-%07d',
'title' => E::ts('Invoice Prefix'),
'is_domain' => 1,
'is_contact' => 0,
'description' => E::ts(
'Will be prefixed to Transaction ID when CiviCRM generates an Invoice number for QBO. You can optionally include a format specifier <a href="%1">for printf</a> e.g. %2 will enforce 7 digits with 0 as padding (123 => Civi-0000123)',
[ 1 => 'https://www.php.net/manual/en/function.printf.php',
2 => 'Civi-%07d'
]),
'help_text' => E::ts(
'Will be prefixed to Transaction ID when CiviCRM generates an Invoice number for QBO. You can optionally include a format specifier <a href="%1">for printf</a> e.g. %2 will enforce 7 digits with 0 as padding (123 => Civi-0000123)',
[ 1 => 'https://www.php.net/manual/en/function.printf.php',
2 => 'Civi-%07d'
]),
'html_type' => 'Text',
'html_attributes' => [
'size' => 10,
],
'quick_form_type' => 'Element',
],
'quickbooks_allow_ach' => [
'group_name' => E::ts('QuickBooks Online Settings'),
'group' => 'civiquickbooks',
Expand Down

0 comments on commit deb1a21

Please sign in to comment.