Skip to content

Commit

Permalink
Add ability to manually set estimate/invoice prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewis-everley committed Oct 3, 2023
1 parent d4800ad commit a511899
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Model/Estimate.php
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,14 @@ protected function get_prefix()
*/
protected function getPrefix(): string
{
$prefix = $this
->dbObject('Prefix')
->getValue();

if (!empty($prefix)) {
return (string)$prefix;
}

$config = SiteConfig::current_site_config();
return (string)$config->EstimateNumberPrefix;
}
Expand Down
8 changes: 8 additions & 0 deletions src/Model/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,14 @@ protected function get_prefix()
*/
protected function getPrefix(): string
{
$prefix = $this
->dbObject('Prefix')
->getValue();

if (!empty($prefix)) {
return (string)$prefix;
}

$config = SiteConfig::current_site_config();
return (string)$config->InvoiceNumberPrefix;
}
Expand Down

0 comments on commit a511899

Please sign in to comment.