Additional information for client presenter dropdown

This commit is contained in:
David Bomba 2024-06-03 07:29:18 +10:00
parent e5bc935515
commit fc091659ed
2 changed files with 21 additions and 3 deletions

View File

@ -105,17 +105,34 @@ class PayPalBalanceAffecting
public $discount; public $discount;
public $creditTransactionalFee; public $creditTransactionalFee;
public $originalInvoiceId; public $originalInvoiceId;
public function __construct(private array $import_row){} public function __construct(private array $import_row){}
public function run(): self public function run(): self
{ {
$this->cleanUp();
foreach($this->import_row as $key => $value) { foreach($this->import_row as $key => $value) {
$prop = $this->key_map[$key] ?? false; $prop = $this->key_map[$key] ?? false;
if($prop) if($prop){
echo "Setting {$prop} to {$value}".PHP_EOL;
$this->{$prop} = $value; $this->{$prop} = $value;
}
}
return $this;
}
private function cleanUp(): self
{
foreach($this->key_map as $value){
echo "Setting {$value} to null".PHP_EOL;
$this->{$value} = null;
} }
return $this; return $this;
@ -149,6 +166,7 @@ class PayPalBalanceAffecting
'line_items' => [$item], 'line_items' => [$item],
'name' => $this->name ?? '', 'name' => $this->name ?? '',
'email' => $this->fromEmailAddress ?? '', 'email' => $this->fromEmailAddress ?? '',
'transaction_reference' => $this->transactionId ?? '',
]; ];
} }

View File

@ -25,7 +25,7 @@
@foreach($multiple_contacts as $contact) @foreach($multiple_contacts as $contact)
<a data-turbolinks="false" <a data-turbolinks="false"
href="{{ route('client.switch_company', $contact->hashed_id) }}" href="{{ route('client.switch_company', $contact->hashed_id) }}"
class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900">{{ $contact->client->present()->name()}} class="block px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900">{{ $contact->client->present()->name()}} - ({{$contact->company->present()->name()}})
</a> </a>
@endforeach @endforeach
</div> </div>