mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 22:27:31 -05:00 
			
		
		
		
	Added fields to search (id number, vat number, ...)
This commit is contained in:
		
							parent
							
								
									1a27e28ff5
								
							
						
					
					
						commit
						e599b7ee89
					
				@ -125,7 +125,7 @@ class AccountRepository
 | 
				
			|||||||
            if ($client->name) {
 | 
					            if ($client->name) {
 | 
				
			||||||
                $data['clients'][] = [
 | 
					                $data['clients'][] = [
 | 
				
			||||||
                    'value' => $client->name,
 | 
					                    'value' => $client->name,
 | 
				
			||||||
                    'tokens' => $client->name,
 | 
					                    'tokens' => implode(',', [$client->name, $client->id_number, $client->vat_number, $client->work_phone]),
 | 
				
			||||||
                    'url' => $client->present()->url,
 | 
					                    'url' => $client->present()->url,
 | 
				
			||||||
                ];
 | 
					                ];
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@ -146,27 +146,18 @@ class AccountRepository
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            foreach ($client->contacts as $contact) {
 | 
					            foreach ($client->contacts as $contact) {
 | 
				
			||||||
                if ($contact->getFullName()) {
 | 
					 | 
				
			||||||
                $data['contacts'][] = [
 | 
					                $data['contacts'][] = [
 | 
				
			||||||
                    'value' => $contact->getDisplayName(),
 | 
					                    'value' => $contact->getDisplayName(),
 | 
				
			||||||
                        'tokens' => $contact->getDisplayName(),
 | 
					                    'tokens' => implode(',', [$contact->first_name, $contact->last_name, $contact->email, $contact->phone]),
 | 
				
			||||||
                    'url' => $client->present()->url,
 | 
					                    'url' => $client->present()->url,
 | 
				
			||||||
                ];
 | 
					                ];
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
                if ($contact->email) {
 | 
					 | 
				
			||||||
                    $data['contacts'][] = [
 | 
					 | 
				
			||||||
                        'value' => $contact->email,
 | 
					 | 
				
			||||||
                        'tokens' => $contact->email,
 | 
					 | 
				
			||||||
                        'url' => $client->present()->url,
 | 
					 | 
				
			||||||
                    ];
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            foreach ($client->invoices as $invoice) {
 | 
					            foreach ($client->invoices as $invoice) {
 | 
				
			||||||
                $entityType = $invoice->getEntityType();
 | 
					                $entityType = $invoice->getEntityType();
 | 
				
			||||||
                $data["{$entityType}s"][] = [
 | 
					                $data["{$entityType}s"][] = [
 | 
				
			||||||
                    'value' => $invoice->getDisplayName() . ': ' . $client->getDisplayName(),
 | 
					                    'value' => $invoice->getDisplayName() . ': ' . $client->getDisplayName(),
 | 
				
			||||||
                    'tokens' => $invoice->getDisplayName() . ': ' . $client->getDisplayName(),
 | 
					                    'tokens' => implode(',', [$invoice->invoice_number, $invoice->po_number]),
 | 
				
			||||||
                    'url' => $invoice->present()->url,
 | 
					                    'url' => $invoice->present()->url,
 | 
				
			||||||
                ];
 | 
					                ];
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user