Scaffold for PDF generation for purchase orders

This commit is contained in:
David Bomba 2022-06-05 20:48:49 +10:00
parent feacf65160
commit 888dfd3092
2 changed files with 7 additions and 1 deletions

View File

@ -159,7 +159,7 @@ class PurchaseOrder extends BaseModel
if(!$invitation)
throw new \Exception('Hard fail, could not create an invitation - is there a valid contact?');
$file_path = $this->client->credit_filepath($invitation).$this->numberFormatter().'.pdf';
$file_path = $this->vendor->purchase_order_filepath($invitation).$this->numberFormatter().'.pdf';
if(Ninja::isHosted() && $portal && Storage::disk(config('filesystems.default'))->exists($file_path)){
return Storage::disk(config('filesystems.default'))->{$type}($file_path);

View File

@ -146,4 +146,10 @@ class Vendor extends BaseModel
return '';
}
public function purchase_order_filepath($invitation)
{
$contact_key = $invitation->contact->contact_key;
return $this->company->company_key.'/'.$this->vendor_hash.'/'.$contact_key.'/purchase_orders/';
}
}