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