|
1 | 1 | <tr wire:key="select2-{{ $value }}" data-number="{{ $value }}" class="item-tr"> |
2 | 2 | <td colspan="5" class="pt-3 bind-select2" style="position: relative;"> |
| 3 | + @include('laravel-crm::partials.form.hidden',[ |
| 4 | + 'name' => 'invoiceLines['.$value.'][order_product_id]', |
| 5 | + 'attributes' => [ |
| 6 | + 'wire:model' => 'order_product_id.'.$value, |
| 7 | + ] |
| 8 | + ]) |
| 9 | + |
3 | 10 | @include('laravel-crm::partials.form.hidden',[ |
4 | 11 | 'name' => 'invoiceLines['.$value.'][invoice_line_id]', |
5 | 12 | 'attributes' => [ |
6 | 13 | 'wire:model' => 'invoice_line_id.'.$value, |
7 | 14 | ] |
8 | 15 | ]) |
9 | | - {{--<span class="autocomplete autocomplete-product-name"> |
10 | | - @include('laravel-crm::partials.form.hidden',[ |
11 | | - 'name' => 'invoiceLines['.$value.'][product_id]', |
12 | | - 'attributes' => [ |
13 | | - 'wire:model' => 'product_id.'.$value, |
14 | | - ] |
15 | | - ]) |
16 | | - <span wire:ignore> |
| 16 | + <span wire:ignore> |
| 17 | + @if($fromOrder) |
| 18 | + |
| 19 | + @include('laravel-crm::partials.form.hidden',[ |
| 20 | + 'name' => 'invoiceLines['.$value.'][product_id]', |
| 21 | + 'attributes' => [ |
| 22 | + 'wire:model' => 'product_id.'.$value, |
| 23 | + ] |
| 24 | + ]) |
| 25 | + |
17 | 26 | @include('laravel-crm::partials.form.text',[ |
18 | | - 'name' => 'invoiceLines['.$value.'][name]', |
19 | | - /*'label' => ucfirst(__('laravel-crm::lang.name')),*/ |
| 27 | + 'name' => 'invoiceLines['.$value.'][name]', |
| 28 | + 'label' => ucfirst(__('laravel-crm::lang.name')), |
| 29 | + 'attributes' => [ |
| 30 | + 'wire:model' => 'name.'.$value, |
| 31 | + 'readonly' => 'readonly' |
| 32 | + ] |
| 33 | + ]) |
| 34 | + |
| 35 | + @else |
| 36 | + @include('laravel-crm::partials.form.select',[ |
| 37 | + 'name' => 'invoiceLines['.$value.'][product_id]', |
| 38 | + 'label' => ucfirst(__('laravel-crm::lang.name')), |
| 39 | + 'options' => [ |
| 40 | + $this->product_id[$value] ?? null => $this->name[$value] ?? null, |
| 41 | + ], |
| 42 | + 'value' => $this->product_id[$value] ?? null, |
20 | 43 | 'attributes' => [ |
21 | | - 'wire:model' => 'name.'.$value, |
22 | | - 'autocomplete' => \Illuminate\Support\Str::random(), |
| 44 | + 'wire:model' => 'product_id.'.$value, |
| 45 | + 'data-value' => $value |
23 | 46 | ] |
24 | 47 | ]) |
25 | | - </span> |
26 | | - </span>--}} |
27 | | - <span wire:ignore> |
28 | | - @include('laravel-crm::partials.form.select',[ |
29 | | - 'name' => 'invoiceLines['.$value.'][product_id]', |
30 | | - 'label' => ucfirst(__('laravel-crm::lang.name')), |
31 | | - 'options' => [ |
32 | | - $this->product_id[$value] ?? null => $this->name[$value] ?? null, |
33 | | - ], |
34 | | - 'value' => $this->product_id[$value] ?? null, |
35 | | - 'attributes' => [ |
36 | | - 'wire:model' => 'product_id.'.$value, |
37 | | - 'data-value' => $value |
38 | | - ] |
39 | | - ]) |
| 48 | + @endif |
40 | 49 | </span> |
| 50 | + @if(!$fromOrder) |
41 | 51 | <span style="position: absolute;top:13%; right: 5px;"> |
42 | 52 | <button wire:click.prevent="remove({{ $value }})" type="button" class="btn btn-outline-danger btn-sm btn-close"><span class="fa fa-remove"></span></button> |
43 | 53 | </span> |
| 54 | + @endif |
44 | 55 | </td> |
45 | 56 | </tr> |
46 | 57 | <tr data-number="{{ $value }}" class="item-tr"> |
47 | 58 | <td colspan="3" class="border-0 pt-0"> |
48 | | - @include('laravel-crm::partials.form.text',[ |
49 | | - 'name' => 'invoiceLines['.$value.'][price]', |
50 | | - 'label' => ucfirst(__('laravel-crm::lang.price')), |
51 | | - 'type' => 'number', |
52 | | - 'prepend' => '<span class="fa fa-dollar" aria-hidden="true"></span>', |
53 | | - 'attributes' => [ |
54 | | - 'wire:model' => 'price.'.$value, |
55 | | - 'wire:change' => 'calculateAmounts', |
56 | | - 'step' => .01 |
57 | | - ] |
58 | | - ]) |
| 59 | + @if($fromOrder) |
| 60 | + @include('laravel-crm::partials.form.text',[ |
| 61 | + 'name' => 'invoiceLines['.$value.'][price]', |
| 62 | + 'label' => ucfirst(__('laravel-crm::lang.price')), |
| 63 | + 'type' => 'number', |
| 64 | + 'prepend' => '<span class="fa fa-dollar" aria-hidden="true"></span>', |
| 65 | + 'attributes' => [ |
| 66 | + 'wire:model' => 'price.'.$value, |
| 67 | + 'wire:change' => 'calculateAmounts', |
| 68 | + 'step' => .01, |
| 69 | + 'readonly' => 'readonly' |
| 70 | + ] |
| 71 | + ]) |
| 72 | + @else |
| 73 | + @include('laravel-crm::partials.form.text',[ |
| 74 | + 'name' => 'invoiceLines['.$value.'][price]', |
| 75 | + 'label' => ucfirst(__('laravel-crm::lang.price')), |
| 76 | + 'type' => 'number', |
| 77 | + 'prepend' => '<span class="fa fa-dollar" aria-hidden="true"></span>', |
| 78 | + 'attributes' => [ |
| 79 | + 'wire:model' => 'price.'.$value, |
| 80 | + 'wire:change' => 'calculateAmounts', |
| 81 | + 'step' => .01 |
| 82 | + ] |
| 83 | + ]) |
| 84 | + @endif |
59 | 85 | </td> |
60 | 86 | <td class="border-0 pt-0"> |
61 | | - @include('laravel-crm::partials.form.text',[ |
62 | | - 'name' => 'invoiceLines['.$value.'][quantity]', |
63 | | - 'label' => ucfirst(__('laravel-crm::lang.quantity')), |
64 | | - 'type' => 'number', |
65 | | - 'attributes' => [ |
66 | | - 'wire:model' => 'quantity.'.$value, |
67 | | - 'wire:change' => 'calculateAmounts' |
68 | | - ] |
69 | | - ]) |
| 87 | + @if($fromOrder) |
| 88 | + @include('laravel-crm::partials.form.select',[ |
| 89 | + 'name' => 'invoiceLines['.$value.'][quantity]', |
| 90 | + 'label' => ucfirst(__('laravel-crm::lang.quantity')), |
| 91 | + 'options' => $this->order_quantities[$value], |
| 92 | + 'value' => $this->quantity[$value] ?? null, |
| 93 | + 'attributes' => [ |
| 94 | + 'wire:model' => 'quantity.'.$value, |
| 95 | + 'data-value' => $value, |
| 96 | + 'wire:change' => 'calculateAmounts' |
| 97 | + ] |
| 98 | + ]) |
| 99 | + @else |
| 100 | + @include('laravel-crm::partials.form.text',[ |
| 101 | + 'name' => 'invoiceLines['.$value.'][quantity]', |
| 102 | + 'label' => ucfirst(__('laravel-crm::lang.quantity')), |
| 103 | + 'type' => 'number', |
| 104 | + 'attributes' => [ |
| 105 | + 'wire:model' => 'quantity.'.$value, |
| 106 | + 'wire:change' => 'calculateAmounts' |
| 107 | + ] |
| 108 | + ]) |
| 109 | + @endif |
70 | 110 | </td> |
71 | 111 | <td class="border-0 pt-0"> |
72 | 112 | @include('laravel-crm::partials.form.text',[ |
|
84 | 124 | </tr> |
85 | 125 | <tr data-number="{{ $value }}" class="item-tr"> |
86 | 126 | <td colspan="5" class="border-0 pt-0 pb-4"> |
87 | | - @include('laravel-crm::partials.form.text',[ |
88 | | - 'name' => 'invoiceLines['.$value.'][comments]', |
89 | | - 'label' => ucfirst(__('laravel-crm::lang.comments')), |
90 | | - 'attributes' => [ |
91 | | - 'wire:model' => 'comments.'.$value, |
92 | | - ] |
93 | | - ]) |
| 127 | + @if($fromOrder) |
| 128 | + @include('laravel-crm::partials.form.text',[ |
| 129 | + 'name' => 'invoiceLines['.$value.'][comments]', |
| 130 | + 'label' => ucfirst(__('laravel-crm::lang.comments')), |
| 131 | + 'attributes' => [ |
| 132 | + 'wire:model' => 'comments.'.$value, |
| 133 | + 'readonly' => 'readonly' |
| 134 | + ] |
| 135 | + ]) |
| 136 | + @else |
| 137 | + @include('laravel-crm::partials.form.text',[ |
| 138 | + 'name' => 'invoiceLines['.$value.'][comments]', |
| 139 | + 'label' => ucfirst(__('laravel-crm::lang.comments')), |
| 140 | + 'attributes' => [ |
| 141 | + 'wire:model' => 'comments.'.$value, |
| 142 | + ] |
| 143 | + ]) |
| 144 | + @endif |
94 | 145 | </td> |
95 | 146 | </tr> |
0 commit comments