Advertisement
Guest User

Untitled

a guest
Mar 15th, 2021
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.76 KB | None | 0 0
  1.  
  2. <table class="table invoice-table {{ $isTasks ? 'task-table' : 'product-table' }}">
  3. <thead  {!! $isTasks ? 'style="display:none;" data-bind="visible: $root.hasTasks"' : ($invoice->has_tasks || ! empty($tasks) ? 'data-bind="visible: $root.hasItems"' : '') !!}>
  4.     @if ($isTasks)
  5.         <tr data-bind="visible: $root.hasItems">
  6.             <td style="20px" colspan="20"></td>
  7.         </tr>
  8.     @endif
  9.     <tr>
  10.         <th style="min-width:32px;" class="hide-border"></th>
  11.        
  12.         @if ($account->customLabel('product1'))
  13.             <th style="min-width:120px">{{ $account->present()->customLabel('product1') }}</th>
  14.         @endif
  15.         @if ($account->customLabel('product2'))
  16.             <th style="width:100%">{{ $account->present()->customLabel('product2') }}</th>
  17.         @endif
  18.         <th style="min-width:120px;width:25%">{{ $invoiceLabels[$isTasks ? 'service' : 'item'] }}</th>
  19.         <th style="min-width:120px;display:{{ $account->hasInvoiceField($isTasks ? 'task' : 'product', $isTasks ? 'product.hours' : 'product.quantity') ? 'table-cell' : 'none' }}">{{ $invoiceLabels[$isTasks ? 'hours' : 'quantity'] }}</th>
  20.         <th style="min-width:120px">{{ $invoiceLabels[$isTasks ? 'rate' : 'unit_cost'] }}</th>
  21.         <th style="min-width:120px;display:{{ $account->hasInvoiceField($isTasks ? 'task' : 'product', 'product.discount') ? 'table-cell' : 'none' }}">{{ $invoiceLabels['discount'] }}</th>
  22.         <th style="min-width:120px">{{ $invoiceLabels['description'] }}</th>
  23.         <th style="min-width:{{ $account->enable_second_tax_rate ? 180 : 120 }}px;display:none;" data-bind="visible: $root.invoice_item_taxes.show">{{ trans('texts.tax') }}</th>
  24.         <th style="min-width:120px;">{{ trans('texts.line_total') }}</th>
  25.         <th style="min-width:32px;" class="hide-border"></th>
  26.     </tr>
  27. </thead>
  28. <tbody data-bind="sortable: { data: invoice_items_{{ $isTasks ? 'with_tasks' : 'without_tasks' }}, allowDrop: false, afterMove: onDragged} {{ $isTasks ? ', visible: $root.hasTasks' : ($invoice->has_tasks || ! empty($tasks) ? ', visible: $root.hasItems' : '') }}"
  29.     {!! $isTasks ? 'style="display:none;border-spacing: 100px"' : '' !!}>
  30.     <tr data-bind="event: { mouseover: showActions, mouseout: hideActions }" class="sortable-row">
  31.         <td class="hide-border td-icon">
  32.             <i style="display:none" data-bind="visible: actionsVisible() &amp;&amp;
  33.                $parent.invoice_items_{{ $isTasks ? 'with_tasks' : 'without_tasks' }}().length > 1" class="fa fa-sort"></i>
  34.         </td>
  35.        
  36.         @if ($account->customLabel('product1'))
  37.             <td>
  38.                 @include('partials.custom_field', [
  39.                     'field' => 'custom_invoice_item_label1',
  40.                     'label' => $account->customLabel('product1'),
  41.                     'databind' => "value: custom_value1, valueUpdate: 'afterkeydown',
  42.                        attr: {name: 'invoice_items[" . ($isTasks ? 'T' : '') . "' + \$index() + '][custom_value1]'}",
  43.                     'raw' => true,
  44.                 ])
  45.             </td>
  46.         @endif
  47.         @if ($account->customLabel('product2'))
  48.             <td>
  49.                 @include('partials.custom_field', [
  50.                     'field' => 'custom_invoice_item_label2',
  51.                     'label' => $account->customLabel('product2'),
  52.                     'databind' => "value: custom_value2, valueUpdate: 'afterkeydown',
  53.                        attr: {name: 'invoice_items[" . ($isTasks ? 'T' : '') . "' + \$index() + '][custom_value2]'}",
  54.                     'raw' => true,
  55.                 ])
  56.             </td>
  57.         @endif
  58.     <td>
  59.             <div id="scrollable-dropdown-menu">
  60.                 <input type="text" data-bind="productTypeahead: product_key, items: $root.products, key: 'product_key', valueUpdate: 'afterkeydown', attr: {name: 'invoice_items[{{ $isTasks ? 'T' : '' }}' + $index() + '][product_key]'}" class="form-control invoice-item handled"/>
  61.             </div>
  62.         </td>
  63.         <td style="display:{{ $account->hasInvoiceField($isTasks ? 'task' : 'product', $isTasks ? 'product.hours' : 'product.quantity') ? 'table-cell' : 'none' }}">
  64.             <input data-bind="value: prettyQty, valueUpdate: 'afterkeydown', attr: {name: 'invoice_items[{{ $isTasks ? 'T' : '' }}' + $index() + '][qty]'}"
  65.                 style="text-align: right" class="form-control invoice-item" name="quantity"/>
  66.         </td>
  67.        <td>
  68.             <input data-bind="value: prettyCost, valueUpdate: 'afterkeydown', attr: {name: 'invoice_items[{{ $isTasks ? 'T' : '' }}' + $index() + '][cost]'}"
  69.                 style="text-align: right" class="form-control invoice-item"/>
  70.         </td>
  71.         <td>
  72.             <textarea data-bind="value: notes, valueUpdate: 'afterkeydown', attr: {name: 'invoice_items[{{ $isTasks ? 'T' : '' }}' + $index() + '][notes]'}"
  73.                 rows="1" cols="60" style="resize: vertical;height:42px" class="form-control word-wrap"></textarea>
  74.                 <input type="text" data-bind="value: task_public_id, attr: {name: 'invoice_items[{{ $isTasks ? 'T' : '' }}' + $index() + '][task_public_id]'}" style="display: none"/>
  75.                 <input type="text" data-bind="value: expense_public_id, attr: {name: 'invoice_items[{{ $isTasks ? 'T' : '' }}' + $index() + '][expense_public_id]'}" style="display: none"/>
  76.                 <input type="text" data-bind="value: invoice_item_type_id, attr: {name: 'invoice_items[{{ $isTasks ? 'T' : '' }}' + $index() + '][invoice_item_type_id]'}" style="display: none"/>
  77.         </td>
  78.        
  79.         <td style="display:{{ $account->hasInvoiceField($isTasks ? 'task' : 'product', 'product.discount') ? 'table-cell' : 'none' }}">
  80.             <input data-bind="value: discount, valueUpdate: 'afterkeydown', attr: {name: 'invoice_items[{{ $isTasks ? 'T' : '' }}' + $index() + '][discount]'}"
  81.                 style="text-align: right" class="form-control invoice-item" name="discount"/>
  82.         </td>
  83.         <td style="display:none;" data-bind="visible: $root.invoice_item_taxes.show">
  84.                 {!! Former::select('')
  85.                         ->addOption('', '')
  86.                         ->options($taxRateOptions)
  87.                         ->data_bind('value: tax1, event:{change:onTax1Change}')
  88.                         ->addClass($account->enable_second_tax_rate ? 'tax-select' : '')
  89.                         ->raw() !!}
  90.             <input type="text" data-bind="value: tax_name1, attr: {name: 'invoice_items[{{ $isTasks ? 'T' : '' }}' + $index() + '][tax_name1]'}" style="display:none">
  91.             <input type="text" data-bind="value: tax_rate1, attr: {name: 'invoice_items[{{ $isTasks ? 'T' : '' }}' + $index() + '][tax_rate1]'}" style="display:none">
  92.             <div data-bind="visible: $root.invoice().account.enable_second_tax_rate == '1'">
  93.                 {!! Former::select('')
  94.                         ->addOption('', '')
  95.                         ->options($taxRateOptions)
  96.                         ->data_bind('value: tax2, event:{change:onTax2Change}')
  97.                         ->addClass('tax-select')
  98.                         ->raw() !!}
  99.             </div>
  100.             <input type="text" data-bind="value: tax_name2, attr: {name: 'invoice_items[{{ $isTasks ? 'T' : '' }}' + $index() + '][tax_name2]'}" style="display:none">
  101.             <input type="text" data-bind="value: tax_rate2, attr: {name: 'invoice_items[{{ $isTasks ? 'T' : '' }}' + $index() + '][tax_rate2]'}" style="display:none">
  102.         </td>
  103.         <td style="text-align:right;padding-top:9px !important" nowrap>
  104.             <div class="line-total" data-bind="text: totals.total"></div>
  105.         </td>
  106.         <td style="cursor:pointer" class="hide-border td-icon">
  107.             <i style="padding-left:2px;display:none;" data-bind="click: $parent.removeItem, visible: actionsVisible() &amp;&amp; !isEmpty()"
  108.             class="fa fa-minus-circle redlink" title="Remove item"/>
  109.         </td>
  110.     </tr>
  111. </tbody>
  112. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement