1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Minor fixes

This commit is contained in:
David Bomba 2023-07-24 21:39:30 +10:00
parent 64e2ae0c57
commit 51a6cf12e1
2 changed files with 9 additions and 3 deletions

View File

@ -373,6 +373,8 @@ class BaseExport
if(!is_array($parts) || count($parts) < 2) if(!is_array($parts) || count($parts) < 2)
return ''; return '';
$value = '';
match($parts[0]) { match($parts[0]) {
'contact' => $value = $this->resolveClientContactKey($parts[1], $entity, $transformer), 'contact' => $value = $this->resolveClientContactKey($parts[1], $entity, $transformer),
'client' => $value = $this->resolveClientKey($parts[1], $entity, $transformer), 'client' => $value = $this->resolveClientKey($parts[1], $entity, $transformer),
@ -385,7 +387,7 @@ class BaseExport
'purchase_order' => $value = $this->resolvePurchaseOrderKey($parts[1], $entity, $transformer), 'purchase_order' => $value = $this->resolvePurchaseOrderKey($parts[1], $entity, $transformer),
'payment' => $value = $this->resolvePaymentKey($parts[1], $entity, $transformer), 'payment' => $value = $this->resolvePaymentKey($parts[1], $entity, $transformer),
'task' => $value = $this->resolveTaskKey($parts[1], $entity, $transformer), 'task' => $value = $this->resolveTaskKey($parts[1], $entity, $transformer),
default => $value = '' default => $value = '',
}; };
return $value; return $value;
@ -580,6 +582,7 @@ class BaseExport
private function resolveInvoiceKey($column, $entity, $transformer) private function resolveInvoiceKey($column, $entity, $transformer)
{ {
nlog("searching for {$column}"); nlog("searching for {$column}");
$transformed_invoice = false;
if($transformer instanceof PaymentTransformer) { if($transformer instanceof PaymentTransformer) {
$transformed_invoices = $transformer->includeInvoices($entity); $transformed_invoices = $transformer->includeInvoices($entity);
@ -615,9 +618,9 @@ class BaseExport
} }
if(array_key_exists($column, $transformed_invoice)) { if($transformed_invoice && array_key_exists($column, $transformed_invoice)) {
return $transformed_invoice[$column]; return $transformed_invoice[$column];
} elseif (array_key_exists(str_replace("invoice.", "", $column), $transformed_invoice)) { } elseif ($transformed_invoice && array_key_exists(str_replace("invoice.", "", $column), $transformed_invoice)) {
return $transformed_invoice[$column]; return $transformed_invoice[$column];
} }

View File

@ -1,8 +1,11 @@
includes:
- ./vendor/nunomaduro/larastan/extension.neon
parameters: parameters:
level: 4 level: 4
paths: paths:
- 'app/' - 'app/'
excludePaths: excludePaths:
- 'vendor/' - 'vendor/'
- 'app/Jobs/Ninja/*'
universalObjectCratesClasses: universalObjectCratesClasses:
- App\DataMapper\Tax\RuleInterface - App\DataMapper\Tax\RuleInterface