ConsoleTVs/Invoices

Invoice date

tdrabikdev opened this issue · 1 comments

Hello guys,

I am facing some bug,

Invoice::make()
            ->with_pagination(true)
            ->date(Carbon::parse($invoice->invocie_date))
            ->due_date(Carbon::parse($invoice->due_date))

When i want to generate invoices which are make in past i should use method ->date however it still take a current date. How i can set up date which i want ?

public function __construct($name = 'Invoice')
    {
        $this->name = $name;
        $this->template = 'default';
        $this->items = Collection::make([]);
        $this->currency = config('invoices.currency');
        $this->decimals = config('invoices.decimals');
        $this->logo = config('invoices.logo');
        $this->logo_height = config('invoices.logo_height');
        $this->date = Carbon::now(); //<<< how to override it ? 
        $this->business_details = Collection::make(config('invoices.business_details'));
        $this->customer_details = Collection::make([]);
        $this->footnote = config('invoices.footnote');
        $this->tax_rates = config('invoices.tax_rates');
        $this->due_date = config('invoices.due_date') != null ? Carbon::parse(config('invoices.due_date')) : null;
        $this->with_pagination = config('invoices.with_pagination');
        $this->duplicate_header = config('invoices.duplicate_header');
    }

Sorry Cache. Works Perfect :)