From a511899eb574dc84684190a3ed0c55b4a91d551e Mon Sep 17 00:00:00 2001 From: Morven Lewis-Everley Date: Tue, 3 Oct 2023 12:38:38 +0100 Subject: [PATCH] Add ability to manually set estimate/invoice prefix --- src/Model/Estimate.php | 8 ++++++++ src/Model/Invoice.php | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/Model/Estimate.php b/src/Model/Estimate.php index 23e5b37..af35154 100644 --- a/src/Model/Estimate.php +++ b/src/Model/Estimate.php @@ -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; } diff --git a/src/Model/Invoice.php b/src/Model/Invoice.php index 45244d2..9b4504e 100644 --- a/src/Model/Invoice.php +++ b/src/Model/Invoice.php @@ -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; }