added invoice/bill number to pdf filename
This commit is contained in:
@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Traits;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
trait Sales
|
||||
{
|
||||
/**
|
||||
@ -60,4 +62,14 @@ trait Sales
|
||||
|
||||
return $statuses;
|
||||
}
|
||||
|
||||
public function getInvoiceFileName($invoice, $separator = '-', $extension = 'pdf')
|
||||
{
|
||||
return $this->getSafeInvoiceNumber($invoice, $separator) . $separator . time() . '.' . $extension;
|
||||
}
|
||||
|
||||
public function getSafeInvoiceNumber($invoice, $separator = '-')
|
||||
{
|
||||
return Str::slug($invoice->invoice_number, $separator, language()->getShortCode());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user