mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for purchase order previews
This commit is contained in:
parent
4cc65fcb40
commit
afd563b6c3
@ -71,7 +71,6 @@ class PreviewController extends BaseController
|
||||
|
||||
$ps = new PdfService($invitation, 'product', [
|
||||
'client' => $client ?? false,
|
||||
// 'vendor' => $vendor ?? false,
|
||||
"{$entity_prop}s" => [$entity_obj],
|
||||
]);
|
||||
|
||||
|
@ -191,7 +191,7 @@ class PreviewPurchaseOrderController extends BaseController
|
||||
$invitation->setRelation($request->entity, $entity_obj);
|
||||
|
||||
}
|
||||
|
||||
|
||||
$ps = new PdfService($invitation, 'purchase_order', [
|
||||
'client' => $entity_obj->client ?? false,
|
||||
'vendor' => $vendor ?? false,
|
||||
|
@ -58,7 +58,11 @@ class PreviewPurchaseOrderRequest extends Request
|
||||
$input['amount'] = 0;
|
||||
$input['balance'] = 0;
|
||||
$input['number'] = isset($input['number']) ? $input['number'] : ctrans('texts.live_preview').' #'.rand(0, 1000); //30-06-2023
|
||||
|
||||
|
||||
if($input['entity_id'] ?? false) {
|
||||
$input['entity_id'] = $this->decodePrimaryKey($input['entity_id'], true);
|
||||
}
|
||||
|
||||
$this->replace($input);
|
||||
}
|
||||
|
||||
|
@ -117,6 +117,14 @@ class PurchaseOrder extends BaseModel
|
||||
use SoftDeletes;
|
||||
use MakesDates;
|
||||
|
||||
protected $hidden = [
|
||||
'id',
|
||||
'private_notes',
|
||||
'user_id',
|
||||
'vendor_id',
|
||||
'company_id',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'number',
|
||||
'discount',
|
||||
|
@ -221,7 +221,6 @@ class PdfConfiguration
|
||||
$this->vendor = $this->entity->vendor;
|
||||
$this->vendor_contact = $this->service->invitation->contact;
|
||||
$this->path = $this->vendor->purchase_order_filepath($this->service->invitation);
|
||||
$this->entity_design_id = 'invoice_design_id';
|
||||
$this->entity_design_id = 'purchase_order_design_id';
|
||||
$this->settings = $this->vendor->company->settings;
|
||||
$this->settings_object = $this->vendor;
|
||||
@ -274,6 +273,7 @@ class PdfConfiguration
|
||||
*/
|
||||
private function setDesign(): self
|
||||
{
|
||||
|
||||
$design_id = $this->entity->design_id ?: $this->decodePrimaryKey($this->settings_object->getSetting($this->entity_design_id));
|
||||
|
||||
$this->design = Design::withTrashed()->find($design_id) ?? Design::withTrashed()->find(2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user