mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 23:37:33 -05:00 
			
		
		
		
	fix missing custom identifier property
This commit is contained in:
		
							parent
							
								
									2fd38ca2f6
								
							
						
					
					
						commit
						808e0ffbb7
					
				@ -15,11 +15,12 @@ class ContactComponent extends Component
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function __construct(ClientContact $contact) {
 | 
					    public function __construct(ClientContact $contact) {
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
        $contact = collect($contact->client->contacts->firstWhere('is_primary', 1)->toArray())->merge([
 | 
					        $contact = collect($contact->client->contacts->firstWhere('is_primary', 1)->toArray())->merge([
 | 
				
			||||||
            'home_phone' =>$contact->client->phone, 
 | 
					            'home_phone' =>$contact->client->phone, 
 | 
				
			||||||
            'custom_identifier' => $contact->client->number,
 | 
					            'custom_identifier' => $contact->client->number,
 | 
				
			||||||
            'name' =>$contact->client->name,
 | 
					            'name' =>$contact->client->name,
 | 
				
			||||||
            'id' => null
 | 
					            'id' => $contact->client->contact_key,
 | 
				
			||||||
        ] )->all();
 | 
					        ] )->all();
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        $this->attributes = $this->newAttributeBag(Arr::only($contact, $this->fields) );
 | 
					        $this->attributes = $this->newAttributeBag(Arr::only($contact, $this->fields) );
 | 
				
			||||||
@ -37,12 +38,13 @@ class ContactComponent extends Component
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    private $defaults = [
 | 
					    private $defaults = [
 | 
				
			||||||
        'customer_type' => "Business",
 | 
					        'customer_type' => "Business",
 | 
				
			||||||
        'customer_identifier' => null,
 | 
					        'custom_identifier' => null,
 | 
				
			||||||
        'id' => null
 | 
					        'customer_id' => null
 | 
				
			||||||
    ];
 | 
					    ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public function render()
 | 
					    public function render()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        return render('gateways.rotessa.components.contact', array_merge($this->defaults, $this->attributes->getAttributes() ) );
 | 
					        \Debugbar::debug($this->attributes->getAttributes() + $this->defaults);
 | 
				
			||||||
 | 
					        return render('gateways.rotessa.components.contact', $this->attributes->getAttributes() + $this->defaults );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user