@if(!empty($record))
@php
function withoutRounding($number, $total_decimals) {
$number = (string)$number;
if($number === '') {
$number = '0';
}
if(strpos($number, '.') === false) {
$number .= '.';
}
$number_arr = explode('.', $number);
$decimals = substr($number_arr[1], 0, $total_decimals);
if($decimals === false) {
$decimals = '0';
}
$return = '';
if($total_decimals == 0) {
$return = $number_arr[0];
} else {
if(strlen($decimals) < $total_decimals) {
$decimals = str_pad($decimals, $total_decimals, '0', STR_PAD_RIGHT);
}
$return = $number_arr[0] . '.' . $decimals;
}
return $return;
}
$records = collect([]);
for ($i=0; $i < $stock; $i++) {
$records[] = $record;
}
$show_price = \Modules\Company\Models\Configuration::first()->isShowPriceBarcodeTicket();
@endphp
@foreach($records as $item)
@switch($format)
@case(1)
{{ $item->name }}
MOD: {{ $item->model }} |
COD: {{ $item->internal_id }} |
@include('tenant.items.exports.barcode')
|
PRECIO
{{withoutRounding($record->sale_unit_price, 2)}} {{$record->currency_type->symbol}}
{{-- {{$loop->iteration}} --}}
|
@break
@case(2)
@if($loop->iteration % 2 === 1)
@endif
{{ $item->name }}
MOD: {{ $item->model }}
COD: {{ $item->internal_id }}
|
@if($show_price)
{{ $item->currency_type->symbol }} {{ round($item->sale_unit_price, 2) }}
|
@endif
@include('tenant.items.exports.barcode')
|
@if($loop->iteration % 2 === 1)
@endif
@break
@default
@if($loop->iteration % 3 === 1)
@endif
@include('tenant.items.exports.barcode')
|
@if($loop->iteration % 3 === 1)
@endif
@endswitch
@endforeach
@else
No se encontraron registros. |
@endif