mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Ensure correct pattern for non-invoice entities
A simple `in_array` check would work here, except there are a lot of valid keys for the number pattern settings so it's easier this way.
This commit is contained in:
parent
e1d08d34bf
commit
bd49aa1a15
@ -208,13 +208,19 @@ class PdfMock
|
|||||||
*/
|
*/
|
||||||
public function getStubVariables(): array
|
public function getStubVariables(): array
|
||||||
{
|
{
|
||||||
// Although $this->mock is the Invoice/etc entity, we need the invitation to get company details.
|
$entity_pattern = $this->entity_string.'_number_pattern';
|
||||||
|
$entity_number = '0029';
|
||||||
|
|
||||||
|
if (!empty($this->settings->{$entity_pattern})) {
|
||||||
|
// Although $this->mock is the Invoice/etc entity,
|
||||||
|
// we need the invitation to get company details.
|
||||||
$entity_number = $this->getFormattedEntityNumber(
|
$entity_number = $this->getFormattedEntityNumber(
|
||||||
$this->mock->invitation,
|
$this->mock->invitation,
|
||||||
29,
|
(int) $entity_number,
|
||||||
$this->settings->counter_padding,
|
$this->settings->counter_padding,
|
||||||
$this->settings->invoice_number_pattern
|
$this->settings->{$entity_pattern},
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return ['values' =>
|
return ['values' =>
|
||||||
[
|
[
|
||||||
|
Loading…
x
Reference in New Issue
Block a user