<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use App\Invoice;

class InvoiceDetail extends Mailable
{
    use Queueable, SerializesModels;
	
	public $invoice;
	public $account_number;
	public $company;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct(Invoice $invoice, $account_number)
    {
		
        $this->invoice = $invoice;
        $this->account_number = $account_number;
		$this->company = $invoice->company;
		
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->subject('Invoice')->from($this->company->contacts['email'], $this->company->name)->view('emails.invoice_detail');
    }
}
