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