Don't render delivery-not-table on products/tasks

This commit is contained in:
Benjamin Beganović 2020-11-09 16:10:47 +01:00
parent 0751a44d21
commit f02826deed

View File

@ -214,6 +214,10 @@ class Design extends BaseDesign
public function deliveryNoteTable(): array public function deliveryNoteTable(): array
{ {
if ($this->type !== 'delivery_note') {
return [];
}
$elements = [ $elements = [
['element' => 'thead', 'elements' => [ ['element' => 'thead', 'elements' => [
['element' => 'th', 'content' => '$item_label'], ['element' => 'th', 'content' => '$item_label'],
@ -259,7 +263,7 @@ class Design extends BaseDesign
public function taskTable(): array public function taskTable(): array
{ {
$task_items = collect($this->entity->line_items)->filter(function ($item) { $task_items = collect($this->entity->line_items)->filter(function ($item) {
return $item->type_id = 2; return $item->type_id == 2;
}); });
if (count($task_items) == 0) { if (count($task_items) == 0) {